:root {
  color-scheme: light;
  --ink: #102a43;
  --muted: #557086;
  --paper: #fffdf6;
  --navy: #173f5f;
  --teal: #1e8a89;
  --teal-dark: #116866;
  --coral: #ee6b5f;
  --gold: #f5c84c;
  --sky: #dff4f3;
  --line: #b8d3d4;
  font-family: Inter, ui-rounded, "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
button { font: inherit; }
body {
  min-width: 1100px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(8, 35, 56, .28), rgba(8, 35, 56, .72)),
    url(./assets/route-backdrop-01.webp) center / cover fixed;
}

.game {
  width: min(1360px, calc(100vw - 52px));
  height: min(820px, calc(100vh - 48px));
  min-height: 720px;
  margin: 24px auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
}

.quest-card, .travel-board {
  border: 1px solid rgba(255, 255, 255, .64);
  box-shadow: 0 24px 70px rgba(4, 28, 47, .28);
  backdrop-filter: blur(16px);
}

.quest-card {
  position: relative;
  overflow: hidden;
  padding: 26px 30px 24px;
  border-radius: 32px;
  background: rgba(255, 253, 246, .95);
}

.mission { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; min-height: 90px; }
.kicker { margin: 0 0 6px; color: var(--coral); font-size: 13px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.mission h1 { max-width: 790px; margin: 0; font-size: clamp(27px, 2.4vw, 38px); line-height: 1.08; letter-spacing: -.035em; }
.nudge { margin: 9px 0 0; color: var(--muted); font-size: 16px; font-weight: 650; }
.region-chip { flex: 0 0 auto; min-width: 86px; padding: 10px 16px; border-radius: 999px; color: white; background: var(--teal); text-align: center; font-size: 14px; font-weight: 900; box-shadow: 0 5px 0 var(--teal-dark); }

.map-stage {
  position: relative;
  height: 440px;
  margin-top: 12px;
  overflow: hidden;
  border: 2px solid #c8e2df;
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 40%, rgba(255,255,255,.92), rgba(230,246,243,.9)),
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(21, 106, 113, .04) 35px 36px);
  box-shadow: inset 0 0 0 8px rgba(255,255,255,.5);
}

.state-map { position: relative; z-index: 2; width: 100%; height: 100%; padding: 12px 24px 8px; filter: drop-shadow(0 12px 12px rgba(15, 65, 81, .16)); }
.state {
  fill: #d7e6e2;
  stroke: #fffdf6;
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
  transition: fill 150ms ease-out, filter 150ms ease-out, transform 150ms ease-out;
  transform-box: fill-box;
  transform-origin: center;
}
.state[data-region="West"] { fill: #c9e7df; }
.state[data-region="Midwest"] { fill: #d9e7bd; }
.state[data-region="South"] { fill: #f5d9bd; }
.state[data-region="Northeast"] { fill: #d7dcf0; }
.state.is-target { fill: var(--gold); filter: drop-shadow(0 0 10px rgba(245, 200, 76, .9)); transform: scale(1.035); }
.state.is-correct { fill: #4cc49a; filter: drop-shadow(0 0 13px rgba(42, 183, 137, .95)); }
.state.is-wrong { animation: state-wiggle 260ms ease-out; }
.map-stage.is-miss { animation: gentle-shake 250ms ease-out; }
.map-stage.is-success { box-shadow: inset 0 0 0 8px rgba(255,255,255,.5), inset 0 0 65px rgba(245,200,76,.46); }

.map-callout { position: absolute; z-index: 4; left: 20px; bottom: 18px; padding: 9px 14px; border-radius: 999px; color: var(--navy); background: rgba(255,255,255,.92); box-shadow: 0 7px 22px rgba(22,63,95,.12); font-size: 13px; font-weight: 850; }
.route-line { position: absolute; inset: auto -30px 22px 47%; z-index: 1; height: 90px; border-top: 3px dashed rgba(238,107,95,.24); border-radius: 50%; transform: rotate(-8deg); }
.map-pin-group { pointer-events: none; transform-origin: center; }
.map-pin-group.is-dropping { animation: pin-drop 480ms cubic-bezier(.2, .9, .25, 1.3) both; }
.map-pin-image { width: 54px; height: 54px; filter: drop-shadow(0 7px 5px rgba(18,44,60,.28)); }

.choice-tray { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-top: 17px; }
.choice {
  position: relative;
  min-height: 66px;
  padding: 12px 14px;
  border: 2px solid #d7e6e4;
  border-radius: 17px;
  color: var(--navy);
  background: white;
  box-shadow: 0 5px 0 #c6d9d7;
  cursor: pointer;
  font-size: 17px;
  font-weight: 900;
  transition: transform 150ms ease-out, border-color 150ms ease-out, box-shadow 150ms ease-out, background 150ms ease-out;
}
.choice:hover { transform: translateY(-2px); border-color: var(--teal); box-shadow: 0 7px 0 #9fc8c4; }
.choice:active { transform: translateY(3px); box-shadow: 0 2px 0 #9fc8c4; }
.choice:focus-visible, .continue:focus-visible, .explain-choice:focus-visible { outline: 4px solid rgba(30,138,137,.28); outline-offset: 3px; }
.choice.is-miss { border-color: #ed9c91; background: #fff5f1; animation: gentle-shake 250ms ease-out; }
.choice:disabled { cursor: default; opacity: .68; transform: none; }
.feedback { min-height: 24px; margin: 11px 0 0; color: var(--coral); text-align: center; font-weight: 850; }

.stamp-card {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: 22px;
  width: min(780px, calc(100% - 70px));
  min-height: 126px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 16px;
  border: 2px solid #f2cc63;
  border-radius: 23px;
  background: #fffaf0;
  box-shadow: 0 18px 50px rgba(25,55,73,.25);
  transform: translateX(-50%) rotate(-.45deg);
  animation: stamp-pop 350ms cubic-bezier(.2,.85,.25,1.18) both;
}
.stamp-star { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--coral); font-size: 29px; box-shadow: 0 5px 0 #bd4a43; }
.stamp-card span { color: var(--teal-dark); font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.stamp-card h2 { margin: 3px 0 5px; font-size: 24px; }
.stamp-card h2 strong { color: var(--coral); }
.stamp-card p { margin: 0; color: var(--muted); font-size: 14px; font-weight: 650; }
.continue { min-height: 48px; padding: 10px 18px; border: 0; border-radius: 14px; color: white; background: var(--teal); box-shadow: 0 5px 0 var(--teal-dark); cursor: pointer; font-weight: 900; }
.continue:hover { transform: translateY(-2px); }

.explain-panel { position: absolute; z-index: 8; left: 50%; bottom: 20px; width: min(800px, calc(100% - 70px)); padding: 18px; border-radius: 22px; background: white; box-shadow: 0 18px 55px rgba(18,47,66,.28); transform: translateX(-50%); }
.explain-panel > p { margin: 0 0 12px; text-align: center; font-weight: 900; }
.explain-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.explain-choice { min-height: 48px; border: 2px solid #d7e6e4; border-radius: 14px; color: var(--navy); background: #f8fcfb; cursor: pointer; font-weight: 800; }

.travel-board { position: relative; overflow: hidden; padding: 20px; border-radius: 28px; background: rgba(18, 55, 78, .92); color: white; }
.sticker-art { overflow: hidden; border: 7px solid white; border-radius: 24px; background: white; box-shadow: 0 10px 25px rgba(0,0,0,.22); }
.sticker-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mascot-sticker { width: 158px; height: 158px; margin: 0 auto; transform: rotate(-2deg); transition: transform 150ms ease-out; }
.mascot-sticker.is-cheering { animation: mascot-cheer 650ms ease-out; }
.mascot-sticker.is-thinking { transform: rotate(2deg) translateY(4px); }
.mascot-bubble { position: relative; width: max-content; max-width: 220px; margin: -2px auto 18px; padding: 9px 13px; border-radius: 12px; color: var(--navy); background: white; box-shadow: 0 5px 15px rgba(0,0,0,.16); text-align: center; font-size: 13px; font-weight: 900; }
.mode-card { padding: 15px 16px; border-radius: 17px; background: rgba(255,255,255,.09); }
.mode-card span { display: block; color: #b8e2df; font-size: 12px; font-weight: 800; }
.mode-card strong { display: block; margin-top: 3px; font-size: 18px; }
.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 12px 0; }
.stats div { padding: 11px 4px; border-radius: 14px; background: rgba(255,255,255,.08); text-align: center; }
.stats span { display: block; color: #b8d7df; font-size: 11px; font-weight: 750; }
.stats strong { display: block; margin-top: 2px; color: var(--gold); font-size: 21px; }
.difficulty-card { padding: 13px; border-radius: 15px; background: rgba(255,255,255,.09); }
.difficulty-card > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; font-weight: 850; }
.difficulty-track { height: 8px; margin: 9px 0; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.15); }
.difficulty-track i { display: block; width: 12%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--gold), var(--coral)); transition: width 300ms ease-out; }
.difficulty-card p { margin: 0; color: #bad6df; font-size: 11px; }
.trunk-sticker { width: 124px; height: 104px; margin: 16px auto 9px; transform: rotate(3deg); }
.travel-note { margin: 0; color: #bdd5df; text-align: center; font-size: 12px; line-height: 1.4; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: 20px; padding: 11px 18px; border-radius: 999px; color: white; background: var(--ink); font-weight: 850; opacity: 0; transform: translate(-50%, 15px); transition: 180ms ease-out; pointer-events: none; }
.toast.is-showing { opacity: 1; transform: translate(-50%,0); }
.confetti { position: fixed; z-index: 40; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -25px; width: 11px; height: 18px; border-radius: 3px; animation: confetti-fall 900ms ease-in forwards; }

@keyframes pin-drop { from { opacity: 0; transform: translateY(-120px) scale(1.6) rotate(-14deg); } 70% { opacity: 1; transform: translateY(5px) scale(.92) rotate(4deg); } to { opacity: 1; transform: none; } }
@keyframes stamp-pop { from { opacity: 0; transform: translate(-50%, 26px) scale(.8) rotate(-4deg); } to { opacity: 1; transform: translateX(-50%) rotate(-.45deg); } }
@keyframes gentle-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes state-wiggle { 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@keyframes mascot-cheer { 0%,100% { transform: rotate(-2deg); } 35% { transform: translateY(-14px) rotate(4deg) scale(1.04); } 65% { transform: translateY(-4px) rotate(-5deg); } }
@keyframes confetti-fall { to { transform: translateY(105vh) rotate(560deg); opacity: .15; } }

@media (max-height: 800px) {
  .game { min-height: 690px; height: calc(100vh - 30px); margin: 15px auto; }
  .map-stage { height: 380px; }
  .mascot-sticker { width: 130px; height: 130px; }
  .trunk-sticker { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
