/* Cryptid Daily — field dossier
   Ink-green panel, charcoal bands, parchment note slips, flagging-tape orange for the pin and the live action. */

:root {
  --ink: #132620;          /* panel */
  --ink-raised: #1a3029;   /* wells inside the panel */
  --ink-deep: #0e1c18;     /* the outer edge of the start-screen backdrop */
  --charcoal: #1c201f;     /* masthead and action bands */
  --rule: #2f463d;         /* hairlines on ink */
  --parchment: #ece2c6;    /* slips, primary text on ink: 12.3:1 */
  --parchment-dim: #b8ae94;/* secondary text on ink: 7.2:1 */
  --sepia: #5a5444;        /* secondary text on parchment: 5.8:1 */
  --sage: #9aa59d;         /* muted text on ink: 6.2:1 */
  --flag: #f0702e;         /* flagging tape: pin, start button, live dot */
  --flag-deep: #d95a1a;
  --flag-ink: #a3471a;     /* orange as text on parchment: 4.7:1 */

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --mono: "Courier Prime", "Courier New", ui-monospace, monospace;

  --panel-w: 420px;
  --gutter: 28px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  accent-color: var(--flag);
  caret-color: var(--flag);
}

::selection { background: var(--flag); color: var(--charcoal); }

a {
  color: inherit;
  text-decoration-color: var(--flag);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--flag);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.app {
  display: grid;
  grid-template-columns: var(--panel-w) 1fr;
  height: 100vh;
  height: 100dvh;
}

/* ---------- panel ---------- */

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  background: var(--ink);
  border-right: 1px solid var(--charcoal);
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

.masthead {
  padding: 22px var(--gutter) 18px;
  background: var(--charcoal);
  border-bottom: 1px solid var(--rule);
}

.masthead h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.875rem;
  font-weight: 700;
  font-variation-settings: "opsz" 72;
  letter-spacing: -0.02em;
  line-height: 1;
}

.case-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--parchment-dim);
}

.case-no { color: var(--flag); font-weight: 700; }

.section-heading {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--parchment-dim);
}

/* ---------- score: one number ---------- */

.score {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
}

.score-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--parchment-dim);
}

.score-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--parchment);
  font-variant-numeric: tabular-nums;
}

.score-num {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
}

/* a miss knocks the number down: it dips, flushes orange, and settles */
.score-value.is-drop {
  display: inline-block;
  animation: points-drop 900ms var(--ease-out) 200ms backwards;
}

@keyframes points-drop {
  0%   { color: var(--flag); transform: translateY(-10px) scale(1.18); }
  35%  { color: var(--flag); transform: translateY(2px) scale(0.97); }
  100% { color: var(--parchment); transform: none; }
}

/* what the miss cost, beside the number for a moment */
.score-delta {
  font-size: 1rem;
  font-weight: 700;
  color: var(--flag);
  opacity: 0;
  font-variant-numeric: tabular-nums;
}

.score-delta.is-shown { animation: delta-out 1400ms var(--ease-out) 200ms backwards; }

@keyframes delta-out {
  0%   { opacity: 0; transform: translateY(6px); }
  15%  { opacity: 1; transform: none; }
  70%  { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-8px); }
}

/* ---------- field notes: one slot, newest first, flip back for older ---------- */

.notes {
  padding: 18px var(--gutter) 6px;
}

.notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.notes-head .section-heading { margin: 0; }

.note-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.note-step {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: transparent;
  color: var(--parchment);
  cursor: pointer;
}

.note-step:hover:not(:disabled) { border-color: var(--sage); background: var(--ink-raised); }
.note-step:disabled { color: var(--rule); cursor: default; }

/* the slot is sized in JS to today's tallest note, so the panel never moves; slips hug their text */
.note-view {
  display: grid;
  align-content: start;
}

.note-probe {
  position: absolute;
  left: -9999px;
  top: 0;
  visibility: hidden;
}

.note {
  padding: 14px 18px 16px;
  border-radius: 2px;
  background: var(--ink-raised);
  border: 1px solid var(--rule);
  color: var(--parchment-dim);
  font-size: 1.125rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.note-n {
  display: block;
  margin-bottom: 6px;
  font: 700 0.8125rem/1.3 var(--mono);
  color: var(--sage);
}

/* the newest note is the parchment slip: where the eye should land */
.note.is-current {
  background: var(--parchment);
  border-color: var(--parchment);
  color: var(--charcoal);
  font-size: 1.25rem;
  line-height: 1.42;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.6);
}

.note.is-current .note-n { color: var(--flag-ink); }

/* a fresh clue is dealt onto the slot like a new slip, with an orange edge that fades as it settles */
.note.is-new {
  animation:
    note-in 620ms var(--ease-out) 280ms backwards,
    note-flag 1600ms ease-out 280ms backwards;
}

.note.is-new .note-n { animation: note-n-flag 1600ms ease-out 280ms backwards; }

@keyframes note-in {
  from { opacity: 0; transform: translateY(26px) rotate(-1.5deg); }
  to   { opacity: 1; transform: none; }
}

@keyframes note-flag {
  0%, 30% { box-shadow: 0 0 0 3px var(--flag), 0 10px 24px -12px rgba(0, 0, 0, 0.6); }
  100%    { box-shadow: 0 0 0 0 rgba(240, 112, 46, 0), 0 10px 24px -12px rgba(0, 0, 0, 0.6); }
}

@keyframes note-n-flag {
  0%, 40% { color: var(--flag-deep); }
  100%    { color: var(--flag-ink); }
}

.note.is-unread {
  background: transparent;
  border-style: dashed;
  color: var(--sage);
}

.note .unread {
  display: block;
  margin-top: 6px;
  font: 400 0.8125rem/1.3 var(--mono);
  color: var(--sage);
}

/* ---------- guess log ---------- */

.log {
  padding: 18px var(--gutter) 8px;
}

.log-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.log-list li {
  display: grid;
  grid-template-columns: 2.5ch 1fr auto;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid var(--rule);
}

.log-list li:first-child { border-top: 0; }

.log-list .n { color: var(--sage); }
.log-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.log-head .section-heading { margin: 0; }

.guesses-left {
  font: 700 0.8125rem/1.3 var(--mono);
  color: var(--flag);
  white-space: nowrap;
}

.log-list .dist { font-weight: 700; color: var(--parchment); }
.log-list li.is-open { border-top-style: dashed; }
.log-list li.is-open .dist { font-weight: 400; color: var(--sage); }
.log-list .way { color: var(--parchment-dim); text-align: right; white-space: nowrap; }
.log-list li.is-hit .dist,
.log-list li.is-hit .way { color: var(--flag); }

/* the row just written: an orange wash that drains away, its text stamped in from the left */
.log-list li.is-fresh {
  margin: 0 -10px;
  padding-left: 10px;
  padding-right: 10px;
  animation: row-wash 1800ms ease-out 120ms backwards;
}

.log-list li.is-fresh .dist,
.log-list li.is-fresh .way { animation: row-stamp 420ms var(--ease-out) 120ms backwards; }

@keyframes row-wash {
  0%, 20% { background: rgba(240, 112, 46, 0.32); }
  100%    { background: rgba(240, 112, 46, 0); }
}

@keyframes row-stamp {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: none; }
}


/* ---------- finished: the dossier entry ---------- */

.result {
  margin: 20px var(--gutter) 2px;
  padding: 22px 22px 24px;
  border-radius: 2px;
  background: var(--parchment);
  color: var(--charcoal);
  box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.7);
}

/* the depiction: only on the closed case */
.result-figure { margin: 0 0 18px; }

.result-frame {
  display: grid;
  place-items: center;
  height: 210px;
  border-radius: 2px;
  background: rgba(90, 84, 68, 0.12);
  overflow: hidden;
}

.result-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.result-credit {
  margin-top: 6px;
  font: 400 0.75rem/1.35 var(--mono);
  color: var(--sepia);
  overflow-wrap: anywhere;
}

.result-credit a { color: inherit; text-decoration-color: rgba(90, 84, 68, 0.5); }

.result-name {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 700;
  font-variation-settings: "opsz" 72;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* focused only so screen readers announce the result; it is not a control, so no ring */
.result-name:focus,
.result-name:focus-visible { outline: none; }

.result-place {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--sepia);
}

.result-verdict {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px dashed rgba(90, 84, 68, 0.45);
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 700;
}

.result.is-win .result-verdict { color: var(--flag-ink); }
.result:not(.is-win) .result-verdict { color: var(--sepia); }

.result-blurb {
  margin: 14px 0 0;
  font-size: 1.0625rem;
  line-height: 1.6;
  text-wrap: pretty;
}

/* ---------- map ---------- */

.map-wrap { position: relative; min-height: 0; }

#map {
  position: absolute;
  inset: 0;
  background: var(--charcoal); /* dark under the imagery, so nothing flashes while tiles draw */
}

.maplibregl-map { font-family: var(--mono); }
.maplibregl-canvas-container.maplibregl-interactive,
.maplibregl-canvas-container.maplibregl-interactive .maplibregl-canvas { cursor: crosshair; }
.maplibregl-canvas-container.maplibregl-interactive:active,
.maplibregl-canvas-container.maplibregl-interactive:active .maplibregl-canvas { cursor: grabbing; }

/* the map's ring shows only once the keyboard is in use; mouse and touch players never see it */
.maplibregl-canvas:focus,
.maplibregl-canvas:focus-visible { outline: none; }
.map-wrap.is-keyboard .maplibregl-canvas:focus { outline: 3px solid var(--flag); outline-offset: -3px; }

/* zoom buttons in the panel's ink, drawn icons in parchment */
.maplibregl-ctrl-group {
  border-radius: 2px !important;
  background: var(--ink) !important;
  box-shadow: 0 4px 14px -6px rgba(19, 38, 32, 0.6) !important;
}

.maplibregl-ctrl-group button {
  width: 34px;
  height: 34px;
  background-color: var(--ink);
}

.maplibregl-ctrl-group button + button { border-top: 1px solid var(--rule) !important; }
.maplibregl-ctrl-group button:not(:disabled):hover { background-color: var(--ink-raised) !important; }
.maplibregl-ctrl-group button:disabled .maplibregl-ctrl-icon { opacity: 0.35; }

.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 6v12M6 12h12' stroke='%23ece2c6' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 18px;
}

.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12h12' stroke='%23ece2c6' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 18px;
}

.maplibregl-ctrl-group button:focus,
.maplibregl-ctrl-group button:focus-visible { box-shadow: none !important; }

.maplibregl-ctrl-group button:focus-visible {
  outline: 2px solid var(--flag);
  outline-offset: 1px;
}

.maplibregl-ctrl.maplibregl-ctrl-attrib {
  background: rgba(236, 226, 198, 0.85);
  color: var(--charcoal);
  font-size: 0.75rem;
}

.maplibregl-ctrl-attrib a { color: var(--charcoal); }

@media (pointer: coarse) {
  .note-step { width: 44px; height: 44px; }
  .maplibregl-ctrl-group button { width: 44px; height: 44px; }
  .maplibregl-ctrl button .maplibregl-ctrl-icon { background-size: 22px !important; }
}

/* centre crosshair: what Enter places when the map is driven by keyboard */
.crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 160ms var(--ease-out);
  background:
    linear-gradient(var(--ink), var(--ink)) center / 2px 100% no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 100% 2px no-repeat;
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff);
}

/* only for keyboard use: a tap focuses the map too, and must not leave a crosshair behind */
.map-wrap.is-keyboard:has(.maplibregl-canvas:focus) .crosshair { opacity: 1; }
.is-done .crosshair { display: none; }

.pin { width: 32px; height: 44px; pointer-events: none; }

.pin svg {
  display: block;
  overflow: visible;
  filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.9)) drop-shadow(0 3px 3px rgba(19, 38, 32, 0.5));
}

/* the pin falls, hits, squashes, and settles */
.pin.is-drop svg { animation: pin-drop 560ms linear; transform-origin: 50% 100%; }

@keyframes pin-drop {
  0%   { transform: translateY(-46px); opacity: 0; animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  10%  { opacity: 1; }
  42%  { transform: translateY(0) scale(1.14, 0.8); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
  66%  { transform: translateY(-5px) scale(0.96, 1.05); }
  100% { transform: none; }
}

/* the shockwave where the guess hit (a map marker, removed after a second) */
.impact {
  position: relative;
  width: 0;
  height: 0;
  pointer-events: none;
}

.impact-ring {
  position: absolute;
  left: -40px;
  top: -40px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--flag);
  opacity: 0;
  animation: impact 820ms cubic-bezier(0.2, 0.7, 0.3, 1) 200ms backwards;
}

.impact-ring.is-late {
  border-width: 2px;
  border-color: var(--parchment);
  animation-delay: 300ms;
}

@keyframes impact {
  0%   { opacity: 0.95; transform: scale(0.1); }
  100% { opacity: 0; transform: scale(1.6); }
}

.past {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--parchment);
  color: var(--parchment);
  font: 700 0.75rem/1 var(--mono);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 2px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.past.is-hit {
  border-color: var(--flag);
  color: var(--flag);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 0 0 5px rgba(240, 112, 46, 0.35), 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* the reveal pin carries its place label above it, as one marker */
.truth {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.truth .pin { margin-top: 8px; }

.truth-label {
  position: relative;
  background: var(--ink);
  color: var(--parchment);
  border-radius: 2px;
  font: 700 0.8125rem/1.2 var(--mono);
  white-space: nowrap;
  box-shadow: 0 4px 12px -4px rgba(19, 38, 32, 0.6);
  padding: 5px 8px;
}

.truth-label { display: flex; flex-direction: column; align-items: center; text-align: center; }
.truth-name { font: 700 0.9375rem/1.2 var(--serif); }
.truth-place { font: 400 0.75rem/1.3 var(--mono); color: var(--parchment-dim); }

.truth-label::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: var(--ink);
}

/* ---------- start screen: the case file on the expedition table ---------- */

.start {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  overflow-y: auto;
  background: radial-gradient(120% 90% at 50% 40%, var(--ink-raised) 0%, var(--ink) 55%, var(--ink-deep) 100%);
}

.start[hidden] { display: none; }

/* survey contours behind the file: the terrain being searched */
.start-contours {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--rule);
  opacity: 0.55;
  pointer-events: none;
}

.start-card {
  position: relative;
  width: min(100%, 35rem);
  padding: 30px 34px 30px;
  border-radius: 2px;
  background: var(--parchment);
  color: var(--charcoal);
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.9), 0 2px 0 rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

/* a trail of tracks walking off the corner of the file */
.start-tracks {
  position: absolute;
  top: -6px;
  right: -14px;
  width: 190px;
  height: auto;
  color: var(--sepia);
  opacity: 0.2;
  fill: currentColor;
  pointer-events: none;
}

.start-file {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  font: 400 0.875rem/1.4 var(--mono);
  color: var(--sepia);
}

.start-file span:first-child {
  padding: 1px 7px;
  border: 1.5px solid var(--flag-ink);
  border-radius: 2px;
  color: var(--flag-ink);
  font-weight: 700;
}

.start-title {
  position: relative;
  margin: 18px 0 0;
  font-size: clamp(3.25rem, 11vw, 5.25rem);
  font-weight: 700;
  font-variation-settings: "opsz" 72;
  letter-spacing: -0.035em;
  line-height: 0.86;
}

.start-lede {
  position: relative;
  margin: 14px 0 0;
  padding-bottom: 18px;
  border-bottom: 1px dashed rgba(90, 84, 68, 0.5);
  font-size: 1.1875rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--sepia);
  text-wrap: balance;
}

/* returning on a day already played: where the case stands, typed onto the file */
.start-summary {
  position: relative;
  margin: 16px 0 0;
  padding: 10px 14px;
  border: 1px dashed rgba(90, 84, 68, 0.6);
  border-radius: 2px;
  font: 700 0.9375rem/1.45 var(--mono);
  color: var(--charcoal);
}

.start-summary[hidden] { display: none; }
.start-summary.is-closed { color: var(--flag-ink); border-color: var(--flag-ink); border-style: solid; }

.how {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.how li {
  position: relative;
  padding: 6px 0 6px 22px;
  font-size: 1.0625rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.how li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.85em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--flag);
}

.start-btn {
  width: 100%;
  min-height: 60px;
  margin-top: 22px;
  border: 0;
  border-radius: 2px;
  background: var(--flag);
  color: var(--charcoal);
  font: 700 1.1875rem/1 var(--mono);
  cursor: pointer;
  box-shadow: 0 10px 20px -12px rgba(160, 64, 20, 0.9);
  transition: background-color 160ms var(--ease-out), transform 120ms var(--ease-out);
}

.start-btn:hover:not(:disabled) { background: var(--flag-deep); }

.start-btn:disabled {
  background: transparent;
  border: 2px dashed var(--sepia);
  color: var(--sepia);
  box-shadow: none;
  cursor: not-allowed;
}

/* a failed load replaces the rules inside the start card */
.start-error {
  position: relative;
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1.5px solid var(--flag-ink);
  border-radius: 2px;
}

.start-error[hidden] { display: none; }
.start-error p { margin: 0; }
.start-error-title { font-size: 1.1875rem; font-weight: 700; }
.start-error-body { margin-top: 6px !important; font: 400 0.9375rem/1.5 var(--mono); color: var(--sepia); }
.start-btn:active { transform: translateY(1px); }
.start-btn:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 3px; }

@media (max-width: 480px) {
  .start-card { padding: 24px 20px 22px; }
  .start-tracks { width: 140px; }
}

/* ---------- load error ---------- */

.is-broken .score,
.is-broken .notes,
.is-broken .log,


.load-error {
  position: fixed;
  inset: auto 16px 16px;
  max-width: min(460px, calc(var(--panel-w) - 32px));
  margin: 0;
  padding: 16px 18px;
  background: var(--parchment);
  color: var(--charcoal);
  border-radius: 2px;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.6);
  z-index: 2000;
}

.load-error[hidden] { display: none; }
.load-error p { margin: 0; }
.load-error-title { font-weight: 700; font-size: 1.125rem; }
.load-error-body { margin-top: 4px !important; font: 400 0.9375rem/1.45 var(--mono); color: var(--sepia); }

.load-error-retry {
  margin-top: 12px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 2px;
  background: var(--ink);
  color: var(--parchment);
  font: 700 1rem/1 var(--mono);
  cursor: pointer;
}

.load-error-retry[hidden] { display: none; }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  :root { --gutter: 16px; }

  .app {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100dvh;
  }

  /* panel children join the page flow so the masthead can sit above the map */
  .panel { display: contents; }

  .score, .result, .notes, .log { order: 2; }

  .map-wrap {
    order: 1;
    height: 44vh;
    height: 44svh;
    flex: none;
  }

  .masthead {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 12px var(--gutter);
  }

  .masthead h1 { font-size: 1.375rem; white-space: nowrap; }
  .case-line { margin: 0; flex-direction: column; align-items: flex-end; gap: 0; font-size: 0.8125rem; }

  .result-name { font-size: 1.875rem; }
  .note.is-current { font-size: 1.125rem; }

}

@media (max-width: 360px) {
  .masthead { display: block; }
  .case-line { margin-top: 6px; justify-content: space-between; }
}

/* Reduced motion: nothing moves or scales, but a guess still lands with weight through
   colour and fades: the orange wash, the flagged note edge, the ring at the hit point, the −150. */
@media (prefers-reduced-motion: reduce) {
  .pin.is-drop svg { animation: none; }
  .crosshair { transition: none; }

  .note.is-new { animation: fade-in 400ms ease-out 280ms backwards, note-flag 1600ms ease-out 280ms backwards; }
  .log-list li.is-fresh .dist,
  .log-list li.is-fresh .way { animation: fade-in 300ms ease-out 120ms backwards; }
  .score-value.is-drop { animation: points-flush 1200ms ease-out 200ms backwards; }
  .score-delta.is-shown { animation: delta-fade 1400ms ease-out 200ms backwards; }
  .impact-ring { animation: ring-fade 900ms ease-out 0ms backwards; transform: scale(0.6); }
  .impact-ring.is-late { display: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes points-flush {
  0%, 30% { color: var(--flag); }
  100%    { color: var(--parchment); }
}

@keyframes delta-fade {
  0%   { opacity: 0; }
  15%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes ring-fade {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}
