/* ───────────── Base ───────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--sky); } /* what shows behind the status bar and on overscroll, on every screen */
body {
  margin: 0; min-height: 100svh;
  background: var(--bg); color: var(--text);
  font-family: var(--font-ui); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
/* Rapid taps on a phone must never trigger double-tap zoom or text selection. */
body { touch-action: manipulation; }
button, .btn, input[type=range], .guess-head, .track-wrap, .street { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 60; background: var(--ink); color: var(--cream); padding: 10px 14px; border-radius: 6px; font-weight: 700; }
.skip:focus { left: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; opacity: 0; pointer-events: none; }
svg { display: block; }
p { margin: 0; }

.display {
  font-family: var(--font-display); font-weight: 800;
  font-variation-settings: "opsz" 96, "wdth" 82;
  letter-spacing: -.075em; line-height: .95; /* Overpass is wider than the old condensed face */
}
.num { font-variant-numeric: tabular-nums lining-nums; }
.eyebrow { font: 700 11.5px/1.2 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--text-soft); margin: 0; }
.of { font-size: .42em; font-weight: 700; letter-spacing: 0; opacity: .8; margin-left: .15em; font-variation-settings: "opsz" 24, "wdth" 90; }

/* wordmark */
.wordmark {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 800; font-variation-settings: "opsz" 48, "wdth" 85;
  letter-spacing: -.075em; font-size: 22px; line-height: 1; color: inherit; text-decoration: none; white-space: nowrap;
}
.wordmark svg { width: 24px; height: 29px; }
.wordmark .sf-plate { height: 1.3em; width: auto; vertical-align: -.3em; margin-left: .22em; } /* the street sign's SF plate, centered on the wordmark's capitals (cap height .7em) */
.wordmark-btn { background: none; border: 0; padding: 4px 6px 4px 0; margin-left: 0; min-height: var(--touch); }

.chip { font: 700 11px/1 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; border: 2px solid currentColor; border-radius: 999px; padding: 7px 11px; white-space: nowrap; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 14px 22px; border-radius: var(--radius);
  border: var(--border-w) solid var(--ink); background: var(--cream); color: var(--ink);
  font-family: var(--font-display); font-weight: 800; font-variation-settings: "opsz" 24, "wdth" 90;
  font-size: 19px; letter-spacing: .005em; line-height: 1; text-decoration: none;
  transition: transform var(--dur-fast) ease, box-shadow var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.btn-primary { background: var(--action); color: var(--action-text); box-shadow: 4px 4px 0 var(--ink); }
.btn-primary:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); background: var(--action-hover); }
.btn-primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-secondary:hover { background: var(--paper-deep); }
.btn-full { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.screen { min-height: 100svh; display: flex; flex-direction: column; overflow-x: clip; } /* the round slide-in starts off-screen; never let it widen the page */
.foot { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding: 18px 20px 28px; font-size: 12px; color: var(--text-muted); border-top: 2px solid var(--cream-line); max-width: 1200px; width: 100%; margin-inline: auto; }

/* When installed to the home screen the page runs under the status bar; each screen's top
   color extends up behind it. */
/* the strip under the status bar is cobalt on every screen */
.home, .ad { border-top: env(safe-area-inset-top) solid var(--sky); }
.gamebar { padding-top: env(safe-area-inset-top); }
.results-intro { padding-top: env(safe-area-inset-top); }

/* ───────────── Home ───────────── */
.home { background: var(--paper); align-items: center; justify-content: center; text-align: center; padding: 32px 24px 40px; }
.home-main { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 360px; }
/* the home illustration: a framed card on wide screens, an edge-to-edge band on phones.
   It holds its shape from first paint; the loading drawing sits on top until today's
   homes are known, then the painted row crossfades in under it. */
.home-mark { position: relative; width: 100%; max-width: 300px; aspect-ratio: 360 / 200; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; background: var(--cream); }
.home-mark > svg, .home-mark .photo-loader svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* the painted row bleeds a pixel under the border so a fractional box size never shows the cream behind it */
.home-mark > svg { inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); }
.home-mark .photo-loading-label { right: 12px; bottom: 10px; }
@media (max-width: 599px) {
  .home-mark { width: 100vw; max-width: none; margin-inline: calc(50% - 50vw); border: 0; border-radius: 0; }
}
.home-title { margin: 22px 0 0; line-height: 0; } /* the title is a street sign drawn by tools/street-sign.py */
.home-title img { display: block; width: min(300px, 80vw); height: auto; margin: 0 auto; }
.home-desc { margin: 12px 0 0; font: 500 18px/1.4 var(--font-ui); color: var(--text); max-width: 26ch; }
.home-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; width: 100%; max-width: 220px; }
.btn-home { min-height: 52px; font-size: 18px; }
.resume-note { margin-top: 14px; font: 500 13px/1.4 var(--font-ui); color: var(--text-soft); }
.home-meta { margin-top: 32px; display: flex; flex-direction: column; gap: 3px; font: 500 13px/1.4 var(--font-ui); color: var(--text-soft); }
.home-meta strong { font-weight: 700; color: var(--ink); }

/* ───────────── Private playtest invitation ─────────────
   The home screen's painting and sign, with a code field where the buttons would be. */
.invite:not([hidden]) { animation: invite-in var(--dur) var(--ease-out) both; }
@keyframes invite-in { from { opacity: 0; } to { opacity: 1; } }
.invite .home-title img { width: min(220px, 60vw); }
.invite-title { margin: 16px 0 0; font-size: 36px; color: var(--ink); }
.invite-desc { font-size: 16px; max-width: 30ch; }
.invite-form { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-top: 24px; width: 100%; max-width: 260px; }
.invite-label { font: 600 14px/1.2 var(--font-ui); color: var(--text-soft); }
.invite-input {
  min-height: 52px; padding: 12px 14px; border: var(--border-w) solid var(--ink); border-radius: var(--radius);
  background: var(--cream); color: var(--ink); font: 600 18px/1.2 var(--font-ui); text-align: center;
}
.invite-input:focus { outline: 3px solid var(--gold); outline-offset: 2px; }
.invite-input[aria-invalid="true"] { border-color: var(--poppy); }
.invite-error { margin: 0; font: 600 14px/1.4 var(--font-ui); color: var(--poppy-deep); text-wrap: balance; }
.invite-form .btn { margin-top: 4px; }
.invite-note { margin-top: 28px; font: 500 13px/1.5 var(--font-ui); color: var(--text-soft); }

/* ───────────── Pre-game ad ───────────── */
.ad { background: var(--paper-deep); justify-content: center; align-items: center; padding: 24px 16px; }
.ad-card { width: 100%; max-width: 420px; background: var(--cream); border: 2px solid var(--cream-line); border-radius: 8px; padding: 14px 14px 18px; }
.ad-label { text-align: center; color: var(--text-muted); margin-bottom: 12px; }
.ad-slot { width: 100%; }
.ad-placeholder { aspect-ratio: 16 / 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--paper); border: 2px dashed var(--cream-line); border-radius: 6px; color: var(--text-muted); }
.ad-placeholder-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--text-soft); }
.ad-placeholder-sub { font: 500 12px/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; }
.ad-foot { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: flex-end; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); }
.btn-text { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 10px; border: 0; background: transparent; color: var(--ink); font: 700 15px/1 var(--font-ui); border-radius: 8px; }
.btn-text:hover { background: var(--paper); }

/* ───────────── How to play ───────────── */
.howto { width: 100%; max-width: 100%; margin: auto 0 0; border: 2px solid var(--ink); border-bottom: 0; border-radius: 16px 16px 0 0; background: var(--cream); color: var(--text); padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); max-height: 92svh; overflow: auto; box-sizing: border-box; }
.howto::backdrop { background: rgba(23, 47, 77, .5); }
.howto-close { display: flex; justify-content: flex-end; margin: -6px -8px 0 0; }
.icon-btn { width: 44px; height: 44px; border: 0; background: transparent; color: var(--ink); font: 700 26px/1 var(--font-ui); border-radius: 50%; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--paper-deep); }
.icon-btn.help { border: 2px solid currentColor; color: var(--cream); width: 36px; height: 36px; font-size: 17px; }
.icon-btn.help:hover { background: var(--sky-deep); }
.bar-right { display: inline-flex; align-items: center; gap: 12px; }
.howto h2 { margin: 0; font-size: 30px; color: var(--ink); }
.howto-lede { margin-top: 6px; font: 500 16px/1.4 var(--font-ui); }
.howto-list { margin: 12px 0 18px; padding-left: 20px; font: 500 14px/1.45 var(--font-ui); color: var(--text); }
.howto-list li + li { margin-top: 6px; }
.howto-ex { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 12px; }
.howto-ex li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; font: 500 14px/1.4 var(--font-ui); }
.howto-ex svg { width: 44px; height: 53px; }
.howto-ex strong { color: var(--ink); }
.howto-rule { border: 0; border-top: 2px solid var(--cream-line); margin: 20px 0 14px; }
.howto-foot { font: 500 13px/1.5 var(--font-ui); color: var(--text-soft); }
@media (min-width: 600px) {
  .howto { max-width: 520px; margin: auto; border-bottom: 2px solid var(--ink); border-radius: 16px; padding: 24px 28px 28px; }
  .home-title img { width: 340px; }
  .home { padding-block: 24px 28px; }
  .home-main { max-width: 480px; }
  .home-mark { max-width: 480px; }
}

/* ───────────── Game chrome ───────────── */
.gamebar { background: var(--sky); color: var(--cream); }
.gamebar-inner { max-width: 1080px; margin: 0 auto; min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; }
.gamebar .wordmark { font-size: 14px; }
.gamebar .wordmark svg { width: 20px; height: 24px; }
.stat { font: 700 12px/1 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; display: inline-flex; align-items: baseline; gap: 4px; }
.stat strong { font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: 0; font-variation-settings: "opsz" 24, "wdth" 85; }
.stat .of { font-size: 12px; opacity: .8; }

/* the little street: the app bar's blue continued down to a sloped bottom edge (8% grade,
   left high, right low). Height is set from the width in JS; houses stand on the edge. */
.street { position: relative; background: var(--sky); clip-path: polygon(0 -60px, 100% -60px, 100% 100%, 0 8px); }
.street-inner { position: absolute; inset: 0; }
.street .h { position: absolute; width: 15px; height: 18px; display: block; }
.street .h svg { display: block; }
.street .h.is-current { animation: bob 1.4s ease-in-out infinite alternate; }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .street .h.is-current { animation: none; } }

.round { position: relative; max-width: 560px; margin: calc(-1 * var(--lift, 0px)) auto 0; padding: 14px 16px 56px; width: 100%; }

/* property */
.hood { margin: 0; width: fit-content; max-width: 100%; font-size: clamp(19px, 5.5vw, 27px); color: var(--ink); font-variation-settings: "opsz" 96, "wdth" 76; line-height: 1.05; }
.hood .sep { color: var(--coral); margin: 0 .12em; }
/* the location map sits on the heading's baseline (its trimmed bottom edge is the county line)
   and its right tip lines up with the photo's right edge */
.hood-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.hood-row .hood { min-width: 0; }
.hood-map { flex: none; line-height: 0; margin-top: -48px; } /* rises above the row without making it taller */
.hood-map:empty { display: none; }
.frame { margin: 12px 0 0; position: relative; border: 2px solid var(--border-soft); border-radius: 12px; overflow: hidden; background: var(--sky); }
.frame svg, .frame img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; display: block; transition: aspect-ratio var(--dur) var(--ease-out); }
.round.is-revealed .frame svg, .round.is-revealed .frame img { aspect-ratio: 3 / 1; }
/* Listing photo: the painted elevation holds the frame while the photo loads, then the
   decoded photo crossfades in. The <img> is always in flow, so the frame never changes size. */
:root { --photo-fade: 200ms; --photo-scale-from: 1.015; }
#frame-art { position: relative; }
.frame img.photo { opacity: 0; transform: scale(var(--photo-scale-from)); transition: opacity var(--photo-fade) var(--ease-out), transform var(--photo-fade) var(--ease-out), aspect-ratio var(--dur) var(--ease-out); }
.frame img.photo.is-shown { opacity: 1; transform: none; }
.frame img.photo.no-fade { transition: aspect-ratio var(--dur) var(--ease-out); }
.photo-loader { position: absolute; inset: 0; background: var(--cream); transition: opacity var(--photo-fade) var(--ease-out); }
.photo-loader.is-gone { opacity: 0; }
.frame .photo-loader svg { width: 100%; height: 100%; aspect-ratio: auto; }
.photo-loader .lw { fill: var(--gold); opacity: 0; animation: window-light 3s ease-in-out infinite; animation-delay: calc(var(--i) * 260ms); }
@keyframes window-light { 0%, 100% { opacity: 0; } 18%, 55% { opacity: .75; } 75% { opacity: 0; } }
.photo-loading-label { position: absolute; right: 10px; bottom: 9px; font: 700 10.5px/1 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); opacity: 0; transition: opacity 400ms ease; }
.photo-loader.is-slow .photo-loading-label { opacity: .6; }
/* while the next home is swapped in, hold the photo crop still instead of tweening it */
.round.is-swapping .frame svg, .round.is-swapping .frame img { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .photo-loader .lw { animation: none; opacity: .5; }
  .frame img.photo { transform: none; transition: none; }
  .photo-loader { transition: none; }
}
.frame-tag { position: absolute; left: 10px; top: 10px; background: var(--cream); color: var(--ink); font: 700 10.5px/1 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; padding: 7px 9px 6px; border-radius: 5px; border: 2px solid var(--ink); }
.facts { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 0; font: 600 15px/1.2 var(--font-ui); color: var(--text); }
.facts li { display: inline-flex; align-items: center; }
.facts li + li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); margin: 0 12px; }

/* guess panel */
.guess-panel { position: relative; margin-top: 12px; padding: 16px 0 0; border-top: 2px solid var(--cream-line); }
.guess-head { display: flex; justify-content: flex-start; align-items: center; gap: 8px; }
.guess-label { font: 600 14px/1.2 var(--font-ui); color: var(--text-soft); }
.price-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.price-field { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 2px; padding: 0; border-radius: 4px; }
.price-field:has(#guess-input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 4px; }
.price-field .cur { font-size: clamp(20px, 4.7vw, 27px); color: var(--coral); line-height: 1; }
#guess-input {
  flex: 1; min-width: 0; width: 100%; background: transparent; border: 0; padding: 0; margin: 0;
  font-size: clamp(27px, 7.8vw, 41px); color: var(--ink); letter-spacing: -.075em; line-height: 1;
  font-variation-settings: "opsz" 96, "wdth" 82;
}
#guess-input:focus { outline: none; }
.vs-ask { margin: 0; display: flex; align-items: center; gap: 8px; font: 600 14px/1.2 var(--font-ui); color: var(--text-soft); min-height: 20px; }
.vs-ask .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); flex: none; border: 2px solid var(--ink); }
.vs-ask.at .dot { background: var(--gold); }
/* over and under become arrows: red up, blue down */
.vs-ask.over .dot, .vs-ask.under .dot { width: 14px; height: 14px; border: 0; border-radius: 0; background: none center / contain no-repeat; }
.vs-ask.over .dot { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 1L13 7.2H9.6V13H4.4V7.2H1Z' fill='%23D6463C' stroke='%23172F4D' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.vs-ask.under .dot { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 1L13 7.2H9.6V13H4.4V7.2H1Z' fill='%231E5CA6' stroke='%23172F4D' stroke-width='1.4' stroke-linejoin='round' transform='rotate(180 7 7)'/%3E%3C/svg%3E"); }

/* money burning up into thin air */
.burn-layer { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 3; }
.bill { position: absolute; width: 26px; height: 14px; border-radius: 2px; background: var(--leaf); border: 1.5px solid var(--ink); color: var(--cream); font: 800 9px/11px var(--font-ui); text-align: center; transform-origin: 50% 100%; animation: burn .85s var(--ease-out) forwards; will-change: transform, opacity; }
.bill::before { content: ""; position: absolute; inset: 2px; border: 1px solid rgba(251,245,230,.55); border-radius: 1px; }
.bill::after { content: ""; position: absolute; left: 50%; top: -9px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50% 50% 50% 0; background: var(--gold); transform: rotate(-45deg); opacity: 0; animation: flame .85s ease-out forwards; }
@keyframes burn {
  0% { opacity: 1; transform: translate(var(--dx, 0px), 0) rotate(0) scale(1); }
  35% { background: var(--gold); }
  65% { background: var(--poppy); border-color: var(--poppy); color: var(--poppy); }
  100% { opacity: 0; transform: translate(calc(var(--dx, 0px) * 2.2), -78px) rotate(var(--rot, 20deg)) scale(.45); background: var(--ink); border-color: var(--ink); }
}
@keyframes flame {
  0% { opacity: 0; transform: rotate(-45deg) scale(.4); }
  25% { opacity: 1; background: var(--gold); }
  60% { background: var(--poppy); transform: rotate(-45deg) scale(1.3); }
  100% { opacity: 0; transform: rotate(-45deg) scale(1.8) translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) { .bill { display: none; } }

.track-wrap { position: relative; margin-top: 16px; padding-top: 22px; }
.ask-mark { position: absolute; top: 0; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; z-index: 1; }
.ask-mark span { font: 700 10px/1 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); background: var(--paper); padding: 0 3px; }
/* first-round drag coach mark: lives in the Asking label's slot, then hands back to it */
.ask-mark span { transition: opacity 220ms ease; }
.ask-mark.is-swapping span { opacity: 0; }
.ask-mark .hint { display: inline-flex; align-items: center; gap: 4px; color: var(--poppy); }
.ask-mark .hint svg { width: 14px; height: 10px; display: block; animation: nudge 700ms ease-in-out infinite alternate; }
@keyframes nudge { from { transform: translateX(-4px); } to { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .ask-mark .hint svg { animation: none; } }
.ask-mark i { display: block; width: 0; height: 50px; border-left: 2px dashed var(--ink); margin-top: 3px; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 48px; background: transparent; margin: 0; display: block; --fill: var(--gold); }
.track-wrap.over input[type=range] { --fill: var(--poppy); }
.track-wrap.under input[type=range] { --fill: var(--sky); }
.track-wrap.at input[type=range] { --fill: var(--gold); }
input[type=range]::-webkit-slider-runnable-track { -webkit-appearance: none; appearance: none; height: 30px; border-radius: 8px; border: 2px solid var(--ink); background: linear-gradient(90deg, var(--fill, var(--gold)) var(--p, 50%), var(--chart-track) var(--p, 50%)); transition: background-color var(--dur-fast); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 41px; height: 48px; margin-top: -9px; border: 0; border-radius: 0; box-shadow: none; outline: none; background-color: transparent; background: var(--thumb) center / contain no-repeat; cursor: grab; }
input[type=range]:active::-webkit-slider-thumb { cursor: grabbing; }
input[type=range]::-moz-range-track { height: 30px; border-radius: 8px; border: 2px solid var(--ink); background: linear-gradient(90deg, var(--fill, var(--gold)) var(--p, 50%), var(--chart-track) var(--p, 50%)); transition: background-color var(--dur-fast); }
input[type=range]::-moz-range-thumb { width: 41px; height: 48px; border: 0; border-radius: 0; box-shadow: none; background-color: transparent; background: var(--thumb) center / contain no-repeat; cursor: grab; }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-runnable-track { outline: 3px solid var(--gold); outline-offset: 3px; }
input[type=range]:focus-visible::-moz-range-track { outline: 3px solid var(--gold); outline-offset: 3px; }
.range-ends { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; margin: 0; font: 700 10px/1 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); pointer-events: none; }

.nudge { flex: none; display: flex; gap: 6px; }
.nudge .btn { min-height: 44px; min-width: 44px; padding: 12px 10px; font-size: 15px; font-variation-settings: "opsz" 24, "wdth" 85; letter-spacing: 0; }
.lock { margin-top: 12px; position: relative; overflow: hidden; --bw: 400px; transition: margin var(--dur) var(--ease-out), width var(--dur) var(--ease-out), border-radius var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), min-height var(--dur) var(--ease-out), transform var(--dur-fast) ease; }
.lock .lock-label { display: inline-block; transition: opacity var(--dur-fast) ease; }
.lock .lock-check { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity var(--dur) ease 80ms; }
.lock .lock-check-text { position: absolute; left: 16px; top: 18px; font: inherit; color: var(--action-text); }
.lock .dots i { font-style: normal; opacity: 0; animation: dot1 1.3s steps(1) infinite; }
.lock .dots i:nth-child(2) { animation-name: dot2; }
.lock .dots i:nth-child(3) { animation-name: dot3; }
@keyframes dot1 { 0% { opacity: 0; } 25%, 100% { opacity: 1; } }
@keyframes dot2 { 0% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes dot3 { 0% { opacity: 0; } 75%, 100% { opacity: 1; } }
/* checking: the button grows into a full-bleed band; a cable car climbs an 8% grade along its foot */
.lock.is-checking { margin: 12px -16px 0; width: calc(100% + 32px); border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; min-height: var(--check-h, 96px); box-shadow: none; transform: none; cursor: progress; background: var(--action); }
.lock.is-checking .lock-label { opacity: 0; }
.lock.is-checking .lock-check { opacity: 1; }
.lock.is-checking:disabled { opacity: 1; }
.lock .rail { position: absolute; left: 0; bottom: 8px; width: 100%; height: calc(var(--bw) * .08); overflow: visible; }
.lock .rail line { stroke: var(--cream); stroke-width: 2; opacity: .9; }
.lock .car { position: absolute; left: 0; bottom: 8px; margin-bottom: -1px; animation: climb 2.6s linear infinite; }
.lock .car-tilt { transform: rotate(-4.57deg); }
/* the Powell & Hyde car carries its own colors (flat brand fills, one ink outline) */
.lock .car { overflow: visible; }
@keyframes climb {
  0%   { transform: translate(-110px, 3.3px); }    /* the 98px car starts fully off the left edge */
  100% { transform: translate(calc(var(--bw) + 20px), calc(var(--bw) * -.08 - 7.1px)); }
}
@keyframes ring { 0%, 50% { opacity: .35; } 52%, 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .lock .car { animation: none; transform: translate(calc(var(--bw) * .55 - 49px), calc(var(--bw) * -.044 - 1.7px)); }
  .lock .car .bell { animation: none; }
}

/* ───────────── Reveal ───────────── */
.reveal { position: relative; margin: 12px -16px 0; background: var(--cream); border-top: 2px solid var(--ink); }

.sold { background: var(--sky); color: var(--cream); padding: 16px 16px 18px; }
.sold .eyebrow { color: inherit; opacity: .9; }
.sold-price { margin-top: 6px; font-size: clamp(33px, 8.6vw, 47px); color: var(--cream); line-height: .7; }

.verdict { position: relative; padding: 16px 16px 18px; border-top: 2px solid var(--ink); overflow: hidden; }
.verdict-head { margin: 0; font-size: clamp(19px, 4.8vw, 25px); color: var(--ink); }
.verdict-sub { margin-top: 6px; min-height: 1.35em; font: 600 14px/1.35 var(--font-ui); color: var(--text-soft); }
.verdict-sub .q { color: var(--ink); }
.reveal .enter { opacity: 0; transform: translateY(6px); transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out); }
.reveal.is-in .enter { opacity: 1; transform: none; }
.reveal.is-in .enter.d1 { transition-delay: 250ms; }
.reveal.is-in .enter.d2 { transition-delay: 450ms; }
.reveal.is-in .enter.d3 { transition-delay: 650ms; }
@media (prefers-reduced-motion: reduce) { .reveal .enter { opacity: 1; transform: none; transition: none; } }

.verdict.is-perfect { background: var(--leaf-deep); }
.verdict.is-perfect .verdict-head, .verdict.is-perfect .verdict-sub, .verdict.is-perfect .verdict-sub .q { color: var(--cream); }
.verdict.is-perfect .verdict-head::before { content: ""; display: inline-block; width: 1.05em; height: 1.05em; margin-right: .3em; vertical-align: -.12em; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M1.6 12.4L4.7 4.6L9.4 9.3Z' fill='%23E8B22F' stroke='%23172F4D' stroke-width='1.4' stroke-linejoin='round'/%3E%3Cpath d='M8.3 3.3l.9-1.8M10.7 6.1l1.8-.9' stroke='%23FBF5E6' stroke-width='1.4' stroke-linecap='round'/%3E%3Ccircle cx='11.7' cy='2.3' r='1' fill='%23FBF5E6'/%3E%3C/svg%3E") center / contain no-repeat; }
.verdict.is-perfect .confetti i { border-color: var(--cream); }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; border: 1.5px solid var(--ink); opacity: 0; animation: fall 1.4s var(--ease-out) forwards; }
@keyframes fall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(140px) rotate(300deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }

.compare { padding: 18px 16px 34px; border-top: 2px solid var(--ink); display: grid; gap: 14px; --ask: 50%; }
.bar-row { display: grid; grid-template-columns: 1fr auto; row-gap: 6px; align-items: center; font: 600 13px/1.2 var(--font-ui); color: var(--text-soft); }
.bar-label { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; border: 2px solid var(--ink); }
.swatch.guess { background: var(--guess-color, var(--chart-guess)); transition: background-color 400ms ease; }
.swatch.actual { background: var(--chart-actual); }
.bar-val { font: 700 14px/1 var(--font-ui); color: var(--ink); white-space: nowrap; }
.bar-track { grid-column: 1 / -1; position: relative; height: 26px; border-radius: 6px; background: var(--chart-track); }
.bar-fill { position: absolute; left: 0; top: 0; height: 100%; width: 0; border-radius: 6px; border: 2px solid var(--ink); min-width: 6px; transition: width var(--dur-slow) var(--ease-out); }
.bar-fill.guess { background: var(--guess-color, var(--chart-guess)); transition: width var(--dur-slow) var(--ease-out), background-color 400ms ease; }
/* while the reveal counts, the guess reads as cream; color is the payoff once the points land */
.reveal.is-counting .bar-fill.guess, .reveal.is-counting .swatch.guess { background: var(--cream); }
.bar-fill.actual { background: var(--chart-actual); }
.bar-ghost { position: absolute; top: 0; height: 100%; border: 2px dashed var(--ink); border-radius: 6px; display: flex; align-items: center; justify-content: center; font: 700 11px/1 var(--font-ui); color: var(--ink); white-space: nowrap; overflow: hidden; opacity: 0; transition: opacity var(--dur) var(--ease-out) var(--dur-slow); background: repeating-linear-gradient(135deg, transparent 0 5px, rgba(23,47,77,.12) 5px 7px); }
.reveal.is-in .bar-ghost { opacity: 1; }
.ask-tick { position: absolute; top: -5px; bottom: -5px; left: var(--ask); border-left: 2px dashed var(--ink); opacity: .8; }
.ask-tick-label { position: absolute; top: calc(100% + 7px); left: var(--ask); transform: translateX(-50%); font: 700 10px/1 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }

.verdict-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-right: 100px; min-height: 92px; }
/* zero-size markers used to measure text baselines (see alignVerdict in app.js) */
.bl { display: inline-block; width: 0; height: 0; overflow: hidden; }
.verdict-text { min-width: 0; flex: 1 1 auto; }
/* the score badge straddles the Sold for band and the verdict, above everything */
.points-tile { position: absolute; top: 14px; right: 16px; z-index: 5; width: 92px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; padding: 10px 6px 8px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--paper); box-shadow: 3px 3px 0 var(--ink); }
.points-val { margin: 0; font-size: 20px; color: var(--ink); line-height: 1; white-space: nowrap; }
.points-val .of { font-size: 11px; }
.points-house { position: relative; width: 75px; height: 88px; transform: translate(3px, 3px); transition: transform 400ms ease; }
.reveal.is-counting .points-house { transform: translate(0, 0); }
.points-house .ph-base, .points-house .ph-color { position: absolute; left: 0; top: 0; transition: opacity 400ms ease; }
.points-house .ph-base svg { width: 75px; height: 88px; display: block; }
.points-house .ph-color svg { width: 68px; height: 82px; display: block; }
.reveal .ph-base { opacity: 0; }
.reveal.is-counting .ph-base { opacity: 1; }
.reveal.is-counting .ph-color { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .bar-fill.guess, .swatch.guess, .points-house, .points-house .ph-base, .points-house .ph-color { transition: none; } }
.compare { border-bottom: 2px solid var(--ink); }
.verdict:not(.is-perfect) + .compare { border-top: 0; padding-top: 4px; }
.reveal-cta { padding: 14px 16px 0; background: var(--paper); }

/* ───────────── Results ───────────── */
.results { max-width: 600px; margin: 0 auto; padding: 0 0 56px; width: 100%; }
.score-band { background: var(--sky); color: var(--cream); padding: 14px 16px 16px; text-align: center; }
.poster-eyebrow { color: inherit; opacity: .9; }
.poster-score { margin: 6px 0 0; font-size: clamp(41px, 11.7vw, 53px); color: var(--cream); line-height: .7; } /* .7 = Overpass cap height: the box runs cap top to baseline */
.poster-score .of { color: var(--gold); opacity: 1; }

/* Frisco Bucks */
.frisco { padding: 12px 16px 11px; background: var(--cream); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); text-align: center; }
.frisco-lead { min-height: 14px; }
.frisco-amt { margin-top: 6px; font-size: clamp(27px, 7.4vw, 34px); color: var(--ink); line-height: .7; text-align: center; }
.frisco-buys { margin-top: 8px; }
.prize { background: var(--sky); }
.prize-art { position: relative; }
/* easter egg fly-by: crosses the top of the painting's sky right to left, climbing a little */
.flyby { animation: flyby 16s linear forwards; }
@keyframes flyby { from { transform: translate(490px, 0); } to { transform: translate(-270px, -4px); } }
.flyby-banner { transform-box: fill-box; transform-origin: left center; animation: flutter .9s ease-in-out infinite alternate; }
@keyframes flutter { from { transform: skewY(-1.6deg) scaleY(.98); } to { transform: skewY(1.6deg) scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .flyby { display: none; } }
.prize-art svg { width: 100%; height: auto; display: block; }
/* Perfect Game! sticker: pinned in the deep left corner of the navy street, above the painting */
.perfect-badge { position: absolute; left: 4%; bottom: 7%; z-index: 2; padding: 5.5px 10px; background: var(--gold); color: var(--ink); border: 2px solid var(--ink); border-radius: 6px; font-size: clamp(15px, 4.4vw, 20px); font-variation-settings: "opsz" 24, "wdth" 85; letter-spacing: 0; line-height: 1; white-space: nowrap; transform: rotate(-3deg); }
.prize.in .perfect-badge { animation: badge-pop 420ms var(--ease-out) 200ms both; }
@keyframes badge-pop { from { transform: rotate(-3deg) scale(.6); opacity: 0; } 70% { transform: rotate(-3deg) scale(1.08); opacity: 1; } to { transform: rotate(-3deg) scale(1); } }
@media (prefers-reduced-motion: reduce) { .prize.in .perfect-badge { animation: none; } }
.prize-cap { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 11px 16px; background: var(--gold); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); color: var(--ink); }
.prize-cap strong { font-size: clamp(15px, 4vw, 19px); line-height: 1.05; }
/* results sequence: pieces rise in from below once the amount has counted in */
.results.is-animating .seq { opacity: 0; transform: translateY(24px); pointer-events: none; }
.results.is-animating .seq.in { opacity: 1; transform: none; pointer-events: auto; transition: opacity 360ms var(--ease-out), transform 420ms cubic-bezier(.2, .9, .3, 1); }
.results.is-animating .frisco-lead:empty::after { content: "\00a0"; }
/* the full-blue intro */
.results-intro { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: var(--sky); color: var(--cream); transition: opacity 400ms ease 250ms; }
.intro-score { margin: 0; font-size: clamp(75px, 23.4vw, 156px); line-height: 1; color: var(--cream); transform-origin: 50% 50%; transition: transform 520ms cubic-bezier(.5, 0, .9, .4), opacity 480ms ease-in 60ms; }
.results-intro.is-out { opacity: 0; pointer-events: none; }
.results-intro.is-out .intro-score { transform: scale(7); opacity: 0; }
@media (prefers-reduced-motion: reduce) { .results.is-animating .seq { opacity: 1; transform: none; pointer-events: auto; } .results-intro { display: none; } }

.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 16px 0; }
.share-actions .btn-primary, .share-actions .btn-secondary { grid-column: 1 / -1; }
.share-actions .btn-primary.is-copied, .share-actions .btn-primary.is-copied:disabled { opacity: 1; cursor: default; background: var(--leaf-deep); transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.share-actions .btn-secondary { min-height: 48px; font-size: 15px; font-variation-settings: "opsz" 24, "wdth" 95; }
.share-note { margin: 10px 16px 0; text-align: center; font: 500 12.5px/1.45 var(--font-ui); color: var(--text-muted); }
.poster-tiles { display: flex; justify-content: center; gap: 10px; padding: 16px 16px 0; }
.poster-tiles svg { width: 36px; height: 43px; }
.breakdown { margin: 16px 16px 0; border: 2px solid var(--cream-line); border-radius: var(--radius); background: var(--cream); padding: 0 16px; }
.breakdown summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font: 700 14px/1 var(--font-ui); color: var(--ink); list-style: none; }
.breakdown summary::-webkit-details-marker { display: none; }
.breakdown summary::after { content: "+"; margin-left: auto; font-size: 20px; }
.breakdown[open] summary::after { content: "–"; }
.poster-rows { list-style: none; margin: 0; padding: 0 0 6px; }
.poster-rows li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 2px dashed var(--cream-line); }
.poster-rows li:last-child { border-bottom: 0; }
.poster-rows svg { width: 40px; height: 48px; }
.poster-rows .r-hood { font-weight: 700; color: var(--ink); }
.poster-rows .r-sub { font: 500 12.5px/1.3 var(--font-ui); color: var(--text-muted); margin-top: 2px; }
.poster-rows .r-pts { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--ink); font-variation-settings: "opsz" 24, "wdth" 85; }
/* tomorrow's invitation: five empty lots, waiting for the next game */
.tomorrow { margin: 28px 16px 0; padding: 22px 16px; border: 2px dashed var(--cream-line); border-radius: var(--radius-lg); text-align: center; }
.tomorrow-lots { display: flex; justify-content: center; gap: 10px; color: var(--ink); }
.tomorrow-lots svg { width: 36px; height: 43px; }
.tomorrow-lots text { font: 800 17px var(--font-display); fill: currentColor; }
.tomorrow-title { margin: 16px 0 0; font-size: 24px; line-height: 1.05; color: var(--ink); }
.tomorrow-when { margin: 10px 0 0; font: 500 14px/1.5 var(--font-ui); color: var(--text-soft); }
.tomorrow-when strong { color: var(--ink); font-weight: 700; }
/* feedback: one link out to the hosted form (OSF.config.FEEDBACK_URL) */
.feedback { margin: 24px 16px 0; text-align: center; }
.feedback-msg { font: 500 14px/1.5 var(--font-ui); color: var(--text-soft); max-width: 40ch; margin: 0 auto 12px; text-wrap: balance; }
.feedback .btn { display: flex; min-height: 48px; font-size: 15px; font-variation-settings: "opsz" 24, "wdth" 95; }
.replay { margin: 28px 16px 0; text-align: center; }
.replay-msg { font: 500 15px/1.5 var(--font-ui); color: var(--text-soft); max-width: 40ch; margin: 0 auto 16px; }
@media (min-width: 640px) {
  .results { margin-top: 24px; border: 2px solid var(--ink); border-radius: 16px; overflow: hidden; background: var(--paper); }
}

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); background: var(--ink); color: var(--cream); border: 2px solid var(--cream); border-radius: 10px; padding: 12px 18px; font: 600 14px/1.3 var(--font-ui); opacity: 0; pointer-events: none; transition: opacity var(--dur) ease, transform var(--dur) var(--ease-out); z-index: 70; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 360px) {
  .facts { font-size: 13.5px; }
  .facts li + li::before { margin: 0 9px; }
  .nudge .btn { font-size: 14px; padding-inline: 8px; }
}
