/* Game Review — tokens from the Clip Label / Crew boards in Penpot (CourtVision/Annotation Hub). */
:root {
  --bg: #121211; --surface: #1b1b1a; --surface-now: #24211e; --border: #2e2d2a;
  --text: #eeece8; --muted: #9c9a94; --accent: #fb923c; --accent-ink: #1b1b1a;
  --accent-soft: #3a2414; --coach: #facc15; --ok: #4ade80; --bad: #e07070;
  --wall: #6f5c86; --ceiling: #8c7aa6; --floor: #8a5f43;
  --radius: 12px; --pad: 16px;
  font-family: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
main { max-width: 480px; margin: 0 auto; padding: var(--pad); padding-bottom: 96px; min-height: 100vh; }

.header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; min-height: 32px; }
.header h1 { font-size: 18px; font-weight: 600; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back { font-size: 24px; color: var(--muted); width: 24px; line-height: 1; }
.chip { border: 1px solid var(--border); border-radius: 999px; padding: 5px 10px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.icon-btn { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--muted); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; flex: none; }
.icon-list { display: inline-flex; flex-direction: column; gap: 3px; }
.icon-list i { display: block; width: 12px; height: 1.6px; background: currentColor; }
.btn-accent { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.sub { font-size: 12px; color: var(--muted); margin: -4px 0 12px; }

/* feed */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; display: block; width: 100%; text-align: left; }
.card-top { display: flex; align-items: center; gap: 8px; }
.card-date { font-size: 15px; font-weight: 700; }
.card-place { font-size: 12px; color: var(--muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.counts { font-size: 12px; color: var(--muted); margin: 10px 0 8px; }
.bar { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; margin-bottom: 10px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.thumb { position: relative; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden;
  background: linear-gradient(var(--ceiling) 0 20%, var(--wall) 20% 72%, var(--floor) 72%); }
.thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.thumb .tl, .thumb .tr { position: absolute; bottom: 4px; font-size: 11px; font-weight: 600; color: #fff; text-shadow: 0 1px 2px #000a; }
.thumb .tl { left: 6px; } .thumb .tr { right: 6px; }

/* list */
.row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 8px; }
.row.now { background: var(--surface-now); border-color: var(--accent); }
.row .thumb { width: 88px; flex: none; }
.row-title { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.row.watched .row-title { color: var(--muted); }
.row-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.tag-new { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 1px 6px; font-size: 10px; font-weight: 700; }
.tag-now { border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 1px 6px; font-size: 10px; font-weight: 700; }

/* review */
/* As big as the phone allows. In portrait the picture is width-limited, so it goes edge to edge in
   the clip's own shape (game video is 4:3, so no letterbox inside the box), capped so the rating row
   stays on screen. In landscape it takes the whole screen height. ⛶ (or the native control) opens
   real fullscreen. */
.stage { position: relative; margin: 0 calc(-1 * var(--pad)); background: #000; }
.player { display: block; width: 100%; aspect-ratio: 4 / 3; max-height: calc(100dvh - 150px);
  object-fit: contain; background: #000; }
.fs-btn { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 8px;
  background: rgba(0,0,0,.45); color: #fff; font-size: 18px; display: flex; align-items: center; justify-content: center; }
main.is-review .header { margin-bottom: 8px; min-height: 30px; }
main.is-review .header h1 { font-size: 17px; }
main.is-review .rate-row { margin: 8px 0 12px; }
@media (min-width: 480px) { .stage { margin: 0; border-radius: 10px; overflow: hidden; } }
@media (orientation: landscape) and (max-height: 520px) {
  main.is-review .header { display: none; }
  main.is-review { padding-top: 0; max-width: none; }
  main.is-review .stage { margin: 0 calc(-1 * var(--pad)); border-radius: 0; }
  .player { height: 100dvh; max-height: none; aspect-ratio: auto; }
  main.is-review .composer { position: static; }
}
.rate-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 14px; }
.rate-row .spacer { flex: 1; }
.tally-line { display: block; font-size: 12px; color: var(--muted); text-align: center; margin: -8px 0 14px; }
.pill { height: 40px; min-width: 44px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-size: 18px; display: inline-flex; align-items: center; justify-content: center; }
.pill[aria-pressed="true"] { background: var(--accent-soft); border: 2px solid var(--accent); color: var(--text); }
.pill:disabled { opacity: .35; }
/* Replay matches the 👍 pill's own weight on purpose -- same size, same resting colors.
   It's an independent, optional action, not a second (and bigger) way to rate the clip.
   The replay count renders inside the icon's own loop (see replayIcon()), not as separate text. */
.replay-btn { width: 44px; height: 40px; border-radius: 20px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
.replay-btn:active { transform: scale(.97); }
.comments-h { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.comment { display: flex; gap: 10px; margin-bottom: 14px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.c-top { display: flex; gap: 8px; align-items: baseline; }
.c-name { font-size: 13px; font-weight: 600; }
.c-time { font-size: 11px; color: var(--muted); }
.c-del { margin-left: auto; color: var(--muted); font-size: 16px; padding: 0 4px; }
.c-text { font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; white-space: pre-wrap; }
.composer { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--border);
  padding: 14px var(--pad) calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 8px; }
.composer-inner { max-width: 448px; margin: 0 auto; display: flex; gap: 8px; width: 100%; }
.composer input { flex: 1; min-width: 0; height: 44px; border-radius: 22px; border: 1px solid var(--border); background: var(--bg);
  color: var(--text); padding: 0 16px; font: inherit; font-size: 16px; }
.composer button { height: 44px; padding: 0 18px; border-radius: 22px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.composer button:disabled { opacity: .5; }

/* centered states: hello, expired, done */
.center { min-height: calc(100vh - 2 * var(--pad)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 0 12px; }
.disc { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; color: var(--accent-ink); }
.center h2 { font-size: 22px; font-weight: 700; margin: 0; }
.center .line { font-size: 14px; color: var(--muted); }
.stats { display: flex; gap: 16px; font-size: 15px; font-weight: 600; color: var(--muted); }
.wide { width: 100%; border-radius: var(--radius); padding: 14px; font-size: 15px; font-weight: 700; text-align: center; display: block; text-decoration: none; }
.wide.primary { background: var(--accent); color: var(--accent-ink); }
.wide.secondary { background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 600; }
.done { display: flex; flex-direction: column; min-height: calc(100vh - 2 * var(--pad)); }
.done .center { flex: 1; min-height: 0; }
.done .actions { display: flex; flex-direction: column; gap: 8px; }
.empty { color: var(--muted); font-size: 14px; text-align: center; margin-top: 40px; }

/* coach marks (5a-5c) */
.coach { position: fixed; inset: 0; z-index: 10; }
.coach-spot { position: fixed; border: 2px solid var(--coach); border-radius: 24px; box-shadow: 0 0 0 200vmax rgba(0,0,0,.72); transition: all .2s; pointer-events: none; }
.coach-card { position: fixed; left: 50%; transform: translateX(-50%); width: min(300px, calc(100vw - 32px)); background: #1c1c1a;
  border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.coach-title { font-size: 17px; font-weight: 700; }
.coach-line { font-size: 14px; color: var(--muted); margin-top: 6px; }
.coach-foot { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.coach-dots { display: flex; gap: 6px; flex: 1; }
.coach-dots i { width: 8px; height: 8px; border-radius: 50%; background: #5a5955; }
.coach-dots i.on { background: var(--coach); }
.coach-skip { color: var(--muted); font-weight: 600; font-size: 14px; }
.coach-next { background: var(--coach); color: var(--accent-ink); border-radius: 17px; height: 34px; padding: 0 18px; font-weight: 700; font-size: 14px; }
.thumb-btn { display: block; width: 100%; }

/* DEV marker (#263): only rendered when /api/me has an env_label */
.env { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 2px 7px; border-radius: 6px;
  background: #e07070; color: #1b1b1a; font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.env-top { position: absolute; top: 12px; left: 16px; }

/* Fullscreen with our own controls (body.fs). Real fullscreen where allowed, else this fixed layer. */
.fs-ui, .fs-sheet { display: none; }
body.fs { overflow: hidden; }
body.fs .stage { position: fixed; inset: 0; z-index: 30; margin: 0; width: 100dvw; height: 100dvh; border-radius: 0;
  display: flex; align-items: center; justify-content: center; background: #000; }
body.fs .player { width: 100%; height: 100%; max-height: none; object-fit: contain; }
body.fs .fs-btn { display: none; }
body.fs .fs-ui { display: block; position: absolute; inset: 0; transition: opacity .25s; pointer-events: none; }
body.fs .stage.ui-off .fs-ui { opacity: 0; }
body.fs .stage:not(.ui-off) .fs-ui > * { pointer-events: auto; }
.fs-top, .fs-bottom { position: absolute; left: 0; right: 0; display: flex; padding: 10px max(12px, env(safe-area-inset-left)); }
.fs-top { top: 0; align-items: center; justify-content: space-between; padding-top: max(10px, env(safe-area-inset-top));
  background: linear-gradient(rgba(0,0,0,.6), transparent); }
.fs-bottom { bottom: 0; flex-direction: column; gap: 8px; padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.fs-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fs-rates { display: flex; gap: 10px; }
.fs-ctl { min-width: 48px; height: 48px; border-radius: 24px; padding: 0 12px; background: rgba(0,0,0,.35); color: #fff;
  border: 1px solid rgba(255,255,255,.18); font-size: 20px; display: inline-flex; align-items: center; justify-content: center; }
.fs-ctl:disabled { opacity: .35; }
.fs-ctl.fs-replay { width: 48px; padding: 0; }
.fs-ctl[aria-pressed="true"] { background: var(--accent-soft); border: 2px solid var(--accent); }
.fs-count { font-size: 15px; font-weight: 600; }
.fs-progress { color: #fff; font-size: 14px; font-weight: 600; text-shadow: 0 1px 2px #000; }
.fs-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 36px; font-size: 26px; }
.fs-bar { height: 3px; background: rgba(255,255,255,.25); border-radius: 2px; overflow: hidden; }
.fs-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
body.fs .stage.sheet-open .fs-sheet { display: flex; flex-direction: column; position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 70%; background: var(--surface); border-radius: 16px 16px 0 0; padding: 14px var(--pad) 0; z-index: 2; overflow: auto; }
body.fs .stage.sheet-open .fs-sheet .composer { position: sticky; bottom: 0; margin: 8px calc(-1 * var(--pad)) 0; }
body.fs .stage.sheet-open .fs-ui .fs-bottom, body.fs .stage.sheet-open .fs-play { display: none; }
