/* AppaTV — change the look here. */
:root {
  --bg: #0d0d14;                       /* room colour: near-black with a hint of blue */
  --bg-2: #17171f;                     /* detail sheet */
  --bg-3: rgba(255, 255, 255, .07);    /* glass fill */
  --glass: rgba(255, 255, 255, .055);  /* tile fill */
  --glass-line: rgba(255, 255, 255, .12);
  --tile-opacity: .72;                 /* how see-through the artwork is until hovered */
  --text: #f3f4f6;
  --muted: #a4a6b0;
  --accent: #ffb020;       /* brand colour */
  --accent-ink: #111;      /* text on top of the brand colour */
  --radius: 10px;
  --gutter: 4vw;
  --card-w: clamp(150px, 19vw, 320px);
  --tile-gap: 12px;
  --poster-min-w: 148px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
html.christmas-layout { scrollbar-gutter: stable; }
html, body { margin: 0; color: var(--text); font-family: var(--font); }
/* Ambient background: a dark room with a pale haze along the floor. bg.js paints the spotlight and the dust. */
body::before { content: ""; position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(73% 22% at 16% 87%, rgba(159, 170, 166, .23), rgba(145, 154, 150, .075) 60%, transparent 100%),
    radial-gradient(85% 52% at 45% 117%, #2a292d 0%, transparent 91%),
    linear-gradient(112deg, #1b191d 0%, var(--bg) 57%, #0e1117 100%); }
body::after {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: url("background-sci-fi.jpg") 30% 65% / cover no-repeat;
  opacity: 0;
  transition: opacity .75s ease;
}
body.sci-fi-backdrop::after { opacity: .4; }
/* Fade in for 18s, hold for 60s, fade out for 18s, then wait 15s. */
body.home-backdrop::after { animation: home-earth 111s ease-in-out infinite; }
@keyframes home-earth {
  0%, 86.48648649%, 100% { opacity: 0; }
  16.21621622%, 70.27027027% { opacity: .28; }
}
#christmasScene {
  position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden;
  background: url("background-christmas.jpg") center / cover no-repeat;
  opacity: 0;
  transition: opacity .75s ease;
}
body.christmas-backdrop #christmasScene { opacity: .43; }
@media (max-aspect-ratio: 1/1) {
  #christmasScene { background-position: 86% center; }
}
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
body { min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.directional-focus :focus,
.directional-focus .avatar-choices input:focus + span {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #09090ee6;
}
.directional-focus #navLinks a:focus { outline-offset: -1px; }
.directional-focus #app :focus { scroll-margin-top: 76px; scroll-margin-bottom: 12px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ nav */
#nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20; height: 64px;
  display: flex; align-items: center; gap: 28px; padding: 0 var(--gutter);
  background: linear-gradient(#08080ca6, #0000); transition: background .3s;
}
#nav.solid { background: #0c0c1299; -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2); box-shadow: 0 1px 0 #ffffff14; }
.brand { font-weight: 900; font-size: 26px; letter-spacing: .04em; color: var(--accent); text-decoration: none; }
.brand span { color: var(--text); font-weight: 300; }
#navLinks { display: flex; gap: 26px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
#navLinks::-webkit-scrollbar { display: none; }
#navLinks a { color: #d6d8de; text-decoration: none; font-size: 15.4px; white-space: nowrap; padding: 6px 0; }
#navLinks a:hover { color: var(--muted); }
#navLinks a.on { color: #fff; font-weight: 700; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.search { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid transparent; border-radius: var(--radius); cursor: text; }
.search input { width: 0; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; outline: none; transition: width .25s; }
.search:focus-within, .search.open { border-color: #fff8; background: #000b; }
.search:focus-within input, .search.open input { width: min(46vw, 240px); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.icon-btn:hover { background: #ffffff1a; }
#ambientToggle[aria-pressed="true"] { color: var(--accent); }
#ambientToggle .ambient-on, #ambientToggle[data-enabled="true"] .ambient-off { display: none; }
#ambientToggle[data-enabled="true"] .ambient-on { display: initial; }
.icon-btn.spin svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------- hero */
/* The featured title is text only, so the background stays clean: just the light and the dust. */
.hero { position: relative; padding: clamp(110px, 16vh, 190px) var(--gutter) clamp(28px, 5vh, 56px); }
.hero-art, .hero video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  /* the artwork melts into the background instead of sitting on it as a hard block */
  -webkit-mask-image: radial-gradient(ellipse 58% 56% at 70% 42%, #000 22%, transparent 100%);
  mask-image: radial-gradient(ellipse 58% 56% at 70% 42%, #000 22%, transparent 100%); }
.hero-art { opacity: .7; }
.hero video { opacity: 0; transition: opacity 1s; }
.hero video.on { opacity: .8; }
.hero-body { position: relative; z-index: 2; width: min(560px, 100%); }
.hero-kicker { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.hero h1 { font-size: clamp(30px, 5.2vw, 68px); line-height: 1.02; margin: 0 0 14px; font-weight: 900; text-shadow: 0 2px 20px #000a; }
.hero p { font-size: clamp(14px, 1.3vw, 18px); line-height: 1.45; margin: 0 0 20px; color: #e6e7ea; text-shadow: 0 1px 8px #000;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 14px; color: #d6d8de; margin-bottom: 14px; }
.meta-line .pill { border: 1px solid #fff6; padding: 0 6px; border-radius: 3px; font-size: 12px; line-height: 18px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; border-radius: var(--radius); font-weight: 700; font-size: 16px; }
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: #ffffffe6; color: #111; }
.btn.primary:hover { background: #ffffffc4; }
.btn.primary svg { fill: currentColor; stroke: none; }
.btn.ghost { background: #ffffff24; color: #fff; border: 1px solid var(--glass-line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.btn.ghost:hover { background: #ffffff38; }
.btn.round { padding: 0; width: 42px; height: 42px; justify-content: center; border-radius: 50%; border: 2px solid #fff8; background: #ffffff1f; }
.btn.round:hover { border-color: #fff; }
.btn.round.on { border-color: var(--accent); color: var(--accent); }

/* ----------------------------------------------------------------- rows */
.rows { position: relative; z-index: 3; margin-top: 0; padding-bottom: 60px; }
.rows.flat { margin-top: 0; padding-top: 88px; }
.row { margin: 0 0 3vw; position: relative; }
.row h2 { margin: 0 var(--gutter) 10px; font-size: clamp(16px, 1.5vw, 22px); font-weight: 700; }
.row h2 small { color: var(--muted); font-weight: 400; font-size: .7em; margin-left: 8px; }
.strip { display: flex; gap: var(--tile-gap); overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 var(--gutter);
  padding: 14px var(--gutter) 22px; margin: -14px 0 -22px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip .card { flex: 0 0 var(--card-w); scroll-snap-align: start; }
.strip .portrait-card { flex-basis: clamp(132px, 10.5vw, 184px); }
.christmas-carousel {
  position: relative; margin: 0 var(--gutter);
}
.christmas-track {
  display: flex; align-items: flex-start; gap: var(--tile-gap); overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.christmas-track::-webkit-scrollbar { display: none; }
.christmas-track .card {
  flex: 0 0 var(--christmas-tile-width, var(--poster-min-w));
  min-width: 0; scroll-snap-align: start;
}
.christmas-track .card:focus { outline-offset: -3px; }
.christmas-carousel .btn {
  position: absolute; top: 50%; z-index: 6; transform: translateY(-50%);
  width: 34px; height: 34px; background: #14141bd9;
}
.christmas-carousel [data-christmas-step="-1"] { left: -17px; }
.christmas-carousel [data-christmas-step="1"] { right: -17px; }
@media (max-width: 620px) {
  .christmas-carousel [data-christmas-step="-1"] { left: -8px; }
  .christmas-carousel [data-christmas-step="1"] { right: -8px; }
}
.home-rows { container-type: inline-size; }
.home-rows .grid .card { min-width: 0; }
.home-rows .strip .card { min-width: 0; flex-basis: min(168px, calc((100vw - 2 * var(--gutter) - var(--tile-gap)) / 2)); }
/* Match the responsive portrait grid tracks, including the Adventure grid. */
@supports (width: calc(1px * round(down, calc(2px / 1px), 1))) {
  .home-rows .strip {
    --tile-space: calc(100cqw - 2 * var(--gutter));
    --tile-min: min(calc(.45 * var(--tile-space)), var(--poster-min-w));
    --tile-columns: max(1, round(down, calc((var(--tile-space) + var(--tile-gap)) / (var(--tile-min) + var(--tile-gap))), 1));
    --tile-width: calc((var(--tile-space) - (var(--tile-columns) - 1) * var(--tile-gap)) / var(--tile-columns));
  }
  .home-rows .strip .card { flex-basis: var(--tile-width); }
}
.arrow { position: absolute; top: 44px; bottom: 54px; width: var(--gutter); min-width: 34px; z-index: 5; display: grid; place-items: center;
  background: linear-gradient(90deg, #0d0d14cc, #0d0d1400); opacity: 0; transition: opacity .2s; }
.arrow.right { background: linear-gradient(270deg, #0d0d14cc, #0d0d1400); }
.arrow.left { left: 0; } .arrow.right { right: 0; }
.row:hover .arrow { opacity: 1; }
.arrow svg { width: 30px; height: 30px; }
@media (hover: none) { .arrow { display: none; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 220px), 1fr)); align-items: start; gap: 22px var(--tile-gap); padding: 0 var(--gutter); }
.portrait-grid { grid-template-columns: repeat(auto-fill, minmax(min(45%, var(--poster-min-w)), 1fr)); }
.grid:not(.portrait-grid) .portrait-card { width: 100%; max-width: 190px; }
.page-title { margin: 0 var(--gutter) 22px; font-size: clamp(22px, 2.4vw, 34px); }
.genre-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0 var(--gutter) 22px; }
.genre-heading .page-title { margin: 0; }
.genre-sort { display: flex; flex-wrap: wrap; gap: 4px; }
.genre-sort button { padding: 6px 9px; border: 1px solid transparent; border-radius: 6px; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.genre-sort button:hover { background: var(--glass); color: var(--text); }
.genre-sort button[aria-pressed="true"] { color: var(--accent); background: #ffb02016; border-color: #ffb02035; }
.genre-back { display: inline-flex; align-items: center; gap: 5px; margin: 0 var(--gutter) 12px; color: var(--text); text-decoration: none; font-size: 14px; }
.genre-back:hover { text-decoration: underline; }
.genre-back svg { width: 18px; height: 18px; }
.empty { padding: 60px var(--gutter); color: var(--muted); line-height: 1.6; max-width: 720px; }
.empty code { background: #ffffff1a; padding: 2px 6px; border-radius: 4px; color: var(--text); }
.loading { padding: 40vh 0; text-align: center; color: var(--muted); }

/* ----------------------------------------------------------------- card */
.book-cover {
  background: linear-gradient(110deg, #362013, #744a2c 42%, #49301d) !important;
  box-shadow: inset 5px 0 0 #0005, inset 8px 0 0 #fff2;
}
.book-cover img { object-fit: contain; }
.book-cover-text {
  display: grid; height: 100%; place-items: center; padding: 14px; text-align: center;
  color: #fff0c6; font: 700 clamp(15px, 2vw, 23px) "Baskervville", Georgia, serif;
}
#bookReader {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 50% 35%, #463122, #161319 76%);
}
.book-toolbar {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 12px; padding: 12px var(--gutter); color: #fff6e1;
}
.book-toolbar h2, .book-toolbar p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-toolbar h2 { font: 700 clamp(17px, 2vw, 26px) "Baskervville", Georgia, serif; }
.book-toolbar p, #bookPage { color: #e0ccb6; font-size: 13px; }
.book-reading-area {
  flex: 1; min-height: 0; display: grid; grid-template-columns: auto minmax(0, 1100px) auto;
  justify-content: center; align-items: center; gap: 14px; padding: 0 3vw 24px;
}
.book-hardcover {
  height: 100%; min-height: 0; padding: 9px 10px 12px; border-radius: 11px;
  background: linear-gradient(90deg, #43251a, #785139 48%, #4c2b1d 51%, #543020);
  border: 1px solid #ad7a55; box-shadow: 0 12px 45px #0009;
}
.book-paper {
  --book-columns: 2; --book-gap: clamp(42px, 7vw, 100px);
  height: 100%; padding: clamp(15px, 3vh, 35px) clamp(18px, 4vw, 62px);
  border-radius: 6px; color: #292018; box-shadow: 0 3px 0 #a58b68, 0 6px 0 #d7c29b;
  background: linear-gradient(90deg, #e4d0a8, #faf2de 5%, #faf2de 46%, #d9c19b 49.6%, #b89a76 50%, #dfc8a4 50.6%, #faf2de 54%, #faf2de 95%, #e4d0a8);
}
.book-clip { width: 100%; height: 100%; overflow: hidden; touch-action: pan-y; }
.book-flow {
  width: 100%; height: 100%; column-count: var(--book-columns); column-gap: var(--book-gap); column-fill: auto;
  font: clamp(15px, 1.5vw, 21px)/1.52 "Baskervville", Georgia, serif;
  overflow-wrap: anywhere; hyphens: auto;
}
.book-flow p { margin: 0 0 .6em; orphans: 2; widows: 2; }
.book-flow p + p { text-indent: 1.15em; }
.book-flow h1, .book-flow h2, .book-flow h3, .book-flow h4 {
  margin: .7em 0 .55em; line-height: 1.19; break-after: avoid; font-family: inherit;
}
.book-flow img { display: block; max-width: 100%; max-height: 60vh; object-fit: contain; margin: .5em auto; break-inside: avoid; }
.book-reading-area button:disabled { opacity: .3; cursor: default; }
@media (max-width: 760px) {
  .book-paper { --book-columns: 1; --book-gap: 22px; background: linear-gradient(90deg, #dfc9a2, #faf2de 9%, #faf2de 93%, #e3cfa9); }
  .book-reading-area { gap: 6px; padding: 0 7px 12px; }
  .book-reading-area .btn { width: 30px; height: 36px; }
  .book-hardcover { padding: 5px 6px 9px; }
  .book-paper { padding-inline: 15px; }
}
.card { cursor: pointer; outline: none; position: relative; padding: 6px 6px 10px; border-radius: calc(var(--radius) + 6px);
  background: var(--glass); border: 1px solid var(--glass-line); box-shadow: inset 0 1px 0 #ffffff14;
  transition: transform .25s ease, background .25s, border-color .25s, box-shadow .25s; }
.card .thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--bg-3); }
.card.portrait-card .thumb, .home-rows .card .thumb { aspect-ratio: 2 / 3; }
.card .thumb img, .card .fallback { opacity: var(--tile-opacity); filter: saturate(.8); transition: opacity .25s, filter .25s; }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .poster-art img { object-fit: contain; }
.home-rows .card:not(.portrait-card) img { object-fit: contain; }
.card .fallback { position: absolute; inset: 0; display: none; align-items: flex-end; padding: 10px 12px; font-weight: 800; font-size: 18px; line-height: 1.1; text-shadow: 0 1px 6px #0008; }
.card .thumb.noimg img { display: none; }
.card .thumb.noimg .fallback { display: flex; }
.card .badge { position: absolute; top: 8px; left: 8px; font-size: 10px; letter-spacing: .1em; font-weight: 700; text-transform: uppercase;
  background: #000b; padding: 3px 6px; border-radius: 3px; }
.card .play { position: absolute; inset: 0; display: grid; place-items: center; background: #0d0d144d; opacity: 0; transition: opacity .2s; }
.card .play span { width: 46px; height: 46px; border-radius: 50%; background: #ffffffe0; color: #111; display: grid; place-items: center; }
.card .play svg { fill: currentColor; stroke: none; width: 20px; height: 20px; margin-left: 2px; }
.card .bar { position: absolute; left: 8px; right: 8px; bottom: 6px; height: 3px; background: #fff5; border-radius: 2px; overflow: hidden; }
.card .bar i { display: block; height: 100%; background: var(--accent); }
.card .info { padding: 9px 6px 0; }
.home-rows .card .info { height: 42px; }
.genre-card { text-align: left; }
.genre-card .thumb, .genre-card .info, .genre-card .name, .genre-card .sub { display: block; }
.card .name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.genre-card .name { white-space: normal; overflow-wrap: anywhere; }
.home-rows .genre-card .name { white-space: nowrap; }
.card .sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) {
  .card:hover, .card:focus-visible { transform: scale(1.06); z-index: 4; background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3);
    box-shadow: inset 0 1px 0 #ffffff30, 0 14px 40px #00000099; }
  .card:hover .play, .card:focus-visible .play { opacity: 1; }
  .card:hover .thumb img, .card:focus-visible .thumb img, .card:hover .fallback, .card:focus-visible .fallback { opacity: 1; filter: none; }
}
.card:focus-visible { border-color: var(--accent); }
.card:active .thumb img { opacity: 1; filter: none; }

/* --------------------------------------------------------------- detail */
.overlay { position: fixed; inset: 0; z-index: 40; background: #08080cb8; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); overflow-y: auto; padding: 4vh 12px 6vh; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: relative; max-width: 900px; margin: 0 auto; background: var(--bg-2); border: 1px solid var(--glass-line); border-radius: 16px; overflow: hidden; box-shadow: 0 20px 80px #000; animation: rise .25s; }
@keyframes rise { from { transform: translateY(24px) scale(.98); opacity: 0; } }
.d-art { position: relative; aspect-ratio: 16 / 9; background: var(--bg-3); max-height: 62vh; width: 100%; }
.d-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.d-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg-2) 0%, transparent 45%); }
.d-art .d-head { position: absolute; z-index: 2; left: 5%; right: 5%; bottom: 8%; }
.d-art h2 { font-size: clamp(24px, 4vw, 46px); margin: 0 0 16px; font-weight: 900; text-shadow: 0 2px 16px #000; }
.d-close { position: absolute; z-index: 3; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%; background: #111c; display: grid; place-items: center; }
.d-body { padding: 6px 5% 34px; }
.d-body p { line-height: 1.55; color: #e1e3e8; max-width: 640px; margin: 0 0 8px; }
.d-file { color: var(--muted); font-size: 12px; margin-top: 10px; }
.d-sec { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 8px; gap: 12px; }
.d-sec h3 { margin: 0; font-size: 20px; }
.d-sec select { background: #26262f; color: var(--text); border: 1px solid #fff3; border-radius: var(--radius); padding: 8px 12px; font: inherit; }
.ep { display: grid; grid-template-columns: 28px 150px 1fr auto; gap: 14px; align-items: center; padding: 14px 10px; border-top: 1px solid #ffffff14; cursor: pointer; border-radius: var(--radius); }
.ep:hover, .ep:focus-visible { background: var(--bg-3); }
.ep .n { color: var(--muted); font-size: 20px; text-align: center; }
.ep .t { position: relative; aspect-ratio: 16/9; border-radius: 4px; overflow: hidden; background: var(--bg-3); }
.ep .t img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep .t .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #fff4; }
.ep .t .bar i { display: block; height: 100%; background: var(--accent); }
.ep b { font-size: 15px; }
.ep .dur { color: var(--muted); font-size: 14px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 14px; }
.photos button { padding: 0; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--bg-3); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.photos button:hover img { transform: scale(1.06); }
@media (max-width: 560px) { .ep { grid-template-columns: 110px 1fr; } .ep .n, .ep .dur { display: none; } }

/* --------------------------------------------------------------- player */
#player { position: fixed; inset: 0; z-index: 60; background: #000; user-select: none; -webkit-user-select: none; }
#player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
#player.idle { cursor: none; }
.p-top, .p-bottom { position: absolute; left: 0; right: 0; padding: 18px 3vw; transition: opacity .25s; z-index: 3; }
.p-top { top: 0; display: flex; align-items: center; gap: 14px; background: linear-gradient(#000b, #0000); padding-bottom: 50px; }
.p-bottom { bottom: 0; background: linear-gradient(#0000, #000d); padding-top: 60px; }
#player.idle .p-top, #player.idle .p-bottom, #player.idle .p-center { opacity: 0; pointer-events: none; }
.p-watch-check { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: #000c; }
.p-watch-check > div { padding: 24px; border: 1px solid var(--glass-line); border-radius: 16px; background: #17171f; }
.p-watch-check h2 { margin: 0 0 16px; }
.p-watch-check .btns { display: flex; flex-wrap: wrap; gap: 10px; }
#player.checking-watch .p-top, #player.checking-watch .p-bottom, #player.checking-watch .p-center { display: none; }
.p-title b { display: block; font-size: 18px; }
.p-title span { font-size: 13px; color: #d0d2d8; }
.p-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; flex: none; }
.p-btn:hover { background: #ffffff24; }
.p-btn svg { width: 26px; height: 26px; }
.p-btn svg text { font: 700 7.5px var(--font); fill: currentColor; stroke: none; text-anchor: middle; }
.p-btn svg.fill { fill: currentColor; stroke: none; }
.p-btn.p-text { width: auto; padding: 0 14px; border-radius: 22px; font-weight: 700; font-size: 14px; }
.p-btn.p-text.on { color: var(--accent); }
.p-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.p-grow { flex: 1; }
.p-time { font-size: 14px; font-variant-numeric: tabular-nums; margin-left: 8px; white-space: nowrap; }
#pVol { width: 90px; accent-color: var(--accent); }
.p-seek { position: relative; height: 22px; cursor: pointer; touch-action: none; }
.p-track { position: absolute; left: 0; right: 0; top: 9px; height: 4px; background: #fff3; border-radius: 2px; overflow: hidden; transition: transform .15s; }
.p-seek:hover .p-track { transform: scaleY(1.6); }
.p-track i, .p-track b { position: absolute; left: 0; top: 0; bottom: 0; width: 0; }
.p-track i { background: #fff5; } .p-track b { background: var(--accent); }
.p-knob { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--accent); left: 0; }
.p-tip { position: absolute; bottom: 26px; transform: translateX(-50%); background: #000d; padding: 4px 8px; border-radius: 4px; font-size: 13px; font-variant-numeric: tabular-nums; }
.p-center { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; }
.p-spinner { position: absolute; z-index: 2; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px; border: 4px solid #fff3; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; pointer-events: none; }
.p-msg { position: absolute; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 520px; width: 86%; text-align: center; background: #000c; padding: 22px; border-radius: 10px; line-height: 1.5; }
video::cue { font-family: var(--font); background: #000a; }
@media (max-width: 640px) { #pVol, #pRew, #pFwd { display: none; } .p-btn.p-text { padding: 0 8px; } }

/* ------------------------------------------------------------- lightbox */
#lightbox { position: fixed; inset: 0; z-index: 70; background: #000; display: grid; place-items: center; }
#lightbox img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.lb-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 12px; padding: 14px 3vw 40px; background: linear-gradient(#000b, #0000); }
.lb-arrow { position: absolute; top: 50%; margin-top: -32px; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: #0008; }
.lb-arrow:hover { background: #fff3; }
.lb-arrow.left { left: 2vw; } .lb-arrow.right { right: 2vw; }
.lb-arrow svg { width: 30px; height: 30px; }

/* --------------------------------------------------------------- mobile */
@media (max-width: 720px) {
  .search:focus-within ~ #ambientToggle, .search.open ~ #ambientToggle { display: none; }
  #nav { gap: 14px; height: 56px; }
  .brand { font-size: 20px; }
  .hero-art, .hero video { -webkit-mask-image: linear-gradient(#000 35%, transparent 92%); mask-image: linear-gradient(#000 35%, transparent 92%); }
  .hero-art { opacity: .5; }
  :root { --card-w: 44vw; }
  .btn { padding: 9px 16px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, body::after { animation: none !important; transition: none !important; } }

/* Profiles */
.profile-switcher { position: relative; flex: none; }
.profile-trigger { display: flex; min-height: 44px; align-items: center; gap: 9px; padding: 4px; border-radius: var(--radius); font-size: 14px; font-weight: 700; }
.profile-trigger:hover, .profile-trigger[aria-expanded="true"] { background: var(--bg-3); }
.profile-trigger .profile-avatar { width: 34px; height: 34px; font-size: 16px; border-radius: 8px; }
.profile-trigger-name { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-trigger svg { width: 14px; height: 14px; color: var(--muted); }
.profile-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
#profileMenu { position: absolute; top: calc(100% + 9px); right: 0; width: min(292px, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100vh - 70px); overflow: auto; padding: 14px; background: var(--bg-2); border: 1px solid var(--glass-line);
  border-radius: 14px; box-shadow: 0 16px 45px #0009; }
#profileMenuHeading { margin: 0 6px 10px; font-size: 16px; }
.profile-options { display: grid; gap: 4px; }
.profile-option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 8px;
  border: 1px solid transparent; border-radius: 9px; text-align: left; }
.profile-option:hover, .profile-option[aria-current="true"] { background: var(--glass); border-color: var(--glass-line); }
.profile-option .profile-avatar { width: 38px; height: 38px; border-radius: 8px; font-size: 18px; }
.profile-option-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.profile-option-copy small { display: block; color: var(--muted); font-size: 12px; }
.profile-option svg { width: 18px; height: 18px; color: var(--accent); }
#profileMenu .profile-actions { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--glass-line); }
#profileMenu .btn { font-size: 14px; padding: 8px 12px; }
#profileMenu .profile-error { margin: 10px 0 0; }
#profileDialog { width: min(620px, calc(100% - 24px)); max-height: 88vh; padding: 0; overflow: auto;
  color: var(--text); background: var(--bg-2); border: 1px solid var(--glass-line); border-radius: 18px; }
#profileDialog::backdrop { background: #09090ee6; backdrop-filter: blur(7px); }
.profile-panel { padding: clamp(18px, 4vw, 32px); }
.profile-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.profile-heading h2 { font-size: clamp(24px, 5vw, 36px); margin: 0; }
.profile-close { font-size: 26px; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(112px, 45%), 1fr)); gap: 12px; }
.profile-card { display: grid; gap: 6px; justify-items: center; padding: 12px 6px; border: 1px solid transparent; border-radius: 12px; font-weight: 700; }
.profile-card:hover, .profile-card[aria-current="true"] { background: var(--glass); border-color: var(--glass-line); }
.profile-card:focus-visible { border-color: var(--accent); }
.profile-avatar { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 12px;
  font-size: 26px; font-weight: 800; color: #fff; background: linear-gradient(145deg, #a47130, #684017); }
.profile-avatar[data-level="teen"] { background: linear-gradient(145deg, #507799, #2a405d); }
.profile-avatar[data-level="preteen"] { background: linear-gradient(145deg, #73864b, #3f4f2e); }
.profile-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.profile-card small, .profile-list small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.profile-list { list-style: none; margin: 0; padding: 0; }
.profile-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--glass-line); }
.profile-slot { display: flex; gap: 10px; align-items: center; min-width: 0; overflow-wrap: anywhere; }
.profile-slot .profile-avatar { width: 36px; height: 36px; border-radius: 8px; font-size: 16px; }
.profile-form { display: grid; gap: 14px; justify-items: start; }
.profile-form label { display: grid; gap: 6px; width: 100%; }
.profile-form input, .profile-form select { color: var(--text); background: #111117; border: 1px solid var(--glass-line); border-radius: 8px; padding: 10px; font: inherit; }
.profile-form p { margin: 0; color: var(--muted); }
.profile-access { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 0; border: 1px solid var(--glass-line); border-radius: 8px; }
.profile-form .profile-access label { display: flex; align-items: center; gap: 6px; width: auto; }
.profile-access input { accent-color: var(--accent); }
.profile-user { width: 100%; }
.profile-user summary { cursor: pointer; }
.profile-user form { margin-top: 10px; }
.avatar-picker { width: 100%; min-width: 0; margin: 0; padding: 0; border: 0; }
.avatar-picker legend { margin-bottom: 8px; padding: 0; }
.avatar-choices { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.avatar-choices label { position: relative; display: block; cursor: pointer; }
.avatar-choices input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.avatar-choices label > span { display: grid; gap: 4px; padding: 4px; border: 1px solid transparent; border-radius: 10px;
  color: var(--muted); text-align: center; font-size: 12px; }
.avatar-choices img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.avatar-choices label:hover > span { background: var(--glass); }
.avatar-choices input:checked + span { background: #ffb02018; border-color: var(--accent); color: var(--text); }
.avatar-choices input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.profile-error { color: #ffb4ad; }
.profile-panel > .btn { margin-top: 16px; }
@media (max-width: 900px) {
  .profile-trigger-name, .profile-trigger svg { display: none; }
}
@media (max-width: 560px) {
  #nav { gap: 9px; }
  .nav-right { gap: 3px; }
  .search:focus-within input, .search.open input { width: min(30vw, 160px); }
  .search:focus-within ~ #rescan, .search.open ~ #rescan { display: none; }
  .avatar-choices { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
