/* ─── Design Tokens ──────────────────────────────────────── */
:root {
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 8px;
  --radius-sm: 5px;
  --topbar-h: 72px;
  --time-axis-h: 34px;
  --guide-row-h: 96px;
  --tier-row-h: 30px;
  --sidebar-w: 270px;
}

/* ─── Dark Pastel ────────────────────────────────────────── */
[data-theme="dark"] {
  --bg-deep: #181c2e;
  --bg-surface: #1e2340;
  --bg-card: #262c50;
  --bg-hover: #2e3560;
  --bg-active: #343c6a;
  --bg-section: #1a1f38;
  --border: #2c3358;
  --border-bright: #3a4268;
  --text-primary: #e2e6f0;
  --text-secondary: #98a0be;
  --text-dim: #606888;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.18);
  --cyan: #7edce8;
  --cyan-soft: rgba(126,220,232,0.10);
  --purple: #b8a4ff;
  --neon: #b87aff;
  --neon-bright: #d49bff;
  --neon-soft: rgba(184,122,255,0.12);
  --neon-glow: 0 0 12px rgba(184,122,255,0.55);
  --neon-glow-soft: 0 0 8px rgba(184,122,255,0.35);
  --live-green: #7ee8b0;
  --fav-gold: #f2d46a;
  --error-red: #f08080;
  --prog-bg: #262c50;
  --prog-current: #2a3462;
  --prog-border: #323a64;
  --pin-bg: radial-gradient(ellipse at 50% 20%, #242a50 0%, #181c2e 70%);
}

/* ─── Light Pastel (airy) ────────────────────────────────── */
[data-theme="light"] {
  --bg-deep: #f2f4fa;
  --bg-surface: #ffffff;
  --bg-card: #f5f7fc;
  --bg-hover: #ebeef8;
  --bg-active: #e2e5f4;
  --bg-section: #e8ebf5;
  --border: #dce0f0;
  --border-bright: #ccd2e4;
  --text-primary: #2a2f45;
  --text-secondary: #5a6282;
  --text-dim: #8890aa;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --cyan: #3db8c8;
  --cyan-soft: rgba(61,184,200,0.08);
  --purple: #8b7cf0;
  --neon: #8b3df5;
  --neon-bright: #a86cff;
  --neon-soft: rgba(139,61,245,0.10);
  --neon-glow: 0 0 10px rgba(139,61,245,0.40);
  --neon-glow-soft: 0 0 6px rgba(139,61,245,0.25);
  --live-green: #3dbb80;
  --fav-gold: #e0b830;
  --error-red: #e05050;
  --prog-bg: #eceef8;
  --prog-current: #dfe5f8;
  --prog-border: #d0d5e8;
  --pin-bg: radial-gradient(ellipse at 50% 20%, #e8eaf5 0%, #f2f4fa 70%);
}

/* ─── Reset ──────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body, #root { height: 100%; width: 100%; background: var(--bg-deep); color: var(--text-primary); font-family: var(--font-display); overflow: hidden; }
button { font-family: var(--font-display); cursor: pointer; }
input[type="range"] { cursor: pointer; }

/* ─── PIN Screen ─────────────────────────────────────────── */
.pin-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100vh; background: var(--pin-bg); position: relative; overflow: hidden;
}
.pin-screen::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 30h60M30 0v60' stroke='%2325305a' stroke-width='0.4' fill='none'/%3E%3C/svg%3E");
  opacity: 0.15; pointer-events: none;
}
[data-theme="light"] .pin-screen::before {
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 30h60M30 0v60' stroke='%23c0c4d8' stroke-width='0.4' fill='none'/%3E%3C/svg%3E");
}
.pin-logo-wrap { display: flex; align-items: center; gap: 16px; margin-bottom: 0.6rem; z-index: 1; }
.pin-logo-img { width: 180px; height: 180px; border: none; border-radius: 50%; object-fit: cover; }
.pin-brand { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em; }
.pin-brand-mole { color: var(--text-primary); }
.pin-brand-tv {
  color: var(--text-primary); margin-left: 10px; padding: 5px 14px 6px; position: relative; font-weight: 900; display: inline-block;
  filter: drop-shadow(0 0 10px rgba(184,122,255,0.6));
}
.pin-brand-tv::before {
  content: ''; position: absolute; top: -3px; right: -4px; bottom: -4px; left: -4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 70' preserveAspectRatio='none'%3E%3Cpath d='M14,8 L106,5 C112,5 116,9 116,15 L114,55 C114,61 110,65 104,65 L16,62 C10,62 7,58 7,52 L5,18 C5,12 8,8 14,8 Z' fill='rgba(184,122,255,0.12)' stroke='%23b87aff' stroke-width='2'/%3E%3Cline x1='10' y1='8' x2='4' y2='1' stroke='%23b87aff' stroke-width='1.8' stroke-linecap='round'/%3E%3Cline x1='16' y1='7' x2='14' y2='1' stroke='%23b87aff' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center/100% 100% no-repeat;
}
.pin-sub { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 2.2rem; letter-spacing: 0.12em; text-transform: uppercase; z-index: 1; }
.pin-error-msg { color: var(--error-red); font-size: 0.9rem; font-weight: 500; margin-top: 1.2rem; height: 22px; transition: opacity 0.3s; opacity: 0; z-index: 1; }
.pin-error-msg.visible { opacity: 1; }
.login-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
  padding: 36px 40px; width: 340px; max-width: 92vw; z-index: 1;
  box-shadow: 0 8px 40px rgba(0,0,0,0.35), 0 0 0 1px rgba(126,220,232,0.08);
}
.login-field { margin-bottom: 18px; }
.login-field label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-dim); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 7px; }
.login-input {
  width: 100%; padding: 11px 14px; border-radius: var(--radius);
  background: var(--bg-deep); border: 2px solid var(--border);
  color: var(--text-primary); font-family: var(--font-body); font-size: 1rem;
  outline: none; transition: border-color 0.15s; box-sizing: border-box;
}
.login-input:focus { border-color: var(--cyan); }
.login-input::placeholder { color: var(--text-dim); }
.login-submit {
  width: 100%; padding: 12px; border-radius: var(--radius);
  background: var(--cyan); color: var(--bg-deep);
  font-weight: 700; font-size: 1rem; border: none; cursor: pointer;
  transition: opacity 0.15s, transform 0.1s; margin-top: 4px;
}
.login-submit:hover { opacity: 0.9; }
.login-submit:active { transform: scale(0.98); }
.login-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.login-footer { margin-top: 18px; text-align: center; }
.login-link { background: none; border: none; color: var(--cyan); font-size: 0.85rem; cursor: pointer; padding: 0; text-decoration: underline; }
.login-link:hover { opacity: 0.8; }
.login-success { color: var(--live-green); font-size: 0.9rem; text-align: center; margin-top: 12px; }

/* ─── Intro Video ───────────────────────────────────────── */
.intro-screen {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 99999;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 1s ease;
}
.intro-screen.fading { opacity: 0; pointer-events: none; }
.intro-screen video {
  width: 100%; height: 100%; object-fit: contain;
}

/* ─── Launcher (post-intro destination grid) ─────────────── */
.launcher {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh; z-index: 4000;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(184,122,255,0.16), transparent 60%),
    radial-gradient(110% 80% at 50% 110%, rgba(126,220,232,0.12), transparent 60%),
    var(--bg-deep);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: auto; animation: launcher-in 0.45s ease both;
}
@keyframes launcher-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.launcher-head { text-align: center; margin-bottom: 44px; }
.launcher-brand { font-size: 2rem; font-weight: 800; letter-spacing: 0.01em; line-height: 1; margin-bottom: 12px; }
.launcher-brand .lb-mole { color: var(--text-primary); }
.launcher-brand .lb-tv { color: var(--cyan); }
.launcher-tagline { font-size: 1.1rem; color: var(--text-secondary); letter-spacing: 0.02em; }
.launcher-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px;
  width: min(900px, 86vw);
}
.launcher-tile {
  position: relative; display: flex; flex-direction: column;
  align-items: flex-start; justify-content: flex-end;
  min-height: 180px; padding: 26px 28px; border-radius: 18px;
  cursor: pointer; overflow: hidden;
  background: var(--bg-surface); border: 1.5px solid rgba(127,140,170,0.18);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.launcher-tile:hover, .launcher-tile.focused {
  transform: translateY(-4px);
  border-color: var(--tile-accent, var(--cyan));
  box-shadow: 0 12px 40px rgba(0,0,0,0.28),
              0 0 0 2px var(--tile-accent, var(--cyan)),
              0 0 28px var(--tile-glow, rgba(126,220,232,0.4));
}
.launcher-tile-icon { width: 60px; height: 60px; margin-bottom: auto; color: var(--tile-accent, var(--cyan)); }
.launcher-tile-icon svg { width: 100%; height: 100%; display: block; }
.launcher-tile-label { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); margin-top: 16px; line-height: 1.1; }
.launcher-tile-sub { font-size: 0.92rem; color: var(--text-secondary); margin-top: 5px; }
.launcher-hint { margin-top: 38px; font-size: 0.9rem; color: var(--text-dim); letter-spacing: 0.03em; }
.launcher-hint b { color: var(--cyan); font-weight: 600; }
@media (max-width: 640px) {
  .launcher-grid { grid-template-columns: 1fr; width: 90vw; gap: 16px; }
  .launcher-tile { min-height: 120px; padding: 20px 22px; }
  .launcher-brand { font-size: 1.6rem; }
  .launcher-tile-icon { width: 48px; height: 48px; }
  .launcher-tile-label { font-size: 1.2rem; }
  .launcher-hint { display: none; }
}

/* ─── Who's Watching ─────────────────────────────────────── */
.whos-watching {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100vh; background: var(--pin-bg); position: relative; overflow: hidden;
}
.whos-watching::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 30h60M30 0v60' stroke='%2325305a' stroke-width='0.4' fill='none'/%3E%3C/svg%3E");
  opacity: 0.15; pointer-events: none;
}
[data-theme="light"] .whos-watching::before {
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 30h60M30 0v60' stroke='%23c0c4d8' stroke-width='0.4' fill='none'/%3E%3C/svg%3E");
}
.whos-title {
  font-size: 1.8rem; font-weight: 700; color: var(--text-primary);
  margin-bottom: 2.5rem; z-index: 1; letter-spacing: -0.01em;
}
.whos-grid {
  display: flex; gap: 28px; flex-wrap: wrap; justify-content: center;
  z-index: 1; max-width: 700px; padding: 0 20px;
}
.whos-profile {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; transition: transform 0.15s;
  background: none; border: none; padding: 8px;
}
.whos-profile:hover, .whos-profile:focus { transform: scale(1.08); outline: none; }
.whos-profile:focus .whos-avatar { box-shadow: 0 4px 24px rgba(126,220,232,0.5), 0 0 0 3px var(--cyan), 0 0 22px 4px rgba(184,122,255,0.5); }
.whos-profile:active { transform: scale(0.96); }
.whos-avatar {
  width: 96px; height: 96px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; font-weight: 800; color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transition: box-shadow 0.15s;
  text-transform: uppercase;
}
.whos-profile:hover .whos-avatar { box-shadow: 0 4px 24px rgba(126,220,232,0.35); }
.whos-name {
  font-size: 0.95rem; color: var(--text-secondary); font-weight: 500;
  max-width: 110px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.whos-add-btn {
  width: 96px; height: 96px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.8rem; color: var(--text-dim);
  background: var(--bg-card); border: 2px dashed var(--border-bright);
  cursor: pointer; transition: all 0.15s;
}
.whos-add-btn:hover, .whos-add-btn:focus { border-color: var(--cyan); color: var(--cyan); background: var(--bg-hover); outline: none; box-shadow: 0 0 0 3px rgba(126,220,232,0.4); }
.whos-add-label { font-size: 0.85rem; color: var(--text-dim); font-weight: 500; }

/* New profile form */
.whos-form {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  z-index: 1; margin-top: 2rem;
}
.whos-input {
  width: 240px; padding: 12px 18px; border-radius: var(--radius);
  background: var(--bg-card); border: 2px solid var(--border);
  color: var(--text-primary); font-family: var(--font-display); font-size: 1.05rem;
  outline: none; text-align: center; transition: border-color 0.15s;
}
.whos-input:focus { border-color: var(--cyan); }
.whos-input::placeholder { color: var(--text-dim); }
.whos-form-btns { display: flex; gap: 10px; }
.whos-form-btn {
  padding: 10px 24px; border-radius: var(--radius); font-weight: 600;
  font-size: 0.95rem; border: none; cursor: pointer; transition: all 0.1s;
}
.whos-form-btn.primary { background: var(--cyan); color: var(--bg-deep); }
.whos-form-btn.primary:hover { filter: brightness(1.1); }
.whos-form-btn.secondary { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border); }
.whos-form-btn.secondary:hover { background: var(--bg-hover); }

/* Profile indicator in topbar */
.profile-menu-wrap { position: relative; flex-shrink: 0; }
.profile-badge {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 4px 12px 4px 4px; border-radius: 20px;
  background: var(--bg-card); border: 1px solid var(--border);
  transition: border-color 0.15s; user-select: none;
}
.profile-badge:hover, .profile-badge.open { border-color: var(--cyan); }
.profile-badge-avatar {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 800; color: #fff; text-transform: uppercase;
}
.profile-badge-name { font-size: 0.82rem; font-weight: 500; color: var(--text-secondary); white-space: nowrap; }
.profile-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  min-width: 160px; z-index: 200; overflow: hidden;
}
.profile-dd-item {
  display: block; width: 100%; text-align: left; padding: 10px 16px;
  font-size: 0.88rem; color: var(--text-secondary); background: transparent;
  border: none; cursor: pointer; transition: background 0.1s, color 0.1s;
}
.profile-dd-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.profile-dd-item.danger:hover { color: #f87171; }
.profile-dd-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ─── Account Panel ────────────────────────────────────────── */
.account-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 300;
  display: flex; align-items: center; justify-content: center;
}
.account-panel {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 14px; width: 480px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px); display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.account-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.account-panel-title { font-size: 1.1rem; font-weight: 700; }
.account-panel-close {
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; background: transparent; border: none;
  color: var(--text-dim); font-size: 1.2rem; cursor: pointer; transition: color 0.15s;
}
.account-panel-close:hover { color: var(--text-primary); }
.account-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.account-tab {
  padding: 10px 20px; font-size: 0.85rem; font-weight: 500; border: none;
  background: transparent; color: var(--text-dim); cursor: pointer; border-bottom: 2px solid transparent;
  transition: color 0.15s; margin-bottom: -1px;
}
.account-tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.account-tab:hover:not(.active) { color: var(--text-secondary); }
.account-body { padding: 24px; overflow-y: auto; flex: 1; }
.account-field { margin-bottom: 18px; }
.account-field label { display: block; font-size: 0.8rem; color: var(--text-dim); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.account-input {
  width: 100%; padding: 9px 12px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-primary); font-family: var(--font-display); font-size: 0.92rem;
  outline: none; transition: border-color 0.15s; box-sizing: border-box;
}
.account-input:focus { border-color: var(--cyan); }
.account-btn {
  width: 100%; padding: 10px; border-radius: var(--radius); border: none;
  background: var(--cyan); color: var(--bg-deep); font-weight: 700;
  font-size: 0.92rem; cursor: pointer; transition: opacity 0.15s; margin-top: 4px;
}
.account-btn:hover { opacity: 0.88; }
.account-btn:disabled { opacity: 0.5; pointer-events: none; }
.account-msg { font-size: 0.85rem; margin-top: 10px; text-align: center; }
.account-msg.ok { color: #4ade80; }
.account-msg.err { color: #f87171; }
.account-stat-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.account-stat {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 12px; text-align: center;
}
.account-stat-val { font-size: 1.6rem; font-weight: 800; color: var(--cyan); }
.account-stat-lbl { font-size: 0.72rem; color: var(--text-dim); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.05em; }
.account-recent-title { font-size: 0.8rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.account-recent-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.account-recent-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border-radius: var(--radius-sm); padding: 8px 12px;
  font-size: 0.82rem;
}
.account-recent-id { flex: 1; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-recent-pct { color: var(--text-dim); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.account-recent-done { color: #4ade80; font-size: 0.75rem; flex-shrink: 0; }

/* ─── App Layout ─────────────────────────────────────────── */
.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: var(--bg-deep); }

/* ─── Top Bar ────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px; height: var(--topbar-h); min-height: var(--topbar-h);
  /* Solid header (no border line) — the soft boundary is the ::after scrim below,
     which bleeds the header into the content instead of ending on a hard edge. */
  background: var(--bg-deep);
  border-bottom: none;
  z-index: 20; flex-shrink: 0;
}
/* No overflow:hidden here — it was clipping the brand-logo's glow. The auto-hide now
   slides the bar up via transform while max-height collapses its layout space, so the
   glow is free to breathe when the bar is open. position/z-index let the ::after scrim
   paint over the top of the content. */
.topbar-shell {
  position: relative; z-index: 20;
  flex-shrink: 0;
  max-height: var(--topbar-h);
  transition: max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Fade the header into the content: a scrim hanging just below the bar, going from the
   header color to transparent. Gives the logo glow room to dissipate and softens the
   header/content boundary. pointer-events:none so it never blocks clicks. Anchored to
   the shell, so it slides away with the bar on auto-hide. */
.topbar-shell::after {
  content: ''; position: absolute; left: 0; right: 0; top: 100%;
  height: 56px; pointer-events: none;
  background: linear-gradient(180deg, var(--bg-deep) 0%, transparent 100%);
  /* Behind the header's own content (the logo) but still inside the shell's z-index:20
     stacking context, so it covers the page content yet lets the logo glow paint over
     it — otherwise the scrim's opaque top edge clips the glow into a hard line. */
  z-index: -1;
}
.topbar-shell.topbar-hidden {
  max-height: 0;
  transform: translateY(calc(-1 * var(--topbar-h)));
}
.topbar-peek-tab {
  position: fixed; top: 0; left: 50%;
  transform: translateX(-50%) translateY(-100%);
  width: 52px; height: 18px;
  background: linear-gradient(180deg, rgba(126,220,232,0.18) 0%, rgba(184,122,255,0.12) 100%);
  border: 1px solid rgba(126,220,232,0.28); border-top: none;
  border-radius: 0 0 22px 22px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 1002;
  opacity: 0; pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.35s;
}
.topbar-peek-tab.visible { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.topbar-peek-tab svg { display: block; }
.brand-wrap { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo { width: 62px; height: 62px; border: none; border-radius: 50%; object-fit: cover; filter: drop-shadow(0 0 7px rgba(126,220,232,0.6)) drop-shadow(0 0 16px rgba(184,122,255,0.55)); }
/* Plain-white wordmark with one restrained theme accent: a cyan→purple gradient
   underline under the whole word. Replaces the gradient-clipped text + SVG box around
   "TV" — that was a lot of brand noise for a header logo. */
.brand-text {
  font-family: 'Unbounded', 'Outfit', sans-serif;
  font-weight: 900; font-size: 1.3rem; white-space: nowrap;
  letter-spacing: -0.025em; text-transform: lowercase;
  display: inline-flex; align-items: baseline;
  position: relative; padding-bottom: 5px;
}
.brand-text::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--neon, #b87aff));
  box-shadow: 0 0 8px rgba(184,122,255,0.4);
}
.brand-mole { color: #fff; }
.brand-tv { font-weight: 900; margin-left: 5px; color: #fff; }
.brand-tv-frame { display: none; }
.search-box {
  flex: 1; max-width: 340px; padding: 8px 16px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-primary); font-family: var(--font-display); font-size: 0.92rem;
  outline: none; transition: border-color 0.15s;
}
.search-box:focus { border-color: var(--cyan); }
.search-box::placeholder { color: var(--text-dim); }
.filter-pills { display: flex; gap: 6px; }
.pill {
  appearance: none;
  font: inherit;
  cursor: pointer;
  padding: 6px 14px; border-radius: 16px; font-size: 0.8rem; font-weight: 500;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); transition: all 0.1s; white-space: nowrap; user-select: none;
}
.pill:hover { border-color: var(--border-bright); color: var(--text-primary); }
.pill.active { background: var(--cyan-soft); border-color: var(--cyan); color: var(--cyan); }

button:focus-visible, [role="button"]:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.profile-badge, .topbar-peek-tab {
  font: inherit;
}

.loading-detail {
  max-width: 34rem;
  margin-top: 10px;
  color: var(--text-dim);
  text-align: center;
}

.retry-btn {
  margin-top: 18px;
  padding: 10px 18px;
  border: 1px solid var(--cyan);
  border-radius: 8px;
  background: var(--cyan-soft);
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* On-Demand silo toggle (Movies / TV Series) */
.vod-silo-tab {
  padding: 9px 26px; border-radius: 22px;
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; letter-spacing: 0.03em;
  border: 1.5px solid var(--border-bright); background: transparent;
  color: var(--text-secondary); cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s, box-shadow 0.18s;
  white-space: nowrap;
}
.vod-silo-tab:hover:not(.active) { border-color: var(--neon); color: var(--neon-bright); }
.vod-silo-tab.active {
  background: var(--neon-soft); border-color: var(--neon);
  color: var(--neon-bright); box-shadow: var(--neon-glow-soft);
}
/* Hero silo title — Tizen View-0-style brand statement inside the featured hero */
.vod-silo-hero-title {
  position: absolute; top: 40px; left: 48px; z-index: 10;
  font-family: 'Unbounded', 'Outfit', sans-serif;
  font-weight: 900; font-size: clamp(2.4rem, 3.8vw, 4.2rem);
  line-height: 0.9; letter-spacing: -0.03em;
  display: flex; align-items: baseline; gap: 0.18em;
  background: linear-gradient(95deg, var(--cyan) 0%, #c39bff 55%, var(--neon-bright, #b070ff) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgba(176,112,255,0.22)) drop-shadow(0 2px 0 rgba(0,0,0,0.35));
}
.vod-hero-silo-btn {
  background: none; border: none; cursor: pointer;
  padding: 0 0 6px 0; border-bottom: 3px solid transparent;
  font-family: inherit; font-size: inherit; font-weight: inherit;
  letter-spacing: inherit; line-height: inherit;
  background: linear-gradient(95deg, var(--cyan) 0%, #c39bff 55%, var(--neon-bright, #b070ff) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  opacity: 0.32; transition: opacity 0.18s, border-bottom-color 0.18s;
}
.vod-hero-silo-btn:hover { opacity: 0.75; }
.vod-hero-silo-btn.active { opacity: 1; border-bottom-color: var(--cyan); }
.vod-hero-silo-sep {
  font-family: inherit; font-size: 0.55em; font-weight: 400; opacity: 0.25;
  color: var(--text-dim); -webkit-text-fill-color: var(--text-dim);
}
@media (max-width: 768px) {
  .vod-silo-hero-title { font-size: 1.9rem; top: 20px; left: 20px; }
}
.lib-silo-hero-title { font-size: clamp(1.4rem, 2.2vw, 2.4rem); flex-direction: column; align-items: flex-start; gap: 2px; }
.lib-silo-hero-title .vod-hero-silo-sep { display: none; }
@media (max-width: 768px) { .lib-silo-hero-title { font-size: 1.1rem; } }
.topbar-left { flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center; gap: 16px; }
.topbar-right { flex-shrink: 0; display: flex; align-items: center; gap: 12px; margin-left: 12px; }
.topbar-time { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-secondary); letter-spacing: 0.03em; }
.lite-toggle {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em;
  padding: 5px 10px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer; font-family: var(--font-mono);
  transition: all 0.15s;
}
.lite-toggle:hover { background: var(--bg-hover); color: var(--text-secondary); }
.lite-toggle.active {
  background: var(--cyan); color: var(--bg-deep);
  border-color: var(--cyan); box-shadow: 0 0 8px var(--cyan-soft);
}
.admin-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  font-family: var(--font-mono); font-size: 0.6rem; font-weight: 600;
  padding: 5px 8px; border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.15s; letter-spacing: 0.03em; white-space: nowrap;
}
.admin-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.admin-btn.busy { opacity: 0.5; pointer-events: none; }
.admin-btn.done { border-color: var(--live-green); color: var(--live-green); }
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 1rem;
  display: flex; align-items: center; justify-content: center; transition: border-color 0.1s;
}
.theme-toggle:hover { border-color: var(--cyan); color: var(--cyan); }

/* ─── Guide Grid Container ───────────────────────────────── */
.guide-container {
  flex: 1; overflow: auto; position: relative;
  -webkit-overflow-scrolling: touch;
}
/* Vertical scrollbar: thin and subtle */
.guide-container::-webkit-scrollbar { width: 6px; height: 14px; }
.guide-container::-webkit-scrollbar-track { background: var(--bg-surface); }
.guide-container::-webkit-scrollbar-thumb { background: var(--cyan); border-radius: 7px; opacity: 0.5; }
.guide-container::-webkit-scrollbar-thumb:hover { opacity: 1; }
.guide-container::-webkit-scrollbar-corner { background: var(--bg-surface); }
.guide-container { scrollbar-width: auto; scrollbar-color: var(--cyan) var(--bg-surface); }

/* ─── Timeline Navigation Bar ───────────────────────────── */
.timeline-nav {
  display: flex; align-items: center;
  height: 38px; background: var(--bg-surface);
  border-top: 1px solid var(--border); flex-shrink: 0;
  padding: 0 8px; gap: 4px;
}
.timeline-nav-btn {
  width: 32px; height: 26px; border: none; background: transparent;
  color: var(--cyan); font-size: 0.85rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border-radius: 4px; transition: background 0.1s;
}
.timeline-nav-btn:hover { background: var(--cyan-soft); color: var(--text-primary); }
.timeline-nav-now-btn {
  background: none; border: 1px solid var(--cyan); cursor: pointer;
  padding: 0 10px; border-radius: 4px;
  font-family: var(--font-mono); font-size: 0.6rem; font-weight: 700;
  color: var(--cyan); letter-spacing: 0.06em; height: 22px;
  display: flex; align-items: center; flex-shrink: 0;
  transition: background 0.1s, color 0.1s;
}
.timeline-nav-now-btn:hover { background: var(--cyan); color: var(--bg-deep); }
.timeline-zoom-group {
  display: flex; align-items: center; gap: 4px; margin-left: auto;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 4px;
}
.timeline-zoom-btn {
  width: 34px; height: 26px; border: 1px solid var(--border-bright); background: var(--bg-hover);
  color: var(--text-primary); font-size: 1.05rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  border-radius: 5px; transition: all 0.12s; font-family: var(--font-mono);
  line-height: 1;
}
.timeline-zoom-btn:hover { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-soft); }
.timeline-zoom-btn:disabled { opacity: 0.3; pointer-events: none; }
.timeline-zoom-label {
  font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700;
  color: var(--cyan); padding: 0 6px; letter-spacing: 0.04em;
  min-width: 28px; text-align: center;
}

/* ─── Program Detail Card (overlay) ─────────────────────── */
.prog-card-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 200;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.prog-card {
  background: var(--bg-surface); border: 1px solid var(--border-bright);
  border-radius: 14px; max-width: 500px; width: 100%;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  overflow: hidden; animation: slideUp 0.2s ease;
}
.prog-card-header {
  background: var(--bg-card); padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.prog-card-ch {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.prog-card-ch-logo {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  object-fit: contain; background: var(--bg-deep); border: 1px solid var(--border);
}
.prog-card-ch-name {
  font-size: 0.82rem; font-weight: 600; color: var(--text-secondary);
}
.prog-card-ch-num {
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-dim);
  margin-left: 4px;
}
.prog-card-live {
  font-family: var(--font-mono); font-size: 0.55rem; font-weight: 700;
  color: var(--neon-bright); background: var(--neon-soft);
  padding: 2px 8px; border-radius: 3px; margin-left: auto; letter-spacing: 0.08em;
  box-shadow: var(--neon-glow-soft);
}
.prog-card-title {
  font-size: 1.15rem; font-weight: 700; color: var(--text-primary);
  line-height: 1.3; margin-bottom: 4px;
}
.prog-card-ep {
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700;
  color: var(--cyan); background: var(--cyan-soft);
  padding: 2px 8px; border-radius: 4px; display: inline-block; margin-bottom: 6px;
}
.prog-card-subtitle {
  font-size: 0.88rem; color: var(--text-secondary); font-style: italic;
  margin-bottom: 2px; line-height: 1.3;
}
.prog-card-body { padding: 16px 22px 20px; }
.prog-card-time {
  font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-secondary);
  font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.prog-card-time-bar {
  flex: 1; height: 4px; border-radius: 2px; background: var(--bg-card); overflow: hidden;
}
.prog-card-time-fill {
  height: 100%; border-radius: 2px; background: var(--cyan);
  transition: width 0.3s;
}
.prog-card-cat {
  font-size: 0.7rem; color: var(--text-dim); font-family: var(--font-mono);
  margin-bottom: 10px; letter-spacing: 0.03em;
}
.prog-card-desc {
  font-size: 0.85rem; color: var(--text-secondary); line-height: 1.55;
  max-height: 120px; overflow-y: auto;
}
.prog-card-actions {
  display: flex; gap: 10px; margin-top: 18px;
}
.prog-card-watch {
  flex: 1; padding: 12px 20px; border-radius: var(--radius);
  background: var(--cyan); color: var(--bg-deep); border: none;
  font-size: 0.88rem; font-weight: 700; cursor: pointer;
  font-family: var(--font-display); letter-spacing: 0.03em;
  transition: opacity 0.15s;
}
.prog-card-watch:hover { opacity: 0.85; }
.prog-card-close {
  padding: 12px 18px; border-radius: var(--radius);
  background: var(--bg-card); color: var(--text-secondary);
  border: 1px solid var(--border); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; font-family: var(--font-display);
  transition: all 0.15s;
}
.prog-card-close:hover { border-color: var(--border-bright); color: var(--text-primary); }

.guide-inner { position: relative; }

/* ─── Time Axis ──────────────────────────────────────────── */
.guide-time-axis {
  position: sticky; top: 0; z-index: 12;
  height: var(--time-axis-h); display: flex;
  background: var(--bg-surface); border-bottom: 1px solid var(--border);
}
.guide-time-corner {
  position: sticky; left: 0; z-index: 13;
  flex-shrink: 0; background: var(--bg-surface);
  display: flex; align-items: center; padding: 0 14px;
  font-size: 0.65rem; font-weight: 700; color: var(--text-dim);
  font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  border-right: 1px solid var(--border);
}
.guide-time-track { position: relative; flex-shrink: 0; }
.guide-time-mark {
  position: absolute; top: 0; height: 100%;
  display: flex; align-items: center; padding-left: 8px;
  font-size: 0.68rem; font-family: var(--font-mono); color: var(--text-dim);
  border-left: 1px solid var(--border);
}
.guide-time-mark.hour { font-weight: 600; color: var(--text-secondary); border-left-color: var(--border-bright); }
.guide-time-mark.half { font-size: 0.6rem; border-left-style: dashed; }

/* ─── Now Indicator ──────────────────────────────────────── */
.time-now-marker {
  position: absolute; top: 0; z-index: 5; height: 100%;
  display: flex; flex-direction: column; align-items: center;
}
.time-now-label {
  font-size: 0.5rem; font-weight: 700; color: var(--neon-bright);
  font-family: var(--font-mono); letter-spacing: 0.06em;
  background: var(--bg-surface); padding: 1px 5px; border-radius: 3px;
  line-height: 1.4;
  text-shadow: 0 0 6px rgba(184,122,255,0.6);
}
.time-now-tick { width: 2px; flex: 1; background: var(--neon); opacity: 0.85; box-shadow: 0 0 6px rgba(184,122,255,0.7); }
.guide-now-line {
  position: absolute; top: var(--time-axis-h); width: 2px;
  height: calc(100% - var(--time-axis-h));
  background: var(--neon); opacity: 0.45;
  box-shadow: 0 0 10px rgba(184,122,255,0.5);
  z-index: 4; pointer-events: none;
}

/* ─── Tier Separator ─────────────────────────────────────── */
.guide-tier-row {
  height: var(--tier-row-h); background: var(--bg-section);
  border-bottom: 1px solid var(--border);
}
.guide-tier-inner {
  position: sticky; left: 0; display: inline-flex; align-items: center;
  height: 100%; gap: 8px; padding: 0 14px;
}
.guide-tier-bar { width: 3px; height: 14px; border-radius: 2px; background: var(--cyan); }
.guide-tier-label {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--cyan); font-family: var(--font-mono);
}
.guide-tier-count { font-size: 0.6rem; color: var(--text-dim); font-family: var(--font-mono); }

/* ─── Guide Row ──────────────────────────────────────────── */
.guide-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  content-visibility: auto; contain-intrinsic-height: auto 96px;
}
.guide-ch {
  position: sticky; left: 0; flex-shrink: 0; z-index: 20;
  background: var(--bg-surface); display: flex; align-items: center;
  gap: 8px; padding: 0 10px; cursor: pointer;
  border-right: 1px solid var(--border); transition: background 0.1s;
}
.guide-ch:hover { background: var(--bg-hover); }
.guide-ch-fav {
  font-size: 0.95rem; color: var(--text-dim); flex-shrink: 0;
  width: 22px; text-align: center; line-height: 1;
}
.guide-ch-fav:hover { color: var(--fav-gold); }
.guide-ch-fav.active { color: var(--fav-gold); filter: drop-shadow(0 0 5px rgba(184,122,255,0.55)); }
.guide-ch-num {
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600;
  color: var(--text-dim); width: 22px; text-align: right; flex-shrink: 0;
}
.guide-ch-logo {
  width: 48px; height: 48px; border-radius: var(--radius);
  object-fit: contain; background: var(--bg-card); border: 1px solid var(--border); flex-shrink: 0;
}
.guide-ch-logo-ph {
  width: 48px; height: 48px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; color: var(--text-dim); font-weight: 700;
}
.guide-ch-name {
  font-size: 0.82rem; font-weight: 600; min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis; line-height: 1.25;
}

/* ─── Timeline + Program Blocks ──────────────────────────── */
.guide-timeline { position: relative; flex-shrink: 0; overflow: hidden; }
.guide-prog {
  position: absolute; top: 3px; height: calc(100% - 6px);
  border-radius: var(--radius-sm); background: var(--prog-bg);
  border: 1px solid var(--prog-border); overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: 5px 10px; gap: 0;
  font-size: 0.78rem; color: var(--text-secondary);
  cursor: pointer; transition: background 0.1s, border-color 0.1s;
}
.guide-prog:hover { background: var(--bg-hover); border-color: var(--border-bright); z-index: 1; }
.guide-prog.current {
  background: var(--prog-current); border-color: var(--neon); color: var(--text-primary);
  box-shadow: inset 0 0 0 1px rgba(184,122,255,0.25), 0 0 10px rgba(184,122,255,0.25);
  /* Collapse-instead-of-slide: as the timeline scrolls right past the card's left edge,
     clamp left to the visible edge of the timeline so the title stays visible.
     Right edge stays anchored via calc(100% - prog-right). */
  left: max(var(--prog-left, 0px), var(--scroll-x, 0px));
  right: calc(100% - var(--prog-right, 100%));
  width: auto;
}
.guide-prog.current .guide-prog-title-line { font-weight: 700; }
.guide-prog-title-line {
  display: flex; align-items: baseline; gap: 5px;
  overflow: hidden; min-width: 0; flex-shrink: 0; white-space: nowrap;
  line-height: 1.25;
}
.guide-prog-title {
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
  font-weight: 600; font-size: 0.78rem;
}
.guide-prog-ep-tag {
  font-family: var(--font-mono); font-size: 0.54rem; font-weight: 700;
  color: var(--cyan); background: var(--cyan-soft);
  padding: 1px 5px; border-radius: 3px; flex-shrink: 0; letter-spacing: 0.02em;
  white-space: nowrap;
}
.guide-prog-subtitle {
  font-size: 0.66rem; color: var(--text-dim); font-style: italic;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
  flex-shrink: 0; margin-top: 1px;
}
.guide-prog-desc {
  font-size: 0.6rem; color: var(--text-dim); line-height: 1.3;
  overflow: hidden; margin-top: 2px; flex: 1; min-height: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}
.guide-prog-time {
  font-size: 0.58rem; color: var(--text-secondary); margin-top: auto;
  flex-shrink: 0; font-family: var(--font-mono); white-space: nowrap;
  font-weight: 600;
}
.guide-no-epg {
  position: absolute; top: 4px; left: 0; right: 0; height: calc(100% - 8px);
  display: flex; align-items: center; padding: 0 14px;
  font-size: 0.72rem; color: var(--text-dim); font-style: italic;
}

/* ─── Video Player ───────────────────────────────────────── */
.player-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; background: #000;
  display: flex; flex-direction: column; animation: fadeIn 0.15s;
}
.player-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  background: linear-gradient(to bottom, rgba(0,0,0,0.82), transparent);
  transition: opacity 0.3s;
}
.player-ch-info { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.player-ch-logo { width: 36px; height: 36px; border-radius: 6px; flex-shrink: 0; }
.player-ch-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.player-ch-name { font-weight: 700; font-size: 1.05rem; color: #fff; white-space: nowrap; }
.player-prog-detail { display: flex; align-items: center; gap: 10px; }
.player-prog-title { color: rgba(255,255,255,0.7); font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.player-prog-time { color: rgba(255,255,255,0.4); font-size: 0.7rem; font-family: var(--font-mono); white-space: nowrap; flex-shrink: 0; }
.player-prog-bar { width: 120px; height: 3px; background: rgba(255,255,255,0.15); border-radius: 2px; flex-shrink: 0; overflow: hidden; }
.player-prog-fill { height: 100%; background: var(--cyan); border-radius: 2px; transition: width 1s linear; }
.player-up-next {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 6px 14px; border-radius: 16px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}
.player-up-label {
  font-size: 0.58rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--cyan); font-family: var(--font-mono);
}
.player-up-title { font-size: 0.75rem; color: rgba(255,255,255,0.6); white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.player-up-time { font-size: 0.65rem; color: rgba(255,255,255,0.35); font-family: var(--font-mono); }
.player-video-area { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; }
.player-video-area video { width: 100%; height: 100%; object-fit: contain; background: #000; }
/* Center channel nav — big always-visible floating buttons on web (bottom-center bar) */
.player-center-nav {
  position: absolute; left: 50%; bottom: 88px; transform: translateX(-50%);
  display: flex; flex-direction: row; gap: 18px; z-index: 6;
  transition: opacity 0.3s;
  background: rgba(0,0,0,0.55); padding: 10px 18px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.player-overlay.hide-ui .player-center-nav { opacity: 0.55; pointer-events: auto; }
.player-overlay.hide-ui:hover .player-center-nav { opacity: 1; }
.ch-nav-btn {
  width: 68px; height: 68px; border-radius: 50%;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.92); font-size: 1.4rem; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s, transform 0.1s, box-shadow 0.2s;
}
.ch-nav-btn:hover { background: rgba(126,220,232,0.22); transform: scale(1.08); box-shadow: 0 0 18px rgba(126,220,232,0.35); }
.ch-nav-btn:active { transform: scale(0.95); }
.ch-nav-btn span { font-size: 0.6rem; font-family: var(--font-mono); letter-spacing: 0.12em; line-height: 1; opacity: 0.85; margin-top: 2px; }
.ch-nav-btn.numpad { font-size: 1.2rem; }
/* Tizen TV: keep the nav minimal — D-pad does it natively */
.tv-mode .player-center-nav { display: none; }

/* Numpad modal — overlay channel-by-number entry on web */
.numpad-overlay {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.15s;
}
.numpad-box {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 24px; width: 320px; max-width: 90vw;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(126,220,232,0.15);
}
.numpad-display {
  font-family: var(--font-mono); font-size: 2.6rem; font-weight: 700;
  color: var(--cyan); text-align: center; padding: 14px 0; margin-bottom: 14px;
  background: var(--bg-card); border-radius: 12px; letter-spacing: 0.12em;
  text-shadow: 0 0 18px rgba(126,220,232,0.4);
  min-height: 1.2em;
}
.numpad-display.empty { color: var(--text-dim); font-size: 1rem; font-weight: 500; padding: 24px 0; letter-spacing: 0.2em; text-shadow: none; }
.numpad-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.numpad-key {
  height: 60px; border-radius: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 1.5rem; font-weight: 600;
  font-family: var(--font-display); cursor: pointer; transition: all 0.12s;
}
.numpad-key:hover { background: var(--bg-hover); border-color: var(--cyan); color: var(--cyan); transform: translateY(-1px); }
.numpad-key:active { transform: translateY(1px); }
.numpad-key.go { background: var(--cyan); color: var(--bg-deep); border-color: var(--cyan); font-weight: 700; }
.numpad-key.go:hover { background: var(--accent-violet); border-color: var(--accent-violet); color: #fff; }
.numpad-key.del { color: var(--text-dim); }
.numpad-not-found { text-align: center; color: var(--error-red); margin-top: 12px; font-size: 0.85rem; }

/* Centered reconnect overlay — sits in the middle of the video area, not pinned */
.player-msg.center {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 3;
  pointer-events: none;
}
.player-msg.center > * { pointer-events: auto; }
/* ─── Channel Switch OSD Bottom Banner ──────────────────── */
.ch-osd {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 50;
  pointer-events: none;
  animation: chOsdIn 0.35s ease;
}
.ch-osd.fading { animation: chOsdOut 0.5s ease forwards; }
@keyframes chOsdIn { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: translateY(0); } }
@keyframes chOsdOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(40px); } }
.ch-osd-inner {
  background: linear-gradient(to top, rgba(0,0,0,0.96) 0%, rgba(0,0,0,0.9) 60%, rgba(0,0,0,0) 100%);
  padding: 90px 64px 52px; display: flex; align-items: flex-end; gap: 30px;
}
.ch-osd-logo { width: 100px; height: 100px; border-radius: 14px; object-fit: contain; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); flex-shrink: 0; }
.ch-osd-logo-ph { width: 100px; height: 100px; border-radius: 14px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.5); font-size: 1.5rem; font-weight: 700; }
.ch-osd-meta { flex: 1; min-width: 0; }
.ch-osd-num { font-family: var(--font-mono); font-size: 1.4rem; color: var(--cyan); font-weight: 700; letter-spacing: 0.06em; margin-bottom: 4px; }
.ch-osd-name { font-size: 2.6rem; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 8px; }
.ch-osd-prog { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ch-osd-prog-title { font-size: 1.5rem; color: rgba(255,255,255,0.9); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-osd-prog-time { font-size: 1.15rem; color: rgba(255,255,255,0.5); font-family: var(--font-mono); flex-shrink: 0; }
.ch-osd-prog-bar { flex: 1; max-width: 280px; height: 6px; background: rgba(255,255,255,0.12); border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.ch-osd-prog-fill { height: 100%; background: var(--cyan); border-radius: 3px; transition: width 0.3s; }
.ch-osd-desc { margin-top: 10px; font-size: 1.15rem; color: rgba(255,255,255,0.55); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ch-osd-upnext { margin-top: 12px; font-size: 1.1rem; color: rgba(255,255,255,0.35); }
.ch-osd-upnext span { color: rgba(255,255,255,0.6); font-weight: 600; }

.player-controls {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 22px; position: absolute; bottom: 0; left: 0; right: 0; z-index: 5;
  background: linear-gradient(to top, rgba(0,0,0,0.82), transparent);
  transition: opacity 0.3s;
}
.player-overlay.hide-ui .player-top,
.player-overlay.hide-ui .player-controls { opacity: 0; pointer-events: none; }
.p-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85); font-size: 0.85rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background 0.15s; font-family: var(--font-display);
}
.p-btn:hover { background: rgba(255,255,255,0.18); }
.p-btn.close { font-size: 1rem; }
.p-btn-text {
  padding: 6px 14px; border-radius: 16px; height: 32px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.75); font-size: 0.72rem; font-weight: 600;
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  transition: background 0.15s; font-family: var(--font-mono); letter-spacing: 0.03em;
}
.p-btn-text:hover { background: rgba(255,255,255,0.18); }
.direct-play-btn { color: var(--cyan); border-color: rgba(126,220,232,0.25); background: rgba(126,220,232,0.1); }
.direct-play-btn:hover { background: rgba(126,220,232,0.22); }
.vol-slider {
  width: 72px; height: 4px; -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,0.18); border-radius: 2px; outline: none;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; cursor: pointer;
}
.vol-slider::-moz-range-thumb {
  width: 12px; height: 12px; border: none;
  border-radius: 50%; background: #fff; cursor: pointer;
}
.player-info-center {
  flex: 1; text-align: center; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.player-info-name { font-weight: 600; font-size: 0.88rem; color: #fff; white-space: nowrap; }
.player-info-prog {
  font-size: 0.78rem; color: rgba(255,255,255,0.5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-msg {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center;
  justify-content: center; z-index: 2;
}
.player-err { color: var(--error-red); font-size: 1rem; }
.player-retry-msg {
  color: rgba(255,255,255,0.5); margin-top: 14px; font-size: 0.82rem;
  font-family: var(--font-mono); letter-spacing: 0.03em;
}
.player-retry-tap {
  text-align: center; cursor: pointer; padding: 24px;
  border-radius: var(--radius); transition: background 0.15s;
}
.player-retry-tap:hover { background: rgba(255,255,255,0.05); }
.player-retry-hint {
  color: rgba(255,255,255,0.35); font-size: 0.78rem; margin-top: 12px;
  font-family: var(--font-mono);
}
.player-load-bar {
  width: 180px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.1);
  overflow: hidden; margin: 0 auto;
}
.player-load-bar-fill {
  height: 100%; width: 30%; border-radius: 2px; background: var(--cyan);
  animation: loadSlide 1.2s ease-in-out infinite;
}
@keyframes loadSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(500%); }
}

/* ─── Loading / Misc ─────────────────────────────────────── */
.loading-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100vh; gap: 16px; background: var(--pin-bg);
}
/* Unified loader: dual-ring with cyan→violet sweep. Used everywhere — initial
   load, channel tune, reconnect, library detail fetch. One visual language. */
.spinner, .mtv-loader {
  width: 56px; height: 56px; border-radius: 50%;
  position: relative; display: inline-block;
  background: conic-gradient(from 0deg, transparent 0deg, var(--cyan) 90deg, transparent 270deg, var(--accent-violet, #b070ff) 340deg, transparent 360deg);
  -webkit-mask: radial-gradient(circle, transparent 56%, #000 58%, #000 100%);
          mask: radial-gradient(circle, transparent 56%, #000 58%, #000 100%);
  animation: spin 1.1s linear infinite;
  box-shadow: 0 0 22px rgba(126,220,232,0.18);
}
.mtv-loader.sm { width: 36px; height: 36px; }
.mtv-loader.lg { width: 88px; height: 88px; }
.mtv-loader-wrap {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.mtv-loader-label {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.18em;
  color: var(--text-secondary); text-transform: uppercase;
  text-shadow: 0 0 12px rgba(126,220,232,0.25);
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-msg { color: var(--text-dim); font-size: 0.95rem; }

/* ─── Color accents (palette extension) ─────────────────────
   Keep dark base, layer warm/cool accent gradients for depth. */
:root {
  --accent-violet: #b070ff;
  --accent-amber: #f5a85a;
  --accent-rose: #ff7eb3;
  --grad-cyan-violet: linear-gradient(135deg, rgba(126,220,232,0.18) 0%, rgba(176,112,255,0.15) 100%);
  --grad-rose-amber: linear-gradient(135deg, rgba(255,126,179,0.16) 0%, rgba(245,168,90,0.13) 100%);
}
.tier-tag {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; font-family: var(--font-mono);
  background: var(--grad-cyan-violet);
  color: var(--cyan); border: 1px solid rgba(126,220,232,0.25);
}
/* Subtle tinted glow on focus for non-poster TV elements */
.tv-mode .guide-ch:focus, .tv-mode .guide-prog:focus {
  box-shadow: 0 0 0 2px var(--cyan), 0 8px 28px rgba(126,220,232,0.22), 0 0 24px rgba(176,112,255,0.18) !important;
}
.empty-state { padding: 50px 24px; text-align: center; color: var(--text-dim); font-size: 0.92rem; }

/* ─── Mobile + iPad Responsive ───────────────────────────── */
/* Contain horizontal swipes inside the guide so they don't drag surrounding UI. */
.guide-container { overscroll-behavior: contain; }

/* Safe-area tokens — used by topbar, bottom tab bar, modals on notched devices */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --bottom-bar-h: 0px; /* set per-breakpoint below */
  --touch-target: 44px;
}

/* Desktop-only chrome (hidden on phone) */
.mobile-search-toggle,
.mobile-tabbar,
.mobile-search-row,
.mobile-filter-strip { display: none; }

/* Drop hover-only affordances on touch (preserve mouse hover on real desktop) */
@media (hover: none) {
  .player-center-nav { opacity: 1 !important; }
  .player-overlay .player-center-nav { pointer-events: auto !important; }
}

/* ──── iPad LANDSCAPE & wide tablet (821–1024px) ──── */
@media (max-width: 1024px) and (min-width: 821px) {
  .topbar { gap: 14px; padding: 0 16px; }
  .nav-tabs { gap: 22px; }
  .nav-tab { font-size: 0.88rem; }
  .search-box { max-width: 240px; }
  .topbar-time { display: none; }
  .profile-badge-name { display: none; }
  .profile-badge { padding: 3px; }
  :root { --sidebar-w: 240px; }
}

/* ──── iPad PORTRAIT / tablet (601–820px) ──── */
@media (max-width: 820px) and (min-width: 601px) {
  :root { --sidebar-w: 200px; --guide-row-h: 86px; --topbar-h: 56px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .brand-logo { width: 40px; height: 40px; }
  .brand-text { font-size: 0.95rem; }
  .nav-tabs { gap: 16px; }
  .nav-tab { font-size: 0.82rem; padding: 6px 2px; }
  .search-box { max-width: 180px; font-size: 0.85rem; padding: 7px 12px; }
  .topbar-time, .admin-btn { display: none; }
  .profile-badge-name { display: none; }
  .profile-badge { padding: 3px; }
  .guide-ch-num { display: none; }
  .guide-ch-name { font-size: 0.76rem; }
  .guide-ch-logo, .guide-ch-logo-ph { width: 40px; height: 40px; }
  .timeline-nav { height: 32px; }
  .timeline-zoom-label { display: none; }
  .player-info-center { display: none; }
  .player-prog-bar { width: 110px; }
  .player-prog-title { max-width: 200px; }
  .player-controls { padding: 10px 14px; gap: 10px; }
  .player-top { padding: 10px 14px; }
  .prog-card { max-width: 92vw; }
  .pill-count { display: none; }
  .poster-grid { grid-template-columns: repeat(4, 1fr) !important; }
}

/* ──── PHONE LANDSCAPE (short height, ≤ 900w) ──── */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  :root { --topbar-h: 48px; --guide-row-h: 68px; --sidebar-w: 160px; --bottom-bar-h: 0px; }
  .mobile-tabbar { display: none !important; }
  .topbar { padding: 0 calc(10px + var(--safe-right)) 0 calc(10px + var(--safe-left)); gap: 8px; }
  .brand-logo { width: 36px; height: 36px; }
  .brand-text { display: none; }
  .nav-tabs { gap: 14px; }
  .nav-tab { font-size: 0.8rem; }
  .topbar-time, .admin-btn { display: none; }
  .player-info-center, .player-up-next { display: none; }
  .player-controls { padding: 6px 12px; }
  .lib-hero { height: 240px; }
}

/* ──── PHONE PORTRAIT (≤ 600px) — restructure ──── */
@media (max-width: 600px) {
  :root {
    --topbar-h: 52px;
    --bottom-bar-h: 58px;
    --sidebar-w: 130px;
    --guide-row-h: 80px;
    --tier-row-h: 26px;
  }

  .app { padding-top: var(--safe-top); padding-bottom: calc(var(--bottom-bar-h) + var(--safe-bottom)); }

  /* Top bar collapses */
  .topbar { padding: 0 calc(10px + var(--safe-right)) 0 calc(10px + var(--safe-left)); gap: 10px; overflow: visible; }
  .brand-wrap { gap: 8px; }
  .brand-logo { width: 38px; height: 38px; }
  .brand-text { display: none; }
  .topbar .nav-tabs,
  .topbar .search-box,
  .topbar .filter-pills,
  .topbar-time,
  .admin-btn,
  .theme-toggle { display: none; }
  .topbar-right { gap: 8px; }

  /* Mobile search toggle button (magnifying glass) */
  .mobile-search-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; min-width: 40px;
    border-radius: 50%; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text-secondary);
    font-size: 1.1rem; cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    margin-left: auto;
  }
  .mobile-search-toggle.active { border-color: var(--cyan); color: var(--cyan); }

  /* Mobile inline search row */
  .mobile-search-row {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    animation: slideDown 0.18s ease;
  }
  .mobile-search-row .search-box {
    display: block !important;
    flex: 1; max-width: none; min-width: 0;
    padding: 10px 14px; font-size: 16px;
    border-radius: 10px;
  }
  .mobile-search-row .search-clear {
    background: transparent; border: none; color: var(--text-dim);
    font-size: 1.2rem; padding: 6px 10px; cursor: pointer;
    min-width: var(--touch-target); min-height: var(--touch-target);
  }
  @keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

  /* Mobile filter strip (Live TV pills) */
  .mobile-filter-strip {
    display: flex; gap: 8px; padding: 8px 12px;
    background: var(--bg-section); border-bottom: 1px solid var(--border);
    overflow-x: auto; overflow-y: hidden; flex-shrink: 0;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .mobile-filter-strip::-webkit-scrollbar { display: none; }
  .mobile-filter-strip .pill {
    flex-shrink: 0; padding: 7px 14px; font-size: 0.82rem;
    min-height: 36px; display: inline-flex; align-items: center;
  }
  .mobile-filter-strip .pill-count { display: inline; }

  /* Bottom tab bar (primary nav on phones) */
  .mobile-tabbar {
    display: flex; align-items: stretch; justify-content: space-around;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--bottom-bar-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    padding-left: var(--safe-left); padding-right: var(--safe-right);
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.25);
  }
  .mobile-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; background: transparent; border: none;
    color: var(--text-dim); cursor: pointer; padding: 6px 4px;
    font-family: var(--font-display); transition: color 0.15s;
    min-height: var(--touch-target);
  }
  .mobile-tab-icon { font-size: 1.2rem; line-height: 1; }
  .mobile-tab-label { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
  .mobile-tab.active { color: var(--cyan); text-shadow: 0 0 10px rgba(126,220,232,0.55); }
  .mobile-tab.active .mobile-tab-icon { filter: drop-shadow(0 0 6px var(--cyan)); }

  /* Guide grid on phone */
  .guide-ch { gap: 5px; padding: 0 6px; }
  .guide-ch-num { display: none; }
  .guide-ch-name { font-size: 0.7rem; line-height: 1.15; }
  .guide-ch-logo, .guide-ch-logo-ph { width: 34px; height: 34px; }
  .timeline-nav { height: 32px; }
  .timeline-nav-btn { width: 36px; height: 28px; }
  .timeline-nav-now-btn { font-size: 0.55rem; padding: 0 8px; height: 26px; }
  .timeline-zoom-label { display: none; }
  .timeline-zoom-btn { width: 38px; height: 30px; }

  /* Player controls on phone */
  .player-info-center, .player-up-next { display: none; }
  .player-prog-bar { width: 70px; }
  .player-prog-title { max-width: 110px; font-size: 0.78rem; }
  .vol-slider { width: 44px; }
  .player-controls { padding: 8px 12px; gap: 6px; flex-wrap: wrap; }
  .player-top { padding: 8px 12px; }
  .ch-nav-btn { width: var(--touch-target); height: var(--touch-target); font-size: 1rem; }
  .player-center-nav { left: auto; transform: none; right: 12px; bottom: 100px; gap: 10px; opacity: 1; }

  /* Program-detail modal → full-screen sheet on phone */
  .prog-card-backdrop { padding: 0; align-items: stretch; }
  .prog-card {
    max-width: 100vw; width: 100vw;
    height: 100dvh; max-height: 100dvh;
    border-radius: 0; border: none;
    display: flex; flex-direction: column;
    padding-top: var(--safe-top);
  }
  .prog-card-header { padding: 14px 16px 12px; flex-shrink: 0; }
  .prog-card-title { font-size: 1.05rem; }
  .prog-card-body { padding: 14px 16px calc(16px + var(--safe-bottom)); flex: 1; overflow-y: auto; }
  .prog-card-desc { max-height: none; }
  .prog-card-watch, .prog-card-close { min-height: var(--touch-target); }

  /* Library / VOD hero + grids */
  .lib-hero { height: 360px; }
  .lib-hero-info { left: 16px; right: 16px; bottom: 24px; max-width: none; }
  .lib-media-tabs { padding: 14px 16px 12px; gap: 22px; }
  .lib-media-tab { font-size: 0.95rem; }
  .library-content { padding: 0 16px 24px; }
  .poster-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }

  /* VOD / Library full-screen detail overlay → tighter hero, safe-area padding */
  .detail-overlay { padding-bottom: calc(var(--bottom-bar-h) + var(--safe-bottom)); }
  .detail-hero { height: 260px; }
  .trailer-mute-btn { bottom: 12px; right: 12px; }

  /* Profile badge — avatar only, larger touch */
  .profile-badge { padding: 2px; }
  .profile-badge-avatar { width: 32px; height: 32px; font-size: 0.78rem; }

  /* Min touch targets */
  .pill { min-height: 36px; padding: 8px 14px; font-size: 0.8rem; }
  .lite-toggle, .admin-btn { min-height: var(--touch-target); }
}

/* ──── PHONE PORTRAIT — small (≤ 380px) ──── */
@media (max-width: 380px) {
  :root { --sidebar-w: 112px; }
  .brand-logo { width: 34px; height: 34px; }
  .mobile-search-toggle { width: 38px; height: 38px; }
  .mobile-tab-label { font-size: 0.6rem; }
  .guide-ch-logo, .guide-ch-logo-ph { width: 30px; height: 30px; }
  .guide-ch-name { font-size: 0.66rem; }
}

/* ──── iPadOS Add-to-Home-Screen standalone PWA ──── */
@media (display-mode: standalone) {
  .app { padding-top: var(--safe-top); }
}

/* ─── Library UI ─────────────────────────────────────────── */

/* Nav tabs — clean text-only with active glow + fading underline */
.nav-tabs {
  display: flex; gap: 28px; background: transparent; padding: 0;
  position: relative; align-items: center;
}
.nav-tabs::after {
  content: ''; position: absolute; left: -8px; right: -8px; bottom: -10px; height: 1px;
  background: linear-gradient(to right, transparent 0%, rgba(126,220,232,0.25) 30%, rgba(126,220,232,0.25) 70%, transparent 100%);
  pointer-events: none;
}
.nav-tab {
  padding: 6px 4px; border-radius: 0; border: none; background: transparent;
  font-family: var(--font-display); font-size: 0.92rem; font-weight: 600;
  color: var(--text-dim); cursor: pointer; transition: color 0.18s, text-shadow 0.25s;
  letter-spacing: 0.04em; position: relative;
}
.nav-tab.active {
  color: var(--cyan); text-shadow: 0 0 14px rgba(126,220,232,0.55);
}
.nav-tab.active::after {
  content: ''; position: absolute; left: 50%; right: auto; bottom: -11px;
  width: 28px; height: 2px; transform: translateX(-50%); border-radius: 2px;
  background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
}
.nav-tab:hover:not(.active) { color: var(--text-primary); background: transparent; }

/* Media type tabs (Movies / TV / All) — minimal text with active glow + fading bar */
.lib-media-tabs {
  display: flex; align-items: center; gap: 32px;
  padding: 18px 24px 14px; position: relative;
}
.lib-media-tabs::after {
  content: ''; position: absolute; left: 24px; right: 24px; bottom: 0; height: 1px;
  background: linear-gradient(to right, transparent 0%, rgba(126,220,232,0.22) 35%, rgba(126,220,232,0.22) 65%, transparent 100%);
}
.lib-media-tab {
  background: transparent; border: none; padding: 4px 2px;
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 600;
  color: var(--text-dim); cursor: pointer;
  letter-spacing: 0.04em; position: relative;
  transition: color 0.18s, text-shadow 0.25s;
}
.lib-media-tab:hover { color: var(--text-primary); }
.lib-media-tab.active { color: var(--cyan); text-shadow: 0 0 14px rgba(126,220,232,0.5); }
.lib-media-tab.active::after {
  content: ''; position: absolute; left: 50%; bottom: -15px; width: 30px; height: 2px;
  transform: translateX(-50%); border-radius: 2px;
  background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
}

/* Library layout */
.library { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0; -webkit-overflow-scrolling: touch; }
.library-content { padding: 0 24px 40px; }
.library-section { margin-bottom: 36px; }
.library-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.library-section-title { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }
.library-section-count { font-size: 0.75rem; color: var(--text-dim); font-family: var(--font-mono); }

/* ─── Hero Banner ─────────────────────────────────────── */
.lib-hero {
  position: relative; width: 100%; height: 520px; overflow: hidden;
  background: var(--bg-card); margin-bottom: 0;
}
@media (max-width: 768px) { .lib-hero { height: 380px; } }
.lib-hero-backdrop {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%;
  background-size: cover; background-position: center top;
  transition: opacity 0.8s ease;
}
.lib-hero-trailer {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; z-index: 1;
  opacity: 0; transition: opacity 1.2s ease;
  pointer-events: none; /* Safari: container too, not just iframe — blocks YT click-through */
}
.lib-hero-trailer.loaded { opacity: 1; }
.lib-hero-trailer iframe {
  position: absolute; top: 50%; left: 50%;
  width: 180%; height: 180%;
  transform: translate(-50%, -50%);
  border: none; pointer-events: none;
}
/* Transparent shield over the YouTube iframe — absorbs any click that
   slips past pointer-events:none on the iframe in WebKit. */
.trailer-click-shield {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2; background: transparent;
  pointer-events: auto;
}
.lib-hero-gradient {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 2;
  background: linear-gradient(to right, rgba(24,28,46,0.92) 0%, rgba(24,28,46,0.55) 50%, transparent 100%),
              linear-gradient(to top, var(--bg-deep) 0%, transparent 40%);
}
[data-theme="light"] .lib-hero-gradient {
  background: linear-gradient(to right, rgba(242,244,250,0.95) 0%, rgba(242,244,250,0.6) 50%, transparent 100%),
              linear-gradient(to top, var(--bg-deep) 0%, transparent 40%);
}
.lib-hero-info {
  /* Left padding leaves room for the large ‹ › nav chevrons so they never
     overlap the title. Right gradient already pushes the column inward. */
  position: absolute; bottom: 60px; left: 96px; right: 40%; z-index: 3;
  max-width: 600px;
}
@media (max-width: 768px) {
  .lib-hero-info { left: 72px; right: 20px; bottom: 50px; max-width: none; }
}
.lib-hero-title {
  font-size: 2.6rem; font-weight: 800; line-height: 1.1; margin-bottom: 10px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
@media (max-width: 768px) { .lib-hero-title { font-size: 1.6rem; } }
.lib-hero-meta {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 10px;
}
.lib-hero-meta-item { display: flex; align-items: center; gap: 4px; }
.lib-hero-meta-rating { color: var(--fav-gold); font-weight: 700; }
.lib-hero-genres {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px;
}
.lib-hero-genre {
  padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.15); color: var(--text-secondary);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
[data-theme="light"] .lib-hero-genre {
  background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.1);
}
.lib-hero-overview {
  font-size: 0.88rem; line-height: 1.55; color: var(--text-secondary); margin-bottom: 18px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.lib-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.lib-hero-play {
  padding: 11px 28px; border-radius: var(--radius); border: none;
  background: var(--cyan); color: var(--bg-deep); font-size: 0.95rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.lib-hero-play:hover { transform: translateY(-1px); box-shadow: 0 4px 18px rgba(126,220,232,0.35); }
.lib-hero-info-btn {
  padding: 11px 22px; border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.08);
  color: var(--text-primary); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: all 0.15s;
}
[data-theme="light"] .lib-hero-info-btn { border-color: var(--border-bright); background: rgba(0,0,0,0.05); }
.lib-hero-info-btn:hover { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.4); }
[data-theme="light"] .lib-hero-info-btn:hover { background: rgba(0,0,0,0.1); }

/* Hero idle-fade — overlay content fades after inactivity so the trailer is visible */
.lib-hero .vod-silo-hero-title,
.lib-hero .lib-hero-info,
.lib-hero .lib-hero-arrow,
.lib-hero .lib-hero-dots,
.lib-hero .trailer-mute-btn { transition: opacity 1.4s ease; }
.lib-hero .lib-hero-gradient { transition: opacity 1.8s ease; }
.lib-hero.hero-idle .vod-silo-hero-title,
.lib-hero.hero-idle .lib-hero-info,
.lib-hero.hero-idle .lib-hero-arrow,
.lib-hero.hero-idle .lib-hero-dots,
.lib-hero.hero-idle .trailer-mute-btn { opacity: 0; pointer-events: none; }
.lib-hero.hero-idle .lib-hero-gradient { opacity: 0.18; }

/* Hero dots navigation */
.lib-hero-dots {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 3; display: flex; gap: 8px; align-items: center;
}
.lib-hero-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.35); border: none; cursor: pointer;
  transition: all 0.3s; padding: 0;
}
.lib-hero-dot.active { width: 24px; border-radius: 4px; background: var(--cyan); }
[data-theme="light"] .lib-hero-dot { background: rgba(0,0,0,0.2); }

/* Hero nav arrows — large, thin, molefam neon-glow chevrons.
   Always visible at a resting glow, brighten on hover. The hero-info column
   has matching left padding so the arrows never overlap the title text. */
.lib-hero-arrow {
  position: absolute; top: 50%; z-index: 4;
  width: 72px; height: 120px; padding: 0;
  background: transparent; border: none;
  color: rgba(255,255,255,0.78);
  font-family: 'Outfit', sans-serif; font-weight: 200;
  font-size: 5.4rem; line-height: 1;
  cursor: pointer; pointer-events: auto;
  display: flex; align-items: center; justify-content: center;
  transform: translateY(-50%);
  opacity: 0.55;
  transition: opacity 0.3s ease, color 0.2s ease, text-shadow 0.25s ease, transform 0.25s ease;
  text-shadow:
    0 0 18px rgba(0,229,255,0.55),
    0 0 36px rgba(184,122,255,0.40),
    0 3px 12px rgba(0,0,0,0.9);
}
.lib-hero:hover .lib-hero-arrow,
.lib-hero:focus-within .lib-hero-arrow { opacity: 0.92; }
.lib-hero-arrow:hover {
  opacity: 1;
  color: var(--cyan);
  text-shadow:
    0 0 22px var(--cyan),
    0 0 44px rgba(184,122,255,0.7),
    0 3px 12px rgba(0,0,0,0.95);
}
.lib-hero-arrow.left  { left: 14px; }
.lib-hero-arrow.right { right: 14px; }
.lib-hero-arrow.left:hover  { transform: translateY(-50%) translateX(-4px); }
.lib-hero-arrow.right:hover { transform: translateY(-50%) translateX(4px); }
@keyframes arrow-dance {
  0%   { transform: translateY(-50%) translateX(0)    scale(1);    opacity: 0.92; }
  20%  { transform: translateY(-50%) translateX(11px) scale(1.22); opacity: 1; }
  40%  { transform: translateY(-50%) translateX(4px)  scale(1.08); }
  60%  { transform: translateY(-50%) translateX(9px)  scale(1.16); opacity: 1; }
  80%  { transform: translateY(-50%) translateX(2px)  scale(1.04); }
  100% { transform: translateY(-50%) translateX(0)    scale(1);    opacity: 0.55; }
}
.lib-hero-arrow.right.arrow-dancing {
  animation: arrow-dance 0.85s cubic-bezier(0.36,0.07,0.19,0.97);
  color: var(--cyan);
}
@media (max-width: 768px) {
  .lib-hero-arrow { width: 56px; height: 96px; font-size: 4rem; }
  .lib-hero-arrow.left  { left: 6px; }
  .lib-hero-arrow.right { right: 6px; }
}
[data-theme="light"] .lib-hero-arrow {
  color: rgba(255,255,255,0.92);
  text-shadow: 0 0 18px rgba(0,168,204,0.65), 0 0 36px rgba(141,82,224,0.5), 0 3px 14px rgba(0,0,0,0.95);
}

/* ─── Browse Tabs ─────────────────────────────────────── */
.lib-browse-tabs {
  display: flex; gap: 4px; padding: 16px 24px 0; margin-bottom: 20px;
  border-bottom: 1px solid var(--border); overflow-x: auto;
}
.lib-browse-tab {
  padding: 10px 18px; border: none; background: none;
  color: var(--text-secondary); font-size: 0.88rem; font-weight: 600;
  font-family: var(--font-display); cursor: pointer;
  border-bottom: 2px solid transparent; transition: all 0.15s;
  white-space: nowrap;
}
.lib-browse-tab:hover { color: var(--text-primary); }
.lib-browse-tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }

/* ─── Genre Row (Netflix-style) ───────────────────────── */
.genre-row { margin-bottom: 32px; position: relative; }
.genre-row-title {
  font-size: 1.1rem; font-weight: 700; color: var(--text-primary);
  margin-bottom: 12px; padding-left: 2px;
}

/* ─── Mega genre header (VOD landing — Netflix-style anchor) ─────
   Brand-display font: heavy Unbounded, all-lowercase, with the molefam
   neon cyan→purple signature on the text and a glowing underscore beneath.
   Sits above its horizontal scroller as a visual anchor for the genre. */
.genre-mega-row { margin: 38px 0 22px; position: relative; }
.genre-mega-row:first-child { margin-top: 8px; }
.genre-mega-head {
  display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap;
  margin: 0 0 18px 2px;
}
.genre-mega-title {
  font-family: 'Unbounded', 'Outfit', sans-serif;
  font-weight: 900;
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
  text-transform: lowercase;
  margin: 0;
  background: linear-gradient(95deg, var(--cyan) 0%, #c39bff 55%, var(--neon-bright, #b070ff) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgba(176,112,255,0.22)) drop-shadow(0 2px 0 rgba(0,0,0,0.35));
  position: relative;
}
.genre-mega-title::after {
  content: '';
  position: absolute; left: 0; right: 30%; bottom: -8px; height: 3px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  border-radius: 2px;
  box-shadow: 0 0 18px rgba(126,220,232,0.55);
}
.genre-mega-count {
  font-family: var(--font-mono);
  font-size: 0.78rem; letter-spacing: 0.08em;
  color: var(--text-dim); text-transform: uppercase;
  padding-bottom: 6px;
}
.genre-mega-seeall {
  margin-left: auto;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(126,220,232,0.08);
  border: 1px solid rgba(126,220,232,0.22);
  color: var(--cyan); cursor: pointer;
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.genre-mega-seeall:hover {
  background: rgba(126,220,232,0.18);
  border-color: var(--cyan);
  transform: translateX(3px);
}
[data-theme="light"] .genre-mega-title {
  filter: drop-shadow(0 0 12px rgba(176,112,255,0.18));
}
.genre-row-scroll {
  display: flex; gap: 12px;
  /* overflow-x: auto forces overflow-y: auto in browsers, which would clip
     the scaled :hover/:focus card. Give the row enough top/bottom breathing
     room (with negative margin so layout stays put) for the 1.15x scale. */
  overflow-x: auto; overflow-y: visible;
  padding: 28px 6px;
  margin: -28px -6px 0;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.genre-row-scroll::-webkit-scrollbar { display: none; }
.genre-row-scroll { -ms-overflow-style: none; scrollbar-width: none; }

/* Horizontal scroll row (updated) */
.hscroll-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; scroll-snap-type: x mandatory; }
.hscroll-row::-webkit-scrollbar { display: none; }
.hscroll-row { -ms-overflow-style: none; scrollbar-width: none; }

/* ─── Immersive genre view (web VOD) ─────────────────────
   Activated when a genre pill is selected. Full-bleed stage
   with backdrop + trailer + active-title info, plus a sticky
   controls bar (movies/TV toggle + genre pills) so the user
   can change genre without returning to the landing. */
.vgi-wrap { display: flex; flex-direction: column; flex: 1; }
.vgi-controls {
  position: sticky; top: 0; z-index: 15;
  background: linear-gradient(180deg, var(--bg-deep) 55%, transparent 100%);
  padding: 14px 24px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.vgi-silo-row {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-display); font-size: 0.78rem;
  font-weight: 700; letter-spacing: 0.04em; color: var(--text-dim);
}
.vgi-silo-btn {
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: inherit; font-weight: inherit;
  letter-spacing: inherit; padding: 0 2px;
  color: var(--text-dim); transition: color 0.15s;
}
.vgi-silo-btn.active { color: var(--neon-bright, #b87aff); }
.vgi-silo-btn:hover:not(.active) { color: var(--text-primary); }
.vgi-silo-sep { opacity: 0.3; }
.vgi-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.vgi-stage {
  position: relative; height: 62vh; min-height: 360px;
  overflow: hidden; flex-shrink: 0;
}
.vgi-backdrop {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 20%;
}
.vgi-scrim {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(to right, rgba(8,10,16,0.90) 0%, rgba(8,10,16,0.55) 42%, rgba(8,10,16,0.05) 100%),
    linear-gradient(to top, rgba(8,10,16,0.96) 0%, transparent 55%);
}
[data-theme="light"] .vgi-scrim {
  background:
    linear-gradient(to right, rgba(240,240,248,0.92) 0%, rgba(240,240,248,0.6) 42%, rgba(240,240,248,0.1) 100%),
    linear-gradient(to top, rgba(240,240,248,0.96) 0%, transparent 55%);
}
.vgi-info {
  position: absolute; bottom: 36px; left: 48px; right: 52%;
  z-index: 5; display: flex; flex-direction: column; gap: 10px;
}
@media (max-width: 768px) {
  .vgi-info { left: 20px; right: 20px; bottom: 24px; }
  .vgi-stage { height: 55vh; min-height: 300px; }
  .vgi-controls { padding: 10px 16px 14px; }
}
.vgi-genre-name {
  font-family: 'Unbounded', 'Outfit', sans-serif;
  font-weight: 900; font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.9; letter-spacing: -0.03em; text-transform: lowercase;
  background: linear-gradient(95deg, var(--cyan) 0%, #c39bff 55%, var(--neon-bright, #b070ff) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgba(176,112,255,0.22)) drop-shadow(0 2px 0 rgba(0,0,0,0.35));
  margin-bottom: 4px;
}
.vgi-active-title {
  font-size: 1.25rem; font-weight: 700; color: #fff;
  line-height: 1.2; text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
[data-theme="light"] .vgi-active-title { color: #111; text-shadow: none; }
.vgi-active-meta {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px; font-size: 0.82rem; color: var(--text-secondary);
  font-family: var(--font-mono);
}
.vgi-active-meta-rating { color: var(--fav-gold); font-weight: 700; }
.vgi-active-overview {
  font-size: 0.87rem; color: rgba(255,255,255,0.72);
  line-height: 1.55; max-width: 400px;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
[data-theme="light"] .vgi-active-overview { color: rgba(0,0,0,0.6); }
.vgi-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.vgi-play-btn {
  background: var(--cyan); color: var(--bg-deep); border: none;
  border-radius: var(--radius); font-family: var(--font-display);
  font-weight: 700; font-size: 0.9rem; padding: 9px 22px;
  cursor: pointer; transition: transform 0.12s, box-shadow 0.12s;
}
.vgi-play-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 18px rgba(126,220,232,0.35); }
.vgi-info-btn {
  background: rgba(255,255,255,0.10); color: #fff;
  border: 1px solid rgba(255,255,255,0.30); border-radius: var(--radius);
  font-family: var(--font-display); font-weight: 700;
  font-size: 0.9rem; padding: 9px 22px; cursor: pointer;
  transition: background 0.12s; backdrop-filter: blur(4px);
}
.vgi-info-btn:hover { background: rgba(255,255,255,0.18); }
[data-theme="light"] .vgi-info-btn { color: #111; border-color: rgba(0,0,0,0.25); background: rgba(0,0,0,0.06); }
[data-theme="light"] .vgi-info-btn:hover { background: rgba(0,0,0,0.12); }
.vgi-rail {
  display: flex; gap: 12px; overflow-x: auto;
  padding: 20px 24px 28px;
  background: linear-gradient(180deg, transparent 0%, var(--bg-deep) 25%);
  -webkit-overflow-scrolling: touch; scroll-behavior: smooth;
  scrollbar-width: thin; scrollbar-color: var(--cyan) var(--bg-surface);
}
.vgi-rail::-webkit-scrollbar { height: 4px; }
.vgi-rail::-webkit-scrollbar-track { background: var(--bg-surface); }
.vgi-rail::-webkit-scrollbar-thumb { background: var(--cyan); border-radius: 2px; }
.vgi-rail-card {
  flex-shrink: 0; width: 108px; cursor: pointer;
  border-radius: 6px; overflow: hidden;
  border: 2px solid transparent; background: var(--bg-card);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.vgi-rail-card:hover { transform: scale(1.06); }
.vgi-rail-card.active {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(126,220,232,0.4);
}
.vgi-rail-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; }
.vgi-rail-noposter {
  width: 100%; aspect-ratio: 2/3;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; color: var(--text-dim);
  padding: 8px; text-align: center; line-height: 1.3;
}
.vgi-rail-label {
  font-size: 0.68rem; color: var(--text-secondary);
  padding: 5px 6px 7px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  background: var(--bg-card); line-height: 1;
}
.vgi-empty { padding: 60px 24px; text-align: center; color: var(--text-dim); }

/* ─── Poster Card (enhanced) ──────────────────────────── */
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 16px; }
@media (max-width: 768px) { .poster-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; } }
.tv-mode .poster-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 28px; padding: 8px; }

.poster-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border);
  cursor: pointer; transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  aspect-ratio: 2/3; scroll-snap-align: start;
  transform-origin: center center; will-change: transform;
}
.poster-card:hover {
  transform: scale(1.15); box-shadow: 0 16px 38px rgba(0,0,0,0.55);
  border-color: var(--cyan); z-index: 5;
}
.poster-card img { width: 100%; height: 100%; object-fit: cover; transition: filter 0.25s; }
.poster-card:hover img { filter: brightness(0.75); }
.poster-card-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  padding: 40px 10px 10px; color: white;
  opacity: 0; transition: opacity 0.25s;
}
.poster-card:hover .poster-card-info { opacity: 1; }
.poster-card-title { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster-card-year { font-size: 0.7rem; opacity: 0.7; font-family: var(--font-mono); }
.poster-card-rating {
  position: absolute; top: 8px; right: 8px;
  padding: 2px 7px; border-radius: 4px;
  font-size: 0.68rem; font-weight: 700; font-family: var(--font-mono);
  color: white; opacity: 0; transition: opacity 0.25s;
}
.poster-card:hover .poster-card-rating { opacity: 1; }
.poster-card-rating.good { background: rgba(40,167,69,0.9); }
.poster-card-rating.mid { background: rgba(255,193,7,0.9); }
.poster-card-rating.low { background: rgba(220,53,69,0.9); }
.poster-card-noposter {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; color: var(--text-dim); text-align: center; padding: 16px;
  background: var(--bg-hover);
}

/* Genre row poster card — fixed width for horizontal scroll */
.genre-row-scroll .poster-card { flex-shrink: 0; width: 160px; }
@media (max-width: 768px) { .genre-row-scroll .poster-card { width: 130px; } }

/* ─── Poster Hover Preview (desktop hover overlay) ─────
   Fixed-position so it escapes .library overflow-x: hidden + the
   overflow-x: auto vertical clipping forced by .genre-row-scroll /
   .hscroll-row. pointer-events: none lets the original card receive
   the click; mouse hover state stays on the underlying card. */
.poster-preview {
  position: fixed;
  z-index: 9000;
  pointer-events: none;
  animation: poster-preview-in 0.16s ease-out;
  filter: drop-shadow(0 18px 50px rgba(0,0,0,0.65));
}
@keyframes poster-preview-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
.poster-preview-poster {
  position: relative; width: 100%; height: 100%;
  border-radius: var(--radius); overflow: hidden;
  border: 2px solid var(--cyan);
  background: var(--bg-card);
  box-shadow: 0 0 0 1px rgba(126,220,232,0.25), 0 0 38px rgba(126,220,232,0.30);
}
.poster-preview-poster img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.poster-preview-info {
  position: absolute;
  padding: 14px 16px;
  background: rgba(12,14,28,0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  box-shadow: 0 14px 40px rgba(0,0,0,0.55);
  overflow: hidden;
  display: flex; flex-direction: column; gap: 8px;
}
.poster-preview-title {
  font-size: 1.05rem; font-weight: 700; line-height: 1.25;
  color: var(--text-primary);
}
.poster-preview-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 0.78rem; color: var(--text-secondary);
  font-family: var(--font-mono);
}
.poster-preview-meta > span { white-space: nowrap; }
.poster-preview-type {
  padding: 1px 7px; border-radius: 3px;
  background: rgba(126,220,232,0.15);
  border: 1px solid rgba(126,220,232,0.35);
  color: var(--cyan); font-size: 0.7rem; letter-spacing: 0.04em;
}
.poster-preview-genres {
  font-size: 0.78rem; color: var(--text-secondary);
  font-style: italic;
}
.poster-preview-overview {
  font-size: 0.82rem; color: var(--text-secondary); line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical;
}

/* Suppress preview on Tizen — TV has its own focus-zoom flow */
.tv-mode .poster-preview { display: none; }

/* ─── Continue Watching card (enhanced) ───────────────── */
.continue-card {
  flex-shrink: 0; width: 200px; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border);
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  scroll-snap-align: start;
}
.continue-card:hover { transform: scale(1.04); border-color: var(--cyan); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
.continue-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.continue-card-info { padding: 8px 10px; }
.continue-card-title { font-size: 0.78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.continue-card-sub { font-size: 0.68rem; color: var(--text-dim); margin-top: 2px; }
.continue-progress { height: 3px; background: var(--border); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.continue-progress-bar { height: 100%; background: var(--cyan); border-radius: 2px; transition: width 0.3s; }

/* ─── A-Z Grid ────────────────────────────────────────── */
.az-letters {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 20px;
}
.az-letter-btn {
  padding: 4px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-secondary); font-size: 0.78rem; font-weight: 700;
  font-family: var(--font-mono); cursor: pointer; transition: all 0.15s;
}
.az-letter-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.az-letter-btn.active { background: var(--cyan); color: var(--bg-deep); border-color: var(--cyan); }
.az-letter-group { margin-bottom: 24px; }
.az-letter-heading {
  font-size: 1.3rem; font-weight: 800; color: var(--cyan);
  margin-bottom: 12px; padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

/* ─── Library toolbar ─────────────────────────────────── */
.lib-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 24px; margin-bottom: 4px;
}

/* Movie/TV Detail view */
.detail-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--bg-deep); overflow-y: auto; overflow-x: hidden;
  animation: fadeIn 0.2s ease;
}
.detail-overlay::before {
  content: ''; position: fixed; inset: 0;
  background-image: var(--detail-bd, none);
  background-size: cover; background-position: center top;
  opacity: 0.13; pointer-events: none; z-index: 0;
}
.detail-hero {
  position: relative; width: 100%; height: 400px; overflow: hidden;
  background: var(--bg-card); z-index: 1;
}
.detail-body { z-index: 1; }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero-trailer {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; z-index: 1;
  opacity: 0; transition: opacity 1s ease;
  pointer-events: none; /* Safari: container too, not just iframe */
}
.detail-hero-trailer.loaded { opacity: 1; }
.detail-hero-trailer iframe {
  position: absolute; top: 50%; left: 50%;
  width: 180%; height: 180%;
  transform: translate(-50%, -50%);
  border: none; pointer-events: none;
}
.detail-hero-trailer .trailer-click-shield {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2; background: transparent;
  pointer-events: auto;
}
.trailer-mute-btn {
  position: absolute; bottom: 16px; right: 16px; z-index: 10;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.25);
  color: white; font-size: 1.3rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.15s;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  pointer-events: auto;
}
.trailer-mute-btn:hover { background: rgba(0,0,0,0.8); transform: scale(1.1); }
.detail-hero-gradient {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 2;
  background: linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,0) 50%, var(--bg-deep) 100%);
}
.detail-close {
  position: absolute; top: 16px; right: 16px; z-index: 5;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.2);
  color: white; font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.detail-close:hover { background: rgba(0,0,0,0.7); }
.detail-body { position: relative; max-width: 1000px; margin: -80px auto 0; padding: 0 24px 40px; }
.detail-top { display: flex; gap: 24px; margin-bottom: 24px; }
@media (max-width: 768px) { .detail-top { flex-direction: column; align-items: center; } }
.detail-poster {
  width: 200px; flex-shrink: 0; border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4); overflow: hidden;
  aspect-ratio: 2/3; background: var(--bg-card);
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { flex: 1; min-width: 0; }
.detail-title { font-size: 1.8rem; font-weight: 800; margin-bottom: 8px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; font-size: 0.85rem; color: var(--text-secondary); }
.detail-meta-item { display: flex; align-items: center; gap: 4px; }
.detail-genres { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.detail-genre {
  padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600;
  background: var(--bg-hover); border: 1px solid var(--border); color: var(--text-secondary);
}
.detail-overview { font-size: 0.92rem; line-height: 1.6; color: var(--text-secondary); margin-bottom: 20px; }
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.detail-play-btn {
  padding: 12px 32px; border-radius: var(--radius); border: none;
  background: var(--cyan); color: var(--bg-deep); font-size: 1rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: transform 0.1s, box-shadow 0.1s;
}
.detail-play-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(126,220,232,0.3); }
.detail-trailer-btn {
  padding: 12px 24px; border-radius: var(--radius);
  border: 1px solid var(--border-bright); background: transparent;
  color: var(--text-primary); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: border-color 0.15s;
}
.detail-trailer-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.my-rating { display: flex; align-items: center; gap: 4px; margin-top: 14px; }
.my-rating-label { font-size: 0.82rem; color: var(--text-dim); margin-right: 8px; }
.my-star {
  background: none; border: none; padding: 0 2px; cursor: pointer; line-height: 1;
  font-size: 1.7rem; color: rgba(255,255,255,0.22); transition: color 0.12s, transform 0.12s;
}
.my-star:hover { transform: scale(1.15); }
.my-star.on { color: #ffd24a; text-shadow: 0 0 10px rgba(255,210,74,0.5); }

/* Cast row */
.detail-cast-title { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.detail-cast-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
.detail-cast-card { flex-shrink: 0; text-align: center; width: 80px; }
.detail-cast-img { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; background: var(--bg-card); border: 1px solid var(--border); }
.detail-cast-name { font-size: 0.7rem; font-weight: 600; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-cast-char { font-size: 0.62rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Season/Episode list for TV */
.season-selector { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.season-pill {
  padding: 5px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: transparent; font-family: var(--font-display); font-size: 0.78rem;
  font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all 0.15s;
}
.season-pill.active { background: var(--cyan); color: var(--bg-deep); border-color: var(--cyan); }
.season-pill:hover:not(.active) { border-color: var(--border-bright); color: var(--text-primary); }

.episode-list { display: flex; flex-direction: column; gap: 8px; }
.episode-card {
  display: flex; gap: 14px; padding: 12px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  cursor: pointer; transition: border-color 0.15s;
}
.episode-card:hover { border-color: var(--cyan); }
.episode-still { width: 160px; flex-shrink: 0; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 16/9; background: var(--bg-hover); }
.episode-still img { width: 100%; height: 100%; object-fit: cover; }
.episode-info { flex: 1; min-width: 0; }
.episode-num { font-size: 0.72rem; font-weight: 700; color: var(--cyan); font-family: var(--font-mono); margin-bottom: 2px; }
.episode-title { font-size: 0.88rem; font-weight: 600; margin-bottom: 4px; }
.episode-overview { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 768px) { .episode-still { width: 100px; } }

/* Library Player — VOD seek bar and player-ctrl-btn aliases */
.player-ctrl-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85); font-size: 0.85rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background 0.15s; font-family: var(--font-display);
}
.player-ctrl-btn:hover { background: rgba(255,255,255,0.18); }
.player-vol-slider {
  width: 72px; height: 4px; -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,0.18); border-radius: 2px; outline: none;
}
.player-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; cursor: pointer;
}
.player-vol-slider::-moz-range-thumb {
  width: 12px; height: 12px; border: none;
  border-radius: 50%; background: #fff; cursor: pointer;
}
.player-progress-bar {
  position: absolute; bottom: 60px; left: 24px; right: 24px;
  height: 5px; background: rgba(255,255,255,0.15); border-radius: 3px;
  cursor: pointer; z-index: 6; transition: height 0.1s;
}
.player-progress-fill { height: 100%; background: var(--cyan); border-radius: 3px; pointer-events: none; }
.player-progress-bar:hover { height: 8px; }

/* Library search results badge */
.search-type-badge {
  display: inline-block; padding: 1px 6px; border-radius: 3px;
  font-size: 0.58rem; font-weight: 700; font-family: var(--font-mono);
  letter-spacing: 0.04em; text-transform: uppercase;
  margin-top: 3px;
}
.search-type-badge.movie { background: var(--purple); color: white; }
.search-type-badge.tv { background: var(--live-green); color: var(--bg-deep); }

/* Library loading skeleton */
.skeleton-card { background: var(--bg-card); border-radius: var(--radius); aspect-ratio: 2/3; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Library scan button */
.lib-scan-btn {
  padding: 6px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-secondary); font-size: 0.72rem; font-weight: 600;
  font-family: var(--font-mono); cursor: pointer; transition: all 0.15s;
}
.lib-scan-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.lib-scan-btn.scanning { pointer-events: none; opacity: 0.6; }

/* ─── Admin Panel ──────────────────────────────────────── */
.admin-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 100;
  background: var(--bg-deep); overflow-y: auto;
  animation: fadeIn 0.2s ease;
}
.admin-pin-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; gap: 20px;
}
.admin-pin-screen h2 { color: var(--text-primary); font-family: var(--font-display); font-weight: 700; }
.admin-pin-input {
  background: var(--bg-card); border: 2px solid var(--border);
  color: var(--text-primary); font-family: var(--font-mono); font-size: 1.5rem;
  padding: 12px 20px; border-radius: var(--radius); text-align: center;
  letter-spacing: 0.3em; width: 200px;
}
.admin-pin-input:focus { outline: none; border-color: var(--cyan); }
.admin-pin-err { color: #f08080; font-size: 0.85rem; }
.admin-container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 32px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.admin-header h1 {
  color: var(--text-primary); font-family: var(--font-display); font-size: 1.6rem; font-weight: 700;
}
.admin-close-btn {
  background: rgba(255,255,255,0.08); border: 1px solid var(--border);
  color: var(--text-primary); padding: 8px 20px; border-radius: var(--radius);
  cursor: pointer; font-family: var(--font-display); font-size: 0.85rem; transition: all 0.15s;
}
.admin-close-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.admin-tabs {
  display: flex; gap: 4px; margin-bottom: 24px;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
}
.admin-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-dim); font-family: var(--font-display); font-size: 0.9rem;
  padding: 10px 20px; cursor: pointer; transition: all 0.15s;
}
.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.admin-section { margin-bottom: 32px; }
.admin-section h3 {
  color: var(--text-primary); font-family: var(--font-display);
  font-size: 1.1rem; margin-bottom: 16px; font-weight: 600;
}
.admin-field { margin-bottom: 16px; }
.admin-field label {
  display: block; color: var(--text-secondary); font-family: var(--font-mono);
  font-size: 0.75rem; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em;
}
.admin-field input, .admin-field textarea {
  width: 100%; background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-primary); font-family: var(--font-mono); font-size: 0.85rem;
  padding: 10px 14px; border-radius: var(--radius); box-sizing: border-box;
}
.admin-field input:focus, .admin-field textarea:focus { outline: none; border-color: var(--cyan); }
.admin-field textarea { resize: vertical; min-height: 60px; }
.admin-field .admin-hint { color: var(--text-dim); font-size: 0.72rem; margin-top: 4px; font-family: var(--font-mono); }
.admin-save-btn {
  background: var(--cyan); color: #000; border: none; padding: 10px 28px;
  border-radius: var(--radius); font-family: var(--font-display); font-weight: 600;
  font-size: 0.9rem; cursor: pointer; transition: opacity 0.15s;
}
.admin-save-btn:hover { opacity: 0.85; }
.admin-save-btn:disabled { opacity: 0.5; cursor: default; }
.admin-save-msg { color: #7ee8b0; font-size: 0.85rem; margin-left: 12px; }

/* Library-scan action button — state-aware feedback right next to the click */
.lib-scan-action {
  display: inline-flex; align-items: center; gap: 10px;
  background: transparent; border: 1px solid var(--cyan); color: var(--cyan);
  transition: background 0.18s, color 0.18s, border-color 0.18s, opacity 0.18s;
}
.lib-scan-action:hover:not(:disabled) {
  background: rgba(126,220,232,0.12); opacity: 1;
}
.lib-scan-action-busy {
  background: rgba(126,220,232,0.16); border-color: var(--cyan);
  color: var(--cyan); cursor: progress;
  box-shadow: 0 0 18px rgba(126,220,232,0.35), inset 0 0 12px rgba(126,220,232,0.15);
}
.lib-scan-action-done {
  background: rgba(126,232,176,0.10); border-color: #7ee8b0; color: #7ee8b0;
}
.lib-scan-action-error {
  background: rgba(255,120,120,0.10); border-color: #ff8585; color: #ff8585;
}
.lib-scan-spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(126,220,232,0.25); border-top-color: var(--cyan);
  animation: lib-scan-spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes lib-scan-spin { to { transform: rotate(360deg); } }
.lib-scan-pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--cyan);
  display: inline-block; margin-right: 8px;
  box-shadow: 0 0 8px var(--cyan);
  animation: lib-scan-pulse 1.2s ease-in-out infinite;
}
@keyframes lib-scan-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.15); }
}
.lib-scan-feedback {
  font-size: 0.85rem; font-family: var(--font-display);
  display: inline-flex; align-items: center;
}
.lib-scan-feedback.busy  { color: var(--cyan); }
.lib-scan-feedback.done  { color: #7ee8b0; }
.lib-scan-feedback.error { color: #ff8585; }
.lib-scan-feedback b { font-weight: 700; }

/* Users table */
.admin-users-table { width: 100%; border-collapse: collapse; }
.admin-users-table th {
  text-align: left; color: var(--text-dim); font-family: var(--font-mono);
  font-size: 0.72rem; text-transform: uppercase; padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.admin-users-table td {
  padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-primary); font-size: 0.85rem;
}
.admin-users-table tr:hover td { background: rgba(255,255,255,0.02); }
.admin-user-avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 700;
  font-size: 0.7rem; color: #000; margin-right: 8px; vertical-align: middle;
}
.admin-delete-btn {
  background: none; border: 1px solid rgba(240,128,128,0.3); color: #f08080;
  padding: 4px 12px; border-radius: var(--radius); cursor: pointer;
  font-size: 0.75rem; transition: all 0.15s;
}
.admin-delete-btn:hover { background: rgba(240,128,128,0.15); border-color: #f08080; }

/* Activity log */
.admin-log { max-height: 600px; overflow-y: auto; }
.admin-log-entry {
  display: flex; gap: 12px; padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.82rem; align-items: baseline;
}
.admin-log-entry:hover { background: rgba(255,255,255,0.02); }
.admin-log-time { color: var(--text-dim); font-family: var(--font-mono); font-size: 0.72rem; white-space: nowrap; }
.admin-log-type {
  font-family: var(--font-mono); font-size: 0.72rem; padding: 2px 8px;
  border-radius: 4px; white-space: nowrap; font-weight: 600;
}
.admin-log-type.login { background: rgba(126,220,232,0.15); color: var(--cyan); }
.admin-log-type.play { background: rgba(126,232,176,0.15); color: #7ee8b0; }
.admin-log-type.profile { background: rgba(184,164,255,0.15); color: #b8a4ff; }
.admin-log-type.admin { background: rgba(240,128,128,0.15); color: #f08080; }
.admin-log-type.settings { background: rgba(242,212,106,0.15); color: #f2d46a; }
.admin-log-detail { color: var(--text-secondary); }
.admin-log-filter {
  display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap;
}
.admin-log-filter-btn {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--text-secondary); padding: 4px 12px; border-radius: 12px;
  font-size: 0.75rem; cursor: pointer; transition: all 0.15s;
}
.admin-log-filter-btn:hover { border-color: var(--cyan); }
.admin-log-filter-btn.active { background: rgba(126,220,232,0.15); border-color: var(--cyan); color: var(--cyan); }

/* ─── TV Mode (Tizen/Samsung) ──────────────────────────── */
/* TV Mode: scale up for big screen readability */
.tv-mode { font-size: 1.35rem; }
.tv-mode .topbar { padding: 18px 40px; height: auto; min-height: 80px; gap: 36px; }
.tv-mode .brand-wrap { gap: 16px; margin-right: 12px; }
.tv-mode .brand-logo { width: 64px; height: 64px; }
.tv-mode .brand-text { font-size: 1.6rem; }
.tv-mode .nav-tabs { gap: 8px; background: transparent; padding: 0; }
.tv-mode .nav-tab { font-size: 1.35rem; padding: 14px 32px; border-radius: 10px; }
.tv-mode .pill { font-size: 1.1rem; padding: 10px 20px; }
.tv-mode .guide-ch-name { font-size: 1.05rem; }
.tv-mode .guide-prog-title { font-size: 0.95rem; }
.tv-mode .guide-prog-time { font-size: 0.82rem; }
.tv-mode .guide-time-mark { font-size: 0.85rem; }
.tv-mode .prog-card { max-width: 700px; }
.tv-mode .prog-card-title { font-size: 1.4rem; }
.tv-mode .prog-card-desc { font-size: 1.05rem; }
.tv-mode .prog-card-watch, .tv-mode .prog-card-close { font-size: 1.15rem; padding: 14px 28px; }
.tv-mode .topbar-time { font-size: 1.25rem; }
.tv-mode .profile-badge-name { font-size: 1.1rem; }
.tv-mode .search-box { font-size: 1.1rem; padding: 10px 16px; }
/* TV focus: suppress all default outlines, use tight per-element highlights */
.tv-mode *:focus { outline: none !important; }
.tv-mode button:focus, .tv-mode a:focus, .tv-mode [tabindex]:focus, .tv-mode input:focus, .tv-mode select:focus {
  outline: 3px solid var(--cyan) !important; outline-offset: 4px !important; border-radius: 6px;
}
.tv-mode .pin-btn:focus { outline: none !important; border-color: var(--cyan); box-shadow: 0 0 12px rgba(126,220,232,0.4); transform: scale(1.08); }
.tv-mode .poster-card { transition: box-shadow 0.25s ease, border-color 0.25s ease; }
/* Selected poster grows the cell itself (spans 2x2 in the grid) instead of
   scale() which only zooms the painted pixels and overflows the row. */
.tv-mode .poster-card:focus {
  outline: none !important; z-index: 50;
  grid-column: span 2; grid-row: span 2;
  box-shadow: 0 16px 48px rgba(0,0,0,0.7), 0 0 0 3px var(--cyan), 0 0 32px rgba(176,112,255,0.25);
  border-color: var(--cyan);
}
.poster-card:focus { z-index: 5; }
/* Same for non-TV (mouse/keyboard) — apply on hover and :focus-within */
.poster-card:hover { z-index: 5; }
/* Selected card: subtle scale + ring. We do NOT grid-span the focused cell
   anymore — reflowing the grid on every focus made navigation feel chunky
   in Library. Pure transform stays composited and smooth. */
.library .poster-card:focus, .library .poster-card.expanded {
  transform: scale(1.08); z-index: 50;
  box-shadow: 0 12px 36px rgba(0,0,0,0.55), 0 0 0 2px var(--cyan), 0 0 22px rgba(176,112,255,0.20);
}
.library .poster-card:focus .poster-card-info,
.library .poster-card.expanded .poster-card-info { opacity: 1; }
.library .poster-card:focus .poster-card-rating,
.library .poster-card.expanded .poster-card-rating { opacity: 1; }
.tv-mode .poster-card:focus .poster-card-info { opacity: 1; }
.tv-mode .poster-card:focus .poster-card-rating { opacity: 1; }
.tv-mode .continue-card { transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.tv-mode .continue-card:focus { outline: none !important; transform: scale(1.3); z-index: 50; box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 3px var(--cyan); border-color: var(--cyan); }
.tv-mode .ch-card:focus { outline: 3px solid var(--cyan) !important; outline-offset: 0px !important; background: var(--bg-hover); }
.tv-mode .nav-tab:focus { outline: 3px solid var(--cyan) !important; outline-offset: 4px !important; }
.tv-mode .filter-pill:focus, .tv-mode .pill:focus { outline: 3px solid var(--cyan) !important; outline-offset: 4px !important; }
.tv-mode .guide-ch:focus { outline: 3px solid var(--cyan) !important; outline-offset: 0px !important; }
.tv-mode .guide-prog:focus { outline: 3px solid var(--cyan) !important; outline-offset: -2px !important; }
.tv-mode .detail-play-btn:focus { outline: 3px solid var(--cyan) !important; outline-offset: 6px !important; }
.tv-mode .detail-close:focus { outline: 3px solid var(--cyan) !important; outline-offset: 4px !important; }
.tv-mode .prog-card-watch:focus, .tv-mode .prog-card-close:focus { outline: 3px solid var(--cyan) !important; outline-offset: 4px !important; }
.tv-mode .ep-row:focus, .tv-mode .episode-card:focus { outline: 3px solid var(--cyan) !important; outline-offset: 2px !important; }
.tv-mode .season-tab:focus { outline: 3px solid var(--cyan) !important; outline-offset: 4px !important; }
.tv-mode .hero-card:focus { outline: 3px solid var(--cyan) !important; outline-offset: 4px !important; }
.tv-mode .alpha-btn:focus { outline: 3px solid var(--cyan) !important; outline-offset: 2px !important; }
.tv-mode .trailer-mute-btn:focus { outline: 3px solid var(--cyan) !important; outline-offset: 4px !important; }
.tv-mode .lib-browse-tab:focus { outline: 2px solid var(--cyan) !important; outline-offset: -2px !important; }
.tv-mode .detail-play-btn:focus { outline: 2px solid #fff !important; outline-offset: 0px !important; }
.tv-mode .detail-trailer-btn:focus { outline: 2px solid var(--cyan) !important; outline-offset: 0px !important; }
.tv-mode .detail-close:focus { outline: 2px solid var(--cyan) !important; outline-offset: 0px !important; }
.tv-mode .search-box { display: none; }
.tv-mode .guide-ch:focus { outline: 2px solid var(--cyan) !important; outline-offset: -2px !important; background: rgba(126,220,232,0.1); }
.tv-mode .guide-prog:focus { outline: 2px solid var(--cyan) !important; outline-offset: -2px !important; z-index: 5; }
.tv-mode .guide-prog.current:focus { outline-color: #fff !important; }
.tv-mode .prog-card-watch:focus, .tv-mode .prog-card-close:focus { outline: none !important; box-shadow: inset 0 0 0 2px var(--cyan); }
.tv-mode .prog-card-actions { gap: 14px; }
.tv-mode .guide-row { min-height: 56px; }
.tv-mode .guide-ch { padding-top: 4px; padding-bottom: 4px; }
.tv-mode .az-letter-btn:focus { outline: 2px solid var(--cyan) !important; outline-offset: -2px !important; }
.tv-mode .lib-hero-play:focus, .tv-mode .lib-hero-info-btn:focus { outline: 2px solid #fff !important; outline-offset: 0px !important; }
.tv-mode .episode-card:focus { outline: 2px solid var(--cyan) !important; outline-offset: -2px !important; background: rgba(126,220,232,0.06); }
.tv-mode .player-ctrl-btn:focus { outline: 2px solid var(--cyan) !important; outline-offset: 0px !important; }
.tv-mode .genre-row-scroll, .tv-mode .hscroll-row { scroll-behavior: smooth; }

/* ─── Music Wheel (slot-machine picker) ─────────────── */
.music-wheel-wrap {
  display: flex; flex-direction: column; height: 100%; min-height: 0;
  padding: 14px 0 18px;
}
/* Live TV guide header */
.live-guide-header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 20px 28px 14px; flex-shrink: 0;
}
.live-guide-title {
  font-family: 'Unbounded', 'Outfit', sans-serif;
  font-weight: 900; font-size: clamp(2.4rem, 3.8vw, 4.2rem);
  line-height: 0.9; letter-spacing: -0.03em; text-transform: lowercase; margin: 0;
  background: linear-gradient(95deg, var(--cyan) 0%, #c39bff 55%, var(--neon-bright, #b070ff) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 0 18px rgba(176,112,255,0.22)) drop-shadow(0 2px 0 rgba(0,0,0,0.35));
}
.live-guide-title .live-guide-sep {
  font-size: 0.5em; font-weight: 400; opacity: 0.25;
  color: var(--text-dim); -webkit-text-fill-color: var(--text-dim);
}
.live-guide-title .live-guide-sub {
  font-size: 0.72em; opacity: 0.55;
}
.music-wheel-header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 20px 28px 14px; flex-shrink: 0;
}
.music-wheel-title {
  font-family: 'Unbounded', 'Outfit', sans-serif;
  font-weight: 900; font-size: clamp(2.4rem, 3.8vw, 4.2rem);
  line-height: 0.9; letter-spacing: -0.03em; text-transform: lowercase;
  background: linear-gradient(95deg, var(--cyan) 0%, #c39bff 55%, var(--neon-bright, #b070ff) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 0 18px rgba(176,112,255,0.22)) drop-shadow(0 2px 0 rgba(0,0,0,0.35));
}
.music-wheel-count {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim);
  padding: 2px 10px; border-radius: 10px; background: var(--bg-card);
  border: 1px solid rgba(184,122,255,0.35);
  box-shadow: 0 0 8px rgba(184,122,255,0.18);
}
.music-wheel {
  position: relative; flex: 1; min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center, rgba(184,122,255,0.07) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-surface) 50%, var(--bg-deep) 100%);
  border-top: 1px solid rgba(184,122,255,0.22); border-bottom: 1px solid rgba(184,122,255,0.22);
}
.music-wheel-track {
  height: 100%; overflow-y: auto; overflow-x: hidden;
  scroll-snap-type: y proximity;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none; -ms-overflow-style: none;
  /* Vertical padding set in JS (CSS % padding is width-based) */
}
.music-wheel-track::-webkit-scrollbar { display: none; }
.music-wheel-row {
  position: relative;
  scroll-snap-align: center;
  height: 64px; display: flex; align-items: center; justify-content: center;
  gap: 14px; padding: 0 64px;
  cursor: pointer; user-select: none;
  font-size: 1.15rem; font-weight: 600; color: var(--text-primary);
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
  text-align: center;
  contain: layout style;
}
.music-wheel-row.active {
  color: #fff;
  text-shadow:
    0 0 10px rgba(184,122,255,0.65),
    0 0 22px rgba(126,220,232,0.35);
}
.music-wheel-num {
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500;
  color: var(--text-dim); letter-spacing: 0.08em; flex-shrink: 0;
}
.music-wheel-row.active .music-wheel-num { color: var(--neon); opacity: 0.95; }
.music-wheel-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 70vw;
  letter-spacing: 0.01em;
}
.music-wheel-fav {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; color: var(--neon);
  font-size: 1.35rem; cursor: pointer; padding: 4px 6px;
  transition: opacity 0.15s, color 0.15s, text-shadow 0.15s;
  opacity: 0; pointer-events: none;
  text-shadow: 0 0 6px rgba(184,122,255,0.5);
}
.music-wheel-row.active .music-wheel-fav { opacity: 1; pointer-events: auto; }
.music-wheel-fav:hover { color: #fff; }
.music-wheel-fav.active { color: #ffd96a; }
/* Center band — highlights the currently selected row */
.music-wheel-center-band {
  position: absolute; left: 0; right: 0; top: 50%; height: 64px;
  transform: translateY(-50%); z-index: 1; pointer-events: none;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(184, 122, 255, 0.10) 25%,
    rgba(184, 122, 255, 0.18) 50%,
    rgba(184, 122, 255, 0.10) 75%,
    transparent 100%);
  border-top: 1px solid rgba(184, 122, 255, 0.45);
  border-bottom: 1px solid rgba(184, 122, 255, 0.45);
  box-shadow:
    inset 0 0 24px rgba(184, 122, 255, 0.12),
    0 0 18px rgba(184, 122, 255, 0.15);
}
.music-wheel-mask {
  position: absolute; left: 0; right: 0; height: 32%; z-index: 2; pointer-events: none;
}
.music-wheel-mask.top { top: 0; background: linear-gradient(to bottom, var(--bg-deep) 0%, transparent 100%); }
.music-wheel-mask.bottom { bottom: 0; background: linear-gradient(to top, var(--bg-deep) 0%, transparent 100%); }
.music-wheel-actions {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 16px 20px 4px; flex-shrink: 0;
}
.music-wheel-step {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: all 0.12s;
  display: flex; align-items: center; justify-content: center;
}
.music-wheel-step:hover {
  border-color: var(--neon); color: var(--neon); transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(184,122,255,0.35);
}
.music-wheel-step:active { transform: translateY(1px); }
.music-wheel-play {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 28px; border-radius: 999px;
  background: linear-gradient(95deg, var(--cyan) 0%, var(--neon) 100%);
  color: var(--bg-deep); border: none;
  font-size: 0.95rem; font-weight: 700; font-family: var(--font-display);
  letter-spacing: 0.12em; cursor: pointer; transition: all 0.15s;
  box-shadow:
    0 6px 20px rgba(126, 220, 232, 0.25),
    0 0 18px rgba(184, 122, 255, 0.30);
}
.music-wheel-play:hover {
  background: linear-gradient(95deg, var(--neon) 0%, #d4a4ff 100%);
  color: #fff;
  box-shadow:
    0 10px 30px rgba(184, 122, 255, 0.45),
    0 0 24px rgba(184, 122, 255, 0.55);
  transform: translateY(-1px);
}
.music-wheel-play-glyph { font-size: 1.1rem; line-height: 1; }
.music-empty {
  display: flex; align-items: center; justify-content: center;
  height: 60vh; color: var(--text-dim); font-size: 1rem;
}
@media (max-width: 640px) {
  .music-wheel-row { font-size: 1rem; padding: 0 18px; gap: 12px; }
  .music-wheel-num { font-size: 0.75rem; min-width: 3em; }
  .music-wheel-play { padding: 10px 22px; font-size: 0.85rem; }
}
