/* Ten-foot-ready layout at 1920x1080: large text, a visible focus ring, and
   nothing that depends on a pointer. The same DOM drives a TV remote later
   ([D-43] input model), so every control is reachable by arrows + Enter. */
:root {
  color-scheme: dark;
  --bg: #0b0d11;
  --panel: #151922;
  --fg: #e9edf2;
  --dim: #98a2b0;
  --line: #232a35;
  --accent: #3b82f6;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* login */
#login { max-width: 32rem; margin: 16vh auto; padding: 0 1.5rem; }
#login h1 { font-size: 1.7rem; margin: 0 0 .25rem; letter-spacing: .02em; }
#login p { color: var(--dim); margin: 0 0 2rem; }
#login form { display: flex; gap: .5rem; }
#code {
  flex: 1; padding: .75rem 1rem; font-size: 1.15rem; letter-spacing: .18em;
  text-transform: uppercase; background: var(--panel); color: var(--fg);
  border: 1px solid var(--line); border-radius: .5rem;
}
button {
  padding: .7rem 1.2rem; font-size: 1rem; border: 0; border-radius: .5rem;
  background: var(--accent); color: #fff; cursor: pointer;
}
button.ghost { background: var(--panel); color: var(--fg); border: 1px solid var(--line); }
button:disabled { opacity: .5; cursor: default; }
.err { color: #f87171; min-height: 1.5rem; margin-top: .75rem; }

/* library */
header.bar {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 2rem; border-bottom: 1px solid var(--line);
}
header.bar h1 { font-size: 1.25rem; margin: 0; letter-spacing: .04em; }
header.bar .spacer { flex: 1; }
.row { padding: 1.5rem 2rem 0; }
.row h2 { font-size: 1.05rem; color: var(--dim); font-weight: 600; margin: 0 0 .75rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: .6rem;
  overflow: hidden; cursor: pointer; text-align: left; padding: 0; color: inherit;
  display: flex; flex-direction: column;
}
.tile .art { aspect-ratio: 2/3; width: 100%; object-fit: cover; background: #0f1218; display: block; }
.tile .meta { padding: .6rem .7rem .7rem; }
.tile .t { font-size: .95rem; line-height: 1.3; }
.tile .s { font-size: .8rem; color: var(--dim); margin-top: .2rem; }
.badge {
  display: inline-block; font-size: .72rem; padding: .1rem .4rem; border-radius: .3rem;
  background: #2b3342; color: var(--dim); margin-top: .35rem;
}
/* Not playable: shown (the catalog is the catalog) but visibly not a play
   target, and not focusable as one. */
.tile.unavailable { cursor: default; opacity: .72; }
.tile.unavailable .badge { background: #3a2a2a; color: #e6b8b8; }

/* [D-75] a freshness notice, not an error: the page below it is fully usable,
   so it informs rather than alarms — no red, no icon, and it does not push the
   content off the first screen. */
.notice {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 6px;
  background: #2a2a1f;
  color: #ded7b0;
  font-size: 13px;
}

/* player */
#player { position: fixed; inset: 0; background: #000; display: flex; flex-direction: column; }
#player video { flex: 1; width: 100%; height: 100%; background: #000; }
.chrome {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1rem 2rem 1.5rem;
  background: linear-gradient(transparent, rgba(0,0,0,.85) 45%);
  display: flex; flex-direction: column; gap: .75rem;
}
.scrub { position: relative; height: 6px; background: #2a3140; border-radius: 3px; cursor: pointer; }
.scrub .buf { position: absolute; inset: 0 auto 0 0; background: #46506380; border-radius: 3px; }
.scrub .pos { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 3px; }
.controls { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.controls .time { font-variant-numeric: tabular-nums; color: var(--dim); }
select {
  background: var(--panel); color: var(--fg); border: 1px solid var(--line);
  border-radius: .4rem; padding: .5rem .6rem; font-size: .95rem;
}
#stats {
  position: absolute; top: 1rem; right: 1rem; max-width: 30rem;
  background: #000000c0; border: 1px solid var(--line); border-radius: .5rem;
  padding: .75rem 1rem; font: 12px/1.5 ui-monospace, monospace; color: #cfe3ff;
  white-space: pre-wrap;
}
