:root {
  color-scheme: dark;
  --bg: #08090c;
  --panel: #151820;
  --panel-soft: #202430;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5f7fb;
  --muted: #aab1c1;
  --accent: #e50914;
  --accent-strong: #ff2632;
  --ok: #2ecc71;
  --danger: #ff5a64;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.login-screen,
.client-login {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(229, 9, 20, 0.18), transparent 42%),
    #08090c;
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 50% -12%, rgba(229, 9, 20, 0.24), transparent 36%),
    linear-gradient(180deg, rgba(8, 9, 12, 0.98), rgba(8, 9, 12, 0.94));
}

.app-loading-panel {
  width: min(520px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.loading-ring {
  width: 72px;
  height: 72px;
  margin-top: 8px;
  border: 5px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: loading-spin 900ms linear infinite;
}

.app-loading h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
}

.app-loading p {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.loading-bar {
  width: min(340px, 78vw);
  height: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.loading-bar span {
  display: block;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: inherit;
  animation: loading-bar 1200ms ease-in-out infinite;
}

.games-screen {
  display: grid;
  gap: 28px;
  padding: 32px 24px 64px;
}

.games-head {
  display: grid;
  gap: 8px;
}

.games-head h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1;
}

.games-head p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.games-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
}

.game-card {
  min-height: 112px;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px;
  color: #fff;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(229, 9, 20, 0.16), transparent 48%),
    #171b24;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.game-card:focus,
.game-card.is-focused {
  outline: 3px solid #fff;
  outline-offset: 3px;
  transform: scale(1.025);
}

.game-time {
  display: grid;
  place-items: center;
  min-height: 64px;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  font-size: 24px;
  font-weight: 950;
}

.game-info {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.game-info strong {
  overflow: hidden;
  color: #fff;
  font-size: 21px;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-info small,
.game-channel {
  color: var(--muted);
  font-size: 14px;
}

.game-channel {
  grid-column: 2;
  font-weight: 800;
}

.games-empty {
  min-height: 180px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.games-empty h2 {
  margin: 0;
  color: #fff;
  font-size: 30px;
}

.games-empty p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.games-channel-rail {
  margin-top: 8px;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes loading-bar {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(260%);
  }
}

.login-card {
  width: min(430px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  background: rgba(21, 24, 32, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.login-card h1 {
  margin: 0;
  font-size: 32px;
}

.device-login-box {
  display: grid;
  gap: 8px;
  padding: 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.device-login-box span,
.device-login-box small {
  color: var(--muted);
  font-size: 13px;
}

.device-login-box strong {
  color: #fff;
  font-size: clamp(42px, 10vw, 64px);
  line-height: 1;
  letter-spacing: 6px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

.brand-logo img {
  display: block;
  width: min(210px, 54vw);
  height: auto;
  max-height: 92px;
  object-fit: contain;
}

.login-card .brand-logo img {
  width: min(230px, 62vw);
  max-height: 130px;
  margin: 0 auto 4px;
}

.brand-logo i {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: linear-gradient(135deg, #e50914, #ff4b55);
  border-radius: 11px;
  box-shadow: 0 10px 26px rgba(229, 9, 20, 0.28);
  font-size: 15px;
  font-style: normal;
  font-weight: 950;
}

.brand-logo strong {
  color: #f8fafc;
  font-weight: 950;
}

.brand-logo span {
  color: var(--accent);
  font-weight: 950;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  background: #0d0f14;
}

.sidebar {
  min-height: 100vh;
  padding: 28px;
  background: #07080b;
  border-right: 1px solid var(--line);
}

.sidebar nav {
  display: grid;
  gap: 8px;
  margin-top: 36px;
}

.sidebar a,
.text-link {
  color: var(--muted);
  text-decoration: none;
}

.sidebar a {
  padding: 12px 14px;
  border-radius: 8px;
}

.sidebar a.active,
.sidebar a:hover {
  color: var(--text);
  background: var(--panel);
}

.admin-main {
  width: min(1240px, 100%);
  padding: 32px;
}

.admin-header,
.section-title,
.playlist-row,
.row-actions {
  display: flex;
  align-items: center;
}

.admin-header,
.section-title,
.playlist-row {
  justify-content: space-between;
  gap: 20px;
}

.admin-header h1 {
  margin: 0;
  font-size: 38px;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(280px, 0.8fr);
  gap: 20px;
  margin: 28px 0;
}

.inline-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

.inline-form-grid label {
  margin-bottom: 0;
}

.muted-pill {
  padding: 6px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.manager-panel {
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.manager-panel h2 {
  margin: 0 0 18px;
  font-size: 20px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  color: var(--text);
  background: #0d1017;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: var(--text);
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
}

.primary-button:hover,
.primary-button.is-focused {
  background: var(--accent-strong);
}

.ghost-button {
  background: var(--panel-soft);
}

.danger-button {
  background: rgba(255, 90, 100, 0.16);
  color: var(--danger);
}

.status-line,
.empty-state {
  color: var(--muted);
}

.device-code {
  display: grid;
  place-items: center;
  min-height: 110px;
  margin-bottom: 18px;
  color: var(--text);
  background: #0c0f15;
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 36px;
  font-weight: 900;
}

.stack-list {
  display: grid;
  gap: 10px;
}

.device-row,
.playlist-row {
  padding: 14px;
  background: #10131a;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.device-row {
  display: grid;
  gap: 4px;
}

.playlist-row span,
.device-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.count-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.count-pills small {
  padding: 5px 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
}

.playlist-table {
  display: grid;
  gap: 10px;
}

.row-actions {
  flex-wrap: wrap;
}

.tv-shell {
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(8, 9, 12, 0) 0%, #08090c 70%),
    radial-gradient(circle at 70% 12%, rgba(229, 9, 20, 0.2), transparent 34%),
    #08090c;
}

.tv-topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 76px;
  padding: 0 clamp(22px, 4vw, 60px);
  background: linear-gradient(180deg, rgba(32, 21, 21, 0.98), rgba(24, 16, 16, 0.94));
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.topnav-brand {
  flex: 0 0 auto;
  font-size: 25px;
}

.topnav-brand.brand-logo img {
  width: 154px;
  max-height: 56px;
}

.topnav-brand.brand-logo i {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 13px;
}

.topnav-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.topnav-menu::-webkit-scrollbar {
  display: none;
}

.topnav-search {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 42px 42px;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.profile-menu {
  position: relative;
  flex: 0 0 auto;
}

.live-only-client .topnav-search,
.live-only-client .profile-menu {
  display: none;
}

.live-only-client .topnav-menu {
  margin-left: auto;
}

.live-only-client .topnav-link[data-nav-section="tv"] {
  display: inline-flex;
}

.profile-button {
  display: grid;
  grid-template-columns: 38px minmax(0, auto) 12px;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 5px 12px 5px 5px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  outline: none;
}

.profile-button span,
.profile-option span,
.profile-editor-card span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: linear-gradient(135deg, #1967ff, #e50914);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 950;
}

.profile-avatar-tile {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  color: transparent;
  background: linear-gradient(135deg, #1769ff, #e50914);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.profile-avatar-tile::before,
.profile-avatar-tile::after,
.profile-avatar-tile i {
  content: "";
  position: absolute;
  z-index: 1;
  display: block;
}

.avatar-smile-blue {
  background:
    radial-gradient(circle at 20% 32%, rgba(255, 255, 255, 0.98) 0 6%, transparent 6.5%),
    radial-gradient(circle at 78% 32%, rgba(255, 255, 255, 0.98) 0 6%, transparent 6.5%),
    linear-gradient(145deg, #1182ff, #0563ce);
}

.avatar-smile-blue::after {
  width: 42%;
  height: 20%;
  top: 53%;
  border-bottom: 5px solid rgba(255, 255, 255, 0.95);
  border-radius: 0 0 999px 999px;
}

.avatar-smile-yellow {
  background:
    radial-gradient(circle at 20% 32%, rgba(255, 255, 255, 0.98) 0 6%, transparent 6.5%),
    radial-gradient(circle at 78% 32%, rgba(255, 255, 255, 0.98) 0 6%, transparent 6.5%),
    linear-gradient(145deg, #ffd23f, #d6a400);
}

.avatar-smile-yellow::after {
  width: 42%;
  height: 20%;
  top: 53%;
  border-bottom: 5px solid rgba(255, 255, 255, 0.96);
  border-radius: 0 0 999px 999px;
}

.avatar-child-purple {
  background:
    radial-gradient(circle at 50% 0%, #ff93bc 0 8%, transparent 9%),
    linear-gradient(145deg, #7b18ff, #e23bb5);
}

.avatar-child-purple::before,
.avatar-child-red::before {
  width: 54%;
  height: 58%;
  top: 18%;
  border-radius: 48% 48% 44% 44%;
  background:
    radial-gradient(circle at 35% 40%, #24122a 0 4%, transparent 5%),
    radial-gradient(circle at 66% 40%, #24122a 0 4%, transparent 5%),
    radial-gradient(circle at 52% 56%, rgba(255, 120, 140, 0.58) 0 7%, transparent 8%),
    #ffd6bd;
  box-shadow: 0 18px 0 -7px #3449b8;
}

.avatar-child-purple::after {
  width: 58%;
  height: 24%;
  top: 13%;
  border-radius: 999px 999px 52% 52%;
  background: #2b1432;
}

.avatar-child-purple i {
  width: 16%;
  height: 16%;
  top: 4%;
  border-radius: 999px;
  background: #ffabc9;
  box-shadow: 10px -4px 0 rgba(255, 255, 255, 0.7);
}

.avatar-child-red {
  background: linear-gradient(145deg, #ff161f, #b10d2a);
}

.avatar-child-red::before {
  top: 20%;
  background:
    radial-gradient(circle at 35% 38%, #221111 0 4%, transparent 5%),
    radial-gradient(circle at 66% 38%, #221111 0 4%, transparent 5%),
    radial-gradient(circle at 51% 54%, rgba(228, 91, 104, 0.58) 0 8%, transparent 9%),
    #ffd7bf;
  box-shadow: 0 18px 0 -5px #293e8d;
}

.avatar-child-red::after {
  width: 62%;
  height: 26%;
  top: 12%;
  border-radius: 999px 999px 48% 48%;
  background: #1f1515;
  transform: rotate(4deg);
}

.avatar-stripes {
  background:
    linear-gradient(90deg, #207a35 0 20%, #ffb331 20% 40%, #ff4ca8 40% 60%, #8b57ff 60% 80%, #2776ff 80% 100%);
}

.avatar-stripes::after {
  content: attr(data-label);
  z-index: 2;
  color: #fff;
  font-size: 22%;
  font-weight: 950;
  text-shadow:
    -2px -2px 0 #e50914,
    2px -2px 0 #e50914,
    -2px 2px 0 #e50914,
    2px 2px 0 #e50914;
}

.avatar-kids {
  background:
    linear-gradient(90deg, #2776ff 0 20%, #26b34a 20% 40%, #ffb331 40% 60%, #ff4ca8 60% 80%, #8b57ff 80% 100%);
}

.avatar-kids::after {
  content: attr(data-label);
  z-index: 2;
  color: #fff;
  font-size: 22%;
  font-weight: 950;
  text-shadow:
    -2px -2px 0 #e50914,
    2px -2px 0 #e50914,
    -2px 2px 0 #e50914,
    2px 2px 0 #e50914;
}

.profile-avatar-mini {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.profile-avatar-mini::after {
  border-bottom-width: 2px;
}

.profile-avatar-menu,
.profile-avatar-editor {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.profile-avatar-large {
  width: clamp(122px, 10.5vw, 156px);
  height: clamp(122px, 10.5vw, 156px);
  border: 4px solid transparent;
  border-radius: 3px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.profile-button strong {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.profile-button i {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.profile-button:hover,
.profile-button.is-focused,
.profile-button:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.36);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 45;
  width: min(280px, 88vw);
  padding: 8px;
  background: rgba(25, 25, 25, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.52);
}

.profile-options {
  display: grid;
  gap: 4px;
}

.profile-option,
.profile-action {
  width: 100%;
  display: grid;
  align-items: center;
  min-height: 48px;
  color: #f7f7f7;
  background: transparent;
  border: 0;
  border-radius: 6px;
  text-align: left;
  outline: none;
}

.profile-option {
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  padding: 6px 8px;
}

.profile-option strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.profile-option small {
  color: var(--muted);
  font-size: 11px;
}

.profile-action {
  padding: 0 12px;
  color: rgba(247, 247, 247, 0.86);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-option:hover,
.profile-option.is-focused,
.profile-option.is-active,
.profile-action:hover,
.profile-action.is-focused {
  background: rgba(255, 255, 255, 0.16);
}

.profile-detail {
  max-width: 760px;
}

.profile-editor-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.profile-editor-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 5px 12px;
  min-height: 74px;
  padding: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  text-align: left;
  outline: none;
}

.profile-editor-card span {
  grid-row: span 2;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  font-size: 15px;
}

.profile-editor-card strong {
  align-self: end;
}

.profile-editor-card small {
  color: var(--muted);
  font-size: 12px;
}

.profile-editor-card:hover,
.profile-editor-card.is-focused,
.profile-editor-card.is-active {
  border-color: var(--accent);
  background: rgba(229, 9, 20, 0.16);
}

.profile-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.profile-chooser {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 68px);
  background:
    radial-gradient(circle at 50% -20%, rgba(229, 9, 20, 0.18), transparent 36%),
    linear-gradient(180deg, #141414, #08090c 68%);
}

.profile-chooser-inner {
  width: min(1120px, 100%);
  display: grid;
  justify-items: center;
  gap: 34px;
}

.profile-chooser h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(42px, 6vw, 78px);
  font-weight: 500;
  line-height: 1.05;
  text-align: center;
}

.profile-chooser-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(24px, 3.5vw, 42px);
}

.profile-choice {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: clamp(132px, 11vw, 170px);
  color: rgba(255, 255, 255, 0.62);
  background: transparent;
  border: 0;
  outline: none;
}

.profile-choice span {
  font-size: 0;
}

.profile-choice strong {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  font-weight: 500;
}

.profile-choice small {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.profile-choice small::before {
  content: "";
  display: block;
  width: 8px;
  height: 6px;
  margin: 5px auto 0;
  border: 1px solid currentColor;
  border-radius: 1px;
  box-shadow: 0 -5px 0 -2px currentColor;
}

.profile-choice:hover,
.profile-choice.is-focused {
  color: #fff;
}

.profile-choice:hover span,
.profile-choice.is-focused span {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.24), 0 16px 40px rgba(0, 0, 0, 0.45);
  filter: brightness(1.08);
  transform: scale(1.06);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.epg-guide {
  max-height: min(34vh, 300px);
  margin-top: 12px;
  padding: 14px;
  overflow: auto;
  background: rgba(12, 14, 18, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}

.epg-guide h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.epg-guide-list {
  display: grid;
  gap: 8px;
}

.epg-guide article {
  display: grid;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.epg-guide article:last-child {
  border-bottom: 0;
}

.epg-guide strong {
  font-size: 14px;
}

.epg-guide p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.android-tv-view .tv-topnav {
  min-height: 78px;
  padding: 0 58px;
  gap: 28px;
  background: linear-gradient(180deg, rgba(8, 9, 12, 0.96), rgba(8, 9, 12, 0.74));
}

.android-tv-view .topnav-brand {
  font-size: 28px;
}

.android-tv-view .topnav-brand.brand-logo img {
  width: 164px;
  max-height: 60px;
}

.android-tv-view .topnav-link {
  min-height: 46px;
  padding: 0 22px;
  font-size: 17px;
}

.android-tv-view .topnav-search {
  grid-template-columns: minmax(190px, 280px) 46px 46px;
}

.android-tv-view .topnav-search input,
.android-tv-view .search-button,
.android-tv-view .profile-button {
  height: 46px;
  min-height: 46px;
}

.android-tv-view .search-button {
  width: 46px;
  font-size: 22px;
}

.android-tv-view .profile-button {
  grid-template-columns: 30px minmax(0, auto) 10px;
}

.android-tv-view .profile-button span {
  width: 30px;
  height: 30px;
}

.android-tv-view .profile-chooser-inner {
  width: min(1180px, 100%);
  gap: 38px;
}

.android-tv-view .profile-chooser h1 {
  font-size: clamp(54px, 6.5vw, 82px);
  font-weight: 500;
}

.android-tv-view .profile-chooser-list {
  gap: 42px;
}

.android-tv-view .profile-choice {
  width: 178px;
  gap: 12px;
}

.android-tv-view .profile-avatar-large {
  width: 156px;
  height: 156px;
}

.android-tv-view .profile-choice strong {
  max-width: 178px;
  font-size: 20px;
}

.android-tv-view .hero {
  min-height: 70vh;
  padding: 58px 60px 42px;
}

.android-tv-view .hero h1 {
  max-width: 780px;
  font-size: clamp(44px, 6vw, 72px);
}

.android-tv-view .hero-subtitle,
.android-tv-view .hero-plot {
  max-width: 680px;
  font-size: 17px;
}

.android-tv-view .catalog {
  gap: 18px;
  padding: 0 60px 60px;
  margin-top: -24px;
}

.android-tv-view .home-category-strip {
  grid-auto-columns: max-content;
  gap: 14px;
  padding-bottom: 14px;
}

.android-tv-view .home-category-pill {
  min-height: 52px;
  padding: 0 26px;
  font-size: 16px;
}

.android-tv-view .media-section {
  gap: 10px;
  margin-bottom: 18px;
}

.android-tv-view .media-section-header {
  padding-bottom: 2px;
  border-bottom: 0;
}

.android-tv-view .media-section-header h2 {
  font-size: clamp(28px, 3.6vw, 42px);
}

.android-tv-view .media-section-header span,
.android-tv-view .rail h3,
.android-tv-view .rail-note {
  display: none;
}

.android-tv-view .rail h3 {
  margin-bottom: 16px;
  font-size: 24px;
}

.android-tv-view .rail-track {
  display: flex;
  align-items: flex-start;
  grid-auto-columns: minmax(205px, 16vw);
  gap: 18px;
  overflow: visible;
  padding: 4px 10px 18px;
  scroll-padding-inline: 10px;
  transform: translate3d(0, 0, 0);
  transition: transform 220ms ease;
  will-change: transform;
}

.android-tv-view .rail-track > .channel-card {
  flex: 0 0 clamp(205px, 16vw, 300px);
  width: clamp(205px, 16vw, 300px);
  min-width: 0;
}

.android-tv-view .channel-name {
  min-height: 34px;
  font-size: 15px;
  line-height: 1.24;
}

.android-tv-view .channel-meta,
.android-tv-view .channel-epg-now,
.android-tv-view .channel-epg-next {
  font-size: 12px;
}

.android-tv-view .series-grid-section {
  min-height: calc(100vh - 58px);
  padding: 14px 40px 34px;
}

.android-tv-view .series-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 34px 26px;
}

.android-tv-view .category-tile-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.android-tv-view .category-tile {
  min-height: 76px;
  padding: 14px 18px 14px 20px;
  font-size: 17px;
}

.android-tv-view .category-tile small {
  font-size: 13px;
}

.android-tv-view .profile-chooser h1 {
  font-size: clamp(54px, 6.5vw, 82px);
}

.android-tv-view .profile-choice {
  width: 178px;
}

.android-tv-view .profile-choice span {
  width: 156px;
  height: 156px;
}

.android-tv-view .keyboard-key {
  min-width: clamp(44px, 4vw, 60px);
  height: clamp(42px, 4vw, 54px);
  font-size: 15px;
}

.android-tv-view .keyboard-key.is-wide {
  min-width: clamp(92px, 10vw, 150px);
}

.remote-debug {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10000;
  max-width: min(520px, calc(100vw - 36px));
  padding: 10px 14px;
  color: #ffffff;
  background: rgba(229, 9, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.topnav-search input {
  height: 42px;
  margin: 0;
  padding: 0 14px;
  background: rgba(0, 0, 0, 0.34);
  border-color: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.search-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.14);
  border: 0;
  border-radius: 999px;
  font-size: 24px;
  font-weight: 900;
}

.search-button:hover,
.search-button.is-focused,
.topnav-search input:focus {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.2);
}

.search-keyboard {
  position: fixed;
  inset: auto 0 0;
  z-index: 60;
  padding: 16px clamp(18px, 5vw, 80px) 22px;
  background: linear-gradient(0deg, rgba(6, 7, 10, 0.98), rgba(8, 9, 12, 0.78));
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -24px 64px rgba(0, 0, 0, 0.42);
}

.search-keyboard-panel {
  width: min(1060px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.keyboard-display {
  display: grid;
  gap: 4px;
}

.keyboard-display span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.keyboard-display strong {
  min-height: 28px;
  color: #fff;
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.1;
}

.keyboard-keys {
  display: grid;
  gap: 8px;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.keyboard-key {
  min-width: clamp(44px, 4vw, 58px);
  height: clamp(42px, 4vw, 52px);
  padding: 0 12px;
  color: #fff;
  background: linear-gradient(180deg, rgba(31, 35, 45, 0.98), rgba(18, 21, 29, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-size: 16px;
  font-weight: 900;
  outline: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.26);
}

.keyboard-key.is-wide {
  min-width: clamp(92px, 12vw, 150px);
}

.keyboard-key:hover,
.keyboard-key.is-focused,
.keyboard-key:focus-visible {
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  border-color: rgba(255, 255, 255, 0.78);
  transform: scale(1.08);
}

.topnav-link {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 18px;
  color: rgba(245, 247, 251, 0.86);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 750;
  outline: none;
}

.topnav-link:hover,
.topnav-link.is-focused,
.topnav-link.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.16);
}

.topnav-link.is-active {
  background: rgba(255, 255, 255, 0.22);
}

.hero {
  position: relative;
  min-height: 56vh;
  display: flex;
  align-items: end;
  padding: 42px clamp(22px, 5vw, 76px);
  background:
    linear-gradient(90deg, #08090c 0%, rgba(8, 9, 12, 0.94) 42%, rgba(8, 9, 12, 0.24) 100%),
    linear-gradient(135deg, #20242e, #0a0b10 58%);
  overflow: hidden;
}

.hero-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 450ms ease;
}

.hero.has-preview .hero-preview {
  opacity: 0.62;
}

.hero.has-logo::after {
  content: "";
  position: absolute;
  inset: 8% 6% 12% 55%;
  background-image: var(--hero-logo);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.72;
  filter: drop-shadow(0 34px 56px rgba(0, 0, 0, 0.72));
}

.hero.has-preview::after {
  opacity: 0.18;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 1;
}

.hero p:not(.eyebrow) {
  max-width: 540px;
  color: var(--muted);
  font-size: 20px;
}

.hero-plot {
  display: -webkit-box;
  max-width: 700px !important;
  margin: 12px 0 0;
  color: rgba(245, 247, 251, 0.88) !important;
  font-size: 17px !important;
  line-height: 1.45;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero .primary-button {
  margin-top: 18px;
  min-width: 142px;
}

.catalog {
  display: grid;
  gap: 34px;
  padding: 0 clamp(18px, 5vw, 76px) 64px;
  margin-top: -8px;
  position: relative;
  z-index: 2;
}

.home-category-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 12px;
  overflow-x: auto;
  padding: 0 0 10px;
  scrollbar-width: none;
}

.home-category-strip::-webkit-scrollbar {
  display: none;
}

.home-category-pill {
  min-height: 46px;
  padding: 0 20px;
  color: rgba(245, 247, 251, 0.9);
  background: linear-gradient(180deg, rgba(28, 31, 39, 0.78), rgba(15, 17, 23, 0.86));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 28px rgba(0, 0, 0, 0.18);
  font-size: 14px;
  font-weight: 800;
  outline: none;
  white-space: nowrap;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.home-category-pill:hover,
.home-category-pill.is-focused,
.home-category-pill:focus-visible {
  color: #ffffff;
  background: linear-gradient(180deg, rgba(229, 9, 20, 0.98), rgba(166, 12, 22, 0.96));
  border-color: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.24), 0 16px 34px rgba(0, 0, 0, 0.35);
  transform: scale(1.06);
}

.search-results-title {
  padding-top: 18px;
}

.search-results-title h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
}

.active-media-section {
  min-height: 280px;
}

.media-section {
  display: grid;
  gap: 18px;
  min-width: 0;
  content-visibility: auto;
  contain-intrinsic-size: 320px;
}

.media-section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.media-section-header h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

.media-section-header span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.rail h3 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 22px;
}

.rail {
  min-width: 0;
  overflow: hidden;
}

.empty-grid {
  padding: 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rail-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 15vw);
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  padding: 4px 0 18px;
  scrollbar-width: none;
}

.rail-track .series-card {
  text-align: left;
}

.rail-track .series-card .poster {
  position: relative;
  aspect-ratio: 2 / 3;
  background: #141821;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.rail-track .series-card .poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rail-track .series-card .channel-name {
  min-height: 0;
  color: #f6f7fb;
  font-size: 15px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.rail-track .series-card .channel-meta {
  color: rgba(246, 247, 251, 0.68);
  font-weight: 700;
}

.watch-progress {
  position: absolute;
  left: 0;
  right: auto;
  bottom: 0;
  height: 5px;
  background: var(--accent);
  border-radius: 0 999px 999px 0;
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.55);
}

.rail-track::-webkit-scrollbar {
  display: none;
}

.channel-card {
  display: grid;
  gap: 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  text-align: left;
  outline: none;
}

.poster {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #242936, #11141b);
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease;
}

.poster img {
  width: 72%;
  height: 72%;
  object-fit: contain;
  background: transparent;
}

.poster strong {
  font-size: 42px;
}

.channel-name {
  min-height: 42px;
  color: #f2f4fa;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.channel-meta {
  min-height: 18px;
  color: rgba(245, 247, 251, 0.7);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.series-grid-section {
  min-height: calc(100vh - 74px);
  margin: 0 calc(-1 * clamp(18px, 5vw, 76px));
  padding: 18px clamp(18px, 5vw, 76px) 42px;
  color: #11131a;
  background: #fbf9fc;
}

.search-only-screen {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(229, 9, 20, 0.14), rgba(8, 9, 12, 0) 220px),
    #08090c;
}

.search-only-screen .search-results-title {
  margin: 8px 0 24px;
}

.search-only-screen .search-results-title h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.05;
}

.search-result-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 34px 26px;
}

.search-result-grid .channel-card {
  color: var(--text);
}

.category-breadcrumb {
  margin-bottom: 18px;
  color: rgba(245, 247, 251, 0.74);
  font-size: 16px;
}

.catalog-side-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 30px;
  min-height: calc(100vh - 300px);
  padding: 2px 0 44px;
}

.category-sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  max-height: calc(100vh - 120px);
  padding: 18px 12px 18px 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.category-sidebar::-webkit-scrollbar {
  width: 6px;
}

.category-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.24);
  border-radius: 999px;
}

.category-sidebar-head {
  display: grid;
  gap: 4px;
  margin: 0 0 14px;
  padding-left: 4px;
}

.category-sidebar-head span {
  color: #e50914;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.category-sidebar-head strong {
  color: #fff;
  font-size: 28px;
  line-height: 1.05;
}

.category-sidebar-list {
  display: grid;
  gap: 10px;
}

.catalog-side-layout .category-tile {
  min-height: 68px;
  background: linear-gradient(180deg, rgba(35, 38, 48, 0.98), rgba(21, 23, 31, 0.98));
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: none;
}

.catalog-side-layout .category-tile strong {
  color: #f7f8fb;
  font-size: 15px;
}

.catalog-side-layout .category-tile small {
  color: rgba(247, 248, 251, 0.62);
}

.catalog-side-layout .category-tile span {
  color: #e50914;
}

.catalog-side-layout .category-tile.is-selected,
.catalog-side-layout .category-tile.is-focused,
.catalog-side-layout .category-tile:hover {
  background: linear-gradient(180deg, #ffffff, #f2f3f6);
  border-color: rgba(229, 9, 20, 0.72);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32), inset 0 0 0 2px rgba(229, 9, 20, 0.45);
}

.catalog-side-layout .category-tile.is-selected strong,
.catalog-side-layout .category-tile.is-focused strong,
.catalog-side-layout .category-tile:hover strong {
  color: #11131a;
}

.catalog-side-layout .category-tile.is-selected small,
.catalog-side-layout .category-tile.is-focused small,
.catalog-side-layout .category-tile:hover small {
  color: rgba(17, 19, 26, 0.6);
}

.category-content-panel {
  min-width: 0;
  padding-top: 36px;
}

.tv-category-screen.catalog-side-layout {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 34px;
}

.tv-category-screen .category-sidebar {
  top: 78px;
  display: grid;
  align-content: center;
  min-height: calc(100vh - 130px);
  max-height: calc(100vh - 94px);
  padding: 10px 12px;
}

.tv-category-screen .category-sidebar-head {
  text-align: center;
  padding-left: 0;
}

.tv-category-screen .category-sidebar-list {
  justify-items: center;
}

.tv-category-screen .side-category-button {
  width: min(100%, 310px);
}

.tv-category-screen .category-content-panel {
  padding-top: 24px;
}

.side-empty-state {
  display: grid;
  align-content: center;
  min-height: 300px;
  padding: 34px;
  color: rgba(245, 247, 251, 0.72);
  background: linear-gradient(180deg, rgba(20, 22, 30, 0.76), rgba(12, 13, 18, 0.76));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.side-empty-state h2 {
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(30px, 4vw, 52px);
}

.side-empty-state p {
  margin: 0;
  font-size: 18px;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 38px 30px;
  align-items: start;
}

.category-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  align-items: start;
}

.category-tile {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 10px;
  min-height: 62px;
  padding: 13px 16px 13px 18px;
  color: #171923;
  text-align: left;
  background: linear-gradient(180deg, #ffffff 0%, #f6f4f8 100%);
  border: 1px solid rgba(44, 42, 58, 0.18);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(17, 19, 26, 0.06);
  outline: none;
  overflow: hidden;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.category-tile::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: #e50914;
  opacity: 0.82;
}

.category-tile span {
  grid-row: span 2;
  align-self: center;
  color: #d9a400;
  font-size: 16px;
}

.category-tile strong {
  align-self: end;
  color: #181922;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: 0;
}

.category-tile small {
  color: rgba(17, 19, 26, 0.56);
  font-size: 12px;
  font-weight: 700;
}

.category-tile:hover,
.category-tile.is-focused {
  transform: translateY(-1px);
  background: #ffffff;
  border-color: rgba(229, 9, 20, 0.55);
  box-shadow: 0 9px 24px rgba(17, 19, 26, 0.12), inset 0 0 0 1px rgba(229, 9, 20, 0.45);
}

.category-tile.is-focused strong,
.category-tile:hover strong {
  color: #e50914;
}

.movie-category-screen .category-tile {
  grid-template-columns: 1fr;
}

.movie-category-screen .category-tile span,
.vod-series-category-screen .category-tile span {
  display: none;
}

.vod-series-category-screen .category-tile {
  grid-template-columns: 1fr;
}

.tv-channel-screen .media-section {
  color: var(--text);
}

.tv-channel-screen .media-section-header,
.tv-channel-screen .rail h3 {
  display: none;
}

.series-grid-section,
.movie-item-screen,
.vod-series-item-screen,
.tv-channel-screen {
  color: var(--text);
  background: #08090c;
}

.series-grid .series-card {
  color: var(--text);
  text-align: center;
}

.series-grid .series-card .channel-name {
  color: #f6f7fb;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.series-grid .series-card .channel-meta {
  color: rgba(246, 247, 251, 0.66);
}

.channel-epg-now,
.channel-epg-next {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-epg-now {
  margin-top: 4px;
  color: #ffffff;
  font-weight: 800;
}

.channel-epg-next {
  color: rgba(255, 255, 255, 0.58);
}

.series-card .poster {
  aspect-ratio: 2 / 3;
  background: #151923;
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}

.series-card .poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.series-card .channel-name {
  min-height: 0;
  color: #f6f7fb;
  font-size: 16px;
  line-height: 1.2;
}

.series-card .channel-meta {
  min-height: 0;
  color: rgba(246, 247, 251, 0.66);
  white-space: normal;
}

.series-grid .series-card:hover .poster,
.series-grid .series-card.is-focused .poster {
  transform: scale(1.04);
  border-color: var(--accent);
}

.channel-card:hover .poster,
.channel-card.is-focused .poster,
.primary-button.is-focused {
  transform: scale(1.06);
  border-color: var(--text);
}

.channel-card.is-focused .channel-name {
  color: var(--text);
}

.tv-empty {
  padding: 32px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.tv-empty p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.5;
}

.storage-hint {
  padding: 12px 14px;
  word-break: break-all;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.primary-link {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  margin-top: 10px;
  padding: 0 18px;
  color: var(--text);
  background: var(--accent);
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.series-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  overflow-y: auto;
  background:
    linear-gradient(90deg, rgba(8, 9, 12, 0.98), rgba(8, 9, 12, 0.88)),
    #08090c;
}

.series-modal.has-detail-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(90deg, rgba(8, 9, 12, 0.98) 0%, rgba(8, 9, 12, 0.78) 46%, rgba(8, 9, 12, 0.42) 100%),
    linear-gradient(0deg, #08090c 0%, rgba(8, 9, 12, 0.32) 52%),
    var(--detail-bg);
  background-position: center;
  background-size: cover;
  opacity: 0.9;
  pointer-events: none;
}

.series-modal[hidden] {
  display: none;
}

.series-detail {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 30px clamp(22px, 5vw, 76px) 64px;
}

.series-detail > .player-icon-button {
  margin-bottom: 28px;
}

.series-detail-head {
  max-width: 860px;
  margin-bottom: 28px;
}

.series-detail-head h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 1;
}

.series-summary {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
  white-space: pre-line;
}

.series-continue-button {
  margin-top: 22px;
  min-width: 230px;
}

.movie-detail-layout {
  display: grid;
  grid-template-columns: minmax(190px, 320px) minmax(0, 760px);
  gap: clamp(24px, 5vw, 56px);
  align-items: start;
}

.movie-detail-poster {
  display: grid;
  place-items: center;
  aspect-ratio: 2 / 3;
  color: var(--text);
  background: #141821;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

.movie-detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.movie-detail-poster strong {
  font-size: 58px;
}

.movie-detail .primary-button {
  margin-top: 24px;
  min-width: 160px;
}

.cast-section {
  margin: 34px 0 30px;
}

.cast-section[hidden] {
  display: none;
}

.cast-section h2 {
  margin: 0 0 16px;
  font-size: 24px;
  line-height: 1.1;
}

.cast-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(116px, 140px);
  gap: 16px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 2px 2px 14px;
  scrollbar-width: thin;
}

.cast-card {
  min-width: 0;
  color: var(--text);
}

.cast-photo {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  margin-bottom: 10px;
  overflow: hidden;
  border-radius: 8px;
  background: #181d27;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.cast-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cast-photo span {
  color: var(--muted);
  font-size: 42px;
  font-weight: 900;
}

.cast-card strong,
.cast-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cast-card strong {
  font-size: 14px;
  line-height: 1.25;
  white-space: nowrap;
}

.cast-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.series-seasons {
  display: grid;
  gap: 30px;
}

.season-block {
  display: grid;
  gap: 14px;
}

.season-block h2 {
  margin: 0;
  font-size: 26px;
}

.episode-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.episode-button {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  min-height: 76px;
  padding: 14px;
  color: var(--text);
  text-align: left;
  background: #10131a;
  border: 2px solid transparent;
  border-radius: 8px;
  outline: none;
  overflow: hidden;
}

.episode-button span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: var(--text);
  background: rgba(229, 9, 20, 0.22);
  border: 1px solid rgba(229, 9, 20, 0.55);
  border-radius: 8px;
  font-weight: 900;
}

.episode-button strong {
  align-self: end;
  font-size: 15px;
  line-height: 1.25;
}

.episode-button small {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-button:hover,
.episode-button.is-focused {
  border-color: var(--text);
  background: #181c25;
}

.episode-button.is-resume {
  border-color: rgba(229, 9, 20, 0.72);
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.18), #10131a 52%);
}

.episode-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  background: var(--accent);
  border-radius: 0 6px 6px 0;
}

.player-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
  overflow: hidden;
}

.player-modal[hidden] {
  display: none;
}

video {
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 34px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent);
  pointer-events: auto;
  transition: opacity 180ms ease, transform 180ms ease;
}

.player-actions {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 12px 0 4px;
  pointer-events: auto;
}

#skip-intro {
  margin-right: auto;
}

#next-episode {
  margin-left: auto;
}

.player-actions[hidden] {
  display: none;
}

.player-action-button {
  min-width: 176px;
  padding: 11px 16px;
  color: #fff;
  background: rgba(18, 20, 27, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 6px;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
}

.player-action-button[hidden] {
  display: none;
}

.player-action-button:hover,
.player-action-button.is-focused {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(229, 9, 20, 0.92);
  transform: translateY(-2px);
}

.player-icon-button,
.player-control-button {
  display: inline-grid;
  place-items: center;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}

.player-icon-button {
  width: 48px;
  height: 48px;
  font-size: 44px;
  line-height: 1;
}

.player-icon-button:hover,
.player-icon-button.is-focused,
.player-control-button:hover,
.player-control-button.is-focused {
  color: #fff;
  transform: scale(1.08);
}

.player-bottom {
  align-self: end;
  padding: 0 28px 22px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0));
  pointer-events: auto;
  transition: opacity 180ms ease, transform 180ms ease;
}

.player-modal.controls-hidden {
  cursor: none;
}

.player-modal.controls-hidden .player-topbar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-18px);
}

.player-modal.controls-hidden .player-bottom {
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
}

.player-modal.controls-visible .player-topbar,
.player-modal.controls-visible .player-bottom {
  opacity: 1;
  transform: translateY(0);
}

.player-progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
}

.player-progress {
  width: 100%;
  height: 18px;
  accent-color: var(--accent);
}

.player-progress::-webkit-slider-runnable-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.72);
}

.player-progress::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -6px;
}

.player-time {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  min-width: 58px;
  text-align: right;
}

.player-controls {
  display: grid;
  grid-template-columns: 1fr minmax(260px, auto) 1fr;
  align-items: center;
  gap: 20px;
  min-height: 78px;
}

.player-controls-left,
.player-controls-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.player-controls-right {
  justify-content: end;
}

.player-control-button {
  min-width: 42px;
  min-height: 42px;
  font-size: 36px;
  font-weight: 900;
}

.player-control-button small {
  margin-left: -4px;
  font-size: 16px;
  font-weight: 950;
}

.player-now {
  min-width: 0;
  text-align: center;
}

.player-group-label {
  margin: 0 0 4px;
  color: rgba(245, 247, 251, 0.62);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.player-now h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-error {
  margin: 0;
  min-height: 20px;
  text-align: center;
  color: var(--danger);
  font-weight: 800;
}

.diagnostics-detail {
  max-width: 980px;
}

.diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.diagnostics-grid article {
  min-height: 78px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(15, 18, 25, 0.86);
}

.diagnostics-grid span {
  display: block;
  margin-bottom: 8px;
  color: rgba(245, 247, 251, 0.58);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.diagnostics-grid strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

@media (max-width: 820px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }

  .inline-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-main {
    padding: 22px;
  }

  .playlist-row,
  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    min-height: 48vh;
  }

  .rail-track {
    grid-auto-columns: minmax(150px, 42vw);
  }

  .movie-detail-layout {
    grid-template-columns: 1fr;
  }

  .movie-detail-poster {
    max-width: 260px;
  }

  .tv-topnav {
    flex-wrap: wrap;
    gap: 18px;
    min-height: 68px;
    padding: 12px 18px;
  }

  .topnav-brand {
    font-size: 22px;
  }

  .topnav-link {
    min-height: 38px;
    padding: 0 14px;
    font-size: 14px;
  }

  .topnav-search {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 42px 42px;
    margin-left: 0;
  }

  .profile-menu {
    margin-left: auto;
  }

  .profile-dropdown {
    right: 0;
  }

  .player-topbar {
    padding: 18px;
  }

  .player-actions {
    width: 100%;
    margin: 10px 0 6px;
  }

  .player-action-button {
    width: 100%;
    min-width: 0;
    text-align: center;
  }

  .player-bottom {
    padding: 0 14px 16px;
  }

  .player-controls {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .player-controls-left,
  .player-controls-right {
    justify-content: center;
  }
}
