/* Fleet's look (the Calm look, Fleet ADR 0075 and 0076): its colours, type and corners, so the room
   sits inside Fleet's window as one of its pages. Figtree is self-hosted (SIL Open Font License,
   figtree-licence.txt), as Fleet does it. */
@font-face {
  font-family: 'Figtree'; font-style: normal; font-display: swap; font-weight: 300 900;
  src: url('/room/app/figtree.woff2') format('woff2-variations'), url('/room/app/figtree.woff2') format('woff2');
}
:root {
  --bg: #f6f7fb; --panel: #ffffff; --ink: #18213a; --soft: #4a5368; --line: #e1e4ec;
  --accent: #1d2a44; --accent-ink: #ffffff; --link: #8a6b3a; --good: #1f7a4a; --warn: #8f6410; --laugh: #c6a267;
  --focus: #8a6b3a; --radius: 14px; --pill: 999px;
  --shadow: 0 1px 2px rgba(24, 33, 58, .04), 0 6px 20px rgba(24, 33, 58, .05);
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1420; --panel: #171e2d; --ink: #e8ebf3; --soft: #b4bccc; --line: #2d3749; --accent: #d6b784; --accent-ink: #131c2d; --link: #d9bd8c; --good: #6ecf95; --warn: #e0b660; --laugh: #d6b784; --focus: #d6b784; --shadow: none; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 17px; line-height: 1.45; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--panel); padding: 8px 12px; z-index: 10; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.renderer { font-size: 14px; color: var(--soft); }
.renderer.off { color: var(--warn); }
main { max-width: 980px; margin: 0 auto; padding: 16px; }
h1 { font-size: 24px; margin: 4px 0 12px; }
h2 { font-size: 19px; margin: 20px 0 8px; }
button, .button { font: inherit; min-height: 44px; min-width: 44px; padding: 8px 14px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.strong, .button.strong { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.quiet { background: transparent; }
button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.muted { color: var(--soft); }

/* Today */
.films { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.film { box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; min-height: 72px; }
.film:hover { border-color: var(--accent); }
.film img { width: 54px; height: 72px; object-fit: cover; border-radius: 6px; background: var(--line); flex: none; }
.film .thumb { width: 54px; height: 72px; border-radius: 6px; background: var(--line); flex: none; }
.film .what { flex: 1; min-width: 0; }
.film .name { font-weight: 600; }
.chip { font-size: 14px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.chip.waiting { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chip.laughed, .chip.final, .chip.sent { border-color: var(--good); color: var(--good); }

/* Watch */
.watch { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .watch { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); align-items: start; } }
/* The stage takes the picture's own shape (--ar is set from the video), so there are no black bars
   and a pin's place on the stage is its place on the picture */
.stage { --ar: 0.5625; --maxh: 62vh; position: relative; width: min(100%, calc(var(--maxh) * var(--ar))); aspect-ratio: var(--ar); margin-inline: auto; background: #000; border-radius: var(--radius); overflow: hidden; touch-action: manipulation; }
.stage video { display: block; width: 100%; height: 100%; object-fit: contain; cursor: pointer; }
.pin { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: var(--laugh); border: 3px solid #fff; box-shadow: 0 1px 4px #0008; pointer-events: none; }
.pin.new { background: var(--accent); }
/* Pins of earlier notes are buttons: a tap shows the note. The ring widens the target to 50px. */
button.pin.old { pointer-events: auto; cursor: pointer; padding: 0; min-width: 0; min-height: 0; }
button.pin.old::after { content: ""; position: absolute; inset: -11px; border-radius: 50%; }
.note.flash { animation: note-flash 1.6s ease-out; }
@keyframes note-flash { from { background: color-mix(in srgb, var(--accent) 28%, var(--bg)); } to { background: var(--bg); } }
.big-play { position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%; background: #000a; color: #fff; border: 2px solid #fff; font-size: 30px; }
.controls { display: grid; gap: 8px; margin-top: 8px; }
.scrub { width: 100%; height: 44px; accent-color: var(--accent); }
/* Each reaction on the line is a small button that goes to its frame */
.marks { position: relative; height: 28px; margin: -6px 8px 0; }
.marks:empty { display: none; }
button.mark { position: absolute; top: 0; transform: translateX(-50%); min-width: 28px; min-height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; font-size: 16px; line-height: 28px; }
/* Hold to peek: the other version lies over the film while the button is held */
.stage .peek { position: absolute; inset: 0; background: #000; cursor: default; }
.peek-tag { position: absolute; left: 8px; top: 8px; padding: 2px 10px; border-radius: var(--pill); background: #000a; color: #fff; font-size: 14px; pointer-events: none; }
.peek-btn { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.time { font-variant-numeric: tabular-nums; color: var(--soft); font-size: 15px; }
.react button { flex: 1; min-height: 52px; font-weight: 600; }
.panel { box-shadow: var(--shadow); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.composer { margin-top: 8px; }
.composer textarea { width: 100%; min-height: 90px; font: inherit; padding: 8px; border-radius: 8px; border: 1px solid var(--soft); background: var(--bg); color: var(--ink); }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.note { border-left: 4px solid var(--laugh); padding: 6px 10px; background: var(--bg); border-radius: 6px; }
.note .reply { margin: 6px 0 0 12px; color: var(--soft); }
.note.done { border-left-color: var(--soft); color: var(--soft); }
.done-notes { margin-top: 8px; }
.done-notes summary { padding: 10px 0; cursor: pointer; color: var(--soft); }
.versions button { min-width: 52px; }
.toast { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--radius); display: flex; gap: 12px; align-items: center; z-index: 20; max-width: calc(100vw - 32px); }
.toast[hidden] { display: none; }
.toast button { background: transparent; color: inherit; border-color: currentColor; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); max-width: 420px; width: calc(100vw - 32px); }
dialog::backdrop { background: #0007; }
.banner { padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--warn); color: var(--warn); margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Inside Fleet's window: Fleet's menu and top bar are already there, so the room drops its own */
.in-fleet .top { display: none; }
.in-fleet .skip { display: none; }

/* Keys */
main input, main select { font: inherit; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--soft); background: var(--panel); color: var(--ink); }
main input:focus-visible, main select:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.secret { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; }
.keys { list-style: none; padding: 0; }
.keys li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.keys li > span:first-child { flex: 1; min-width: 12em; }
main section.panel { margin: 12px 0; }
main .row + .row { margin-top: 8px; }

/* Where the film stands, and what changed in this version */
.status { font-weight: 600; margin: 8px 0; }
.version-note { margin: 8px 0 0; }
.next { justify-content: space-between; }

/* On a phone the film, its buttons and the three reactions fit one screen: the film is shorter,
   and Laughed, Meh and Confused stay at the bottom, under the thumb. They step aside while he writes a note. */
@media (max-width: 859px) {
  .stage { --maxh: 44vh; }
  main:has(.react) { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .react { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; margin: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .12); flex-wrap: nowrap; }
  .writing .react { display: none; }
  /* The toast sits at the top on a phone, clear of the buttons under the film */
  body:has(.react) .toast { top: max(8px, env(safe-area-inset-top)); bottom: auto; }
  .controls > .row:not(.react):not(.next) button { padding: 8px 10px; }
}

/* Outside Fleet the header already says the PC is off, so the line is not said twice */
:root:not(.in-fleet) main > .banner { display: none; }
