:root {
  --ink: #17324a;
  --navy: #0b4167;
  --ocean: #1685be;
  --sky: #dff7fb;
  --cream: #fffaf0;
  --land: #dce8b4;
  --land-hover: #f3d87e;
  --coral: #f06b5b;
  --gold: #ffd45c;
  --mint: #75d6a5;
  --white: #fff;
  font-family: ui-rounded, "Avenir Next", Avenir, system-ui, sans-serif;
  color: var(--ink);
  background: #caedf1;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
button { font: inherit; }
body {
  background:
    radial-gradient(circle at 12% 14%, rgba(255,255,255,.9) 0 3px, transparent 4px),
    radial-gradient(circle at 83% 78%, rgba(255,255,255,.7) 0 2px, transparent 3px),
    linear-gradient(150deg, #e8fbf8 0%, #bce8ef 100%);
  background-size: 120px 120px, 90px 90px, auto;
}

.scene {
  min-height: 100%;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 26px;
  padding: 28px 34px 30px;
  align-items: center;
}

.mission-card {
  position: relative;
  z-index: 3;
  background: rgba(255, 250, 240, .97);
  border: 2px solid rgba(11, 65, 103, .12);
  border-radius: 28px;
  box-shadow: 0 20px 50px rgba(24, 74, 97, .16);
  padding: 24px;
}

.mission-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.level-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 11px;
  border-radius: 999px;
  background: #e2f2d0;
  color: #356044;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}
.score { font-size: 12px; font-weight: 800; color: #587082; white-space: nowrap; }

.rocky-row { display: grid; grid-template-columns: 58px 1fr; gap: 14px; align-items: center; margin: 28px 0 14px; }
.rocky-avatar {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 20px 20px 24px 24px;
  background: #ee8b5f;
  border: 3px solid #923f31;
  box-shadow: inset 0 -7px 0 rgba(115,46,38,.12);
  transform: rotate(-2deg);
}
.rocky-avatar .hat { position: absolute; width: 62px; height: 23px; top: -12px; left: -5px; border-radius: 50% 55% 18% 18%; background: var(--gold); border: 3px solid #9b6915; transform: rotate(-4deg); }
.rocky-avatar .face { position: relative; margin-top: 8px; color: #4d281f; font-size: 16px; letter-spacing: 2px; }
.rocky-name { margin: 0 0 3px; color: var(--coral); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 900; }
h1 { margin: 0; max-width: 190px; font-size: clamp(24px, 2.15vw, 32px); line-height: 1.03; letter-spacing: -.035em; color: var(--navy); }
.nudge { min-height: 42px; margin: 0 0 18px; color: #5a7181; font-size: 14px; line-height: 1.45; }

.find-strip { display: flex; flex-wrap: wrap; gap: 7px; min-height: 78px; align-content: flex-start; }
.find-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #edf1ed;
  color: #647480;
  font-size: 11px;
  font-weight: 800;
  transition: transform 150ms ease-out, background 150ms ease-out, color 150ms ease-out;
}
.find-dot.current { background: var(--gold); color: #5a4100; transform: translateY(-2px); }
.find-dot.found { background: var(--mint); color: #174e37; }
.find-dot.found::before { content: "✓"; margin-right: 4px; }

.mission-actions { margin-top: 18px; }
.primary-button, .quiet-button { width: 100%; min-height: 48px; border-radius: 15px; cursor: pointer; font-weight: 900; }
.primary-button { border: 0; background: var(--coral); color: white; box-shadow: 0 6px 0 #af4338; }
.primary-button:hover { transform: translateY(-1px); }
.primary-button:active { transform: translateY(4px); box-shadow: 0 2px 0 #af4338; }
.quiet-button { border: 2px solid #b7ced4; background: white; color: var(--navy); }

.map-card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: min(86vh, 800px);
  padding: 22px 22px 14px;
  background: linear-gradient(160deg, #d3f1f6 0%, #a9dced 55%, #8ccbe6 100%);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 36px;
  box-shadow: 0 25px 65px rgba(17, 76, 105, .18);
  overflow: hidden;
}
.map-glow { position: absolute; inset: 18% 12%; background: #70e0f2; filter: blur(70px); opacity: .5; }
.world-map { position: relative; display: block; width: 100%; max-height: min(74vh, 760px); margin: 0 auto; cursor: crosshair; filter: drop-shadow(0 10px 14px rgba(9,66,98,.18)); touch-action: manipulation; }
.ocean-base { fill: url(#oceanFill); stroke: #0b648f; stroke-width: 3; }
.wave-layer { fill: url(#waves); pointer-events: none; }
.graticule path { fill: none; stroke: rgba(255,255,255,.15); stroke-width: 1; pointer-events: none; }
.graticule .equator { stroke: rgba(255,238,151,.45); stroke-width: 2; stroke-dasharray: 7 7; }
.ocean-targets path { fill: transparent; stroke: none; cursor: pointer; }
.country {
  fill: var(--land);
  stroke: #577e6b;
  stroke-width: .72;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill 120ms ease-out, filter 120ms ease-out;
}
.country:hover, .country:focus { fill: var(--land-hover); outline: none; }
.country.is-found { fill: #ffd86d; filter: url(#softGlow); }
.country.is-wrong { animation: map-wiggle 260ms ease-out; fill: #f6a89b; }
.country.is-hinted { fill: #fff0a3; animation: hint-pulse 900ms ease-in-out 2; }
.country.is-dimmed { opacity: .72; }
.ocean-targets path.is-found { fill: rgba(255, 231, 112, .34); stroke: rgba(255,245,174,.95); stroke-width: 4; filter: url(#softGlow); }
.ocean-targets path.is-wrong { fill: rgba(246, 130, 114, .28); }
.ocean-targets path.is-hinted { fill: rgba(255,240,163,.25); stroke: rgba(255,240,163,.8); stroke-width: 3; animation: hint-pulse 900ms ease-in-out 2; }
.map-labels text { fill: white; font-size: 16px; font-weight: 900; text-anchor: middle; paint-order: stroke; stroke: rgba(9,65,97,.72); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.map-labels text.country-label { font-size: 12px; }
.hint-layer .hint-ring { fill: none; stroke: #fff19c; stroke-width: 5; animation: ring 1.25s ease-out infinite; }
.map-key { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 28px; color: #3c687c; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.map-key span { width: 9px; height: 9px; border-radius: 50%; background: #73c596; }

.mute-button { position: fixed; z-index: 8; right: 24px; bottom: 22px; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(11,65,103,.16); background: rgba(255,255,255,.94); color: var(--navy); cursor: pointer; box-shadow: 0 8px 22px rgba(24,74,97,.16); }
.mute-button svg { width: 23px; height: 23px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mute-button .sound-off { display: none; }
.mute-button[aria-pressed="true"] .sound-on { display: none; }
.mute-button[aria-pressed="true"] .sound-off { display: block; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 28px; transform: translate(-50%, 22px); padding: 12px 18px; border-radius: 999px; background: #17324a; color: white; font-weight: 850; opacity: 0; pointer-events: none; transition: opacity 160ms ease-out, transform 160ms ease-out; box-shadow: 0 12px 28px rgba(0,0,0,.18); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.success { background: #267956; }

.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 12px; height: 20px; border-radius: 3px; animation: confetti 1.25s ease-in forwards; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

button:focus-visible, .country:focus-visible { outline: 4px solid #fff19c; outline-offset: 3px; }
@keyframes map-wiggle { 30% { transform: translateX(-3px); } 65% { transform: translateX(3px); } }
@keyframes hint-pulse { 50% { filter: brightness(1.22) drop-shadow(0 0 9px #fff19c); } }
@keyframes ring { from { r: 10; opacity: 1; } to { r: 38; opacity: 0; } }
@keyframes confetti { to { transform: translate(var(--drift), 640px) rotate(540deg); opacity: .1; } }

@media (max-width: 1120px) { .scene { grid-template-columns: 280px minmax(0,1fr); gap: 18px; padding-inline: 20px; } .mission-card { padding: 20px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; } }
