/* MaxTV Live for Titan OS - Cinema Dark. Stage is a fixed 1920x1080 canvas
   scaled to the TV viewport by App.fit(). TV-safe margins: 96px x 54px. */

@font-face { font-family: 'Manrope'; src: url('../assets/fonts/Manrope.ttf') format('truetype'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Unbounded'; src: url('../assets/fonts/Unbounded.ttf') format('truetype'); font-weight: 200 900; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../assets/fonts/JetBrainsMono.ttf') format('truetype'); font-weight: 100 800; font-display: swap; }

:root {
  --onyx: #08090C; --obsidian: #111420; --graphite: #16181F; --slate: #1F222B; --smoke: #2A2E3A; --ash: #3A3F4D;
  --brand: #76B74F; --brand2: #9FE36E; --live: #FF3B5C; --info: #2FA8E0;
  --text: #F5F6F8; --text2: #B5BAC7; --muted: #7A8091;
  --ring: 0 0 0 6px var(--brand2), 0 14px 36px rgba(0, 0, 0, 0.5);
  --selbg: linear-gradient(90deg, #3E6B2B, #2C4D20);
  --red: #FF3B3B; --green: #4CD964; --yellow: #FFCC00; --blue: #2F8BFF;
  --display: 'Unbounded', 'Manrope', sans-serif;
  --body: 'Manrope', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', 'Menlo', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: var(--onyx); }
body { font-family: var(--body); font-size: 26px; color: var(--text); -webkit-font-smoothing: antialiased; cursor: default; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; outline: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.time { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ico { flex: none; display: block; }

#app {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; overflow: hidden;
  transform-origin: 0 0;
  background: radial-gradient(1200px 700px at 12% 0%, rgba(118, 183, 79, 0.10), transparent 60%),
              radial-gradient(1000px 700px at 100% 100%, rgba(47, 168, 224, 0.07), transparent 60%),
              linear-gradient(180deg, var(--obsidian), var(--onyx));
}
.screen { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: none; }
.screen.active { display: block; }
[data-scroll] { overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
[data-scroll]::-webkit-scrollbar { display: none; }
[data-scroll-x] { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }

/* ---- Common pieces ------------------------------------------------------- */
.spinner { width: 64px; height: 64px; border-radius: 50%; border: 6px solid rgba(255, 255, 255, 0.12); border-top-color: var(--brand); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--graphite); border: 1px solid var(--smoke); border-radius: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  height: 80px; padding: 0 44px; border-radius: 40px; font-size: 28px; font-weight: 700;
  background: var(--slate); color: var(--text); border: 2px solid var(--smoke);
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn.focused { background: var(--text); color: var(--onyx); border-color: var(--text); box-shadow: var(--ring); transform: scale(1.04); }
.btn-primary { background: var(--brand); color: #0B1206; border-color: var(--brand); }
.btn-primary.focused { background: var(--brand2); border-color: var(--brand2); color: #0B1206; }
.btn-danger { background: rgba(255, 59, 92, 0.14); color: #FF8DA0; border-color: rgba(255, 59, 92, 0.5); }
.btn-danger.focused { background: var(--live); color: #fff; border-color: var(--live); }
.btn-block { width: 100%; }
.btn-small { height: 64px; padding: 0 32px; font-size: 24px; }
.btn.disabled { opacity: 0.6; }

.field {
  display: flex; align-items: center; overflow: hidden; white-space: nowrap; width: 100%; height: 84px; padding: 0 34px; border-radius: 42px;
  background: var(--onyx); border: 2px solid var(--smoke); color: var(--text); font-size: 30px; outline: none;
}
.field.is-empty { color: var(--muted); }
.field.focused { border-color: var(--brand2); box-shadow: var(--ring); background: #0D0F14; }

.bar { display: block; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }

.logo { position: relative; display: flex; align-items: center; justify-content: center; flex: none; background: var(--onyx); border-radius: 14px; overflow: hidden; }
.logo img { max-width: 84%; max-height: 80%; object-fit: contain; position: relative; z-index: 1; }
.logo .logo-fallback { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: none; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; color: var(--text2); font-size: 26px; }
.logo.broken img { display: none; }
.logo.broken .logo-fallback { display: flex; }

.section-title { font-family: var(--display); font-weight: 600; font-size: 28px; color: var(--text2); margin: 0 0 22px; }
.kicker { font-family: var(--mono); font-size: 24px; letter-spacing: 3px; text-transform: uppercase; color: var(--brand2); margin-bottom: 14px; }
.hint { color: var(--muted); font-size: 24px; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 70%; color: var(--text2); font-size: 32px; text-align: center; line-height: 1.5; }
.empty.small { height: auto; padding-top: 80px; font-size: 28px; color: var(--muted); }

#toast {
  position: absolute; left: 50%; bottom: 72px; transform: translate(-50%, 40px); opacity: 0;
  background: var(--slate); border: 1px solid var(--ash); border-radius: 36px; padding: 18px 40px; font-size: 26px;
  transition: opacity 0.2s, transform 0.2s; z-index: 50; pointer-events: none;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.backdrop-bright {
  background:
    linear-gradient(to bottom, rgba(5, 8, 12, 0) 55%, rgba(5, 8, 12, 0.55) 100%),
    linear-gradient(115deg, rgba(255, 255, 255, 0) 32%, rgba(255, 255, 255, 0.07) 46%, rgba(255, 255, 255, 0) 60%),
    radial-gradient(ellipse 900px 700px at 8% 6%, rgba(159, 227, 110, 0.65), rgba(159, 227, 110, 0) 100%),
    radial-gradient(ellipse 800px 800px at 96% 40%, rgba(47, 168, 224, 0.55), rgba(47, 168, 224, 0) 100%),
    radial-gradient(ellipse 800px 700px at 4% 98%, rgba(168, 107, 255, 0.5), rgba(168, 107, 255, 0) 100%),
    linear-gradient(135deg, #2E6B35 0%, #14506F 55%, #2C2366 100%);
}
/* ---- Splash ------------------------------------------------------------------ */
#splash-screen { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 40px; }
#splash-screen.active { display: flex; }
.splash-logo { width: 620px; }
.splash-msg { color: var(--text2); font-size: 30px; margin: 0; max-width: 1100px; text-align: center; }
.splash-msg:empty { display: none; }
.splash-actions { display: flex; gap: 28px; }

/* ---- Sign in ------------------------------------------------------------------- */
.login-wrap { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; padding-top: 70px; }
.login-logo { width: 330px; margin-bottom: 30px; }
.login-title { font-family: var(--display); font-weight: 700; font-size: 52px; margin: 0 0 44px; letter-spacing: -0.5px; }
.login-cards { display: flex; align-items: stretch; gap: 0; }
.login-card { background: rgba(17, 20, 32, 0.78); width: 640px; padding: 44px 48px; }
.card-title { font-size: 32px; font-weight: 700; margin: 0 0 30px; }
.login-or { width: 140px; display: flex; align-items: center; justify-content: center; color: var(--text); font-weight: 700; font-size: 26px; }
.qr-row { display: flex; gap: 36px; align-items: flex-start; }
.qr-box { width: 268px; height: 268px; flex: none; background: #fff; border-radius: 22px; padding: 24px; display: flex; align-items: center; justify-content: center; }
.qr-img { width: 220px; height: 220px; display: flex; align-items: center; justify-content: center; }
.qr-img svg { width: 220px; height: 220px; display: block; }
.qr-img.expired { opacity: 0.12; }
.qr-img .spinner { border-color: rgba(0, 0, 0, 0.1); border-top-color: var(--brand); }
.qr-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.qr-steps li { display: flex; gap: 16px; color: var(--text2); font-size: 26px; line-height: 1.3; }
.qr-steps b { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #0B1206; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.qr-status { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; min-height: 64px; color: var(--muted); font-size: 26px; }
.form-card .field { margin-bottom: 22px; }
.form-card .btn { margin-top: 8px; }
.form-error { color: #FF8DA0; font-size: 25px; min-height: 34px; margin: 18px 0 0; line-height: 1.35; }
.login-foot { margin-top: 44px; color: var(--text2); font-size: 26px; }

/* ---- Home: top bar + tabs ---------------------------------------------------- */
.topbar { position: absolute; left: 0; right: 0; top: 0; height: 160px; padding: 44px 96px 0; display: flex; align-items: flex-start; justify-content: space-between; }
.tabs { display: flex; gap: 4px; padding: 8px; border-radius: 48px; background: rgba(22, 24, 31, 0.9); border: 1px solid var(--smoke); }
.tab { position: relative; display: flex; align-items: center; gap: 10px; height: 76px; padding: 0 22px; border-radius: 38px; color: var(--text2); font-size: 27px; font-weight: 700; transition: background 0.12s, color 0.12s, transform 0.12s; }
.tab.active { background: var(--slate); color: var(--text); }
.tab.focused { background: var(--text); color: var(--onyx); box-shadow: var(--ring); transform: scale(1.05); }
.cdot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.cdot.red { background: var(--red); } .cdot.green { background: var(--green); } .cdot.yellow { background: var(--yellow); } .cdot.blue { background: var(--blue); }
.clock { width: 130px; text-align: right; font-family: var(--mono); font-size: 32px; color: var(--text2); padding-top: 22px; }
.topbar-logo { width: 170px; }
.tab-body { position: absolute; left: 96px; right: 96px; top: 170px; bottom: 0; }

/* Chips */
.chips { display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 10px 14px 14px; margin: 0 -14px; flex: none; white-space: nowrap; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 62px; padding: 0 30px; border-radius: 31px; font-size: 26px; font-weight: 700; color: var(--text2); background: var(--graphite); border: 2px solid var(--smoke); }
.chip.active { background: var(--slate); color: var(--text); border-color: var(--ash); }
.chip.focused { background: var(--text); color: var(--onyx); border-color: var(--text); box-shadow: var(--ring); transform: scale(1.05); }

/* Key hints */
.hints { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: center; margin-top: 22px; color: var(--text2); font-size: 24px; }
.hint-item { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.kbd { display: inline-block; min-width: 44px; padding: 3px 14px; border-radius: 12px; border: 2px solid var(--brand); color: var(--brand2); font-size: 20px; font-weight: 800; text-align: center; letter-spacing: 1px; }

/* Live TV */
.tab-live { display: flex; gap: 56px; }
.live-left { width: 900px; flex: none; height: 100%; display: flex; flex-direction: column; }
.ch-list { flex: 1; min-height: 0; padding: 10px 14px 54px; margin: 0 -14px; }
.ch-item { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ch-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 22px; height: 124px; padding: 0 26px 0 14px; border-radius: 22px; background: var(--graphite); border: 2px solid var(--smoke); transition: transform 0.1s; }
.ch-row.focused, .gd-ch.focused { background: var(--selbg); box-shadow: var(--ring); border-color: var(--brand2); transform: scale(1.02); }
.ch-num { width: 84px; flex: none; text-align: right; font-size: 34px; font-weight: 700; color: var(--text2); }
.ch-row.focused .ch-num, .gd-ch.focused .ch-num { color: var(--brand2); }
.ch-logo { width: 176px; height: 110px; }
.ch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ch-name, .ch-now { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-name { font-size: 36px; font-weight: 700; }
.ch-now { font-size: 28px; color: var(--text2); }
.ch-row.focused .ch-now { color: var(--text); }
.ch-text .bar { height: 7px; margin-top: 2px; }
.ch-cu { flex: none; color: var(--info); }
.ch-lock { margin-left: 14px; color: var(--muted); display: inline-block; vertical-align: middle; }
.ch-fav { flex: none; width: 92px; height: 92px; border-radius: 46px; display: flex; align-items: center; justify-content: center; color: var(--muted); background: var(--graphite); border: 2px solid var(--smoke); }
.ch-fav.on { color: #FFC83D; }
.ch-fav.focused { background: var(--text); color: var(--onyx); box-shadow: var(--ring); transform: scale(1.08); }
.ch-fav.on.focused { color: #E59A00; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--live); margin-right: 10px; vertical-align: middle; position: relative; top: -2px; }
.preview { flex: 1; min-width: 0; padding-top: 12px; }
.pv-head { display: flex; align-items: center; gap: 36px; margin-bottom: 44px; }
.pv-logo { width: 220px; height: 128px; border-radius: 20px; background: var(--graphite); }
.pv-num { font-family: var(--mono); color: var(--brand2); font-size: 28px; margin-bottom: 4px; }
.pv-name { font-family: var(--display); font-weight: 700; font-size: 52px; margin: 0; line-height: 1.1; }
.pv-epg { display: flex; flex-direction: column; gap: 26px; margin-bottom: 30px; }
.pv-item { display: flex; gap: 36px; align-items: flex-start; font-size: 32px; }
.pv-item .time { width: 110px; flex: none; color: var(--muted); font-size: 30px; padding-top: 2px; }
.pv-item .live-time { color: var(--live); }
.pv-t { flex: 1; min-width: 0; }
.pv-t span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-now .pv-t span { font-weight: 700; }
.pv-now .bar { margin-top: 14px; width: 420px; }
.pv-noepg { color: var(--muted); font-size: 28px; margin: 0 0 44px; }

/* Guide */
.tab-guide { display: flex; gap: 40px; }
.gd-left { width: 760px; flex: none; height: 100%; padding: 10px 14px 54px; margin: 0 -14px; position: relative; }
.gd-ch { display: flex; align-items: center; gap: 18px; width: 100%; height: 108px; padding: 0 22px 0 8px; margin-bottom: 12px; border-radius: 20px; background: var(--graphite); border: 2px solid var(--smoke); }
.gd-ch .ch-num { width: 76px; font-size: 30px; }
.gd-ch .ch-name { font-size: 30px; }
.gd-ch .ch-now { font-size: 24px; }
.gd-logo { width: 104px; height: 66px; }
.gd-right { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.gd-head { display: flex; align-items: center; gap: 28px; margin-bottom: 18px; min-height: 120px; }
.gd-hlogo { width: 150px; height: 92px; }
.gd-name { font-family: var(--display); font-weight: 700; font-size: 40px; margin: 0; }
.gd-note { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--info); font-size: 24px; text-align: right; max-width: 280px; line-height: 1.2; }
.gd-progs { flex: 1; min-height: 0; padding: 10px 14px 54px; margin: 0 -14px; position: relative; }
.gp-day { font-family: var(--display); font-size: 26px; color: var(--brand2); padding: 22px 8px 10px; }
.gp { display: flex; align-items: center; gap: 28px; width: 100%; height: 96px; padding: 0 24px; margin-bottom: 10px; border-radius: 18px; background: var(--graphite); border: 2px solid var(--smoke); font-size: 30px; }
.gp-time { width: 100px; flex: none; color: var(--text2); font-size: 30px; }
.gp-title { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp.past { opacity: 0.62; }
.gp.past.unrec { opacity: 0.4; }
.gp.now { border-color: var(--live); }
.gp.now .gp-time { color: var(--live); }
.gp.focused { opacity: 1; background: var(--selbg); box-shadow: var(--ring); border-color: var(--brand2); }
.gp-badge { flex: none; display: inline-flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; padding: 6px 16px; border-radius: 12px; background: rgba(47, 168, 224, 0.18); color: #7FD0F5; }
.gp-badge.live { background: var(--live); color: #fff; letter-spacing: 1px; }
.gp-badge.off { background: rgba(255, 255, 255, 0.08); color: var(--muted); }

/* Movies */
/* minmax(0, 1fr): a plain 1fr column grows to its widest nowrap title, so tiles came out uneven. */
.poster-chips { margin-bottom: 4px; }
.tab-movies, .tab-series { display: flex; flex-direction: column; }
.poster-grid { flex: 1; min-height: 0; height: auto; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 40px 34px; padding: 14px 16px 60px; margin: 0 -16px; align-content: start; }
.poster { display: flex; flex-direction: column; gap: 16px; min-width: 0; width: 100%; }
.poster-img { position: relative; display: block; width: 100%; height: 0; padding-top: 150%; border-radius: 20px; overflow: hidden; background: var(--graphite); border: 1px solid var(--smoke); transition: transform 0.12s; }
.poster-img img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.poster-fallback { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; color: var(--ash); }
.poster-progress { position: absolute; left: 14px; right: 14px; bottom: 14px; height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.6); z-index: 2; overflow: hidden; }
.poster-progress i { display: block; height: 100%; background: var(--brand); }
.poster-title { display: block; width: 100%; font-size: 25px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster-fav { position: absolute; top: 12px; right: 12px; z-index: 3; color: #FFC83D; filter: drop-shadow(0 2px 4px #000); }
.poster-empty { grid-column: 1 / -1; }
.poster.focused .poster-img { box-shadow: var(--ring); transform: scale(1.05); }
.poster.focused .poster-title { color: var(--text); font-weight: 700; }

/* Movie details layer */
.layer { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 20; }
.details-layer { background: rgba(8, 9, 12, 0.88); display: flex; align-items: center; justify-content: center; }
.details { width: 1500px; display: flex; gap: 64px; padding: 72px; background: rgba(22, 24, 31, 0.97); }
.details-poster { width: 380px; height: 570px; flex: none; border-radius: 22px; overflow: hidden; background: var(--slate); position: relative; display: flex; align-items: center; justify-content: center; color: var(--ash); }
.details-poster img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.details-info { flex: 1; min-width: 0; padding-top: 10px; }
.details-title { font-family: var(--display); font-size: 58px; font-weight: 700; margin: 0 0 28px; line-height: 1.12; }
.details-desc { color: var(--text2); font-size: 30px; line-height: 1.5; margin: 0 0 48px; max-height: 315px; overflow: hidden; white-space: pre-line; }
.details-actions { display: flex; gap: 28px; }

/* Search */
.tab-search { display: flex; flex-direction: column; }
.search-bar { display: flex; align-items: center; gap: 24px; color: var(--muted); margin: 6px 0 32px; }
.search-field { width: 1100px; }
.search-results { flex: 1; padding: 8px 12px 54px; margin: 0 -12px; }
.search-results .section-title { margin-top: 12px; }
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 36px; }
.result { display: flex; align-items: center; gap: 22px; height: 112px; padding: 0 22px; border-radius: 20px; background: var(--graphite); border: 1px solid var(--smoke); min-width: 0; }
.result.focused { background: var(--selbg); box-shadow: var(--ring); }
.r-logo { width: 110px; height: 66px; }
.r-poster { width: 56px; height: 84px; border-radius: 8px; overflow: hidden; background: var(--slate); flex: none; }
.r-poster img { width: 100%; height: 100%; object-fit: cover; }
.r-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.r-title, .r-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-title { font-weight: 700; font-size: 28px; }
.r-sub { font-size: 24px; color: var(--text2); }

/* History */
.history-list { height: 100%; padding: 8px 12px 54px; margin: 0 -12px; max-width: 1400px; }
.h-row { display: flex; align-items: center; gap: 28px; width: 100%; height: 136px; padding: 0 28px; margin-bottom: 14px; border-radius: 22px; background: var(--graphite); border: 1px solid var(--smoke); }
.h-row.focused { background: var(--selbg); box-shadow: var(--ring); }
.h-logo { width: 140px; height: 82px; }
.h-poster { width: 66px; height: 98px; border-radius: 10px; overflow: hidden; background: var(--slate); flex: none; margin: 0 37px; }
.h-poster img { width: 100%; height: 100%; object-fit: cover; }
.h-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.h-title { font-weight: 700; font-size: 34px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-sub { font-size: 28px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-text .bar { width: 360px; height: 6px; margin-top: 6px; }
.h-when { color: var(--muted); font-size: 24px; flex: none; }

/* Settings */
.settings { height: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding: 8px 12px 54px; margin: 0 -12px; align-content: start; }
.set-card { padding: 40px 44px; }
.set-note { color: var(--text2); margin: -6px 0 26px; font-size: 26px; }
.set-actions { display: flex; flex-wrap: wrap; gap: 20px; }
.kv { display: grid; grid-template-columns: 300px 1fr; gap: 18px 24px; margin: 0; font-size: 28px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; }

/* Modal / PIN */
.modal-layer { background: rgba(8, 9, 12, 0.82); display: flex; align-items: center; justify-content: center; z-index: 30; }
.modal-card { width: 920px; padding: 56px 64px; border-radius: 32px; background: var(--graphite); border: 1px solid var(--ash); text-align: center; box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6); }
.modal-title { font-family: var(--display); font-weight: 700; font-size: 44px; margin: 0 0 18px; }
.modal-text { color: var(--text2); font-size: 28px; line-height: 1.45; margin: 0 0 40px; }
.modal-actions { display: flex; gap: 28px; justify-content: center; margin-top: 40px; }
.modal-actions .btn { min-width: 260px; opacity: 0.55; }
.modal-actions .btn.focused { opacity: 1; background: var(--brand2); border-color: #fff; color: #0B1206; box-shadow: 0 0 0 7px #fff, 0 14px 36px rgba(0, 0, 0, 0.6); transform: scale(1.08); }
.modal-actions .btn.focused::before { content: '\25B6'; font-size: 22px; margin-right: 4px; }
.modal-stack { flex-direction: column; align-items: center; }
.modal-stack .btn { width: 520px; }
.pin-dots { display: flex; gap: 28px; justify-content: center; }
.pin-dots i { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--ash); }
.pin-dots i.on { background: var(--brand2); border-color: var(--brand2); }
.pin-error { color: #FF8DA0; min-height: 36px; margin: 18px 0 10px; font-size: 26px; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 180px); gap: 18px; justify-content: center; }
.pin-key { height: 84px; padding: 0; font-family: var(--mono); font-size: 34px; }
.pin-key-wide { font-family: var(--body); font-size: 24px; }

/* Locked channels */
.locks-layer { background: rgba(8, 9, 12, 0.88); display: flex; align-items: center; justify-content: center; }
.locks { width: 1100px; height: 920px; padding: 52px 56px 0; display: flex; flex-direction: column; }
.locks .modal-text { margin-bottom: 24px; }
.locks-list { flex: 1; padding: 8px 12px 40px; margin: 0 -12px; }
.lock-row { display: flex; align-items: center; gap: 24px; width: 100%; height: 92px; padding: 0 24px; margin-bottom: 12px; border-radius: 20px; background: var(--slate); }
.lock-row.focused { box-shadow: var(--ring); background: var(--selbg); }
.l-logo { width: 104px; height: 60px; }
.l-name { flex: 1; font-size: 28px; font-weight: 700; }
.l-state { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 24px; }
.lock-row.on .l-state { color: var(--live); }

/* On-screen keyboard */
.osk-layer { background: rgba(8, 9, 12, 0.6); z-index: 40; }
.osk { position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 96px 54px; background: var(--graphite); border-top: 1px solid var(--ash); box-shadow: 0 -30px 80px rgba(0, 0, 0, 0.6); }
.osk-label { color: var(--muted); font-size: 24px; text-align: center; margin-bottom: 8px; }
.osk-value { text-align: center; font-size: 40px; min-height: 60px; margin-bottom: 22px; font-weight: 700; letter-spacing: 1px; }
.caret { display: inline-block; width: 3px; height: 40px; background: var(--brand2); vertical-align: middle; margin-left: 4px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.osk-row { display: flex; justify-content: center; gap: 12px; margin-bottom: 12px; }
.osk-key { width: 118px; height: 76px; border-radius: 16px; background: var(--slate); border: 1px solid var(--smoke); font-size: 32px; font-weight: 700; text-align: center; }
.osk-key.focused { background: var(--text); color: var(--onyx); box-shadow: var(--ring); }
.osk-wide { width: 220px; font-size: 26px; }
.osk-space { width: 520px; font-size: 26px; }
.osk-done { background: var(--brand); color: #0B1206; }
.osk-done.focused { background: var(--brand2); }
.osk-key.on { color: var(--brand2); }

/* ---- Series details ------------------------------------------------------------ */
.sd { width: 1640px; height: 940px; display: flex; gap: 56px; padding: 56px 64px; background: rgba(22, 24, 31, 0.97); }
.sd-left { width: 340px; flex: none; display: flex; flex-direction: column; gap: 24px; }
.sd-poster { width: 340px; height: 510px; }
.sd-fav { width: 100%; padding: 0 20px; font-size: 24px; }
.sd-right { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sd-title { font-size: 48px; margin-bottom: 10px; }
.sd-meta { color: var(--brand2); font-size: 26px; margin-bottom: 10px; min-height: 30px; }
.sd-plot { color: var(--text2); font-size: 25px; line-height: 1.4; margin: 0 0 8px; max-height: 105px; overflow: hidden; }
.sd-seasons { padding-top: 8px; padding-bottom: 12px; }
.sd-eps { flex: 1; min-height: 0; padding: 8px 12px 24px; margin: 0 -12px; position: relative; }
.ep { position: relative; display: flex; align-items: center; gap: 26px; width: 100%; min-height: 104px; padding: 12px 26px; margin-bottom: 12px; border-radius: 18px; background: var(--slate); border: 2px solid var(--smoke); }
.ep.focused { background: var(--selbg); box-shadow: var(--ring); border-color: var(--brand2); }
.ep-n { width: 56px; flex: none; text-align: right; font-size: 34px; font-weight: 700; color: var(--brand2); }
.ep-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ep-title { font-size: 31px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-plot { font-size: 22px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-d { flex: none; color: var(--text2); font-size: 26px; }
.ep-bar { position: absolute; left: 26px; right: 26px; bottom: 8px; height: 5px; }

/* ---- Player ------------------------------------------------------------------- */
#player-screen { background: #000; }
#video { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; background: #000; object-fit: contain; }
.pl-spinner { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: none; align-items: center; justify-content: center; }
.pl-spinner.show { display: flex; }

/* live info bar */
.pl-info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 120px 96px 56px; display: flex; gap: 36px; align-items: center;
  background: linear-gradient(180deg, transparent, rgba(8, 9, 12, 0.94) 42%); opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.pl-info.show { opacity: 1; }
.pi-num { font-size: 84px; font-weight: 800; color: var(--brand2); min-width: 150px; text-align: right; line-height: 1; padding-bottom: 14px; }
.pi-logo { width: 200px; height: 118px; border-radius: 18px; background: rgba(22, 24, 31, 0.9); }
.pi-main { flex: 1; min-width: 0; }
.pi-top { display: flex; align-items: center; gap: 20px; margin-bottom: 12px; }
.badge-live { background: var(--live); color: #fff; font-weight: 800; font-size: 24px; letter-spacing: 2px; padding: 6px 18px; border-radius: 10px; }
.pi-name { font-family: var(--display); font-weight: 700; font-size: 50px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi-lock, .pi-fav { color: #FFC83D; }
.pi-lock { color: var(--muted); }
.pi-clock { margin-left: auto; color: var(--text2); font-size: 34px; }
.pi-now { display: flex; gap: 24px; align-items: baseline; font-size: 36px; margin-bottom: 14px; }
.pi-now .time { color: var(--text2); font-size: 28px; }
.pi-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-info .bar { max-width: 1000px; height: 10px; margin-bottom: 16px; }
.pi-next { display: flex; gap: 18px; font-size: 28px; color: var(--text2); }
.pi-next .time { color: var(--muted); }
.pl-info .hints { margin-top: 18px; font-size: 22px; }
.pl-digits { position: absolute; top: 56px; right: 96px; display: none; padding: 10px 40px; border-radius: 24px; background: rgba(8, 9, 12, 0.88); border: 2px solid var(--brand2); font-family: var(--mono); font-size: 96px; font-weight: 800; color: var(--brand2); }
.pl-digits.show { display: block; }
.pl-flash { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); padding: 14px 44px; border-radius: 40px; background: rgba(8, 9, 12, 0.82); font-size: 52px; font-weight: 800; opacity: 0; transition: opacity 0.15s; pointer-events: none; }
.pl-flash.show { opacity: 1; }

/* recording bar */
.pl-vod { position: absolute; left: 0; right: 0; bottom: 0; padding: 150px 96px 52px; background: linear-gradient(180deg, transparent, rgba(8, 9, 12, 0.95) 45%); opacity: 0; transition: opacity 0.25s; pointer-events: none; }
.pl-vod.show { opacity: 1; }
.mode-live .pl-vod { display: none; }
.pv-top { display: flex; align-items: baseline; gap: 26px; margin-bottom: 20px; }
.pv-title { font-family: var(--display); font-weight: 700; font-size: 46px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 62%; }
.pv-sub { color: var(--text2); font-size: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pv-row { display: flex; align-items: center; gap: 26px; }
.pv-state { width: 72px; height: 72px; border-radius: 50%; background: var(--text); color: var(--onyx); display: flex; align-items: center; justify-content: center; flex: none; }
.pv-time { font-size: 34px; color: var(--text); min-width: 130px; text-align: right; flex: none; }
.pv-len { text-align: left; color: var(--text2); }
.pv-seek { flex: 1; height: 16px; border-radius: 8px; background: rgba(255, 255, 255, 0.22); overflow: hidden; }
.pv-seek i { display: block; height: 100%; width: 0; background: var(--brand2); }
.pv-btns { display: none; justify-content: center; gap: 22px; margin-top: 34px; }
.with-btns .pv-btns { display: flex; }
.pv-btn { width: 200px; height: 146px; border-radius: 24px; background: rgba(31, 34, 43, 0.95); border: 2px solid var(--smoke); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text); font-size: 27px; font-weight: 700; text-align: center; }
.pv-btn.sel { background: var(--selbg); border-color: var(--brand2); box-shadow: var(--ring); transform: scale(1.06); }
.pv-ic { display: flex; }
.pv-hint { display: none; }
.with-btns .pv-hint { display: block; }
.pv-hint .hints { justify-content: center; margin-top: 22px; }

/* side panels */
.pl-panel { position: absolute; top: 30px; bottom: 30px; width: 900px; padding: 26px 26px 20px; border-radius: 34px; background: rgba(10, 12, 18, 0.99); border: 2px solid var(--smoke); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7); display: flex; flex-direction: column; opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.18s; }
.pl-panel.show { opacity: 1; transform: none !important; }
.pl-chlist { left: 30px; transform: translateX(-60px); }
.pl-opts { right: 30px; width: 760px; transform: translateX(60px); }
.pl-opts.wide { width: 1100px; }
.pl-ph { display: flex; align-items: center; gap: 22px; min-height: 84px; margin-bottom: 14px; }
.pl-hd { flex: 1; min-width: 0; }
.pl-hd b { display: block; font-family: var(--display); font-size: 42px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-hd small { display: block; font-size: 25px; color: var(--text2); margin-top: 4px; }
.pl-arr { width: 68px; height: 68px; border-radius: 20px; border: 2px solid var(--brand); color: var(--brand2); display: flex; align-items: center; justify-content: center; font-size: 46px; line-height: 1; flex: none; }
.pl-box { flex: 1; min-height: 0; overflow: hidden; position: relative; padding: 8px 6px 0; margin: 0 -6px; }
.pl-foot { flex: none; padding-top: 4px; }
.pl-foot .hints { margin-top: 10px; font-size: 21px; gap: 10px 20px; }
.pl-foot .kbd { min-width: 38px; padding: 2px 10px; font-size: 18px; }
.pl-it { display: flex; align-items: center; gap: 22px; min-height: 112px; padding: 10px 24px 10px 14px; margin-bottom: 12px; border-radius: 22px; background: rgba(31, 34, 43, 0.9); border: 2px solid var(--smoke); }
.pl-it.sel { background: var(--selbg); border-color: var(--brand2); box-shadow: var(--ring); }
.pl-it.current { border-color: var(--brand); }
.pl-it.sel.current { border-color: var(--brand2); }
.pl-it.dim, .pl-it.off { opacity: 0.5; }
.pl-it.past { opacity: 0.7; }
.pl-it.now { border-color: var(--live); }
.pc-num { width: 80px; flex: none; text-align: right; font-size: 38px; font-weight: 700; color: var(--text2); }
.pl-it.sel .pc-num { color: var(--brand2); }
.pc-logo { width: 124px; height: 78px; }
.pc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pc-name, .pc-now { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-name { font-weight: 700; font-size: 34px; }
.pc-now { font-size: 26px; color: var(--text2); }
.pl-it.sel .pc-now { color: var(--text); }
.pc-text .bar { height: 7px; }
.pc-badge { flex: none; background: var(--brand); color: #0B1206; font-size: 20px; font-weight: 800; padding: 6px 14px; border-radius: 10px; }
.pc-lock { color: var(--muted); }
.pc-star { color: #FFC83D; }
.po-l { flex: 1; min-width: 0; font-size: 34px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.po-v { flex: none; max-width: 230px; font-size: 27px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-it.sel .po-v { color: var(--text); }
.po-ck { width: 40px; flex: none; color: var(--brand2); display: flex; }
.pl-it.on .po-l { color: var(--brand2); }
.pl-it.sel.on .po-l { color: var(--text); }
.pg-t { width: 100px; flex: none; font-size: 30px; color: var(--text2); }
.pg-title { flex: 1; min-width: 0; font-size: 32px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-it .gp-badge { margin-left: auto; }

.pl-error { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: none; align-items: center; justify-content: center; background: rgba(8, 9, 12, 0.85); }
.pl-error.show { display: flex; }
.err-card { width: 1000px; padding: 64px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.err-card .ico { color: var(--live); margin-bottom: 20px; }
.err-title { font-family: var(--display); font-size: 40px; margin: 0 0 16px; }
.err-text { color: var(--text2); font-size: 28px; margin: 0 0 40px; }
.err-actions { display: flex; gap: 24px; }
.qr-retry { white-space: nowrap; flex: none; }
