:root {
  color-scheme: dark;
  --background: #13171a;
  --surface: #1e2529;
  --line: #3b464b;
  --ink: #f8f5eb;
  --muted: #b7c1c2;
  --accent: #f4dd73;
  font: 16px/1.45 system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.shell { width: min(1020px, calc(100% - 48px)); min-height: 100dvh; margin: auto; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(26px, 6vw, 100px); align-items: center; }
.sidebar { align-self: start; padding: clamp(26px, 7vh, 72px) 0 24px; }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; font-size: 1.35rem; font-weight: 820; letter-spacing: -.04em; }
.brand span { color: var(--accent); font-size: 1.65rem; }
.intro { margin: 3rem 0 1.75rem; }
h1 { margin: 0; font-size: 2.7rem; letter-spacing: -.055em; line-height: .99; }
.intro p, .hint, details, #notice { color: var(--muted); }
.intro p { font-size: .92rem; }
nav { display: flex; gap: .4rem; }
nav button, .genres button { background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: .45rem .65rem; white-space: nowrap; }
nav button[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: #211e15; font-weight: 750; }
#count { margin-left: .15rem; font-variant-numeric: tabular-nums; }
.genres { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .9rem; }
.genres button { font-size: .78rem; color: var(--muted); }
.genres button[aria-pressed=true] { color: var(--ink); background: var(--surface); }
details { margin-top: 1.1rem; font-size: .78rem; }
summary { cursor: pointer; }
details img { display: block; height: auto; margin-top: .5rem; }
main { padding: 20px 0; min-width: 0; }
#viewer { display: grid; grid-template-columns: minmax(0, 440px) 44px; justify-content: center; gap: 12px; }
.card {
  position: relative; width: 100%; height: min(75dvh, 720px); min-height: 460px;
  display: flex; align-items: end; isolation: isolate; overflow: hidden;
  border: 1px solid var(--line); border-radius: 17px;
  background: #283439; touch-action: pan-x;
}
.poster, .shade { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.poster { object-fit: cover; }
.shade { background: linear-gradient(180deg, #101417a8, transparent 27%), linear-gradient(0deg, #101417 0%, #101417db 20%, transparent 66%); }
.topline { position: absolute; top: 1rem; inset-inline: 1rem; display: flex; justify-content: space-between; font-size: .78rem; font-weight: 700; }
.topline span { padding: .23rem .5rem; border-radius: 4px; background: #101417bf; }
#position { font-variant-numeric: tabular-nums; }
.play { position: absolute; top: 45%; left: 50%; translate: -50% -50%; display: grid; place-items: center; width: 66px; height: 66px; border: 0; border-radius: 50%; background: var(--accent); color: #211e15; font-size: 1.4rem; padding-left: .35rem; box-shadow: 0 3px 24px #1119; }
.info { min-width: 0; padding: 20px 82px 20px 20px; }
.meta { color: var(--accent); font-size: .8rem; font-weight: 700; margin: 0 0 .35rem; }
.info h2 { margin: 0; font-size: clamp(1.65rem, 3.8vw, 2.6rem); letter-spacing: -.045em; line-height: 1.02; text-wrap: balance; overflow-wrap: anywhere; }
.description { color: #eee9de; margin: .5rem 0 0; font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.actions { position: absolute; right: 10px; bottom: 16px; display: grid; gap: .45rem; }
.actions button { display: grid; place-items: center; width: 60px; min-height: 53px; border: 1px solid #e6eced3b; border-radius: 8px; background: #13171ad9; line-height: 1; }
.actions span { font-size: 1.35rem; }
.actions small { font-size: .61rem; }
.actions button[aria-pressed=true] { color: var(--accent); border-color: var(--accent); }
.rail { display: grid; align-content: center; gap: .45rem; }
.rail button, .player-links button, .player-links a { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 7px; padding: .5rem; text-decoration: none; }
.rail button { width: 44px; height: 44px; }
.rail button:disabled { opacity: .35; cursor: default; }
.hint { grid-column: 1; margin: 0; text-align: center; font-size: .75rem; }
.player { position: absolute; inset-inline: 0; top: 43%; translate: 0 -50%; z-index: 1; }
#frame { aspect-ratio: 16 / 9; min-height: 200px; background: #000; }
iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-links { display: flex; justify-content: space-between; padding: .35rem; background: #13171ae6; font-size: .72rem; }
@media (max-width: 680px) {
  .shell { display: block; width: min(460px, calc(100% - 16px)); }
  .sidebar { position: relative; padding: 6px 4px; }
  .brand { font-size: 1.15rem; }
  .intro { display: none; }
  nav { position: absolute; right: 4px; top: 8px; }
  nav button { font-size: .76rem; padding: .35rem .45rem; }
  .genres { flex-wrap: nowrap; overflow-x: auto; margin-top: .4rem; padding: 2px; scrollbar-width: thin; }
  details { margin-top: .3rem; }
  main { padding: 5px 0; }
  #viewer { grid-template-columns: minmax(0, 1fr) 34px; gap: 5px; }
  .card { height: calc(100dvh - 138px); min-height: 420px; border-radius: 11px; }
  .rail button { width: 34px; height: 40px; }
  .info { padding: 13px 62px 13px 12px; }
  .actions { right: 6px; bottom: 9px; }
  .actions button { width: 48px; }
}

.settings { display: flex; gap: .45rem; margin-bottom: .7rem; }
.settings button, select, dialog button {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; padding: .43rem .65rem; font: inherit;
}
.preview { color: var(--accent); font-size: .76rem; margin-top: .3rem; }
body.dev { --background: #181927; --surface: #292b40; --line: #4d4d66; --accent: #b5d9ff; }
.hint { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem .7rem; }
.hint input { accent-color: var(--accent); }
.card.playing .poster { filter: brightness(.48); }
.player { top: 42%; }
dialog { width: min(420px, calc(100% - 28px)); padding: 1.1rem; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; }
dialog::backdrop { background: #080a0be6; }
.dialog-title { display: flex; justify-content: space-between; align-items: center; }
.dialog-title h2 { margin: 0; font-size: 1.35rem; }
#auth-form label { display: grid; gap: .25rem; margin-top: .65rem; }
#auth-form input { width: 100%; font: inherit; padding: .55rem; color: var(--ink); background: var(--background); border: 1px solid var(--line); border-radius: 5px; }
.auth-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.auth-actions button:first-child { background: var(--accent); color: #21212b; border-color: var(--accent); font-weight: 740; }
#auth-hint, #auth-status { color: var(--muted); font-size: .87rem; }
@media (max-width: 680px) {
  .settings { margin: .45rem 0 0; }
  .settings button, select { padding: .25rem .45rem; font-size: .76rem; }
  .card { height: calc(100dvh - 169px); }
  .actions small { font-size: .53rem; }
}
.embed-notice { height: 100%; margin: 0; display: grid; place-items: center; padding: 1rem; text-align: center; color: var(--muted); }

/* The trailer is the focal point. Navigation sits beside it or below it. */
:root { --background:#111016; --surface:#211e29; --accent:#ffb398; --line:#4c424e; }
.shell { grid-template-columns: minmax(180px, 245px) minmax(0, 1fr); }
.sidebar { padding-top: clamp(32px, 12vh, 130px); }
.intro { margin: 2rem 0 1.5rem; }
.navigation { display:grid; gap:.4rem; }
.navigation button { display:flex; align-items:center; gap:.7rem; text-align:left; padding:.65rem .8rem; }
.navigation b { font-size:1.2rem; line-height:1; }
.count { margin-left:auto; font-size:.72em; }
#viewer { grid-template-columns:minmax(0, 440px); }
.card { height:min(82dvh, 790px); border-radius:22px; background:#1b1923; color:#fff8f5; }
.card .info { padding-right:88px; }
.actions { bottom:24px; right:12px; gap:.8rem; }
.actions button { border:0; border-radius:50%; width:52px; min-height:52px; background:#171218cf; }
.actions button[aria-pressed=true] { color:#ff7d9c; }
.actions small { display:none; }
.actions span { font-size:1.85rem; }
#settings-dialog > label { display:flex; justify-content:space-between; align-items:center; margin:.85rem 0; }
#settings-dialog > button, #legacy { margin:.4rem .3rem .2rem 0; }
.rotate-note { display:none; }
#load-more { background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:.55rem; }
.card.shift { animation:card-shift .21s ease-out; }
@keyframes card-shift { from { opacity:.62; transform:translateY(var(--slide, 14px)); } }
@media (prefers-reduced-motion: reduce) { .card.shift { animation:none; } }
html[data-theme="light"] { color-scheme:light; --background:#fff7f3; --surface:#ffeae1; --ink:#2b1d2b; --muted:#594752; --line:#c7aaa8; --accent:#a83e50; }
html[data-theme="light"] nav button[aria-pressed=true], html[data-theme="light"] .play { color:#fff; }
@media (max-width:680px) {
  .shell { width:100%; }
  .sidebar { padding:8px 14px; }
  .sidebar details { display:none; }
  main { padding:0 0 calc(62px + env(safe-area-inset-bottom)); }
  #viewer { display:block; }
  .card { border-radius:0; border-inline:0; height:calc(100dvh - 111px - env(safe-area-inset-bottom)); min-height:300px; }
  .navigation { position:fixed; inset:auto 0 0; z-index:3; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; background:var(--background); padding:4px 4px calc(4px + env(safe-area-inset-bottom)); border-top:1px solid var(--line); }
  .navigation button { padding:.35rem .1rem; flex-direction:column; justify-content:center; gap:.22rem; font-size:.7rem; white-space:normal; text-align:center; }
  .count { display:none; }
  .card .info { padding-right:76px; }
  .actions { bottom:16px; right:10px; }
  .rotate-note { display:block; align-self:center; margin-right:.25rem; }
  #load-more { width:100%; }
}
@media (max-width:1000px) and (orientation:landscape) and (pointer:coarse) {
  .shell { display:block; width:100%; }
  .card { height:calc(100dvh - 70px); min-height:230px; }
  .card.playing .player { width:min(65vw, 58dvh * 1.77); left:19%; top:50%; }
  .card.playing .info { max-width:24%; }
  .rotate-note { display:none; }
}
@media (min-width:1400px) {
  .shell { width:min(1250px, calc(100% - 80px)); gap:110px; }
  #viewer { grid-template-columns:minmax(0, 510px); }
  .navigation button { min-height:52px; }
  .actions button { width:59px; min-height:59px; }
}
body.locked .navigation, body.locked main { display:none; }
body.locked .sidebar { grid-column:1 / -1; }
@media (max-width:680px) { #settings-dialog { margin-bottom:calc(66px + env(safe-area-inset-bottom)); } }
.brand .brand-name { color:var(--ink); font-size:inherit; }

.navigation button,
.navigation button[aria-pressed="true"],
html[data-theme="light"] .navigation button[aria-pressed="true"] {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-weight: 500;
}
.navigation button[aria-pressed="true"],
html[data-theme="light"] .navigation button[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 700;
}
.navigation button[aria-pressed="true"] svg { color: var(--accent); }
.navigation button:disabled { opacity: .48; }
.navigation button svg {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (min-width:681px) {
  .sidebar .brand { padding-inline: calc(.8rem + 1px); gap: .7rem; }
  .sidebar .brand > [aria-hidden] { flex: 0 0 22px; text-align: center; }
}
#position:empty { display: none; }
#feed-progress {
  position: absolute;
  top: 12px;
  right: 14px;
  margin: 0;
  padding: .25rem .6rem;
  background: #111016d9;
  border-radius: 12px;
  color: #fff8f5;
  font-size: .72rem;
}
@media (hover:hover) {
  .navigation button:not(:disabled):hover { background: var(--surface); }
}
@media (max-width:680px) {
  .navigation { padding-inline: 8px; }
  .navigation button { min-height: 47px; padding-block: .25rem; }
}

/* Settings, genres and details share the same panel and row rhythm. */
dialog {
  width: min(430px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 20px;
  border-color: var(--line);
  border-radius: 20px;
  box-shadow: 0 18px 56px #0006;
}
dialog:focus { outline: none; }
.dialog-title { min-height: 42px; margin-bottom: 12px; gap: 12px; }
.dialog-title h2 { letter-spacing: -.03em; overflow-wrap: anywhere; }
.dialog-title button {
  width: 36px;
  height: 36px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  font-size: 1.3rem;
}
.settings-group { border-top: 1px solid var(--line); }
.setting-row {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  padding: .35rem .05rem;
  font-size: .92rem;
}
.setting-row + .setting-row { border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent); }
.setting-row select { min-width: 112px; max-width: 52%; padding: .35rem .5rem; font-size: .83rem; }
.setting-row input[type="checkbox"] {
  appearance: none;
  flex: none;
  width: 42px;
  height: 24px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--background);
  cursor: pointer;
}
.setting-row input[type="checkbox"]::before {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  margin: 3px;
  border-radius: 50%;
  background: var(--muted);
}
.setting-row input:checked { border-color: var(--accent); }
.setting-row input:checked::before { translate: 18px; background: var(--accent); }
.setting-row input:focus-visible, .setting-row select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button.setting-row { width: 100%; border: 0; border-radius: 0; background: transparent; text-align: left; }
.setting-arrow { color: var(--muted); font-size: 1.05rem; }
#genres-dialog .genres { gap: .45rem; }
#genres-dialog .genres button { padding: .55rem .8rem; border-radius: 20px; }
#genres-dialog .genres button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
#auth #legacy { border: 0; color: var(--muted); padding-left: 0; background: transparent; font-size: .78rem; }
#auth-form input { min-height: 44px; }
@media (max-width:680px) {
  #settings-dialog, #genres-dialog, #details-dialog, #about-dialog {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
}
#genres-dialog { width: min(525px, calc(100% - 32px)); }
.filter-section { border-top: 1px solid var(--line); padding: 12px 0; }
.filter-section h3 { margin: 0; font-size: .84rem; color: var(--muted); font-weight: 650; }
#genres-dialog .filter-section .genres { margin-top: .55rem; flex-wrap: wrap; overflow: visible; }
.filter-footer {
  display: flex;
  justify-content: flex-end;
  gap: .55rem;
  position: sticky;
  bottom: -20px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 12px 0 4px;
}
#apply-filters { color: var(--background); background: var(--accent); border-color: transparent; font-weight: 700; }
@media (max-width:680px) {
  #genres-dialog { width: 100%; max-height: 78dvh; }
}

.watch-brand { display: none; }
.player-links {
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .35rem .55rem;
  padding: .45rem .65rem;
}
.player-links button, .player-links a {
  background: transparent;
  border-color: transparent;
  padding: .32rem .3rem;
}
.player-links svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.volume-control, #wide {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.volume-control { margin-right: auto; }
.volume-control input { width: clamp(42px, 15vw, 85px); accent-color: var(--accent); }
#rotate-prompt { margin: 0; padding: .4rem .65rem; background: #17141c; color: #fff8f5; font-size: .75rem; }
.wide-player .shell { width: min(1380px, calc(100% - 48px)); gap: clamp(16px, 4vw, 64px); }
.wide-player #viewer { grid-template-columns: minmax(0, 940px); }
.wide-player .card {
  display: grid;
  grid-template-areas: "header" "video" "caption";
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(200px, auto) auto;
  align-content: center;
  height: auto;
  min-height: 0;
  color: var(--ink);
  background: var(--surface);
  animation: wide-enter .25s ease-out;
}
.wide-player .card .poster { grid-area: video; position: static; z-index: 0; aspect-ratio: 16/9; }
.wide-player .card.playing .poster, .wide-player .shade, .wide-player .topline .label { display: none; }
.wide-player .watch-brand { display: inline-flex; align-items: center; gap: .36rem; color: var(--accent); }
.wide-player .topline {
  grid-area: header;
  position: static;
  inset: auto;
  padding: .4rem .75rem;
}
.wide-player .topline span { background: transparent; }
.wide-player .play { z-index: 1; }
.wide-player .card .info { grid-area: caption; padding: .65rem 116px .8rem .85rem; max-width: none; }
.wide-player .info h2 { font-size: clamp(1.25rem, 3vw, 1.9rem); text-wrap: wrap; }
.wide-player .description { color: var(--muted); -webkit-line-clamp: 2; }
.wide-player .actions { right: 9px; bottom: 9px; display: flex; gap: .35rem; }
.wide-player .actions button { width: 42px; min-height: 42px; color: #fff8f5; }
.wide-player .actions button[aria-pressed=true] { color: #ff7d9c; }
@keyframes wide-enter { from { opacity: .7; transform: translateY(6px); } }
@media (orientation: landscape) and (max-height: 600px) and (pointer: coarse) {
  .wide-player .shell { width: 100%; display: block; }
  .wide-player .sidebar { padding: 0; }
  .wide-player .sidebar > :not(nav) { display: none; }
  .wide-player .navigation { position: static; display: flex; justify-content: center; border: 0; }
  .wide-player .navigation button { flex-direction: row; min-height: 36px; font-size: .75rem; padding: .25rem .45rem; }
  .wide-player .navigation svg { width: 17px; height: 17px; }
  .wide-player main { padding: 0 8px 8px; }
  .wide-player .card { max-width: min(100%, calc(68dvh * 1.7778)); margin: 0 auto; border-radius: 12px; }
  .wide-player .card .info { padding-bottom: .45rem; }
}
@media (prefers-reduced-motion: reduce) { .wide-player .card { animation: none; } }
@media (orientation: landscape) and (max-height: 600px) and (pointer: coarse) {
  .wide-player .card { max-width: min(100%, max(356px, calc((100dvh - 145px) * 1.7778))); }
  .wide-player .topline { padding-block: .2rem; }
  .wide-player .description { -webkit-line-clamp: 1; }
  .wide-player .card .info { padding-top: .35rem; }
}
#trailer-fallback { margin: .45rem 0 0; color: inherit; font-size: .78rem; }

.title-art.has-logo h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.title-logo {
  display: block;
  width: auto;
  max-width: min(100%, 290px);
  max-height: 72px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 1px 3px #000b) drop-shadow(0 0 1px #fff8);
}
.title-caption {
  display: flex;
  flex-wrap: wrap;
  gap: .1rem .45rem;
  margin-top: .32rem;
  color: #f3e9e2;
  font-size: .73rem;
  line-height: 1.35;
}
.title-caption span:empty { display: none; }
.title-caption span + span:not(:empty)::before { content: '·'; margin-right: .45rem; opacity: .6; }
.title-caption span:empty + span::before { content: none; }
.wide-player .title-logo { max-height: 58px; }
.wide-player .title-caption { color: var(--muted); }
@media (max-width:680px) { .title-logo { max-height: 60px; } }
@media (orientation:landscape) and (max-height:600px) and (pointer:coarse) { .wide-player .title-logo { max-height: 42px; } }

.setting-select { position: relative; width: min(48%, 160px); }
.setting-select .setting-select-trigger {
  width: 100%;
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .42rem .65rem .42rem .75rem;
  border-radius: 9px;
  background: var(--background);
  font-size: .84rem;
  text-align: left;
}
.setting-select-trigger span:first-child { overflow-wrap: anywhere; }
.setting-select-chevron {
  flex: 0 0 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: .75;
}
.setting-select-trigger[aria-expanded="true"] .setting-select-chevron { transform: translateY(2px) rotate(225deg); }
.setting-select-menu {
  position: absolute;
  top: calc(100% + 5px);
  inset-inline-end: 0;
  z-index: 3;
  width: max(100%, 136px);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 0 8px 24px #0005;
}
.setting-select-menu button {
  width: 100%;
  min-height: 37px;
  display: block;
  padding: .35rem .55rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: .83rem;
  text-align: left;
}
.setting-select-menu button[aria-selected="true"] { color: var(--accent); font-weight: 650; }
.setting-select-menu button:focus, .setting-select-menu button:hover { background: var(--background); outline: none; }
.player-links, .player-links button, .player-links a { color: #fff8f5; }

.about-intro { margin: 0 0 1rem; font-size: .92rem; }
.about-source { border-top: 1px solid var(--line); padding: .85rem 0; }
.about-source:last-child { padding-bottom: 0; }
.about-source h3 { margin: 0; font-size: .9rem; }
.about-source h3 a {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--ink);
  text-decoration: none;
  min-height: 28px;
}
.about-source h3 a:hover { text-decoration: underline; }
.about-source h3 img { display: block; height: auto; }
.about-source h3 span { color: var(--muted); }
.about-source p { margin: .35rem 0 0; color: var(--muted); font-size: .86rem; }
.about-source .about-credit { font-size: .74rem; }

.library-tabs {
  display: flex;
  gap: .35rem;
  max-width: 600px;
  margin: 0 auto .65rem;
  border-bottom: 1px solid var(--line);
}
.library-tabs button {
  min-height: 38px;
  padding: .35rem .55rem;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font-size: .82rem;
}
.library-tabs button[aria-pressed="true"] { border-bottom-color: var(--accent); color: var(--ink); }
#back-to-likes { margin-inline-start: auto; color: var(--ink); }
.likes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(136px,1fr));
  gap: .6rem;
  max-width: 600px;
  margin: 0 auto;
}
.likes-grid button {
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  text-align: start;
}
.likes-grid img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.likes-grid span { display: block; padding: .48rem .56rem; font-size: .82rem; overflow-wrap: anywhere; }
@media (max-width:680px) {
  .library-tabs, .likes-grid { margin-inline: 10px; }
  main:has(.library-tabs:not([hidden])) .card { height: calc(100dvh - 158px - env(safe-area-inset-bottom)); }
  .wide-player main:has(.library-tabs:not([hidden])) .card { height: auto; }
}

#genres-dialog .genres button[aria-pressed="true"] {
  color: var(--background);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}
#genres-dialog .genres button[aria-pressed="true"]::before { content: '✓'; margin-inline-end: .36rem; }
#genres-dialog .genres button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.filter-status { margin: .65rem 0 0; color: var(--muted); font-size: .8rem; }

#frame video { display: block; width: 100%; height: 100%; object-fit: contain; }
.media-controls {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .25rem .65rem;
  background: #13171a;
  color: #fff8f5;
}
.media-controls button { border: 0; background: transparent; min-width: 36px; min-height: 32px; }
.media-controls input { flex: 1; min-width: 0; accent-color: var(--accent); }

/* Cinema layout: the poster, video and controls share the same screen. */
.cinema-backdrop { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.cinema-backdrop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(15px) brightness(.48); transform: scale(1.07); opacity: 0; transition: opacity .55s ease; }
.cinema-backdrop img.shown { opacity: 1; }
.cinema-backdrop::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg,#0e0c1450 12%,#0e0c1460 60%,#0e0c14 89%),linear-gradient(0deg,#0e0c14d9,transparent 65%); }
.shell, .wide-player .shell { width: min(1530px, calc(100% - 72px)); grid-template-columns: minmax(0, 1fr) 174px; gap: clamp(20px, 4vw, 68px); align-items: center; }
.sidebar { grid-column: 2; grid-row: 1; align-self: center; padding: 0; }
.shell main { grid-column: 1; grid-row: 1; }
.sidebar .intro { display: none; }
.sidebar .navigation { margin-top: 1.25rem; }
#viewer, .wide-player #viewer { grid-template-columns: minmax(0, 1fr); }
#card {
  --chrome: #fff8f2;
  --video-accent: #ffb398;
  width: 100%; aspect-ratio: 16/9; height: auto; min-height: 0;
  display: block; max-width: none; margin: 0;
  position: relative; color: var(--chrome); background: #110f16; touch-action: auto;
  border-radius: clamp(12px, 2vw, 24px); box-shadow: 0 16px 70px #0006;
  container-type: inline-size;
}
#card .poster { display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; touch-action: pan-x; }
#card .shade { display: block; z-index: 1; pointer-events: none; background: linear-gradient(180deg,#08060ccd,transparent 36%,transparent 57%,#08060cf0); }
#card .player { position: absolute; inset: 0; width: 100%; translate: none; z-index: 0; }
#frame { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; background: #09080c; touch-action: pan-x; }
#frame video { animation: frame-fade .32s ease-out; }
#card .info { position: absolute; top: 5%; left: 4%; z-index: 2; width: 31%; max-width: none; padding: 0; pointer-events: none; }
#card .info h2 { font-size: clamp(1rem, 3.1cqw, 2.4rem); text-wrap: wrap; }
#card .title-logo { max-width: 100%; max-height: clamp(25px, 7cqw, 68px); }
#card .title-caption { color: #fff8f2; font-size: clamp(.58rem, 1.45cqw, .8rem); }
.release-date { position: absolute; z-index: 2; top: 5%; left: 37%; width: 26%; text-align: center; pointer-events: none; }
.release-date span, .release-date time { display: block; font-size: clamp(.6rem, 1.55cqw, .92rem); }
.release-date span { color: #ddd2d3; }
.film-facts { position: absolute; z-index: 2; top: 5%; right: 4%; width: 31%; text-align: right; font-size: clamp(.58rem, 1.55cqw, .86rem); pointer-events: none; }
.film-facts > span { display: block; }
.film-facts .film-rating { color: var(--video-accent); font-weight: 740; }
.film-facts .meta { color: #e7dedf; font-size: inherit; margin: .2rem 0 0; }
#card .synopsis { position: absolute; z-index: 2; inset-inline: 4% 15%; bottom: 8%; max-width: 64ch; }
#card.playing .synopsis { bottom: min(23%, 112px); }
#card .description {
  display: block; padding: .45rem .62rem; margin: 0;
  max-height: clamp(30px, 9cqw, 82px); overflow: auto; overscroll-behavior: contain;
  touch-action: pan-y; scrollbar-width: thin; line-height: 1.35; color: var(--chrome);
  border-radius: 8px; background: #130f19bc; font-size: clamp(.66rem, 1.7cqw, .94rem);
}
#card .description:empty { display: none; }
#card .actions { z-index: 2; display: grid; bottom: 22%; right: 3%; gap: .38rem; }
#card .actions button { width: clamp(32px, 6cqw, 52px); min-height: clamp(32px, 6cqw, 52px); color: var(--chrome); }
#card .actions button[aria-pressed="true"] { color: var(--video-accent); }
#card .actions span { font-size: clamp(1.2rem, 3.2cqw, 1.8rem); }
#card .play, #card .player-center { position: absolute; top: 48%; left: 50%; translate: -50% -50%; width: clamp(43px, 8cqw, 67px); height: clamp(43px, 8cqw, 67px); z-index: 3; display: grid; place-items: center; border-radius: 50%; background: #1b131de0; color: var(--chrome); border: 1px solid #ffffff42; padding: 0; font-size: clamp(1rem, 3cqw, 1.5rem); }
#card[data-buffering="true"] .player-center { opacity: 0; pointer-events: none; }
.video-buffering, #frame .embed-notice { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .55rem; margin: 0; color: #fff8f2; text-align: center; font-size: .84rem; pointer-events: none; }
.video-buffering { z-index: 1; background: #08060c46; }
.spinner { width: 27px; height: 27px; border-radius: 50%; border: 2px solid #fff4; border-top-color: #ffb398; animation: frame-spin .8s linear infinite; }
@keyframes frame-spin { to { transform: rotate(360deg); } }
@keyframes frame-fade { from { opacity: 0; } }
#card .media-controls, #card .player-links { position: absolute; inset-inline: 4%; z-index: 3; background: transparent; padding: 0; }
#card .media-controls { bottom: 38px; gap: .7rem; }
#card .player-links { bottom: 6px; }
#media-clock { flex: none; color: var(--chrome); font: 650 clamp(.61rem, 1.55cqw, .78rem)/1.2 system-ui; font-variant-numeric: tabular-nums; }
#media-seek { appearance: none; height: 16px; margin: 0; background: transparent; cursor: pointer; }
#media-seek::-webkit-slider-runnable-track { height: 4px; border-radius: 9px; background: linear-gradient(to right,var(--video-accent) var(--progress,0%),#fff5 var(--progress,0%)); }
#media-seek::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; margin-top: -3.5px; border-radius: 50%; background: var(--video-accent); }
#media-seek::-moz-range-track { height: 4px; border-radius: 9px; background: #fff5; }
#media-seek::-moz-range-progress { height: 4px; background: var(--video-accent); }
#media-seek::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: var(--video-accent); }
#rotate-prompt { position: absolute; z-index: 3; bottom: 62px; right: 4%; border-radius: 8px; }
#card :is(.info,.release-date,.film-facts,.synopsis,.actions,.media-controls,.player-links,.player-center,.shade) { transition: opacity .25s ease; }
#card.controls-hidden :is(.info,.release-date,.film-facts,.synopsis,.actions,.media-controls,.player-links,.player-center,.shade) { opacity: 0; pointer-events: none; }
#card.shift { animation: frame-fade .32s ease-out; }
#notice { display: grid; place-items: center; text-align: center; min-height: 160px; }
body.locked .shell .sidebar { grid-column: 1 / -1; }
@media (max-width:680px), (pointer:coarse) {
  .cinema-backdrop { display: none; }
}
@media (max-width:680px) {
  .shell, .wide-player .shell { display: flex; flex-direction: column; justify-content: center; gap: 10px; width: 100%; padding: 0 0 calc(60px + env(safe-area-inset-bottom)); }
  .shell .sidebar { width: 100%; padding: 0 14px; }
  .shell main { width: 100%; padding: 0 8px; }
  .sidebar .navigation { margin: 0; }
  #card { border-radius: 13px; border-inline: 1px solid var(--line); }
  #card .title-caption { display: none; }
  #card.playing .synopsis { bottom: 57px; }
  #card .media-controls { bottom: 29px; }
  #card .player-links { bottom: 1px; font-size: .62rem; }
  #card .player-links svg { width: 14px; height: 14px; }
  #card .actions { bottom: 28%; }
}
@media (orientation:landscape) and (max-height:600px) and (pointer:coarse) {
  .wide-player .shell { padding-bottom: 0; }
  .wide-player #card { max-width: min(100%, calc((100dvh - 45px) * 1.7778)); margin: 0 auto; }
  .wide-player .sidebar .navigation { margin: 0; }
}
@media (prefers-reduced-motion:reduce) {
  .cinema-backdrop img, #card :is(.info,.release-date,.film-facts,.synopsis,.actions,.media-controls,.player-links,.player-center,.shade) { transition: none; }
  #card.shift, #frame video, .spinner { animation: none; }
}

.cinema-backdrop { z-index: 0; }
.shell { position: relative; z-index: 1; }
#card .player { z-index: auto; pointer-events: none; }
#card #frame, #card .player-center, #card .media-controls, #card .player-links { pointer-events: auto; }
#card.controls-hidden :is(.media-controls,.player-links,.player-center) { pointer-events: none; }
#card:not(.playing) .synopsis { bottom: 5%; }
#card.playing .synopsis { max-height: 24%; overflow: auto; overscroll-behavior: contain; }
#card .synopsis { touch-action: pan-y; }
#card .poster, #frame { touch-action: pan-x; }
.landscape-gestures #card .poster, .landscape-gestures #frame { touch-action: pan-y; }
@media (max-width: 680px) {
  #card .info h2 { font-size: clamp(.82rem, 4cqw, 1.3rem); }
  #card.playing .synopsis { bottom: 51px; max-height: 18%; }
  #card .film-facts .meta { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
}
#card.preparing #frame { background: #09080c60; }
#card.preparing .poster { filter: brightness(.6); }
#notice.is-loading { align-content: center; gap: .65rem; }
#notice.is-loading::before { content: ''; width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: frame-spin .8s linear infinite; }
@media (min-width:681px) and (pointer:fine) {
  body:has(.cinema-backdrop img.shown) .sidebar .brand-name,
  body:has(.cinema-backdrop img.shown) .sidebar .navigation button { color: #f6eef0; }
  body:has(.cinema-backdrop img.shown) .sidebar .navigation button:hover { background: #ffffff12; }
}
@media (prefers-reduced-motion:reduce) { #notice.is-loading::before { animation: none; } }

#card { --seek-bottom: 38px; --center-control: clamp(43px, 8cqw, 67px); }
#card :is(.play, .player-center) { width: var(--center-control); height: var(--center-control); }
#card .media-controls { bottom: var(--seek-bottom); }
#card .synopsis {
  inset-inline: 0;
  width: min(72%, 66ch);
  margin-inline: auto;
  max-height: none;
  text-align: center;
}
#card.playing .synopsis {
  top: calc(48% + var(--center-control) / 2 + 4px);
  bottom: calc(var(--seek-bottom) + 20px);
  max-height: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  pointer-events: none;
}
#card .description {
  max-height: 70%;
  min-height: 0;
  pointer-events: auto;
  box-sizing: border-box;
  background: #130f19d9;
  padding: clamp(.18rem, .65cqw, .6rem) clamp(.4rem, 1.4cqw, 1rem);
  font-size: clamp(.74rem, 2.05cqw, 1.16rem);
  line-height: 1.42;
}
#card:not(.playing) .description { max-height: min(15cqw, 145px); }
#card .description:focus-visible { outline: 2px solid var(--video-accent); outline-offset: 2px; }
@media (max-width:680px) {
  #card { --seek-bottom: 29px; }
  #card .synopsis { width: 74%; }
}

#card.controls-hidden .synopsis .description { pointer-events: none; }
