/* PACMUN hunt. Delegate-facing, read on a phone in a hotel corridor:
   large tap targets, high contrast, nothing decorative. */

:root {
  --teal: #17879c;
  --teal-ink: #0b5260;
  --bg: #f4f7f8;
  --surface: #ffffff;
  --fg: #16272b;
  --muted: #5d7278;
  --line: #d4e0e3;
  --good: #16794a;
  --good-bg: #e6f5ec;
  --bad: #a6332a;
  --bad-bg: #fcecea;
  --warn: #8a5a00;
  --warn-bg: #fdf3e0;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1619;
    --surface: #162328;
    --fg: #e6eef0;
    --muted: #96abb1;
    --line: #27383e;
    --teal: #4fc3d9;
    --teal-ink: #9fe3f0;
    --good: #5ddc9b;
    --good-bg: #102e22;
    --bad: #ff8d7e;
    --bad-bg: #331c19;
    --warn: #f0c46a;
    --warn-bg: #2a2114;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.wrap {
  max-width: 34rem;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 20px 60px;
}

.loading { text-align: center; padding: 80px 20px; color: var(--muted); }
.spinner {
  width: 32px; height: 32px; margin: 0 auto 16px;
  border: 3px solid var(--line); border-top-color: var(--teal);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* Header ----------------------------------------------------------------- */
header { margin-bottom: 18px; }
.kicker {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--teal); margin-bottom: 4px;
}
h1 { font-size: 1.6rem; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 26px 0 10px; }
.lede { color: var(--muted); margin: 0; }

/* Score ------------------------------------------------------------------ */
.score {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 20px;
  display: flex; gap: 20px; flex-wrap: wrap; align-items: baseline;
}
.score .big {
  font-size: 2.1rem; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.score .unit { color: var(--muted); font-size: 0.9rem; }
.pending {
  flex-basis: 100%; color: var(--warn); font-size: 0.88rem;
  border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px;
}

/* Cards ------------------------------------------------------------------ */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius); padding: 15px; margin-bottom: 12px;
}
.card.pin { border-color: var(--teal); border-left-width: 5px; }
.card.away { border-left-color: var(--warn); }
.card .pts {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--teal);
}
.card .clue { margin: 7px 0 0; font-size: 1.02rem; }
.card .where { margin: 8px 0 0; color: var(--muted); font-size: 0.88rem; }
.card img { width: 100%; border-radius: 8px; margin-top: 10px; display: block; }

.tap, .warn, .media-note {
  margin-top: 10px; padding: 9px 11px; border-radius: 8px; font-size: 0.86rem;
}
.tap { background: var(--good-bg); color: var(--good); }
.warn { background: var(--warn-bg); color: var(--warn); }
.media-note { background: var(--warn-bg); color: var(--warn); }

/* Controls --------------------------------------------------------------- */
label { display: block; font-size: 0.84rem; font-weight: 600; margin-bottom: 5px; }
input[type="text"], textarea {
  width: 100%; padding: 13px; font-size: 1.05rem; font-family: inherit;
  color: var(--fg); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px;
}
input[type="text"]:focus-visible, textarea:focus-visible,
button:focus-visible, a:focus-visible {
  outline: 3px solid var(--teal); outline-offset: 2px;
}

button, a.btn {
  display: block; width: 100%; margin-top: 12px;
  padding: 15px; font-size: 1.05rem; font-weight: 700; font-family: inherit;
  text-align: center; text-decoration: none;
  color: #fff; background: var(--teal);
  border: 0; border-radius: 8px; cursor: pointer;
}
button.off { opacity: 0.55; pointer-events: none; }
a.btn.secondary {
  color: var(--teal); background: transparent; border: 1.5px solid var(--teal);
}

.field { margin-top: 14px; }

/* Verdict ---------------------------------------------------------------- */
.verdict { margin-top: 16px; padding: 14px; border-radius: var(--radius); display: none; }
.verdict.show { display: block; }
.verdict.yes { background: var(--good-bg); color: var(--good); }
.verdict.no { background: var(--bad-bg); color: var(--bad); }
.verdict strong { display: block; font-size: 1.05rem; margin-bottom: 2px; }

.banner {
  background: var(--teal); color: #fff; border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 16px; font-size: 0.92rem;
}

.foot {
  margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.84rem;
}

details.howto {
  margin-top: 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px;
}
details.howto summary { font-weight: 600; cursor: pointer; }
details.howto ol { padding-left: 1.3em; margin: 10px 0 0; }
details.howto li { margin-bottom: 6px; }
details.howto img { width: 100%; border-radius: 8px; margin-top: 10px; }

.empty {
  background: var(--surface); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 24px 16px; text-align: center;
  color: var(--muted);
}
