@font-face {
  font-family: "Press Start";
  src: url("./assets/press-start.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fbefd9;
  --cream: #fff6e1;
  --ink: #2e1b39;
  --quiet: #66546c;
  --lilac: #efe2f1;
  --accent: #ff6d53;
  --gold: #ffcf57;
  --pixel: "Press Start", monospace;
  --stroke: 3px solid var(--ink);
  color: var(--ink);
  font-family: system-ui, sans-serif;
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; border-top: var(--stroke); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
:focus-visible { outline: 3px solid #8b3dc2; outline-offset: 4px; }
.shell { width: min(1488px, calc(100% - 2 * clamp(18px, 2vw, 34px))); margin-inline: auto; }
.top { border-bottom: var(--stroke); }
.top-inner { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { font: 14px/1.4 var(--pixel); text-decoration: none; }
.wordmark span { color: #ad372d; }
.home { font-weight: 760; text-underline-offset: 3px; }
.home span { margin-right: 6px; }
main.shell { padding-block: 17px 56px; }

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(270px, 23vw, 350px);
  isolation: isolate;
  background: #2b1939;
  border: var(--stroke);
  border-radius: 9px;
  overflow: hidden;
  color: var(--cream);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, #291735 0%, #291735ed 24%, #29173550 52%, transparent 70%);
}
.hero-copy { max-inline-size: 59%; padding: clamp(23px, 2.1vw, 36px) clamp(24px, 4vw, 68px); }
.hero-art {
  --art-x: 50%;
  --art-y: 70%;
  position: absolute;
  inset: 0;
  z-index: -2;
  container-type: size;
  overflow: hidden;
}
.hero-scene {
  position: absolute;
  left: var(--art-x);
  top: var(--art-y);
  /* Keep the sign anchored to the same spot as the 3:1 artwork crops. */
  width: max(100cqw, 300cqh);
  aspect-ratio: 3;
  transform: translate(calc(-1 * var(--art-x)), calc(-1 * var(--art-y)));
  background: url("./assets/evening-store.webp") center / 100% 100% no-repeat;
}
.store-sign {
  position: absolute;
  left: 74.15%;
  top: 49.9%;
  transform: translate(-50%, -50%);
  width: max-content;
  min-width: 10.35%;
  max-width: clamp(130px, 28cqw, 300px);
  text-align: center;
}
.sign-name {
  display: block;
  padding: clamp(2px, .45cqw, 6px) clamp(4px, .8cqw, 11px);
  border: 1px solid #ffbb82;
  border-radius: 2px;
  background: linear-gradient(#a02f3f, #781d32);
  box-shadow: 0 0 9px #ff966678;
  color: #fff4c7;
  font-size: clamp(11px, 1.5cqw, 20px);
  font-weight: 860;
  line-height: 1.1;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.sign-name.is-lit { animation: sign-light 520ms ease-out both; }
@keyframes sign-light {
  from { opacity: 0; transform: translateY(3px) scale(.97); }
  42% { opacity: 1; filter: brightness(1.55); }
  to { opacity: 1; transform: none; filter: none; }
}
h1 {
  font: normal clamp(32px, 5.15vw, 76px)/1.17 var(--pixel);
  text-transform: uppercase;
  letter-spacing: -.06em;
  margin: 0;
  text-shadow: 3px 4px #1f142b;
}
h1 span { color: var(--gold); }
.hero p { max-inline-size: 35ch; margin: 12px 0 0; font-size: clamp(16px, 1.65vw, 23px); line-height: 1.35; font-weight: 700; }
.board { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; gap: 20px; margin-top: 21px; }
.snapshot-date { display: block; margin-top: 20px; color: var(--quiet); font-size: 13px; line-height: 1.4; }
.panel { border: var(--stroke); border-radius: 9px; background: var(--cream); padding: clamp(16px, 1.8vw, 27px); box-shadow: 5px 5px var(--ink); min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: var(--stroke); }
h2 { font: normal clamp(15px, 2.05vw, 29px)/1.45 var(--pixel); letter-spacing: -.06em; margin: 0; }
h3 { font-size: clamp(17px, 1.7vw, 23px); line-height: 1.2; margin: 0; }
.stats { display: flex; gap: 8px; margin: 0; }
.stats div { padding: 6px 9px 7px; min-width: 73px; border: 2px solid var(--ink); border-radius: 4px; text-align: center; }
.stats dt { font-size: 10px; font-weight: 750; }
.stats dd { font: normal clamp(11px, 1.35vw, 20px)/1.2 var(--pixel); margin: 5px 0 0; }
.stats .score { background: var(--paper); }
.stats .timer { background: var(--ink); color: var(--cream); }

.play { padding-block: 16px; }
label { display: block; margin-bottom: 8px; font-size: clamp(17px, 1.75vw, 24px); font-weight: 790; }
.entry { display: flex; align-items: stretch; gap: 13px; }
input {
  min-width: 0;
  width: 100%;
  height: 50px;
  padding-inline: 12px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: #fffdfa;
  color: var(--ink);
  font-size: 17px;
}
input::placeholder { color: #665871; }
input:disabled { background: #ebdfea; opacity: 1; border-color: #8d7c92; }
.cta {
  flex: 0 0 auto;
  min-height: 50px;
  padding: 7px clamp(12px, 2vw, 25px);
  background: var(--accent);
  color: #281524;
  border: var(--stroke);
  border-radius: 5px;
  box-shadow: 3px 3px var(--ink);
  font-weight: 850;
}
.cta:hover:not(:disabled) { background: #ff8c68; }
.cta:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px var(--ink); }
.cta:disabled { background: #efd5ca; color: #635168; box-shadow: none; border-color: #8d7c92; }
.hint, .feedback { font-size: 14px; line-height: 1.4; }
.play-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 11px; }
.hint { margin: 0; color: var(--quiet); }
.feedback:empty { display: none; }
.feedback { margin: 9px 0 0; font-weight: 760; overflow-wrap: anywhere; }
.feedback[data-kind="good"] { color: #286149; }
.feedback[data-kind="bad"] { color: #96372e; }
.finish { flex-shrink: 0; border: 0; padding: 0; min-height: 28px; color: var(--ink); background: transparent; font-weight: 740; text-decoration: underline; text-underline-offset: 3px; }
.finish:disabled { color: var(--quiet); }
.choices { display: grid; gap: 7px; margin-top: 12px; }
.choices button { border: 2px solid #a589aa; border-radius: 4px; text-align: left; padding: 8px 11px; min-height: 44px; font-weight: 650; color: var(--ink); background: var(--lilac); overflow-wrap: anywhere; }
.choices button:hover { background: #e5cdeb; }
.round-end { margin-top: 13px; border-left: 4px solid #d69e3b; padding: 9px 11px; background: #fff0c7; font-weight: 750; }

.atlas, .receipt { border-top: var(--stroke); padding-top: 15px; }
.subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.subhead span { font: 9px/1.45 var(--pixel); color: var(--quiet); text-transform: uppercase; }
.chart {
  border: 2px solid var(--ink);
  border-radius: 5px;
  overflow: hidden;
  background-color: #2e2145;
  background-image: linear-gradient(#b79dd216 1px, transparent 1px), linear-gradient(90deg, #b79dd216 1px, transparent 1px);
  background-size: 24px 24px;
}
.chart svg { display: block; width: 100%; max-height: 252px; }
.land { fill: #8063a6; stroke: #291b3d; stroke-width: 7; transform: translateY(3px); stroke-linejoin: round; }
.coast { fill: #957bb8; stroke: #ddc3ed; stroke-width: 1.5; stroke-linejoin: round; }
.pin-mark { fill: #ff755d; stroke: #402447; stroke-width: 2; }
.pin-light { fill: #fff3bc; }
.pin.is-latest .pin-mark { fill: #ffd151; }
.pin.is-new .pin-body { animation: pin-drop 480ms steps(8, end) both; }
.pin.is-new .pulse { animation: pin-pulse 750ms 160ms steps(8, end) both; }
.pulse { fill: none; stroke: #ffda79; stroke-width: 2; opacity: 0; }
@keyframes pin-drop {
  from { transform: translateY(-26px); opacity: .25; }
  65% { transform: translateY(2px); opacity: 1; }
  86% { transform: translateY(-4px); }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes pin-pulse {
  from { transform: scale(.4); opacity: .9; }
  to { transform: scale(2.25); opacity: 0; }
}
.map-note { color: var(--quiet); font-size: 13px; min-height: 1.4em; margin: 8px 0 14px; }

.receipt p { margin: 10px 0 0; color: var(--quiet); }
.receipt ol { margin: 11px 0 0; padding: 0; list-style-position: inside; max-height: 290px; overflow: auto; }
.receipt ol:empty { display: none; }
.receipt li { padding: 7px 5px; border-bottom: 1px dashed #c2adc1; overflow-wrap: anywhere; }
.receipt li::marker { font-weight: 780; color: #9c4b41; }
.receipt li span { margin-left: 9px; color: var(--quiet); font-size: 13px; }

.medals { background: var(--lilac); }
.medals-head { min-height: 55px; }
.geo-title { margin-top: 18px; }
.medal-count { flex-shrink: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.medal-list { padding: 0; margin: 0; list-style: none; }
.medal {
  display: grid;
  grid-template-columns: clamp(44px, 5vw, 70px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(9px, 1.5vw, 20px);
  min-height: 83px;
  border-bottom: 2px solid #d1bad9;
  padding-block: 11px;
}
.sprite { display: block; width: 100%; aspect-ratio: 1; image-rendering: pixelated; }
.medal-copy { min-width: 0; }
.medal-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.medal-label strong { font-size: clamp(14px, 1.55vw, 22px); line-height: 1.2; overflow-wrap: anywhere; }
.medal-label span { flex-shrink: 0; font: 10px/1.35 var(--pixel); }
.segments { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; margin-top: 9px; max-width: 310px; }
.segments span { border: 2px solid #604b6e; border-radius: 2px; height: clamp(11px, 1.4vw, 19px); background: #fbf0ed; }
.segments .filled { background: var(--badge, #ffaa62); border-color: #493557; }
.medal[data-unlocked="true"] .medal-label span { color: #285c3c; }
.medal[data-unlocked="true"] .sprite { filter: drop-shadow(0 0 4px #ecb55d); }
.medal-note { margin: 5px 0 0; font-size: 11px; color: var(--quiet); }
.regions { margin-top: 12px; }
.regions summary { cursor: pointer; min-height: 30px; font-weight: 780; }
.regions .medal:last-child { border-bottom: 0; }

@media (max-width: 790px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  h2 { font-size: clamp(16px, 3.25vw, 24px); }
  .stats dd { font-size: 14px; }
  .hero-art { --art-x: 64%; --art-y: 65%; }
  .hero::before { background: linear-gradient(90deg, #291735f0 0%, #291735a8 40%, #2917351a 80%); }
  .medal { grid-template-columns: 52px minmax(0, 1fr); min-height: 69px; }
  .medal-label strong { font-size: 17px; }
}
@media (max-width: 640px) {
  .hero { display: block; min-height: 0; }
  .hero::before { content: none; }
  .hero-copy { max-inline-size: none; padding-bottom: 12px; }
  .hero-art { --art-x: 90%; position: relative; inset: auto; z-index: auto; height: clamp(155px, 48vw, 220px); }
  .hero-art::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(#2b1939, #2b193900 24%);
    pointer-events: none;
  }
}
@media (max-width: 460px) {
  .shell { width: calc(100% - 28px); }
  main.shell { padding-top: 13px; }
  .top-inner { min-height: 44px; }
  .wordmark { font-size: 10px; }
  .home { font-size: 13px; }
  .hero-copy { padding: 20px 15px 12px; }
  .hero h1 { font-size: clamp(22px, 7.8vw, 32px); }
  .hero p { margin-top: 10px; font-size: 15px; }
  .board { margin-top: 15px; }
  .panel { padding: 13px; box-shadow: 4px 4px var(--ink); }
  .panel-head { gap: 6px; }
  .stats { gap: 4px; }
  .stats div { min-width: 56px; padding-inline: 4px; }
  .stats dt { font-size: 9px; }
  .stats dd { font-size: 11px; }
  .entry { gap: 7px; }
  .play-foot { flex-wrap: wrap; gap: 6px; }
  .cta { padding-inline: 9px; font-size: 13px; }
  input { padding-inline: 7px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; }
}
