@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,800&family=DM+Sans:wght@400;500;700;800&display=swap');

:root {
  --canvas: #F5F1E7;
  --canvas-alt: #EFE9DB;
  --ink: #22201C;
  --forest: #2E5141;
  --forest-light: #3C5C4E;
  --coral: #C8512E;
  --mustard: #F0C24B;
  --blue: #5FA8D3;
  --rule: #D6D1C4;
  --radius: 4px;
  --radius-lg: 8px;
  --shadow-hard: 3px 3px 0 0 rgba(34,32,28,.20);
  --shadow-hard-lg: 4px 4px 0 0 rgba(34,32,28,.14);
  --f-display: 'Bricolage Grotesque', sans-serif;
  --f-body: 'DM Sans', sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--f-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 12%, rgba(95, 168, 211, 0.2) 0 72px, transparent 73px),
    radial-gradient(circle at 91% 9%, rgba(255, 201, 64, 0.25) 0 86px, transparent 87px),
    linear-gradient(90deg, rgba(26, 26, 26, 0.035) 1px, transparent 1px),
    linear-gradient(var(--canvas), var(--canvas));
  background-size: auto, auto, 48px 48px, auto;
}
button { font: inherit; }
a { color: inherit; }

.sp-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.75rem);
}

.sp-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: clamp(1.25rem, 3vw, 2.5rem);
}

.sp-brand { display: flex; align-items: center; gap: 0.8rem; }
.sp-mark { position: relative; width: 40px; height: 40px; flex: none; }
.sp-mark::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: conic-gradient(var(--mustard) 0 30%, var(--coral) 30% 55%, var(--blue) 55% 78%, var(--forest) 78% 100%);
  box-shadow: var(--shadow-hard);
}
.sp-mark::after {
  content: '';
  position: absolute;
  left: 17px;
  top: 4px;
  width: 6px;
  height: 20px;
  background: var(--ink);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.sp-brand h1,
.sp-title,
.sp-card h2,
.sp-reward h2 {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.04;
  margin: 0;
}
.sp-brand h1 { font-size: clamp(1.45rem, 4vw, 2rem); }
.sp-brand p,
.sp-kicker {
  margin: 0;
  color: var(--forest);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sp-link,
.sp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--canvas);
  color: var(--ink);
  font-weight: 800;
  line-height: 1;
  min-height: 44px;
  padding: 0.78rem 1rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-hard);
  transition: 0.15s ease-in-out;
}
.sp-link:hover,
.sp-btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-hard-lg); }
.sp-link:focus-visible,
.sp-btn:focus-visible,
.sp-choice:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.sp-btn--primary { background: var(--coral); color: var(--ink); }
.sp-btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.sp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.42fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: stretch;
  margin-bottom: 1.5rem;
}
.sp-title { font-size: clamp(2.45rem, 6vw, 4.6rem); max-width: 9.5ch; }
.sp-title span { background-image: linear-gradient(transparent 65%, var(--mustard) 65%); padding: 0 4px; }
.sp-lede {
  color: #444;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 500;
  line-height: 1.65;
  max-width: 54ch;
  margin: 1.25rem 0 0;
}

.sp-map-card {
  position: relative;
  min-height: 230px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--canvas-alt);
  box-shadow: var(--shadow-hard-lg);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.sp-map-card::before {
  content: '';
  position: absolute;
  inset: 24px;
  border: 2px dashed rgba(26, 26, 26, 0.34);
  transform: rotate(-8deg);
}
.sp-map-card .sp-spinner-svg {
  width: 132px;
  z-index: 1;
  filter: drop-shadow(4px 5px 0 rgba(26, 26, 26, 0.18));
}
.sp-map-card b {
  position: absolute;
  left: 22px;
  bottom: 25px;
  z-index: 2;
  max-width: 11rem;
  font-family: var(--f-display);
  font-size: 1.45rem;
}
.sp-stamp {
  position: absolute;
  right: 28px;
  bottom: 26px;
  z-index: 2;
  background: var(--mustard);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard);
  padding: 0.45rem 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  transform: rotate(-5deg);
}

.sp-progress-wrap { display: grid; gap: 0.6rem; margin-bottom: 1.5rem; }
.sp-progress-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sp-progress { height: 18px; border: 2px solid var(--ink); background: var(--canvas-alt); border-radius: 999px; overflow: hidden; }
.sp-progress span { display: block; height: 100%; width: var(--pct, 0%); background: linear-gradient(90deg, var(--forest), var(--mustard)); }

.sp-card {
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--canvas);
  box-shadow: var(--shadow-hard-lg);
  padding: clamp(1rem, 3vw, 2rem);
}
.sp-card h2 { font-size: clamp(1.7rem, 4vw, 2.55rem); margin-bottom: 0.75rem; }
.sp-card p { margin: 0; color: #444; font-weight: 500; }

.sp-play-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.34fr) minmax(0, 0.66fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: start;
}

.sp-target-card { display: grid; gap: 1rem; align-content: start; }
.sp-target-card h2 {
  display: inline-flex;
  width: fit-content;
  background: var(--mustard);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 0.55rem 0.9rem;
  text-transform: capitalize;
}
.sp-facts { display: grid; gap: 0.65rem; margin: 0; }
.sp-facts div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.75rem;
  border-top: 2px solid var(--rule);
  padding-top: 0.65rem;
}
.sp-facts dt { font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.74rem; }
.sp-facts dd { margin: 0; font-weight: 700; text-transform: capitalize; }

.sp-work-card { display: grid; gap: 1rem; }
.sp-instruction { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.sp-count-pill {
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--canvas-alt);
  padding: 0.35rem 0.75rem;
  font-size: 0.84rem;
  font-weight: 900;
}
.sp-mini-label {
  font-size: 0.74rem;
  font-weight: 900;
  color: #555;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.sp-spinner-card {
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.52), transparent 44%),
    var(--canvas-alt);
  padding: 1rem;
  text-align: center;
}
.sp-spinner-card .sp-spinner-svg { width: min(260px, 72vw); max-width: 100%; }
.sp-spinner-card p { margin: 0.35rem 0 0; font-weight: 800; color: var(--forest); }
.sp-spinner-card--compact .sp-spinner-svg { width: min(190px, 42vw); }
.sp-compare-spinners {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.sp-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}
.sp-choice {
  min-height: 64px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--canvas-alt);
  box-shadow: var(--shadow-hard);
  cursor: pointer;
  font-weight: 900;
  color: var(--ink);
  padding: 0.75rem;
  transition: 0.12s ease-in-out;
}
.sp-choice:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-hard-lg); }
.sp-choice.is-selected { background: var(--forest); color: var(--canvas); }
.sp-choice.is-correct { background: var(--mustard); color: var(--ink); }
.sp-choice.is-extra { background: #F7B8A8; color: var(--ink); }

.sp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.sp-feedback,
.sp-success {
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 1rem;
}
.sp-feedback { background: #FFF7D8; }
.sp-success { background: #E4F1DD; }
.sp-feedback h3,
.sp-success strong { display: block; margin: 0 0 0.35rem; font-family: var(--f-display); font-size: 1.25rem; }

.sp-reward {
  min-height: min(720px, calc(100vh - 4rem));
  display: grid;
  place-items: center;
  text-align: center;
  gap: 1.5rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--canvas-alt);
  box-shadow: var(--shadow-hard-lg);
  padding: clamp(1.25rem, 5vw, 4rem);
}
.sp-reward h2 { font-size: clamp(2.5rem, 7vw, 5rem); }
.sp-reward p { max-width: 42rem; margin: 0 auto; color: #444; font-weight: 600; line-height: 1.6; }
.sp-reward-map {
  width: 150px;
  height: 150px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: conic-gradient(var(--mustard) 0 25%, var(--coral) 25% 45%, var(--blue) 45% 70%, var(--forest) 70% 100%);
  box-shadow: var(--shadow-hard-lg);
}

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

@media (max-width: 780px) {
  .sp-shell { padding: 1rem; }
  .sp-topbar,
  .sp-hero,
  .sp-play-grid { grid-template-columns: 1fr; }
  .sp-topbar { align-items: flex-start; flex-direction: column; }
  .sp-map-card { min-height: 180px; }
  .sp-choice-grid { grid-template-columns: 1fr; }
  .sp-compare-spinners { grid-template-columns: 1fr; }
  .sp-progress-row { font-size: 0.72rem; }
}
