/* Buckley Rocks Hunt — styles */
:root {
  --stone: #e4e9e5;
  --paper: #f7f8f5;
  --bark: #33261d;
  --bark-soft: #6b5c51;
  --moss: #2f5d3a;
  --moss-deep: #224530;
  --marigold: #f2b632;
  --sky: #2f7fc1;
  --berry: #b8346e;
  --line: #c9d1cb;
  --danger: #b3261e;
  --on-moss: #ffffff;
  --display: "Gluten", "Comic Sans MS", cursive;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, sans-serif;
  --pebble: 54% 46% 43% 57% / 57% 47% 53% 43%;
  --pebble-2: 46% 54% 58% 42% / 44% 58% 42% 56%;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --stone: #161d18;
    --paper: #202a23;
    --bark: #ece8e1;
    --bark-soft: #b5aca3;
    --moss: #5f9a6b;
    --moss-deep: #4b8457;
    --line: #34413a;
    --sky: #6aaee6;
    --berry: #e0709f;
    --danger: #ff8a80;
    --on-moss: #0f1712;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--stone);
  color: var(--bark);
  font: 17px/1.5 var(--body);
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
img { max-width: 100%; display: block; }
a { color: var(--sky); }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.1; margin: 0 0 .4em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--bark-soft); }
.small { font-size: .88rem; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: #2f5d3a; color: #fff;
}
.brand { font-family: var(--display); font-size: 1.3rem; font-weight: 700; color: inherit; text-decoration: none; }
.chip {
  font-weight: 700; font-size: .9rem; padding: 4px 12px; border-radius: 999px;
  background: var(--marigold); color: #33261d; text-decoration: none; white-space: nowrap;
}
main {
  max-width: 640px; margin: 0 auto;
  padding: 18px 16px 8px;
}
.foot {
  max-width: 640px; margin: 0 auto; text-align: center; font-size: .9rem;
  padding: 8px 16px calc(110px + env(safe-area-inset-bottom));
}
.foot a { color: var(--bark-soft); }
body[data-page="map"] .foot, body[data-page="hunt"] .foot, body[data-page="scan"] .foot,
body[data-page="feedback"] .foot, body[data-page="print"] .foot { padding-top: 0; }
body[data-page="map"] .foot a, body[data-page="hunt"] .foot a, body[data-page="scan"] .foot a,
body[data-page="feedback"] .foot a, body[data-page="print"] .foot a { display: none; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  background: var(--paper); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .75rem; color: var(--bark-soft); text-decoration: none; padding: 4px 0;
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--moss); font-weight: 700; }
.tab-scan { position: relative; }
.tab-scan .pebble-btn {
  width: 68px; height: 60px; margin-top: -28px;
  display: grid; place-items: center;
  background: var(--marigold); color: #33261d;
  border-radius: var(--pebble);
  box-shadow: 0 3px 0 #c48d14;
}
.tab-scan .pebble-btn svg { width: 30px; height: 30px; }

/* ---------- surfaces ---------- */
.panel {
  background: var(--paper); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px;
}
.panel > :last-child { margin-bottom: 0; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list a { color: inherit; text-decoration: none; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px; border: 0; border-radius: 12px;
  font: 700 1rem var(--body); cursor: pointer; text-decoration: none;
  background: var(--moss); color: var(--on-moss);
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.block { width: 100%; }
.btn.gold { background: var(--marigold); color: #33261d; }
.btn.berry { background: var(--berry); color: #fff; }
.btn.sky { background: var(--sky); color: #fff; }
.btn.ghost { background: transparent; color: var(--bark); border: 2px solid var(--line); }
.btn.danger { background: transparent; color: var(--danger); border: 2px solid currentColor; }
.btn.sm { min-height: 38px; padding: 6px 14px; font-size: .9rem; }
.btn.big { min-height: 60px; font-size: 1.15rem; }

label { display: block; font-weight: 700; margin: 14px 0 6px; }
label.inline { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 8px 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], textarea, select {
  width: 100%; font: inherit; color: inherit; background: var(--stone);
  border: 2px solid var(--line); border-radius: 10px; padding: 11px 12px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--moss); outline: none; }
.hint { font-size: .85rem; color: var(--bark-soft); margin-top: 4px; }

.choice {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px;
  border: 2px solid var(--line); border-radius: 12px; margin-top: 8px; font-weight: 400; cursor: pointer;
}
.choice input { margin-top: 5px; accent-color: var(--moss); }
.choice:has(input:checked) { border-color: var(--moss); background: color-mix(in srgb, var(--moss) 8%, transparent); }
.choice strong { display: block; }

.seg { display: flex; background: var(--paper); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.seg button {
  flex: 1; border: 0; background: transparent; font: 700 .92rem var(--body); color: var(--bark-soft);
  padding: 10px 6px; border-radius: 9px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--moss); color: var(--on-moss); }

/* ---------- the pebble (signature) ---------- */
.pebble {
  border-radius: var(--pebble);
  background: var(--moss);
  overflow: hidden;
}
.rock-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 0 4px; }
.rock-hero .pebble {
  width: 210px; height: 176px; display: grid; place-items: center;
  box-shadow: inset 0 -10px 0 rgba(0,0,0,.12);
  margin-bottom: 14px;
}
.rock-hero .pebble img { width: 100%; height: 100%; object-fit: cover; }
.rock-hero .pebble .code { font-family: var(--display); font-size: 2rem; color: #fff; }
.rock-hero h1 { font-size: 2.3rem; margin-bottom: .1em; }
.mode-rehide { background: var(--sky); }
.mode-keep { background: var(--berry); }
.mode-leave { background: var(--moss); }
.tag {
  display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .82rem; font-weight: 700;
  color: #fff; background: var(--moss);
}
.tag.mode-rehide { background: var(--sky); }
.tag.mode-keep { background: var(--berry); }
.tag.plain { background: var(--line); color: var(--bark); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; margin: 14px 0 4px; }
.stats b { display: block; font-family: var(--display); font-size: 1.7rem; line-height: 1; }
.stats span { font-size: .8rem; color: var(--bark-soft); }

/* points reveal: the one orchestrated motion */
.reward { text-align: center; padding: 26px 18px; }
.reward .pts {
  font-family: var(--display); font-size: 4.2rem; line-height: 1; color: var(--moss);
}
.reward .pebble-badge {
  width: 150px; height: 124px; margin: 0 auto 12px; display: grid; place-items: center;
  background: var(--marigold); border-radius: var(--pebble-2);
  animation: drop .55s cubic-bezier(.3,1.5,.5,1) both;
}
.reward .pebble-badge .pts { color: #33261d; }
@keyframes drop { from { transform: translateY(-40px) rotate(-8deg) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .reward .pebble-badge { animation: none; } }

/* ---------- home ---------- */
.score {
  display: flex; align-items: center; gap: 18px;
}
.score .pebble {
  flex: 0 0 auto; width: 118px; height: 100px; display: grid; place-items: center;
  background: var(--marigold); color: #33261d; border-radius: var(--pebble-2);
}
.score .pebble b { font-family: var(--display); font-size: 2.4rem; line-height: 1; }
.welcome h1 { font-size: 2.5rem; }
.welcome .pebbles { display: flex; gap: 10px; margin: 6px 0 18px; }
.welcome .pebbles span { height: 46px; border-radius: var(--pebble); }
.notice {
  border-left: 5px solid var(--marigold); background: var(--paper);
  padding: 12px 14px; border-radius: 0 12px 12px 0; margin-bottom: 16px;
}
.notice.warn { border-color: var(--berry); }

/* ---------- board ---------- */
.board li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; }
.board .rank { font-family: var(--display); font-size: 1.25rem; color: var(--bark-soft); text-align: center; }
.board li:nth-child(1) .rank { color: #c48d14; font-size: 1.6rem; }
.board .me { background: color-mix(in srgb, var(--marigold) 22%, transparent); border-radius: 10px; padding-left: 6px; padding-right: 6px; }
.board .val { font-family: var(--display); font-size: 1.3rem; }

/* ---------- map ---------- */
.map-wrap { margin: -18px -16px 0; }
#map { height: calc(100dvh - 250px); min-height: 340px; }
.leaflet-popup-content { font-family: var(--body); font-size: 15px; }
.leaflet-popup-content h3 { margin-bottom: 4px; }

/* ---------- scanner ---------- */
.scanner { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 3 / 4; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .frame {
  position: absolute; inset: 18%; border: 4px solid var(--marigold); border-radius: var(--pebble);
}

/* ---------- journey ---------- */
.journey { list-style: none; padding: 0; margin: 0; position: relative; }
.journey li { position: relative; padding: 0 0 14px 26px; }
.journey li::before {
  content: ""; position: absolute; left: 4px; top: 6px; width: 12px; height: 10px;
  background: var(--moss); border-radius: var(--pebble);
}
.journey li::after { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.journey li:last-child::after { display: none; }
.journey .found::before { background: var(--marigold); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 50;
  max-width: 560px; margin: 0 auto; padding: 14px 16px; border-radius: 12px;
  background: var(--bark); color: var(--stone); font-weight: 700;
}
.toast.err { background: var(--danger); color: #fff; }

.thumb { width: 64px; height: 54px; object-fit: cover; border-radius: var(--pebble); flex: 0 0 auto; background: var(--line); }
.gps { font-size: .95rem; padding: 10px 12px; border-radius: 10px; background: var(--stone); }
.gps.good { background: color-mix(in srgb, var(--moss) 18%, transparent); }

/* ---------- print sheet ---------- */
body.printing { background: #fff; color: #000; }
.print-tools { padding: 16px; max-width: 900px; margin: 0 auto; }
.sheet { display: flex; flex-wrap: wrap; gap: 0.12in; padding: 0.3in; background: #fff; justify-content: flex-start; }
.label {
  width: var(--lw); height: var(--lh); border: 1px dashed #bbb; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  page-break-inside: avoid; break-inside: avoid; color: #000; background: #fff;
}
.label svg { width: var(--qr); height: var(--qr); }
.label .lc { font: 700 11pt/1 "Atkinson Hyperlegible", sans-serif; letter-spacing: .08em; margin-top: 3px; }
.label .lt { font: 7pt/1.1 "Atkinson Hyperlegible", sans-serif; margin-top: 2px; }
@media print {
  .print-tools, .topbar, .tabbar, .foot { display: none !important; }
  main { padding: 0; max-width: none; }
  .sheet { padding: 0; }
  @page { margin: 0.4in; }
}

/* welcome card shown when someone scans a rock without an account */
.welcome-find { border-top: 6px solid var(--marigold); }
.welcome-find h2 { font-size: 1.7rem; }
details summary { cursor: pointer; margin: 6px 0; }

/* ---------- organizer menu ---------- */
.admin-tabs { flex-wrap: wrap; gap: 2px; }
.admin-tabs button { flex: 1 0 22%; padding-left: 6px; padding-right: 6px; font-size: .84rem; white-space: nowrap; }
.dot {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--berry); color: #fff; font-size: .75rem; line-height: 20px; text-align: center;
}
.feed-item { border-left: 4px solid var(--line); padding-left: 12px !important; }
.feed-item.found { border-left-color: var(--marigold); }
.feed-item.hide { border-left-color: var(--sky); }
.feed-item.new { border-left-color: var(--moss); }
.feed-item.report { border-left-color: var(--berry); }
.feed-item.is-new { background: color-mix(in srgb, var(--marigold) 14%, transparent); }
.feed-item a { color: var(--sky); text-decoration: underline; }
.feed-photo { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.feed-photo img { width: 96px; height: 80px; object-fit: cover; border-radius: 10px; }
.feed-photo.is-hidden img { opacity: .35; filter: grayscale(1); }
.linkish { background: none; border: 0; padding: 0; color: var(--danger); font: inherit; text-decoration: underline; cursor: pointer; }
.setting { gap: 12px; padding: 6px 0; }
.setting label { margin: 0; font-weight: 400; flex: 1; }
.setting input { width: 110px; flex: 0 0 auto; }

/* ---------- bounties ---------- */
.wanted { margin: 4px 0 16px; }
.wanted h2 { color: var(--berry); }
.wanted-card {
  background: var(--paper); border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
  border: 2px dashed var(--berry);
}
.wanted-top { display: flex; gap: 14px; align-items: center; }
.wanted-top h3 { margin: 0 0 2px; }
.wanted-pebble { flex: 0 0 auto; width: 74px; height: 62px; }
.wanted-pebble img { width: 100%; height: 100%; object-fit: cover; }
.bounty-pts { font-family: var(--display); font-size: 1.35rem; color: var(--berry); margin: 0 0 4px; }
.bounty-banner { border-left-color: var(--berry); }
.wanted-pin {
  background: var(--berry); color: #fff; font: 700 12px/24px var(--body); text-align: center;
  border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.feed-item.bounty { border-left-color: var(--berry); }

/* ---------- hot/cold ---------- */
.hc { display: flex; flex-direction: column; align-items: center; margin: 8px 0 18px; }
.hc-pebble {
  width: min(78vw, 300px); aspect-ratio: 6 / 5; display: grid; place-items: center;
  border-radius: var(--pebble); background: #7a8a80; color: #fff;
  box-shadow: inset 0 -14px 0 rgba(0,0,0,.14);
  transition: background-color .6s ease;
}
.hc-pebble span { font-family: var(--display); font-size: clamp(2.2rem, 11vw, 3.4rem); text-align: center; padding: 0 12px; line-height: 1.05; }
.hc-sub { text-align: center; margin: 14px 0 0; min-height: 3em; max-width: 34ch; }
.hc-pebble.pulse { animation: hcpulse 1.1s ease-in-out infinite; }
@keyframes hcpulse { 50% { transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .hc-pebble.pulse { animation: none; } .hc-pebble { transition: none; } }

/* ---------- clue photos ---------- */
.clue img, .clue-peek img { width: 100%; border-radius: 12px; margin-top: 8px; }
.clue { border-top: 6px solid var(--berry); }
.clue-peek summary { cursor: pointer; font-weight: 700; margin-top: 8px; color: var(--berry); }
.popup-clue { width: 180px; max-width: 100%; border-radius: 8px; }
.feed-photo .stack { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.feed-photo .stack > * + * { margin-top: 0; }

/* ---------- game area editor ---------- */
.zone-map { height: 360px; border-radius: 12px; overflow: hidden; }
.zone-handle {
  background: var(--marigold); border: 3px solid #2f5d3a; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.35); cursor: grab;
}
.label .lsite { font-weight: 700; font-size: 7.5pt; letter-spacing: .01em; }

/* ---------- feature switches ---------- */
.off-tag { background: var(--line); color: var(--bark); font-family: var(--body); font-size: .72rem; vertical-align: middle; }
.feature-list li { gap: 14px; }
.feature { display: flex; flex-direction: column; gap: 2px; margin: 0; font-weight: 400; cursor: pointer; }
.switch {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 52px; height: 30px; margin: 0;
  border-radius: 999px; background: var(--line); position: relative; cursor: pointer; border: 0; padding: 0;
  transition: background-color .2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .2s;
}
.switch:checked { background: var(--moss); }
.switch:checked::after { transform: translateX(22px); }
.switch:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }

/* ---------- home screen guide ---------- */
.install-card { border: 2px solid var(--marigold); }
.install-icon { border-radius: 12px; flex: 0 0 auto; }
.steps { padding-left: 1.3em; margin: 0; }
.steps li { margin: 0 0 10px; line-height: 1.5; }
.ico { width: 1.25em; height: 1.25em; vertical-align: -.25em; display: inline-block; }
details.panel > summary { font-weight: 700; }
details.panel > section.panel { padding: 0; margin: 8px 0 0; background: none; }

/* ---------- feedback ---------- */
.panel .seg { background: var(--stone); }
.fb-item { border-left: 4px solid var(--sky); padding-left: 12px !important; }
.fb-item.fb-bug { border-left-color: var(--berry); }
.fb-item.fb-other { border-left-color: var(--line); }
.fb-kind { margin-right: 6px; background: var(--sky); }
.fb-bug .fb-kind { background: var(--berry); }
.fb-other .fb-kind { background: var(--line); color: var(--bark); }
.fb-msg { margin: 8px 0; white-space: pre-wrap; }
.fb-photo { max-width: 160px; max-height: 160px; border-radius: 10px; display: block; margin-bottom: 6px; }
.fb-status { margin: 8px 0 6px; }
.fb-status button { font-size: .8rem; padding: 7px 4px; }
.fb-note { font-size: .9rem; padding: 8px 10px; }

/* ---------- avatars, levels, streaks, badges ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.avatar { display: inline-block; vertical-align: middle; flex: 0 0 auto; }
.hi { display: flex; align-items: center; gap: 8px; }
.me-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.me-avatar { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--bark-soft); text-decoration: none; }
.level { margin-top: 12px; }
.level .bar { height: 12px; border-radius: 999px; background: var(--stone); overflow: hidden; margin-top: 6px; }
.level .bar span { display: block; height: 100%; background: var(--moss); border-radius: 999px; min-width: 6px; }
.streak { margin: 10px 0 0; }
.badges { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px 8px; }
.badges li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; }
.badges li b { font-size: .9rem; line-height: 1.15; }
.badges li .small { font-size: .74rem; line-height: 1.2; }
.badges li.locked .avatar { opacity: .4; }
.board .who { display: flex; align-items: center; gap: 8px; }
.lv { font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--stone); color: var(--bark-soft); white-space: nowrap; }
.avatar-preview { display: flex; flex-direction: column; align-items: center; margin: 4px 0 14px; }
.avatar-preview p { margin: 6px 0 0; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 42px; height: 42px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255,255,255,.5); }
.swatches button[aria-checked="true"] { border-color: var(--bark); }
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.avatar-grid button { background: none; border: 3px solid transparent; border-radius: 14px; padding: 6px 0; cursor: pointer; }
.avatar-grid button[aria-checked="true"] { border-color: var(--marigold); background: color-mix(in srgb, var(--marigold) 16%, transparent); }
.celebrate {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + 64px); z-index: 60;
  display: flex; gap: 12px; align-items: center; width: min(92vw, 380px);
  background: var(--marigold); color: #33261d; padding: 12px 14px 12px 18px; border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); animation: pop .35s ease-out;
}
.celebrate button { background: none; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; color: inherit; }
@keyframes pop { from { transform: translate(-50%, -12px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .celebrate { animation: none; } }

/* ---------- journal ---------- */
.journey li .avatar { margin-right: 6px; }
.jnote { margin: 6px 0 4px; padding: 8px 12px; background: var(--stone); border-radius: 12px; font-style: italic; }
.jphoto { display: block; max-width: 220px; width: 100%; border-radius: 12px; margin: 6px 0; }
.report-note { color: var(--bark-soft); }
.news li { display: block; }
.note-form { border-top: 6px solid var(--sky); margin-top: 14px; }

/* ---------- weekly race ---------- */
.race-card.active {
  background: var(--paper); border-radius: var(--radius); padding: 14px; margin-bottom: 16px;
  border: 3px dashed #d89a12;
}
.race-pebble { flex: 0 0 auto; width: 70px; height: 58px; }
.race-pebble img { width: 100%; height: 100%; object-fit: cover; }
.race-kicker { margin: 0; font: 700 .8rem var(--body); text-transform: uppercase; letter-spacing: .06em; color: #b07c0c; }
.podium { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; counter-reset: place; }
.podium li { counter-increment: place; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--stone); }
.podium li::before { content: counter(place); font-family: var(--display); font-size: 1.15rem; width: 18px; color: #b07c0c; }
.podium .pts { margin-left: auto; font-weight: 700; }
.race-pts { font-family: var(--display); font-size: 1.35rem; color: #b07c0c; margin: 0 0 4px; }
.race-banner { border-left-color: #d89a12; }
.race-pin {
  background: #f2b632; color: #33261d; font: 700 12px/24px var(--body); text-align: center;
  border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .race-kicker, :root:not([data-theme="light"]) .race-pts,
  :root:not([data-theme="light"]) .podium li::before { color: #f2b632; }
}
.celebrate div { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.race-card.active, .race-card { margin-bottom: 16px; }

/* ---------- naming helper ---------- */
.namebox { margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--stone); }
.namebox fieldset { border: 0; padding: 0; margin: 0 0 10px; }
.namebox legend { font-weight: 700; font-size: .9rem; margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { margin: 0; font-weight: 400; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-block; padding: 6px 11px; border-radius: 999px; border: 2px solid var(--line); background: var(--paper); font-size: .88rem; }
.chip-check input:checked + span { background: var(--moss); border-color: var(--moss); color: var(--on-moss); }
.chip-check input:focus-visible + span { outline: 3px solid var(--marigold); outline-offset: 1px; }
.chip-pick { border: 2px solid var(--marigold); background: var(--paper); color: var(--bark); border-radius: 999px; padding: 7px 12px; font: 700 .9rem var(--body); cursor: pointer; }
.chip-pick.more { border-style: dashed; border-color: var(--line); font-weight: 400; }

/* ---------- fog ---------- */
.fog-canvas { position: absolute; left: 0; top: 0; pointer-events: none; transition: opacity .2s; }

/* ---------- teams ---------- */
.team-panel .row input { flex: 1; min-width: 0; }
.team-members .who { display: flex; align-items: center; gap: 8px; }
.team-code { font-family: var(--display); font-size: 1.6rem; letter-spacing: .12em; padding: 4px 14px; border-radius: 10px; background: var(--stone); }

/* ---------- stats ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
@media (min-width: 520px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--paper); border-radius: 12px; padding: 12px; }
.kpi b { display: block; font-family: var(--display); font-size: 1.7rem; line-height: 1.1; }
.kpi span { font-size: .82rem; color: var(--bark-soft); }
.chart { margin: 0 0 18px; }
.chart figcaption { font-weight: 700; margin-bottom: 4px; }
.chart-wrap { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart text { font: 10px var(--body); fill: var(--bark-soft); }
.chart .hit { fill: transparent; }
.chart .c-moss { fill: var(--moss); } .chart .c-sky { fill: var(--sky); } .chart .c-berry { fill: var(--berry); }
.chart .bar.on path { opacity: .75; }
.chart .bar.on .hit { fill: color-mix(in srgb, var(--bark) 7%, transparent); }
.chart .tip {
  position: absolute; top: -6px; transform: translate(-50%, -100%); white-space: nowrap; pointer-events: none;
  background: var(--bark); color: var(--paper); font-size: .8rem; font-weight: 700; padding: 4px 8px; border-radius: 6px;
}
.mini { border-collapse: collapse; margin-top: 6px; }
.mini td { padding: 2px 12px 2px 0; border-bottom: 1px solid var(--line); }
.stats-map { height: 300px; border-radius: 12px; overflow: hidden; margin-top: 10px; }
.quiet { color: var(--berry); font-weight: 700; font-size: .9rem; white-space: nowrap; }
[data-trail][aria-pressed="true"] { border-color: var(--sky); color: var(--sky); }
