:root {
  font-family: 'Aptos', 'Segoe UI', system-ui, sans-serif;
  color: #23213e;
  background: transparent;
  font-synthesis: none;
  --ink: #23213e;
  --muted: #625e70;
  --border: #e8e3dd;
  --paper: #fffefd;
  --orange: #e95732;
  --orange-dark: #a5371e;
  --lavender: #eceaf7;
  --green: #23725a;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
button:focus-visible, input:focus-visible, a:focus-visible, svg:focus-visible, path:focus-visible { outline: 3px solid #725cdf; outline-offset: 3px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.shell { width: min(1180px, calc(100% - 20px)); margin: 0 auto; padding: 5px 0 1px; }
.game-toolbar, .top-actions, .quiet { display: flex; align-items: center; }
.game-toolbar { justify-content: space-between; flex-wrap: wrap; gap: 9px; }
.top-actions { gap: 2px; }
.quiet { min-height: 42px; border: 0; gap: 7px; border-radius: 9px; padding: 0 12px; color: var(--ink); background: transparent; font-size: .92rem; font-weight: 650; }
.quiet:hover, .icon-button:hover { background: #efecf7; }
.quiet .icon { width: 19px; height: 19px; }
.game-status { min-height: 45px; display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; column-gap: 12px; row-gap: 5px; padding: 7px 0; }
.eyebrow { display: flex; gap: 7px; align-items: center; margin: 0; color: var(--orange-dark); font-size: .91rem; font-weight: 750; }
.edition-dot { width: 8px; height: 8px; border-radius: 50%; background: #e95732; }
h1, h2, h3, p { margin-top: 0; }
.route-choice { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .84rem; }
.route-choice select { min-height: 33px; padding: 3px 7px; background: var(--paper); color: var(--ink); border: 1px solid var(--border); border-radius: 7px; font: inherit; font-weight: 700; }
.route-tools, .daily-tools { display: flex; align-items: center; gap: 8px; }
.route-tools .mini-button, .daily-tools .mini-button { min-height: 35px; padding-inline: 8px; font-size: .85rem; }
.mini-button .icon { width: 15px; height: 15px; }
.mode-switch { border: 1px solid var(--border); border-radius: 13px; padding: 5px; background: #f0ede8; display: flex; gap: 4px; flex: 0 0 auto; }
.mode-switch button { display: flex; min-height: 41px; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border: 0; background: transparent; border-radius: 8px; color: #676173; font-weight: 700; white-space: nowrap; }
.mode-switch button:hover { color: var(--ink); }
.mode-switch button[aria-pressed='true'] { color: var(--ink); background: #fff; box-shadow: 0 1px 4px #231c2524; }
.mode-switch .icon { width: 17px; height: 17px; }
.game-grid { display: grid; grid-template-columns: minmax(0, 1.47fr) minmax(365px, 1fr); gap: 21px; align-items: start; }
.photo-card, .play-card, .history { border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 8px 24px #30251a0b; }
.photo-card { width: 100%; min-width: 0; margin: 0; position: relative; overflow: hidden; min-height: 430px; aspect-ratio: 1.47; background: #393344; color: white; }
.photo-card::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, #20132a2e, transparent 26%, transparent 84%, #20132a3d); }
.photo-card>img { display: block; position: absolute; width: 100%; height: 100%; object-fit: cover; color: white; text-align: center; }
.photo-card>img.photo-loading { opacity: 0; }
.photo-card>img.wide-photo { object-position: 52% center; }
.photo-top { position: absolute; top: 15px; left: 15px; right: 15px; display: flex; align-items: flex-start; justify-content: space-between; z-index: 2; pointer-events: none; }
.photo-label, .photo-zoom { display: inline-flex; align-items: center; gap: 7px; background: #252136dc; color: #fff; border: 1px solid #fff3; border-radius: 10px; backdrop-filter: blur(6px); }
.photo-label { padding: 8px 10px; font-weight: 680; font-size: .88rem; }
.photo-label .icon { width: 16px; height: 16px; }
.photo-zoom { display: grid; place-items: center; width: 43px; height: 43px; pointer-events: auto; }
.photo-zoom:hover { background: #252136; }
.photo-credit { position: absolute; z-index: 2; bottom: 11px; left: 12px; max-width: calc(100% - 24px); padding: 6px 9px; font-size: .8rem; background: #252136e8; border-radius: 6px; line-height: 1.4; }
.photo-credit a { color: #fff; }
.photo-error { position: absolute; z-index: 2; inset: 0; display: grid; place-content: center; gap: 12px; text-align: center; }
.photo-error button { color: #fff; background: #23213e; border: 1px solid #fff5; padding: 8px; border-radius: 7px; }
.photo-zoom:disabled { opacity: .5; }
.play-card { padding: 19px; background: var(--paper); }
.play-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 13px; }
.play-heading h2 { font-size: 1.46rem; margin-bottom: 4px; font-weight: 800; letter-spacing: -.035em; }
.play-heading p { font-size: .89rem; margin-bottom: 0; color: var(--muted); }
.attempts { align-self: start; border-radius: 8px; white-space: nowrap; padding: 6px 8px; background: #fcebe2; color: #9f381e; font-size: .8rem; font-weight: 800; }
.attempts.pin-status { background: #ece8fb; color: #4c3887; }
.map-panel { position: relative; overflow: hidden; background: #f4f2fa; border: 1px solid #e6e2ef; border-radius: 13px; isolation: isolate; }
.map-panel.is-pin { cursor: crosshair; }
.map-text { position: absolute; top: 10px; left: 11px; letter-spacing: .15em; color: #666078; font-size: .68rem; font-weight: 750; z-index: 1; pointer-events: none; }
#map { width: 100%; height: auto; display: block; user-select: none; }
.is-pin #map { touch-action: none; }
.state-shape { fill: #d8d3ed; stroke: #fff; stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; transition: fill 140ms ease; }
.state-shape.selectable { cursor: pointer; }
.state-shape.selectable:hover, .state-shape.selectable:focus-visible { fill: #b9abe6; outline: none; }
.state-shape.guessed { fill: #a99dcf; }
.state-shape.selected { fill: #7460b4; }
.state-shape.correct { fill: #70af96; }
.state-label { fill: #403662; font-size: 10px; font-weight: 750; letter-spacing: .025em; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.state-label.selected { fill: #fff; }
.state-label.correct { fill: #132e23; }
.map-city { pointer-events: none; fill: #2d2446; }
.map-city text { font-size: 11px; font-weight: 750; paint-order: stroke; stroke: #f8f5fe; stroke-width: 2.8; stroke-linejoin: round; }
.map-line { stroke: #352451; stroke-dasharray: 4 3; stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-marker { fill: var(--orange); stroke: white; stroke-width: 2; pointer-events: none; }
.map-marker.answer { fill: #13684e; }
.map-tooltip { position: absolute; z-index: 2; color: #fff; background: var(--ink); border-radius: 6px; font-weight: 650; font-size: .8rem; padding: 5px 7px; pointer-events: none; white-space: nowrap; transform: translate(-50%, -120%); }
.map-controls { position: absolute; right: 8px; bottom: 8px; z-index: 1; display: flex; gap: 4px; }
.map-controls button, .nudge button { display: grid; place-items: center; min-width: 34px; min-height: 34px; color: var(--ink); background: #fff; border: 1px solid #e5e0f1; border-radius: 7px; }
.map-controls button:hover, .nudge button:hover { background: #e9e2f8; }
.map-controls .icon { width: 15px; height: 15px; }
#guess-form { display: flex; gap: 8px; margin-top: 12px; }
.search-field { min-width: 0; position: relative; flex: 1; }
.search-field>.icon { position: absolute; top: 14px; left: 11px; width: 17px; height: 17px; color: #726a7d; pointer-events: none; }
.search-field input { height: 45px; width: 100%; border: 1px solid #ded7e8; background: #fff; border-radius: 9px; padding: 0 10px 0 35px; color: var(--ink); }
.search-field input::placeholder { color: #726c7b; }
#state-options { position: absolute; bottom: calc(100% + 5px); z-index: 5; margin: 0; padding: 4px; list-style: none; border: 1px solid #ded7e8; background: #fff; border-radius: 10px; overflow: auto; max-height: 225px; width: 100%; box-shadow: 0 8px 20px #23213e26; }
#state-options li { padding: 8px 9px; border-radius: 5px; cursor: pointer; }
#state-options li:hover, #state-options li[aria-selected='true'] { background: #eee9fa; }
.primary, .secondary { display: inline-flex; min-height: 45px; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border-radius: 9px; font-weight: 800; white-space: nowrap; }
.primary { border: 1px solid transparent; color: #fff; background: #b33f25; }
.primary:hover { background: #9e331a; }
.primary:disabled { color: #635970; background: #eee9f0; }
.secondary { border: 1px solid #e7e0ee; color: var(--ink); background: #fff; }
.secondary:hover { background: #f0edf8; }
#guess-button { min-width: 87px; }
.below-form { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hint-button { display: inline-flex; align-items: center; gap: 6px; min-height: 33px; color: #544284; background: #eeeaf9; border: none; border-radius: 7px; padding: 0 9px; font-weight: 750; font-size: .86rem; }
.hint-button:not(:disabled):hover { background: #e4dafb; }
.hint-button:disabled { color: #5d576a; background: #f0eef2; }
.hint-button .icon { width: 16px; height: 16px; }
#hint-cost { font-size: .83rem; color: var(--muted); }
.hints { margin: 9px 0 0; padding: 9px 12px 9px 29px; background: #f6f3fc; border-radius: 8px; font-size: .9rem; }
.hints li+li { margin-top: 5px; }
.message { margin: 10px 0 0; color: #583b78; font-size: .89rem; font-weight: 650; }
.pin-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; font-size: .88rem; }
.pin-actions { display: flex; gap: 6px; margin-left: auto; }
.nudge { display: flex; gap: 3px; }
.round-result { margin-top: 12px; padding: 12px 13px; background: #f1f6f3; border: 1px solid #dfeae4; border-radius: 11px; }
.round-result h3 { font-size: 1.1rem; margin-bottom: 3px; line-height: 1.3; }
.round-result p { font-size: .88rem; margin-bottom: 8px; color: #454653; }
.round-result p:last-child { margin-bottom: 0; }
.round-result .result-score { color: var(--green); font-weight: 800; }
.round-result.missed { background: #faf2ee; border-color: #f0e5de; }
.result-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.result-actions button { min-height: 40px; padding-inline: 11px; font-size: .9rem; }
.result-actions .icon { width: 16px; height: 16px; }
.history { margin-top: 16px; padding: 14px 17px; background: var(--paper); }
.history h2 { font-size: 1rem; margin-bottom: 9px; }
.history ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 0; padding: 0; list-style: none; }
.guess-row { display: flex; justify-content: space-between; align-items: center; min-height: 41px; gap: 7px; border-radius: 8px; padding: 6px 8px 6px 10px; font-size: .9rem; background: #f3f0f9; }
.guess-row strong { font-weight: 740; }
.guess-row span { text-align: right; color: #544472; }
.guess-row.right { background: #e9f4ed; }
.guess-row.right span { color: #1c624a; }
.trip-progress { display: flex; gap: 6px; align-items: center; font-size: .87rem; font-weight: 750; }
.trip-progress span:first-child { margin-right: 5px; }
.trip-progress i { width: 11px; height: 11px; border-radius: 50%; background: #e8e3ed; }
.trip-progress i.current { background: var(--orange); }
.trip-progress i.past { background: #63a58b; }
.trip-progress span:last-child { margin-left: auto; color: var(--muted); }
.site-footer { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .84rem; padding: 12px 1px 8px; }
.site-footer>span:first-child { font-weight: 750; }
.site-footer button { border: none; padding: 0; color: #534378; background: transparent; text-decoration: underline; text-underline-offset: 2px; }
.dialog { width: min(94vw, 470px); max-height: 90dvh; padding: 20px; border: 1px solid var(--border); border-radius: 17px; color: var(--ink); background: var(--paper); box-shadow: 0 18px 55px #22193855; }
dialog::backdrop { background: #1b1527b3; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.dialog-head h2 { margin: 0; letter-spacing: -.035em; }
.icon-button { border: none; background: transparent; color: var(--ink); border-radius: 8px; display: grid; place-items: center; width: 38px; height: 38px; }
.rules { padding-left: 22px; }
.rules li+li { margin-top: 9px; }
.dialog p { line-height: 1.45; }
.passport-guide { color: var(--muted); font-size: .9rem; }
.archive-list { display: grid; gap: 5px; max-height: min(57dvh, 400px); overflow-y: auto; margin: 0; padding: 2px; list-style: none; }
.archive-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 45px; width: 100%; padding: 6px 10px; background: var(--paper); border: 1px solid var(--border); border-radius: 8px; color: var(--ink); text-align: left; }
.archive-row:hover, .archive-row[aria-current='date'] { background: #f3eff7; }
.archive-row time { font-weight: 720; }
.archive-state { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.passport-grid { padding: 0; margin: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(38px, 1fr)); gap: 5px; }
.passport-grid li { display: grid; place-items: center; min-height: 35px; color: #625a72; background: #f3eff7; border-radius: 6px; font-size: .84rem; font-weight: 650; }
.passport-grid li.stamped { color: #165d46; background: #e0f1e9; outline: 1px solid #98ccbb; font-weight: 850; }
.dialog .attribution { color: var(--muted); font-size: .84rem; margin-bottom: 0; }
.dialog a { color: #51408a; }
.dialog textarea { width: 100%; margin-top: 8px; resize: vertical; padding: 8px; border: 1px solid var(--border); border-radius: 7px; }
.full-photo { max-width: 96vw; max-height: 94dvh; margin: auto; padding: 0; border: 0; border-radius: 13px; background: #252136; overflow: hidden; }
.full-photo>img { display: block; max-width: 96vw; max-height: 94dvh; object-fit: contain; }
.full-photo .photo-zoom { position: absolute; top: 10px; right: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 16px; }
.stat { text-align: center; background: #f3effa; padding: 8px 2px; border-radius: 7px; font-size: .82rem; }
.stat strong { display: block; font-size: 1.3rem; }
.stats-bars { display: grid; gap: 3px; margin-bottom: 12px; }
.stats-bars>div { display: flex; align-items: center; gap: 6px; }
.stats-bars b { background: #dcd4f3; padding: 2px 5px; border-radius: 4px; font-size: .85rem; }
.trip-score { font-size: 1.45rem; font-weight: 850; }
.trip-summary { list-style: none; padding: 0; }
.trip-summary li { display: flex; justify-content: space-between; gap: 7px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.toast { position: fixed; z-index: 9; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: white; padding: 9px 13px; border-radius: 8px; box-shadow: 0 4px 12px #0003; }
@media (max-width: 1050px) {
  .game-grid { grid-template-columns: minmax(0, 1.25fr) minmax(345px, 1fr); gap: 15px; }
  .photo-card { min-height: 342px; }
  .play-card { padding: 14px; }
}
@media (max-width: 720px) {
  .shell { width: calc(100% - 14px); }
  .mode-switch { padding: 3px; }
  .mode-switch button { min-height: 38px; padding-inline: 8px; font-size: .9rem; }
  .game-grid { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .photo-card { min-height: 0; aspect-ratio: 1.58; border-radius: 13px; }
  .play-card, .history { border-radius: 13px; }
  .photo-top { top: 8px; left: 8px; right: 8px; }
  .photo-zoom { width: 39px; height: 39px; }
  .history ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 430px) {
  .shell { width: calc(100% - 10px); }
  .game-toolbar { gap: 4px; }
  .mode-switch { gap: 1px; }
  .mode-switch button { padding-inline: 6px; }
  .mode-switch .icon { display: none; }
  .quiet { width: 37px; justify-content: center; padding: 0; }
  .quiet span { display: none; }
  .top-actions { gap: 0; }
  .quiet .icon { width: 19px; height: 19px; }
  .game-status { gap: 4px 6px; }
  .trip-progress i { display: none; }
  .play-card { padding: 12px; }
  .history ol { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; scroll-behavior: auto !important; }
}
