/* =====================================================================
   BizzTycoonsOTT — viewer app (Home, Browse, Detail, Search, My List,
   Player, Account, Plans). Dark, Netflix-style layout, own branding.
   ===================================================================== */
:root {
  --bg: #0b0b0f;
  --bg-2: #121218;
  --surface: #18181f;
  --surface-2: #22222b;
  --line: #2c2c36;
  --text: #ffffff;
  --muted: #a1a1aa;
  --dim: #71717a;
  --red: #e50914;
  --red-dark: #b20710;
  --gold: #f5c542;
  --green: #46d369;
  --radius: 6px;
  --gutter: 4%;
  --header-h: 68px;
  --font: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.app {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
  min-height: 100vh;
}
.app a { color: inherit; text-decoration: none; }
.app button { font-family: inherit; }
.app img { max-width: 100%; }
.app svg { width: 1.15em; height: 1.15em; flex-shrink: 0; } /* default icon size; specific rules below override */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------------- Header ---------------- */
.app-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; gap: 28px;
  padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(0,0,0,.75) 0%, rgba(0,0,0,0) 100%);
  transition: background .3s ease;
}
.app-header.is-solid { background: rgba(11,11,15,.97); box-shadow: 0 1px 0 rgba(255,255,255,.04); }
.app-logo { display: flex; align-items: center; flex-shrink: 0; }
.app-logo img { height: 40px; width: auto; display: block; }
.app-logo .logo-text { display: none; font-weight: 900; color: var(--gold); letter-spacing: 1px; }
.main-nav { display: flex; gap: 20px; font-size: 14px; }
.main-nav a { color: #e5e5e5; transition: color .2s; white-space: nowrap; }
.main-nav a:hover { color: var(--muted); }
.main-nav a.active { color: #fff; font-weight: 700; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.icon-btn {
  background: none; border: 0; color: #fff; cursor: pointer; padding: 6px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 4px;
}
.icon-btn svg { width: 22px; height: 22px; }
.search-box { display: flex; align-items: center; border: 1px solid transparent; transition: all .25s; }
.search-box.is-open { background: rgba(0,0,0,.8); border-color: #fff; }
.search-box input {
  width: 0; padding: 0; border: 0; background: transparent; color: #fff; font-size: 14px;
  transition: width .25s, padding .25s; outline: none;
}
.search-box.is-open input { width: 220px; padding: 6px 6px 6px 0; }
.profile-menu { position: relative; }
.avatar-btn {
  display: flex; align-items: center; gap: 6px; background: none; border: 0; color: #fff; cursor: pointer; padding: 0;
}
.avatar {
  width: 34px; height: 34px; border-radius: 5px; object-fit: cover;
  background: linear-gradient(135deg, var(--red), #7a0510);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; color: #fff;
}
.avatar-btn .caret { transition: transform .2s; font-size: 10px; }
.profile-menu.is-open .caret { transform: rotate(180deg); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 14px); min-width: 220px;
  background: rgba(15,15,20,.97); border: 1px solid var(--line); border-radius: 6px; padding: 8px 0;
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
}
.dropdown .who { padding: 8px 16px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.dropdown .who strong { display: block; color: #fff; font-size: 14px; word-break: break-all; }
.dropdown a, .dropdown button {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 16px; font-size: 14px;
  background: none; border: 0; color: #e5e5e5; cursor: pointer; text-align: left;
}
.dropdown a:hover, .dropdown button:hover { background: rgba(255,255,255,.06); color: #fff; }
.dropdown .sep { border-top: 1px solid var(--line); margin: 6px 0; }

/* ---------------- Bottom tab bar (phones) ---------------- */
.tab-bar {
  display: none; position: fixed; inset: auto 0 0 0; z-index: 60;
  background: rgba(14,14,18,.98); border-top: 1px solid var(--line);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tab-bar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10.5px; color: var(--dim); padding: 4px 0;
}
.tab-bar a svg { width: 22px; height: 22px; }
.tab-bar a.active { color: #fff; }

/* ---------------- Buttons & badges ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 5px; padding: 10px 22px; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: background .15s, opacity .15s, transform .1s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 22px; height: 22px; }
.btn-play { background: #fff; color: #000; }
.btn-play:hover { background: rgba(255,255,255,.78); }
.btn-ghost { background: rgba(109,109,110,.7); color: #fff; }
.btn-ghost:hover { background: rgba(109,109,110,.45); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); }
.btn-outline { background: transparent; color: #fff; border: 1px solid #777; }
.btn-outline:hover { border-color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: default; }
.round-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6);
  background: rgba(30,30,30,.6); color: #fff; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color .15s, background .15s; flex-shrink: 0;
}
.round-btn:hover { border-color: #fff; background: rgba(60,60,60,.8); }
.round-btn svg { width: 20px; height: 20px; }
.round-btn.is-white { background: #fff; color: #000; border-color: #fff; }
.round-btn.is-white:hover { background: rgba(255,255,255,.8); }
.rating {
  display: inline-block; border: 1px solid rgba(255,255,255,.45); padding: 0 6px; font-size: 12px;
  line-height: 18px; border-radius: 2px; color: #ddd; white-space: nowrap;
}
.badge-premium {
  display: inline-flex; align-items: center; gap: 4px; background: var(--gold); color: #111;
  font-size: 10.5px; font-weight: 800; padding: 2px 6px; border-radius: 3px; letter-spacing: .3px;
}
.badge-premium svg { width: 11px; height: 11px; }
.match { color: var(--green); font-weight: 700; }
.dot-list { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; color: #ddd; font-size: 14px; }
.dot-list > * + *::before { content: '•'; color: #666; margin: 0 7px; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative; height: 82vh; min-height: 520px; max-height: 900px;
  display: flex; align-items: flex-end; overflow: hidden; background: #000;
}
.hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  transition: opacity .9s ease; opacity: 0;
}
.hero-bg.is-active { opacity: 1; }
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(77deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,0) 70%),
    linear-gradient(180deg, rgba(11,11,15,0) 60%, rgba(11,11,15,.6) 82%, var(--bg) 100%);
}
.hero-content {
  position: relative; z-index: 2; padding: 0 var(--gutter) 15vh; max-width: 680px;
}
.hero-kicker { display: flex; align-items: center; gap: 8px; color: var(--gold); font-weight: 800; font-size: 13px; letter-spacing: 3px; margin-bottom: 10px; }
.hero-title {
  font-size: clamp(36px, 6vw, 76px); line-height: .98; font-weight: 900; margin: 0 0 12px;
  text-transform: uppercase; letter-spacing: -1px; text-shadow: 0 2px 20px rgba(0,0,0,.4);
}
.hero-tagline { font-size: clamp(16px, 1.6vw, 22px); font-weight: 600; margin: 0 0 8px; }
.hero-desc {
  font-size: clamp(14px, 1.2vw, 17px); color: #e5e5e5; margin: 0 0 20px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
}
.hero-meta { margin-bottom: 18px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-dots { position: absolute; z-index: 3; right: var(--gutter); bottom: 16vh; display: flex; gap: 8px; }
.hero-dots button { width: 22px; height: 3px; border: 0; padding: 0; background: rgba(255,255,255,.35); cursor: pointer; }
.hero-dots button.is-active { background: #fff; }

/* ---------------- Rows ---------------- */
.rows { position: relative; z-index: 3; margin-top: -9vh; padding-bottom: 40px; }
.rows.no-hero { margin-top: 0; padding-top: calc(var(--header-h) + 20px); }
.row { margin: 0 0 3.2vw; position: relative; }
.row-head { display: flex; align-items: baseline; gap: 12px; padding: 0 var(--gutter); margin-bottom: 10px; }
.row-title { font-size: clamp(17px, 1.5vw, 22px); font-weight: 700; margin: 0; color: #e5e5e5; }
.row-more { font-size: 13px; color: var(--gold); opacity: 0; transition: opacity .2s; font-weight: 600; }
.row:hover .row-more, .row-more:focus { opacity: 1; }
.row-track {
  display: flex; gap: 8px; overflow-x: auto; overflow-y: visible; scroll-behavior: smooth;
  padding: 6px var(--gutter) 12px; scroll-padding: 0 var(--gutter); scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.row-track::-webkit-scrollbar { display: none; }
.row-arrow {
  position: absolute; top: 40px; bottom: 18px; width: var(--gutter); min-width: 34px; z-index: 6;
  border: 0; background: rgba(11,11,15,.55); color: #fff; cursor: pointer; opacity: 0; transition: opacity .2s, background .2s;
  display: flex; align-items: center; justify-content: center;
}
.row-arrow svg { width: 30px; height: 30px; }
.row:hover .row-arrow { opacity: 1; }
.row-arrow:hover { background: rgba(11,11,15,.8); }
.row-arrow.left { left: 0; }
.row-arrow.right { right: 0; }
.row-arrow[disabled] { display: none; }

/* ---------------- Cards ---------------- */
.card {
  position: relative; flex: 0 0 calc((100% - 6 * 8px) / 7); scroll-snap-align: start;
  border-radius: var(--radius); cursor: pointer; transition: transform .25s ease, z-index 0s .25s;
  background: var(--surface);
}
.card .poster { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius); background: var(--surface-2); }
.card .card-badge { position: absolute; top: 8px; left: 8px; z-index: 2; }
.card .new-tag {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); background: var(--red); color: #fff;
  font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 3px 3px 0 0; letter-spacing: .4px; white-space: nowrap;
}
.card-hover {
  position: absolute; left: 0; right: 0; top: 100%; margin-top: -6px; padding: 12px;
  background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 14px 30px rgba(0,0,0,.6);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.card-hover .actions { display: flex; gap: 8px; margin-bottom: 10px; }
.card-hover .actions .spacer { flex: 1; }
.card-hover .round-btn { width: 32px; height: 32px; }
.card-hover .round-btn svg { width: 16px; height: 16px; }
.card-hover .title { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.card-hover .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: #ddd; margin-bottom: 6px; }
.card-hover .genres { font-size: 12px; }
@media (hover: hover) and (min-width: 900px) {
  .card:hover { transform: scale(1.18) translateY(-22px); z-index: 20; transition: transform .3s ease .35s, z-index 0s .35s; }
  .card:hover .card-hover { opacity: 1; pointer-events: auto; transition: opacity .2s ease .4s; }
  .card:hover .poster { border-radius: var(--radius) var(--radius) 0 0; }
  .row-track > .card:first-child:hover { transform-origin: left center; }
  .row-track > .card:last-child:hover { transform-origin: right center; }
}
.row-track:has(.card:hover) { padding-bottom: 150px; margin-bottom: -138px; }

/* landscape cards: Continue Watching, episodes */
.card.wide { flex-basis: calc((100% - 4 * 8px) / 5); }
.card.wide .poster { aspect-ratio: 16 / 9; }
.card .wide-label {
  position: absolute; left: 10px; right: 10px; bottom: 14px; font-weight: 800; font-size: 15px;
  text-shadow: 0 1px 8px rgba(0,0,0,.9); line-height: 1.2;
}
.card .wide-label small { display: block; font-weight: 600; font-size: 12px; color: #ddd; }
.progress { height: 3px; background: rgba(255,255,255,.3); border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--red); }
.card .progress { position: absolute; left: 0; right: 0; bottom: 0; }
.card .card-play-icon {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s;
}
.card .card-play-icon span { width: 46px; height: 46px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; }
.card .card-play-icon svg { width: 22px; height: 22px; }
.card.wide:hover .card-play-icon { opacity: 1; }

/* Top 10: big number + poster */
.card.top10 { flex-basis: calc((100% - 4 * 8px) / 5); display: flex; align-items: flex-end; background: none; }
.card.top10 .rank {
  font-size: clamp(90px, 10vw, 170px); font-weight: 900; line-height: .8; letter-spacing: -8px;
  color: var(--bg); -webkit-text-stroke: 3px #595959; flex: 0 0 48%; text-align: right; margin-right: -6%; user-select: none;
}
.card.top10 .poster-wrap { flex: 0 0 52%; position: relative; }
.card.top10 .card-hover { display: none; }
@media (hover: hover) and (min-width: 900px) { .card.top10:hover { transform: scale(1.06); } }

/* ---------------- Grid pages (Browse, Search, My List) ---------------- */
.page { padding: calc(var(--header-h) + 24px) var(--gutter) 60px; min-height: 70vh; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-bottom: 26px; }
.page-title { font-size: clamp(26px, 3vw, 38px); font-weight: 800; margin: 0; }
.select {
  background: #000; color: #fff; border: 1px solid #fff; padding: 6px 30px 6px 10px; font-size: 14px; font-family: inherit;
  appearance: none; -webkit-appearance: none; border-radius: 2px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 30px 10px; }
.grid .card { flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid #555; border-radius: 999px; padding: 6px 14px; font-size: 13px; background: transparent; color: #ddd; cursor: pointer;
}
.chip:hover, .chip.is-active { border-color: #fff; color: #fff; background: rgba(255,255,255,.08); }
.empty {
  text-align: center; padding: 60px 20px; color: var(--muted); max-width: 520px; margin: 0 auto;
}
.empty svg { width: 54px; height: 54px; color: #555; margin-bottom: 14px; }
.empty h2 { color: #fff; font-size: 22px; margin: 0 0 8px; }
.empty p { margin: 0 0 20px; }
.load-more { display: flex; justify-content: center; margin-top: 34px; }

/* search page */
.search-hero { display: flex; align-items: center; gap: 12px; background: #1f1f26; border: 1px solid #333; padding: 4px 14px; border-radius: 6px; margin-bottom: 26px; }
.search-hero svg { width: 22px; height: 22px; color: var(--muted); flex-shrink: 0; }
.search-hero input { flex: 1; background: transparent; border: 0; color: #fff; font-size: 18px; padding: 12px 0; outline: none; font-family: inherit; min-width: 0; }
.search-hero button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 22px; line-height: 1; }
.section-label { font-size: 18px; font-weight: 700; margin: 0 0 14px; color: #e5e5e5; }

/* ---------------- Detail (modal + page) ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.72); overflow-y: auto;
  display: flex; justify-content: center; padding: 32px 12px; animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(14px); } to { opacity: 1; transform: none; } }
.detail {
  position: relative; width: 100%; max-width: 900px; background: var(--bg-2); border-radius: 8px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.7); animation: pop .25s ease; align-self: flex-start;
}
.detail-page .detail { max-width: 1100px; margin: 0 auto; animation: none; }
.detail-close {
  position: absolute; top: 14px; right: 14px; z-index: 5; width: 38px; height: 38px; border-radius: 50%;
  background: #181818; border: 0; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.detail-close svg { width: 20px; height: 20px; }
.detail-hero { position: relative; aspect-ratio: 16 / 9; max-height: 500px; width: 100%; background-size: cover; background-position: center; }
.detail-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg-2) 0%, rgba(18,18,24,0) 55%); }
.detail-hero-content { position: absolute; z-index: 2; left: 48px; right: 48px; bottom: 36px; }
.detail-title { font-size: clamp(28px, 4.5vw, 52px); font-weight: 900; text-transform: uppercase; line-height: 1; margin: 0 0 18px; letter-spacing: -.5px; }
.detail-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-body { padding: 6px 48px 40px; }
.detail-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 15px; color: #ddd; }
.detail-desc { font-size: 15.5px; margin: 0 0 8px; }
.detail-tagline { font-style: italic; color: var(--muted); margin: 0 0 12px; }
.detail-side { font-size: 14px; color: var(--dim); }
.detail-side p { margin: 0 0 10px; }
.detail-side span { color: #ddd; }
.detail-side a { color: #ddd; }
.detail-side a:hover { text-decoration: underline; }
.resume-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-size: 14px; color: #ddd; max-width: 420px; }
.resume-bar .progress { flex: 1; border-radius: 2px; }
.section-h { font-size: 22px; font-weight: 700; margin: 34px 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.episode {
  display: grid; grid-template-columns: 34px 150px 1fr; gap: 16px; align-items: center; padding: 16px 14px;
  border-bottom: 1px solid var(--line); border-radius: 4px; cursor: pointer;
}
.episode:first-child { border-top: 1px solid var(--line); }
.episode:hover, .episode.is-current { background: #26262e; }
.episode .num { font-size: 22px; color: var(--muted); text-align: center; }
.episode .thumb { position: relative; border-radius: 4px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface-2); }
.episode .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.episode .thumb .progress { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 0; }
.episode .thumb .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.episode:hover .thumb .play { opacity: 1; }
.episode .thumb .play span { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #fff; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; }
.episode .thumb .play svg { width: 16px; height: 16px; }
.episode .ep-top { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; margin-bottom: 4px; }
.episode .ep-top span { color: #ddd; font-weight: 500; white-space: nowrap; }
.episode .ep-desc { font-size: 14px; color: var(--muted); margin: 0; }
.similar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.similar-grid .card { flex: none; }
.about p { margin: 0 0 8px; color: var(--dim); font-size: 14px; }
.about span { color: #ddd; }

/* ---------------- Account / Plans ---------------- */
.narrow { max-width: 860px; margin: 0 auto; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 18px; overflow: hidden; }
.panel-h { padding: 16px 22px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-row:last-child { border-bottom: 0; }
.panel-row .k { color: var(--muted); font-size: 14px; min-width: 130px; }
.panel-row .v { font-weight: 600; word-break: break-all; flex: 1; text-align: right; }
.panel-row .v-left { flex: 1; }
.link-btn { background: none; border: 0; color: #4ea8ff; cursor: pointer; font-size: 14px; padding: 0; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.inline-form { display: flex; gap: 8px; flex: 1; justify-content: flex-end; flex-wrap: wrap; }
.input {
  background: #0f0f14; border: 1px solid #444; color: #fff; border-radius: 5px; padding: 9px 12px; font-size: 15px; font-family: inherit; min-width: 0;
}
.input:focus { border-color: var(--gold); outline: none; }
.account-top { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.account-top .avatar { width: 64px; height: 64px; font-size: 26px; border-radius: 8px; }
.membership { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 10px; }
.plan {
  position: relative; background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 24px 22px 22px;
  display: flex; flex-direction: column; cursor: pointer; transition: border-color .15s, transform .15s;
}
.plan:hover { transform: translateY(-2px); }
.plan.is-selected { border-color: var(--red); }
.plan .tag { position: absolute; top: -12px; left: 22px; background: var(--gold); color: #111; font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; letter-spacing: .4px; }
.plan h3 { margin: 0 0 4px; font-size: 22px; }
.plan .price { font-size: 30px; font-weight: 900; margin: 8px 0 2px; }
.plan .price small { font-size: 14px; color: var(--muted); font-weight: 500; }
.plan .note { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 20px; flex: 1; }
.plan li { padding: 7px 0 7px 26px; position: relative; font-size: 14px; border-top: 1px solid var(--line); }
.plan li::before { content: '✓'; position: absolute; left: 4px; color: var(--green); font-weight: 900; }
.plan li.no::before { content: '—'; color: #555; }
.plan li.no { color: var(--dim); }
.compare { width: 100%; border-collapse: collapse; margin-top: 34px; font-size: 14px; }
.compare th, .compare td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: center; }
.compare th:first-child, .compare td:first-child { text-align: left; color: var(--muted); }
.compare thead th { color: #fff; font-size: 15px; }

/* ---------------- Toast / lock popup ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px); z-index: 200;
  background: #f4f4f5; color: #111; padding: 11px 20px; border-radius: 6px; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); opacity: 0; transition: all .25s; pointer-events: none; max-width: 90vw; text-align: center;
}
.toast.is-show { opacity: 1; transform: translateX(-50%); }
.lock-box { max-width: 460px; padding: 34px 30px 28px; text-align: center; align-self: center; }
.lock-box .lock-icon { width: 58px; height: 58px; border-radius: 50%; background: rgba(245,197,66,.14); color: var(--gold); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.lock-box .lock-icon svg { width: 28px; height: 28px; }
.lock-box h2 { margin: 0 0 8px; font-size: 24px; }
.lock-box p { color: var(--muted); margin: 0 0 20px; }
.lock-box .btn { width: 100%; margin-bottom: 10px; }

/* ---------------- Footer ---------------- */
.app-footer { padding: 40px var(--gutter) 50px; color: var(--dim); font-size: 13px; max-width: 1100px; margin: 0 auto; }
.app-footer .links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 22px; }
.app-footer a:hover { text-decoration: underline; }

/* ---------------- Skeleton / loading ---------------- */
.skeleton { background: linear-gradient(90deg, #1b1b22 25%, #24242c 50%, #1b1b22 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skeleton-row { display: flex; gap: 8px; padding: 0 var(--gutter); margin-bottom: 40px; overflow: hidden; }
.skeleton-row .skeleton { flex: 0 0 calc((100% - 6 * 8px) / 7); aspect-ratio: 2 / 3; }
.spinner { width: 46px; height: 46px; border: 4px solid rgba(255,255,255,.15); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-error { padding: calc(var(--header-h) + 60px) var(--gutter); }

/* ---------------- Profiles (header) ---------------- */
.kids-chip { background: linear-gradient(135deg, #ffd84d, #ff7a59); color: #1a1a1a; font-weight: 900; font-size: 12px; letter-spacing: 1px; padding: 3px 9px; border-radius: 4px; margin-left: -14px; }
img.avatar { background: none; }
.dropdown img.avatar { border-radius: 4px; }

/* ---------------- Who's watching ---------------- */
.who-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 90px 20px 60px; text-align: center; }
.who-logo { position: absolute; top: 18px; left: var(--gutter); }
.who-logo img { height: 42px; }
.who-title { font-size: clamp(30px, 4.5vw, 56px); font-weight: 600; margin: 0 0 28px; }
.who-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 2vw; margin-bottom: 50px; max-width: 980px; }
.who-item { width: clamp(90px, 10vw, 160px); background: none; border: 0; color: var(--muted); cursor: pointer; font-family: inherit; padding: 0; text-align: center; }
.who-item .pic { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: 6px; overflow: hidden; border: 3px solid transparent; transition: border-color .15s; }
.who-item .pic img { width: 100%; height: 100%; display: block; }
.who-item .name { display: block; margin-top: 10px; font-size: clamp(13px, 1.2vw, 18px); transition: color .15s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-item:hover .pic, .who-item:focus-visible .pic { border-color: #fff; }
.who-item:hover .name, .who-item:focus-visible .name { color: #fff; }
.who-item:focus-visible { outline: none; }
.who-item .kids-tag { position: absolute; left: 6px; bottom: 6px; font-size: 10px; font-weight: 900; background: #fff; color: #111; padding: 1px 6px; border-radius: 3px; }
.who-item .edit-mask { position: absolute; inset: 0; background: rgba(0,0,0,.55); display: none; align-items: center; justify-content: center; }
.who-item .edit-mask svg { width: 34%; height: 34%; color: #fff; }
.managing .who-item .edit-mask { display: flex; }
.who-add .pic { display: flex; align-items: center; justify-content: center; background: transparent; }
.who-add .pic svg { width: 46%; height: 46%; color: var(--muted); transition: color .15s; }
.who-add:hover .pic { background: rgba(255,255,255,.08); }
.who-add:hover .pic svg { color: #fff; }
.btn-manage { background: transparent; border: 1px solid #808080; color: #808080; padding: 9px 26px; font-size: clamp(14px, 1.2vw, 18px); letter-spacing: 2px; cursor: pointer; font-family: inherit; text-transform: uppercase; }
.btn-manage:hover { border-color: #fff; color: #fff; }
.btn-manage.is-done { background: #fff; color: #111; border-color: #fff; font-weight: 700; }
.edit-wrap { width: 100%; max-width: 620px; text-align: left; }
.edit-wrap h1 { font-size: clamp(28px, 4vw, 48px); font-weight: 600; margin: 0 0 6px; }
.edit-wrap .lead { color: var(--muted); margin: 0 0 22px; }
.edit-body { display: flex; gap: 22px; padding: 22px 0; border-top: 1px solid #333; border-bottom: 1px solid #333; }
.edit-body .big-avatar { width: 120px; height: 120px; border-radius: 6px; flex-shrink: 0; }
.edit-fields { flex: 1; min-width: 0; }
.edit-fields .input { width: 100%; font-size: 17px; padding: 10px 12px; background: #666; border-color: #666; }
.edit-fields .input:focus { background: #555; }
.field-error { color: #ff6b6b; font-size: 13px; margin-top: 6px; min-height: 18px; }
.avatar-pick { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.avatar-pick button { padding: 0; border: 3px solid transparent; border-radius: 6px; background: none; cursor: pointer; width: 54px; height: 54px; overflow: hidden; }
.avatar-pick button img { width: 100%; height: 100%; display: block; }
.avatar-pick button.is-on, .avatar-pick button:hover { border-color: #fff; }
.toggle-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 15px; cursor: pointer; }
.toggle-row input { width: 22px; height: 22px; accent-color: var(--red); }
.toggle-row small { display: block; color: var(--muted); }
.edit-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.edit-actions .btn { text-transform: uppercase; letter-spacing: 1.5px; font-size: 15px; padding: 10px 24px; border-radius: 0; }
.edit-actions .btn-white { background: #fff; color: #111; }
.edit-actions .btn-white:hover { background: var(--red); color: #fff; }
@media (max-width: 600px) {
  .who-grid { gap: 18px; }
  .who-item { width: 30vw; max-width: 120px; }
  .edit-body { flex-direction: column; align-items: center; }
}

/* ---------------- Public pages: Help, Terms, Privacy, Contact ---------------- */
.doc-body .tab-bar { display: none; }
.doc-body { padding-bottom: 0 !important; }
.doc-header { position: sticky; background: #0b0b0f !important; box-shadow: 0 1px 0 #222; }
.doc-nav { display: flex !important; }
.doc { max-width: 860px; margin: 0 auto; padding: 34px var(--gutter) 60px; }
.doc h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; margin: 0 0 6px; }
.doc .updated { color: var(--dim); font-size: 14px; margin: 0 0 26px; }
.doc h2 { font-size: 21px; margin: 34px 0 10px; scroll-margin-top: 90px; }
.doc h3 { font-size: 17px; margin: 22px 0 8px; }
.doc p, .doc li { color: #d4d4d8; font-size: 15.5px; line-height: 1.65; }
.doc ul { padding-left: 22px; }
.doc a { color: var(--gold); text-decoration: underline; }
.doc .lead { font-size: 17px; color: #e5e5e5; }
.doc .toc { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; margin: 0 0 10px; }
.doc .toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 30px; }
.doc .toc li { font-size: 14.5px; break-inside: avoid; }
.doc .note { background: rgba(245,197,66,.08); border: 1px solid rgba(245,197,66,.35); border-radius: 8px; padding: 12px 16px; font-size: 14px; color: #f3e3b0; }
.help-search { display: flex; align-items: center; gap: 10px; background: #1f1f26; border: 1px solid #333; border-radius: 8px; padding: 4px 14px; margin: 18px 0 26px; }
.help-search input { flex: 1; background: none; border: 0; color: #fff; font-size: 17px; padding: 12px 0; outline: none; font-family: inherit; }
.help-topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 10px; }
.help-topic { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; text-decoration: none !important; color: #fff !important; transition: border-color .15s; }
.help-topic:hover { border-color: var(--gold); }
.help-topic strong { display: block; margin-bottom: 4px; }
.help-topic span { color: var(--muted); font-size: 13.5px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 16px 30px 16px 0; font-weight: 700; font-size: 16px; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 4px; top: 12px; font-size: 24px; font-weight: 400; color: var(--muted); }
.faq details[open] summary::after { content: '−'; }
.faq details > div { padding: 0 0 16px; }
.faq details > div p { margin: 0 0 8px; }
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; align-items: start; }
.contact-form label { display: block; font-size: 14px; color: var(--muted); margin: 14px 0 6px; }
.contact-form .input, .contact-form select, .contact-form textarea { width: 100%; }
.contact-form textarea { min-height: 140px; resize: vertical; }
.contact-form select.input { appearance: auto; }
.contact-side { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; }
.contact-side p { font-size: 14.5px; }
.form-msg { margin-top: 14px; padding: 10px 14px; border-radius: 6px; font-size: 14px; }
.form-msg.ok { background: rgba(46,160,67,.15); border: 1px solid #2ea043; color: #d6ffe0; }
.form-msg.err { background: rgba(229,9,20,.15); border: 1px solid var(--red); color: #ffd6d8; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 900px) { .doc-nav { display: none !important; } }
@media (max-width: 700px) { .contact-grid { grid-template-columns: 1fr; } .doc .toc ol { columns: 1; } }

/* ---------------- Ratings (👎 / 👍 / 👍👍) ---------------- */
.rate-wrap { position: relative; display: inline-flex; }
.rate-pop {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%) scale(.9); z-index: 30;
  display: flex; gap: 4px; padding: 6px; background: #26262e; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.6);
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
}
.rate-wrap.is-open .rate-pop { opacity: 1; pointer-events: auto; transform: translateX(-50%) scale(1); }
@media (hover: hover) { .rate-wrap:hover .rate-pop { opacity: 1; pointer-events: auto; transform: translateX(-50%) scale(1); } }
.rate-pop button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.rate-pop button:hover { background: rgba(255,255,255,.12); transform: scale(1.12); }
.rate-pop button.on { color: var(--gold); }
.rate-pop button svg { width: 22px; height: 22px; }
.card-hover .rate-pop button { width: 32px; height: 32px; }
.card-hover .rate-pop button svg { width: 18px; height: 18px; }

/* ---------------- Hero silent preview ---------------- */
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1s ease; z-index: 1; background: #000; }
.hero-video.is-playing { opacity: 1; }
.hero::after { z-index: 1; }
.hero.is-previewing .hero-desc { opacity: 0; max-height: 0; margin: 0; transition: opacity .8s, max-height .8s, margin .8s; }
.hero-desc { transition: opacity .8s, max-height .8s; max-height: 6em; }
.hero-mute {
  position: absolute; right: var(--gutter); bottom: 22vh; z-index: 4; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.7); background: rgba(0,0,0,.35); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.hero-mute:hover { background: rgba(255,255,255,.15); }
.hero-mute svg { width: 22px; height: 22px; }

.playback-settings { padding: 20px 0 6px; border-bottom: 1px solid #333; }
.playback-settings h2 { font-size: 18px; margin: 0 0 6px; color: #e5e5e5; }
.playback-settings .toggle-row { margin: 12px 0; }
.data-usage { display: block; margin: 16px 0 10px; color: #ddd; font-size: 15px; }
.data-usage .input { display: block; margin-top: 8px; width: 100%; max-width: 420px; background: #1c1c22; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1400px) { .card { flex-basis: calc((100% - 5 * 8px) / 6); } .skeleton-row .skeleton { flex-basis: calc((100% - 5 * 8px) / 6); } }
@media (max-width: 1100px) {
  .card { flex-basis: calc((100% - 4 * 8px) / 5); } .card.wide, .card.top10 { flex-basis: calc((100% - 3 * 8px) / 4); }
  .skeleton-row .skeleton { flex-basis: calc((100% - 4 * 8px) / 5); }
  .main-nav { gap: 14px; }
}
@media (max-width: 900px) {
  :root { --header-h: 58px; }
  .main-nav { display: none; }
  .tab-bar { display: flex; }
  body.app { padding-bottom: 64px; }
  .card { flex-basis: calc((100% - 3 * 8px) / 4); }
  .card.wide, .card.top10 { flex-basis: calc((100% - 2 * 8px) / 3); }
  .skeleton-row .skeleton { flex-basis: calc((100% - 3 * 8px) / 4); }
  .row-arrow { display: none; }
  .row-more { opacity: 1; }
  .hero { height: 72vh; min-height: 460px; }
  .search-box { display: none; }
  .detail-hero-content { left: 22px; right: 22px; bottom: 20px; }
  .detail-body { padding: 6px 22px 30px; }
  .detail-cols { grid-template-columns: 1fr; gap: 6px; }
  .app-footer .links { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .app-logo img { height: 32px; }
  .card { flex-basis: calc((100% - 2 * 8px) / 3.2); }
  .card.wide { flex-basis: 62%; }
  .card.top10 { flex-basis: 46%; }
  .skeleton-row .skeleton { flex-basis: calc((100% - 2 * 8px) / 3.2); }
  .hero { height: 66vh; min-height: 420px; align-items: flex-end; }
  .hero-content { padding-bottom: 12vh; text-align: center; margin: 0 auto; }
  .hero-kicker, .hero-meta .dot-list, .hero-actions { justify-content: center; }
  .hero-desc { display: none; }
  .hero-dots { left: 50%; right: auto; transform: translateX(-50%); bottom: 6vh; }
  .rows { margin-top: -6vh; }
  .btn { padding: 9px 18px; font-size: 15px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 16px 8px; }
  .modal-backdrop { padding: 0; }
  .detail { border-radius: 0; min-height: 100vh; }
  .episode { grid-template-columns: 110px 1fr; gap: 12px; padding: 12px 6px; }
  .episode .num { display: none; }
  .episode .ep-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; }
  .similar-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .panel-row { padding: 12px 16px; }
  .panel-row .v { text-align: left; flex-basis: 100%; }
  .inline-form { justify-content: flex-start; }
  .search-box.is-open input { width: 140px; }
}

/* Long one-word titles (e.g. BOOTSTRAPPED) must never be cut off on small screens */
.hero-title, .detail-title { overflow-wrap: anywhere; hyphens: auto; }
@media (max-width: 600px) {
  .detail-title { font-size: clamp(24px, 8.5vw, 40px); }
  .hero-title { font-size: clamp(30px, 10vw, 48px); }
}
