/* A tool, not a page. Everything here is in service of getting through several hundred judgements
   without losing your place, so: fixed header, dense grid, and the verdict visible on the tile
   rather than a hover away. */

:root {
  --paper: #f4f3ef;
  --card: #ffffff;
  --ink: #1c2126;
  --soft: #666e76;
  --line: #dcd9d2;
  --good: #2f7a52;
  --wrong: #b0392c;
  --star: #c58a1e;
  --focus: #2f5d8c;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14181c; --card: #1c2126; --ink: #eceff2; --soft: #98a1a9;
    --line: #2c333a; --good: #4fa87a; --wrong: #d9695a; --star: #dcae4c; --focus: #6fa3d6;
  }
}

* { box-sizing: border-box; }

/* [hidden] MUST WIN, AND IT DOES NOT BY DEFAULT.
 *
 * The browser hides [hidden] with a rule of its own, and any author rule at the same specificity
 * beats it. Both overlays here set a display, .who-gate flex and .focus grid, so setting hidden on
 * them changed the property and nothing else: the reviewer gate never went away after you picked a
 * name, and the focus overlay could never be closed. Clicking a name looked completely dead when in
 * fact it had worked and the answer was sitting behind a panel that would not leave.
 *
 * !important because it has to outrank every display rule in this file, including ones nobody has
 * written yet. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

/* ---------------------------------------------------------------- header */

.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center;
  padding: 12px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.who { display: flex; align-items: baseline; gap: 8px; }
.lbl { color: var(--soft); font-size: 13px; }
.who strong { font-size: 17px; text-transform: capitalize; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.filters button {
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--soft); font: inherit; font-size: 13px; cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filters button .n { opacity: .6; margin-left: 5px; font-variant-numeric: tabular-nums; }

.right { display: flex; align-items: center; gap: 14px; }
.compare { display: flex; align-items: center; gap: 6px; color: var(--soft); font-size: 13px; cursor: pointer; }
.ghost {
  border: 1px solid var(--line); background: transparent; color: var(--soft);
  border-radius: 6px; padding: 3px 8px; font: inherit; font-size: 12px; cursor: pointer;
}
.go {
  border: 0; background: var(--focus); color: #fff; border-radius: 7px;
  padding: 8px 15px; font: inherit; font-weight: 700; cursor: pointer;
}

/* -------------------------------------------------------------- progress */

.progress {
  display: flex; flex-wrap: wrap; gap: 8px 26px; align-items: center;
  padding: 10px 20px; border-bottom: 1px solid var(--line);
  color: var(--soft); font-size: 13px;
}
.progress b { color: var(--ink); font-variant-numeric: tabular-nums; }
.meter { flex: 1; min-width: 160px; height: 7px; background: var(--line); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--good); }

/* ------------------------------------------------------------------ grid */

.grid {
  display: grid; gap: 16px; padding: 18px 20px 80px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.tile {
  margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; display: flex; flex-direction: column;
}
.tile.mine-good { border-color: var(--good); box-shadow: inset 0 0 0 1px var(--good); }
.tile.mine-wrong { border-color: var(--wrong); box-shadow: inset 0 0 0 1px var(--wrong); }

.tile .shot { border: 0; padding: 0; background: none; cursor: zoom-in; display: block; }
.tile img { display: block; width: 100%; height: auto; }

.tile figcaption { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 6px; }
.tile .nm { font-weight: 700; font-size: 13.5px; word-break: break-word; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; }
.chips i {
  font-style: normal; font-size: 11px; padding: 2px 6px; border-radius: 4px;
  background: var(--paper); color: var(--soft); border: 1px solid var(--line);
}
.chips i.photo { color: var(--star); border-color: var(--star); }
.chips i.twin { color: var(--wrong); border-color: var(--wrong); }

.acts { display: flex; gap: 5px; padding: 0 11px 11px; }
.acts button {
  flex: 1; padding: 5px 0; border: 1px solid var(--line); border-radius: 6px;
  background: transparent; color: var(--soft); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.acts button[aria-pressed="true"][data-verdict="good"] { background: var(--good); border-color: var(--good); color: #fff; }
.acts button[aria-pressed="true"][data-verdict="wrong"] { background: var(--wrong); border-color: var(--wrong); color: #fff; }
.acts button[aria-pressed="true"].star { background: var(--star); border-color: var(--star); color: #fff; }

/* The other person's verdict, only when comparing. Small and separate, so it can never be mistaken
   for your own mark. */
.theirs { padding: 0 11px 10px; font-size: 11.5px; color: var(--soft); }
.theirs b.good { color: var(--good); }
.theirs b.wrong { color: var(--wrong); }

.empty { padding: 40px 20px; color: var(--soft); }

/* ----------------------------------------------------------------- focus */

.focus {
  position: fixed; inset: 0; z-index: 40; background: var(--paper);
  display: grid; grid-template-rows: auto 1fr auto auto auto; gap: 10px;
  padding: 14px 20px 20px;
}
.focus .close {
  position: absolute; right: 16px; top: 10px; z-index: 2;
  border: 0; background: none; color: var(--soft); font-size: 30px; line-height: 1; cursor: pointer;
}
.stage { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; align-items: center; min-height: 0; }
.stage img {
  max-height: calc(100vh - 300px); max-width: 100%; margin: 0 auto; display: block;
  border: 1px solid var(--line); border-radius: 8px;
}
.stage figcaption h2 { margin: 0 0 8px; font-size: 22px; word-break: break-word; }
.stage figcaption p { margin: 0 0 10px; color: var(--soft); font-size: 14px; }

.verdicts { display: flex; gap: 10px; justify-content: center; }
.verdicts .v {
  padding: 11px 22px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer;
}
.verdicts .v b {
  display: inline-block; min-width: 20px; margin-right: 8px; padding: 1px 5px;
  border-radius: 4px; background: var(--paper); border: 1px solid var(--line); font-size: 12px;
}
.verdicts .good[aria-pressed="true"] { background: var(--good); border-color: var(--good); color: #fff; }
.verdicts .wrong[aria-pressed="true"] { background: var(--wrong); border-color: var(--wrong); color: #fff; }
.verdicts .star[aria-pressed="true"] { background: var(--star); border-color: var(--star); color: #fff; }

.note {
  width: 100%; max-width: 720px; margin: 0 auto; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--ink); font: inherit;
}
.pos { margin: 0; text-align: center; color: var(--soft); font-size: 13px; }

/* ----------------------------------------------------------------- toast */

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: var(--paper); padding: 9px 16px; border-radius: 8px; font-size: 13px;
}
.toast.bad { background: var(--wrong); color: #fff; }

@media (max-width: 820px) {
  .stage { grid-template-columns: 1fr; }
  .stage img { max-height: 50vh; }
}

/* ------------------------------------------------------------- who gate */

.who-gate {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
}
.who-box { width: min(440px, 90vw); text-align: center; }
.who-box h1 { margin: 0 0 8px; font-size: 26px; }
.who-box p { margin: 0 0 22px; color: var(--soft); font-size: 14px; }
.who-picks { display: flex; gap: 12px; justify-content: center; margin-bottom: 20px; }
.who-picks button {
  flex: 1; padding: 16px 0; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); font: inherit; font-size: 18px; font-weight: 700; cursor: pointer;
}
.who-picks button:hover { border-color: var(--focus); }
.who-other { display: flex; gap: 8px; }
.who-other input {
  flex: 1; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--card); color: var(--ink); font: inherit;
}
.who-other button {
  border: 1px solid var(--line); background: transparent; color: var(--soft);
  border-radius: 7px; padding: 0 14px; font: inherit; cursor: pointer;
}
.who-err { color: var(--wrong); margin: 14px 0 0; }

/* ------------------------------------------------------- offline notice */

.offline {
  margin: 0; padding: 11px 20px;
  background: #fbf1d8; color: #6b4d10; border-bottom: 1px solid #e6d3a4;
  font-size: 13.5px;
}
.offline b { font-weight: 700; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .offline { background: #33290f; color: #f0dca8; border-bottom-color: #4a3c17; }
}

/* ------------------------------------------------------------ zoom + notes */

/* Unzoomed, the card is scaled to fit the space it has. Zoomed, it is shown at the 1080 it will be
   posted at, in a scroller that fills the window: the question this tool asks is whether the type
   sits right, and that cannot be answered from a scaled copy. */
.shot-wrap { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; }
.shot-wrap img { cursor: zoom-in; }

.focus .zoom {
  position: absolute; right: 10px; bottom: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 7px; padding: 6px 11px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.focus .zoom b {
  display: inline-block; min-width: 16px; margin-right: 6px; padding: 0 4px;
  border-radius: 3px; background: var(--paper); border: 1px solid var(--line); font-size: 11px;
}

.focus.zoomed .stage {
  position: fixed; inset: 0; z-index: 50; display: block;
  overflow: auto; background: var(--paper); padding: 20px;
}
.focus.zoomed .shot-wrap { display: block; min-height: auto; }
.focus.zoomed .shot-wrap img {
  width: 1080px; max-width: none; max-height: none; margin: 0 auto; cursor: zoom-out;
}
.focus.zoomed figcaption { display: none; }
.focus.zoomed .zoom { position: fixed; right: 20px; bottom: 20px; z-index: 51; }

.notebox { max-width: 720px; margin: 0 auto; width: 100%; position: relative; }
.notebox label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.notebox .hint { font-weight: 400; color: var(--soft); }
.notebox textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--card); color: var(--ink); font: inherit; resize: vertical;
}
.notebox textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.notebox .saved {
  position: absolute; right: 8px; top: 0; font-size: 11.5px; color: var(--good); font-weight: 700;
}

/* A note on a tile, so the grid shows what you said rather than hiding it one click away. */
.tile .mynote {
  margin: 0; padding: 0 11px 10px; font-size: 11.5px; line-height: 1.35; color: var(--ink);
}
.tile .mynote b { color: var(--wrong); }
.acts button.note[aria-pressed="true"] { background: var(--focus); border-color: var(--focus); color: #fff; }
