* { box-sizing: border-box; }
html, body { margin: 0; background: #111418; color: #e8eaed;
  font: 17px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
header { display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: #1b1f24; position: sticky; top: 0; z-index: 5; }
.title { font-weight: 700; flex: 1; }
.done { color: #9aa0a6; font-size: 15px; }
.help { display: inline-flex; width: 34px; height: 34px; border-radius: 50%;
  align-items: center; justify-content: center; background: #2b3138;
  color: #e8eaed; text-decoration: none; font-weight: 700; }
main, section { padding: 12px; max-width: 900px; margin: 0 auto; }
#tutorial { max-width: 640px; }
.card { background: #1b1f24; border-radius: 14px; padding: 16px; }
.card p { font-size: 20px; margin: 0 0 14px; }
.card .pairrow { display: grid; gap: 10px; }
.tut-nav { display: flex; gap: 10px; margin-top: 14px; }
.tut-nav .btn { flex: 1; }
.dots { text-align: center; margin-top: 10px; color: #5f6368; letter-spacing: 6px; }
.dots .on { color: #e8eaed; }
.status { text-align: center; padding: 40px 10px; color: #9aa0a6; }
/* One narrow, centred card: A buttons, A row, B row, B buttons, decide. */
#pair { max-width: 620px; margin: 0 auto; }
.track { background: #1b1f24; padding: 6px 8px; }
.track[data-side="a"] { border-radius: 14px 14px 0 0; border-bottom: 1px solid #2b3138; }
.track[data-side="b"] { border-radius: 0 0 14px 14px; margin-bottom: 4px; }
.label { font-size: 12px; color: #9aa0a6; margin: 4px 0 3px; line-height: 1.2; }
/* One row of crops per track, evenly sized, filling the card width. */
.strip { display: flex; gap: 4px; }
/* Each crop is a box at its final size: spinner until loaded, red mark on failure. */
.strip .crop { flex: 1 1 0; min-width: 0; position: relative; aspect-ratio: 2 / 3;
  max-height: 300px; background: #000; border-radius: 6px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; }
.strip .crop img { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; opacity: 0; }
.strip .crop.loaded img { opacity: 1; }
.strip .crop.loaded .spinner, .strip .crop.failed .spinner { display: none; }
.strip .crop.failed { outline: 2px solid #d93025; outline-offset: -2px; }
.strip .crop.failed::after { content: "\2715"; color: #f28b82; font-size: 22px; font-weight: 700; }
.track-btns { display: flex; gap: 6px; }
.track-btns .btn { flex: 1 1 0; min-width: 0; }
.track[data-side="a"] .track-btns { margin-bottom: 2px; }
.track[data-side="b"] .track-btns { margin-top: 6px; }
.decide { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px;
  position: sticky; bottom: 0; padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  background: #111418; }
.btn { border: 0; border-radius: 12px; padding: 12px 14px; font: inherit; font-weight: 600;
  color: #fff; background: #2b3138; min-height: 48px; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.btn.big { min-height: 64px; font-size: 20px; }
.btn.small { font-size: 15px; min-height: 44px; }
.btn.primary { background: #1a73e8; }
.btn.ghost { background: transparent; border: 1px solid #3c4043; color: #bdc1c6; }
.btn.same { background: #188038; }
.btn.diff { background: #c5221f; }
.btn.skip { background: #3c4043; }
.btn.undo { background: #1a73e8; }
.btn.warn { background: #6b4e16; }
.btn.warn.on { background: #b06000; }
.btn:disabled { opacity: .35; cursor: default; }
.toast { position: fixed; left: 12px; right: 12px; bottom: 150px; max-width: 600px; margin: 0 auto;
  background: #3c4043; border-radius: 12px; padding: 10px 14px; display: flex;
  align-items: center; gap: 12px; z-index: 20; }
.toast span { flex: 1; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 30;
  display: flex; align-items: center; justify-content: center; padding: 12px; }
.modal[hidden], .toast[hidden], [hidden] { display: none !important; }
.modal-body { width: 100%; max-width: 520px; text-align: center; }
.gif-view { min-height: 300px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.gif-view img { max-width: 100%; max-height: 70vh; border-radius: 10px; background: #000; }
@media (min-width: 760px) {
  #pair .decide { grid-template-columns: 1fr 1fr 1fr 1fr; }
}
.login { display: grid; gap: 12px; max-width: 420px; margin: 40px auto; }
.login input { font: inherit; font-size: 20px; padding: 14px; border-radius: 12px;
  border: 1px solid #3c4043; background: #111418; color: #e8eaed; }
.err { color: #f28b82; margin: 0; }
.logout { margin: 0; }
.logout button { background: none; border: 0; color: #9aa0a6; font: inherit; font-size: 15px;
  padding: 8px 4px; cursor: pointer; }
/* Spinners: GIF overlay, "Loading pairs", header while saving. */
.spinner { display: inline-block; width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid #3c4043; border-top-color: #8ab4f8; animation: spin .8s linear infinite;
  flex: none; }
.spinner.small { width: 18px; height: 18px; border-width: 2px; }
.loading { display: inline-flex; align-items: center; gap: 10px; color: #9aa0a6; }
@keyframes spin { to { transform: rotate(360deg); } }
.note { color: #fdd663; margin: 0; }
#expired .modal-body { max-width: 420px; }
#expired p { font-size: 20px; margin: 0 0 14px; }
#expired .btn { display: inline-block; text-decoration: none; }
/* ── Shared clip player (static/clip.js): canvas + drag-to-scrub timeline ── */
.cc { background: #1b1f24; border-radius: 12px; padding: 6px; }
.cc .stage { position: relative; background: #000; border-radius: 8px; overflow: hidden;
  display: flex; justify-content: center; align-items: center; height: 46vh; min-height: 160px;
  cursor: pointer; }
.cc .stage canvas { max-width: 100%; max-height: 100%; display: block; }
.cc .stage.inspan { box-shadow: inset 0 0 0 4px #34a853; }
.cc .clip-load { position: absolute; inset: 0; display: flex; gap: 10px; align-items: center;
  justify-content: center; color: #9aa0a6; background: rgba(0,0,0,.6); }
.cc .tag { position: absolute; bottom: 6px; left: 6px; background: #34a853; color: #fff; font-weight: 700;
  font-size: 12px; padding: 1px 7px; border-radius: 6px; }
.cc .spaninfo { position: absolute; bottom: 6px; right: 6px; font-size: 12px; color: #e8eaed;
  background: rgba(0,0,0,.55); padding: 1px 6px; border-radius: 6px; }
.cc .spaninfo:empty { display: none; }
.cc .ppmark { position: absolute; top: 6px; right: 8px; color: #fff; font-size: 14px; opacity: .8; }
.cc .scrub { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.cc .timeline { position: relative; flex: 1; height: 38px; background: #2b3138; border-radius: 8px;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.cc.scrubbing .timeline { cursor: grabbing; }
.cc .timeline .span { position: absolute; top: 0; bottom: 0; background: #34a853; border-radius: 8px;
  opacity: .9; }
.cc .timeline .head { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1px;
  background: #fff; border-radius: 2px; pointer-events: none; }
/* Span handles: a white grip on each end of the green span; the hit area
   is ~44 px wide and taller than the timeline (thumb-sized on a phone). */
.cc.withspan .scrub { padding: 0 16px; }
.cc .hdl { position: absolute; top: -5px; bottom: -5px; width: 44px; margin-left: -22px; z-index: 2;
  display: flex; align-items: center; justify-content: center; cursor: ew-resize; touch-action: none; }
.cc .hdl .grip { width: 10px; height: 30px; border-radius: 5px; background: #fff;
  box-shadow: 0 0 0 2px #1e8e3e, 0 1px 4px rgba(0,0,0,.6); }
.cc .hdl:focus-visible { outline: 2px solid #fdd663; outline-offset: -2px; border-radius: 8px; }
.cc.dragging .timeline { cursor: ew-resize; }
.cc.dragging .hdl .grip { background: #fdd663; }
.cc.locked .hdl { opacity: .5; pointer-events: none; }
@media (max-width: 600px) {
  html, body { font-size: 15px; }
  header { padding: 6px 10px; gap: 8px; }
  .help { width: 30px; height: 30px; }
  main, section { padding: 6px 8px; }
  .card { padding: 10px; border-radius: 12px; }
  .card p { font-size: 16px; margin: 0 0 8px; }
  .btn { padding: 8px 10px; min-height: 40px; }
  .btn.big { min-height: 48px; font-size: 17px; }
  .btn.small { min-height: 40px; font-size: 14px; }
  .decide { gap: 6px; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
  .status { padding: 24px 8px; }
}
#gif-clip { width: 100%; } #gif-clip .stage { height: 62vh; }
/* ── Tabs: "<thing> review" (owner 2026-10-13) ── */
.tabs { flex: 1; display: flex; gap: 4px; min-width: 0; }
.tabs .tab { padding: 7px 10px; border-radius: 9px; color: #bdc1c6; text-decoration: none;
  font-weight: 600; font-size: 15px; white-space: nowrap; }
.tabs .tab.on { background: #2b3138; color: #fff; }
/* Button groups share a colour: decisions/classes, no-action group, neutral. */
.btn.neutral { background: #3c4043; color: #e8eaed; }
.btn.noact { background: #8a4f00; }
/* Loading more clip past the edge: striped pulsing segment on the timeline,
   a spinner badge on the video, then "+1.5 s added"; errors offer Retry. */
.cc .timeline .pend { position: absolute; top: 0; bottom: 0; border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
  color: #202124; white-space: nowrap; pointer-events: none;
  background: repeating-linear-gradient(-45deg, #fdd663 0 8px, #b08900 8px 16px);
  background-size: 22.6px 22.6px; animation: pend-slide .6s linear infinite, pend-pulse .9s ease-in-out infinite alternate; }
.cc .timeline .pend span { background: rgba(253,214,99,.9); padding: 0 4px; border-radius: 4px; }
@keyframes pend-slide { to { background-position: 22.6px 0; } }
@keyframes pend-pulse { from { opacity: .55; } to { opacity: 1; } }
/* At the top edge of the picture, off the player (who is centred in the crop). */
.cc .morebox { position: absolute; left: 50%; top: 4px; transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 10px; font-size: 14px;
  color: #fff; background: rgba(0,0,0,.72); white-space: nowrap; }
.cc .morebox[hidden] { display: none; }
.cc .morebox[data-state="added"] { background: rgba(30,142,62,.92); font-weight: 700; }
.cc .morebox[data-state="error"] { background: rgba(197,34,31,.92); }
.cc .morebox .btn.small { min-height: 36px; background: #fff; color: #202124; }
/* Player review tutorial: the closing take-your-time note. */
#tut-card.tut-note p { font-size: 19px; line-height: 1.4; }
/* Unsaved answers (static/savequeue.js): a small bar over the header, away
   from the answer buttons; tapping it re-sends them. */
.savebar { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 4px); left: 50%;
  transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 24px); white-space: nowrap;
  border: 0; border-radius: 16px; padding: 6px 14px; font: inherit; font-size: 14px; font-weight: 600;
  background: #fdd663; color: #202124; box-shadow: 0 2px 8px rgba(0,0,0,.4); cursor: pointer; }
