/* Office Guessr — palette taken from the venue and from Pip (the pin mascot):
   floor-plan paper, ink, Pip's coral tie and teal body. Dark only where it sits on the 3D view. */
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/fonts/bricolage.woff2') format('woff2');
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --paper: #efe8da;
  --paper-2: #e5dccb;
  --card: #fbf8f1;
  --ink: #1f1b16;
  --ink-2: #5b5348;
  --rule: rgba(31, 27, 22, 0.14);
  --coral: #e9643f;
  --coral-ink: #2a0f05;
  --teal: #17868c;
  --teal-soft: #d3e9e6;
  --good: #2f8a4f;
  --warn: #c98a12;
  --bad: #c63d2b;
  /* on top of the 3D view */
  --hud: rgba(26, 23, 19, 0.84);
  --hud-line: rgba(255, 255, 255, 0.14);
  --hud-text: #f6f1e7;
  --hud-muted: #c2b9a8;
  --radius: 14px;
  --font: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-family: var(--font);
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--ink);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button {
  font: inherit;
  border: 0;
  border-radius: 12px;
  padding: 13px 20px;
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.005em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation; /* no double-tap zoom on iOS */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.08s ease, background-color 0.15s ease, opacity 0.15s ease;
}
button:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
button:disabled { opacity: 0.45; cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
button.primary { background: var(--coral); color: var(--coral-ink); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
button.secondary { background: var(--teal); color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2); }
button.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--rule); }
button.danger { background: var(--bad); color: #fff; }
button.good { background: var(--good); color: #fff; }
button svg { width: 1.15em; height: 1.15em; flex: none; }
input, textarea {
  font: inherit;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid var(--rule);
  background: var(--card);
  color: var(--ink);
  font-size: 18px;
}
input:focus { border-color: var(--teal); outline: none; }
input::placeholder { color: #9b9284; }
a { color: var(--teal); font-weight: 600; }
[hidden] { display: none !important; }
.muted { color: var(--ink-2); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }

/* ---------- full-screen paper layers ---------- */
.stage { position: fixed; inset: 0; background: #2a2620; }
.stage canvas.gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  text-align: center;
  color: var(--ink);
  /* drafting-paper grid, like the floor plans the game is about */
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(31, 27, 22, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 27, 22, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(31, 27, 22, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 27, 22, 0.035) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
  z-index: 20;
  overflow-y: auto;
}
.logo {
  font-size: 40px;
  font-weight: 800;
  font-stretch: 85%;
  letter-spacing: -0.035em;
  line-height: 0.95;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.18em;
}
.logo span { color: var(--coral); }
.logo .mark { width: 0.72em; height: 0.72em; flex: none; }
.tagline { margin: -6px 0 0; font-size: 16px; color: var(--ink-2); max-width: 30ch; }
.card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 18px;
  padding: 20px;
  width: min(400px, 100%);
  box-shadow: 5px 5px 0 var(--ink);
  text-align: left;
}
.field-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }

/* Pip stands on top of the card edge */
.mascot-wrap { position: relative; width: min(400px, 100%); padding-top: 92px; }
.mascot {
  position: absolute;
  top: 0;
  right: 18px;
  width: 112px;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  z-index: 1;
  filter: drop-shadow(0 4px 0 rgba(31, 27, 22, 0.12));
}
/* the card sits above Pip so his feet tuck behind its top edge */
.mascot-wrap .card { position: relative; z-index: 2; }
.mascot-wrap .mascot { top: 6px; }

.steps { list-style: none; margin: 0; padding: 0; width: min(400px, 100%); display: grid; gap: 8px; text-align: left; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-size: 15px; line-height: 1.35; color: var(--ink-2); }
.steps b { color: var(--ink); font-weight: 700; }
.steps .n {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--ink);
  background: var(--card);
}
.status-line { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(47, 138, 79, 0.5); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(47, 138, 79, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 138, 79, 0); } }
.controls-list { list-style: none; margin: 4px 0 0; padding: 12px 0 0; border-top: 2px dashed var(--rule); display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.controls-list li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: center; }
.controls-list svg { width: 22px; height: 22px; color: var(--teal); }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- player HUD (on the 3D view) ---------- */
.crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.crosshair::before, .crosshair::after {
  content: '';
  position: absolute;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
}
.crosshair::before { left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-50%); }
.crosshair::after { top: 50%; left: 0; right: 0; height: 2px; transform: translateY(-50%); }
.crosshair .dot {
  /* hollow, so a small target under the crosshair stays visible */
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  border: 2.5px solid var(--coral);
  box-shadow: 0 0 0 1.5px #fff, inset 0 0 0 1px #fff;
  z-index: 1;
}

.hud-top {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.hud-stats { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.clue-thumb {
  width: 36vw;
  max-width: 220px;
  padding: 5px 5px 0;
  border-radius: 6px;
  background: var(--card);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  cursor: zoom-in;
  transform: rotate(-1.5deg);
}
.clue-thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: 2px; background: #000; }
.clue-thumb .tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  padding: 4px 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.clue-thumb .tag svg { width: 12px; height: 12px; flex: none; }
.pill {
  background: var(--hud);
  color: var(--hud-text);
  border: 1px solid var(--hud-line);
  border-radius: 10px;
  padding: 7px 12px;
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.pill .lbl { color: var(--hud-muted); font-weight: 600; margin-right: 4px; }
.timer { font-size: 20px; min-width: 76px; text-align: center; }
.timer.low { background: var(--bad); border-color: transparent; color: #fff; animation: tick 1s steps(1) infinite; }
@keyframes tick { 50% { background: #a32f20; } }

.hud-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 10px;
  padding: 0 12px;
  pointer-events: none;
}
.hud-bottom > * { pointer-events: auto; }
.hud-bottom button { min-height: 52px; font-size: 16px; }
.hud-bottom button.primary.ready { animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18), 0 0 0 0 rgba(233, 100, 63, 0.7); } 50% { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18), 0 0 0 8px rgba(233, 100, 63, 0); } }
/* where to put your thumb to walk, until the first time someone does */
.joy-ghost {
  position: absolute;
  left: max(20px, 8vw);
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 120px);
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.75);
  background: rgba(31, 27, 22, 0.28);
  display: grid;
  place-items: center;
  pointer-events: none;
  animation: breathe 2.4s ease-in-out infinite;
}
.joy-ghost::before { content: ''; width: 40px; height: 40px; border-radius: 50%; background: rgba(246, 241, 231, 0.7); grid-area: 1 / 1; }
.joy-ghost span { grid-area: 1 / 1; transform: translateY(-70px); font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
@keyframes breathe { 50% { transform: scale(1.06); } }
.hud-bottom button.secondary { background: var(--card); color: var(--ink); }
.hud-bottom button.secondary svg { color: var(--coral); }
.height-btns {
  position: absolute;
  right: 12px;
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 104px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.height-btns button { width: 48px; height: 48px; padding: 0; background: var(--hud); color: var(--hud-text); border: 1px solid var(--hud-line); }
.height-btns button svg { width: 20px; height: 20px; }
.hint {
  position: absolute;
  left: 50%;
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 70px);
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 600;
  color: var(--hud-text);
  background: var(--hud);
  padding: 5px 11px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
}

.joystick {
  position: absolute;
  width: 110px;
  height: 110px;
  margin: -55px 0 0 -55px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  background: rgba(31, 27, 22, 0.25);
  pointer-events: none;
}
.joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(246, 241, 231, 0.75);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 13, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 16px;
}
.overlay img { max-width: 100%; max-height: 100%; border-radius: 8px; transform-origin: center; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.overlay-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  width: 46px;
  height: 46px;
  padding: 0;
  background: var(--card);
  color: var(--ink);
}
.overlay-close svg { width: 20px; height: 20px; }
.overlay-hint {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 600;
  color: var(--hud-text);
  background: var(--hud);
  padding: 5px 11px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
}

.sheet {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  padding: 16px 18px;
  max-width: 460px;
  margin: 0 auto;
}
.sheet-row { display: flex; align-items: center; gap: 12px; }
.sheet-row > div { flex: 1; min-width: 0; }
.sheet .check { width: 40px; height: 40px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; flex: none; }
.sheet .check svg { width: 22px; height: 22px; }
.sheet-title { font-weight: 800; font-size: 18px; }
.sheet-mascot { position: absolute; right: 14px; top: -74px; width: 88px; height: auto; pointer-events: none; animation: hop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes hop { from { transform: translateY(24px) scale(0.85); opacity: 0; } }
.big-num { font-size: 44px; font-weight: 800; font-stretch: 85%; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; color: var(--ink); }
.big-num small { font-size: 16px; font-weight: 700; color: var(--ink-2); letter-spacing: 0; margin-left: 4px; }
.meter { height: 10px; border-radius: 99px; background: var(--paper-2); overflow: hidden; margin: 12px 0 8px; }
.meter > i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--teal); transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.meter.hot > i { background: var(--coral); }
.result-dist { font-weight: 700; font-size: 16px; }
.result-rank { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.toast {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--hud);
  color: var(--hud-text);
  padding: 10px 16px;
  border-radius: 12px;
}

/* ---------- host / TV ---------- */
body.host { font-size: clamp(16px, 1.3vw, 30px); }
.host-grid {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr minmax(300px, 26vw);
}
.host-main { position: relative; overflow: hidden; background: #2a2620; }
.host-side {
  background: var(--paper);
  color: var(--ink);
  border-left: 2px solid var(--ink);
  padding: 2.4vh 1.5vw;
  display: flex;
  flex-direction: column;
  gap: 1.6vh;
  overflow: auto;
}
.host-side h2 { margin: 0; font-size: 0.8em; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 800; }
.host-side .side-brand { font-weight: 800; font-size: 1.1em; letter-spacing: -0.02em; display: flex; align-items: center; gap: 0.35em; }
.host-side .side-brand .mark { width: 1em; height: 1em; }
.host-side .side-brand span { color: var(--coral); }
.round-label { font-size: 1em; font-weight: 700; color: var(--ink-2); }
.big-timer { font-size: 5.2em; font-weight: 800; font-stretch: 80%; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.big-timer.low { color: var(--bad); }
.progress-line { height: 8px; background: var(--paper-2); border-radius: 99px; overflow: hidden; }
.progress-line > i { display: block; height: 100%; width: 0; background: var(--teal); transition: width 0.4s ease; }
.clue-big {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.4vh;
  padding: 3vh 3vw;
  background: var(--ink);
  color: var(--hud-text);
}
.clue-big .frame {
  background: var(--card);
  padding: 1.2vh 1.2vh 6vh;
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  position: relative;
  max-width: 100%;
  transform: rotate(-0.8deg);
}
.clue-big img { display: block; max-width: 100%; max-height: 74vh; border-radius: 2px; }
.clue-big .frame figcaption { position: absolute; left: 0; right: 0; bottom: 1.4vh; text-align: center; color: var(--ink); font-weight: 800; font-size: 1.7em; letter-spacing: -0.02em; }
.clue-big .q { font-size: 1em; font-weight: 700; color: var(--hud-muted); letter-spacing: 0.12em; text-transform: uppercase; }
.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--rule);
}
.plist .sw { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); }
.plist .nm { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.plist .sc { font-variant-numeric: tabular-nums; font-weight: 800; }
.plist .rk { width: 1.6em; color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 700; }
.plist li.off { opacity: 0.45; }
.plist li.done { border-color: var(--teal); background: var(--teal-soft); }
.plist li.done .nm::after { content: ' ✓'; color: var(--teal); font-weight: 800; }
.plist li.empty { justify-content: center; color: var(--ink-2); background: transparent; border-style: dashed; }
.host-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 1vh; }
.host-actions button { flex: 1; font-size: 1.05em; padding: 1.4vh 1vw; white-space: nowrap; }
.host-actions button.ghost { flex: 0 0 auto; padding-inline: 1.4vw; }
.kbd-help { font-size: 12px; color: var(--ink-2); line-height: 1.6; }
kbd { font: inherit; font-weight: 700; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--rule); border-bottom-width: 2px; background: var(--card); }

/* host lobby */
.host .screen { gap: 3.2vh; padding: 4vh 4vw; }
.host .logo { font-size: 4.4em; }
.lobby-wrap { display: flex; gap: 3vw; align-items: stretch; justify-content: center; flex-wrap: wrap; }
.join-card {
  display: flex;
  gap: 2.4vw;
  align-items: center;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 22px;
  box-shadow: 8px 8px 0 var(--ink);
  padding: 2.4vh 8.5vw 2.4vh 2.4vw; /* room on the right for Pip */
  text-align: left;
  position: relative;
}
.join-card .qr { width: min(40vh, 480px); aspect-ratio: 1; border-radius: 10px; background: #fff; padding: 8px; border: 2px solid var(--ink); display: block; }
.join-card .host-mascot { position: absolute; right: -3vw; bottom: -2vh; width: 10.5vw; max-width: 200px; pointer-events: none; filter: drop-shadow(0 6px 0 rgba(31, 27, 22, 0.12)); }
.join-url { font-size: 1.9em; font-weight: 800; letter-spacing: -0.02em; color: var(--teal); word-break: break-all; }
.host .steps { width: auto; font-size: 1.05em; gap: 1.2vh; }
.host .steps li { font-size: 1em; grid-template-columns: 1.9em 1fr; }
.host .steps .n { width: 1.9em; height: 1.9em; font-size: 0.85em; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 80vw; }
.chip {
  padding: 0.5em 1em;
  border-radius: 10px;
  background: var(--card);
  border: 2px solid var(--ink);
  font-weight: 700;
  font-size: 1.2em;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  animation: pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.chip i { width: 0.7em; height: 0.7em; border-radius: 50%; display: inline-block; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
.chips-empty { color: var(--ink-2); font-size: 1.2em; font-weight: 600; }

.label3d {
  font-size: 13px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(26, 23, 19, 0.82);
  color: #fff;
  white-space: nowrap;
  transform: translateY(16px);
  font-family: var(--font);
}
.label3d.answer { background: var(--good); color: #fff; font-size: 15px; transform: translateY(-26px); z-index: 1; }
.host .label3d { font-size: 0.85em; padding: 0.2em 0.55em; }
.host .label3d.answer { font-size: 1.05em; }

/* podium */
.podium-wrap { display: flex; align-items: flex-end; gap: 2vw; border-bottom: 3px solid var(--ink); padding: 0 3vw; }
.podium { display: flex; align-items: flex-end; gap: 1.6vw; justify-content: center; }
.podium .col { display: flex; flex-direction: column; align-items: center; gap: 0.8vh; width: 15vw; }
.podium .bar {
  width: 100%;
  border-radius: 12px 12px 0 0;
  border: 2px solid var(--ink);
  border-bottom: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1.4vh;
  font-size: 4em;
  font-weight: 800;
  font-stretch: 80%;
  color: var(--ink);
  transform-origin: bottom;
  animation: rise 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
/* third place rises first, the winner last */
.podium .p3 .bar { animation-delay: 0.1s; }
.podium .p2 .bar { animation-delay: 0.6s; }
.podium .p1 .bar { animation-delay: 1.1s; }
.podium .col > :not(.bar) { animation: pop 0.4s ease both; }
.podium .p3 > :not(.bar) { animation-delay: 0.5s; }
.podium .p2 > :not(.bar) { animation-delay: 1s; }
.podium .p1 > :not(.bar) { animation-delay: 1.6s; }
@keyframes rise { from { transform: scaleY(0); } }
.podium .nm { font-size: 1.6em; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; max-width: 100%; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.podium .sc { color: var(--ink-2); font-size: 1.15em; font-weight: 600; }
.podium-mascot { width: 12vw; max-width: 220px; margin-bottom: 1vh; }

/* ---------- editor ---------- */
.ed-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ed-list li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  align-items: center;
  padding: 6px;
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  border: 2px solid transparent;
}
.ed-list li.sel { border-color: var(--coral); }
.ed-list img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; background: #000; }
.ed-list .t { font-weight: 700; font-size: 14px; }
.ed-list .s { font-size: 12px; color: var(--ink-2); }
.ed-detail { display: flex; flex-direction: column; gap: 8px; }
.ed-detail img { width: 100%; border-radius: 10px; }
.ed-detail input { font-size: 14px; padding: 8px 10px; }
.ed-row { display: flex; gap: 6px; flex-wrap: wrap; }
.ed-row button { padding: 8px 12px; font-size: 13px; }
.ed-model { border: 2px solid var(--rule); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; background: var(--card); }
.ed-model > * + * { margin-top: 8px; }
.ed-model summary { cursor: pointer; font-weight: 700; }
.ed-model textarea { font: 12px ui-monospace, monospace; padding: 8px; border-radius: 8px; }
.ed-model progress { width: 100%; }
.ed-calib { margin: 0; font-size: 11px; white-space: pre-wrap; word-break: break-all; color: var(--ink-2); max-height: 120px; overflow: auto; }
.ed-list .warn { color: var(--warn); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-height: 640px) {
  .mascot-wrap { padding-top: 64px; }
  .mascot { width: 80px; }
  .steps li { font-size: 14px; }
}

/* ---------- editor: crop the clue photo ---------- */
.crop-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 17, 13, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  color: #f6f1e7;
}
.crop-head { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.crop-head .muted, .crop-bar .muted { color: #c9c0b0; }
.crop-stage { position: relative; line-height: 0; overflow: hidden; border-radius: 6px; touch-action: none; user-select: none; -webkit-user-select: none; }
.crop-stage img { display: block; max-width: min(92vw, 1200px); max-height: 72vh; }
.crop-rect {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  cursor: move;
}
.crop-rect i {
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--coral);
  border: 2px solid #fff;
  border-radius: 50%;
}
.crop-rect i[data-h="nw"] { left: -10px; top: -10px; cursor: nwse-resize; }
.crop-rect i[data-h="ne"] { right: -10px; top: -10px; cursor: nesw-resize; }
.crop-rect i[data-h="sw"] { left: -10px; bottom: -10px; cursor: nesw-resize; }
.crop-rect i[data-h="se"] { right: -10px; bottom: -10px; cursor: nwse-resize; }
.crop-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- reveal: the full photo ---------- */
.reveal-photo { margin: 0; background: var(--card); padding: 6px 6px 0; border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); }
.reveal-photo img { display: block; width: 100%; max-height: 30vh; object-fit: contain; background: #000; border-radius: 2px; }
.reveal-photo figcaption { font-size: 0.8em; font-weight: 700; color: var(--ink); padding: 5px 2px 6px; }
.clue-thumb.full-photo { animation: fullPhoto 0.9s ease-out 2; }
@keyframes fullPhoto {
  0% { transform: rotate(-1.5deg) scale(1); }
  40% { transform: rotate(-1.5deg) scale(1.12); box-shadow: 0 0 0 4px var(--coral), 0 8px 22px rgba(0, 0, 0, 0.45); }
  100% { transform: rotate(-1.5deg) scale(1); }
}
