/* ==========================================================================
   Kenny Adu Antwi · Checkpoint Journey
   ========================================================================== */
:root {
  --navy: #1b2440;
  --navy-2: #283459;
  --orange: #f07a2a;
  --orange-2: #ffa660;
  --gold: #ffc94a;
  --denim: #5b6f8f;
  --denim-2: #8296b6;
  --denim-dark: #3c4b6b;
  --cream: #fffaf1;
  --paper: #ffffff;
  --text: #24304f;
  --muted: #5c6782;

  --font-display: "Bungee", "Arial Black", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --hud-h: 60px;
  --ground-h: clamp(96px, 19vh, 190px);
  --sprite-h: clamp(184px, 30vh, 250px);   /* box height; the drawn character is ~88% of this */
  --kenny-x: clamp(130px, 19vw, 300px);    /* Kenny's horizontal centre on screen */
  --marker-h: calc(var(--sprite-h) * 0.8); /* posts stay below the speech bubble */
  --gate-w: 200px;
  --gate-shift: -118px;                    /* start/finish gate centre relative to Kenny (read by JS) */

  --radius: 18px;
  --border: 4px solid var(--navy);
  --shadow: 7px 7px 0 rgba(27, 36, 64, 0.28);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: #5fb8f0;
  -webkit-font-smoothing: antialiased;
}

body.journey-page { overflow: hidden; }

a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; }

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ==========================================================================
   WORLD (fixed, decorative)
   ========================================================================== */
.world {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.sky { position: absolute; inset: 0; }

.sun {
  position: absolute;
  right: 14vw;
  width: clamp(90px, 13vw, 170px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fff6cf 0%, #ffd56b 45%, #ffad4a 100%);
  box-shadow: 0 0 60px 20px rgba(255, 196, 92, 0.45);
  will-change: transform;
}

.layer {
  position: absolute;
  left: 0; right: 0;
  background-repeat: repeat-x;
  will-change: background-position;
}

.clouds     { top: 9vh; height: 26vh; background-size: auto 100%; opacity: 0.95; }
.hills-far  { bottom: calc(var(--ground-h) - 6px); height: 40vh; background-size: auto 100%; background-position-y: bottom; }
.hills-near { bottom: calc(var(--ground-h) - 6px); height: 24vh; background-size: auto 100%; background-position-y: bottom; }
.ground     { bottom: 0; height: var(--ground-h); background-size: auto 220px; background-position-y: top; background-color: var(--denim-dark); }

/* ---------- checkpoint markers (live on the ground track) ---------- */
.track {
  position: absolute;
  left: 0;
  bottom: var(--ground-h);
  height: 0;
  width: 0;
  will-change: transform;
}

.marker {
  position: absolute;
  bottom: -4px;
  height: var(--marker-h);
  width: 120px;
  transform: translateX(-50%);
}

.marker-pole {
  position: absolute;
  left: 50%; bottom: 0;
  width: 12px;
  height: 100%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--navy) 0 55%, var(--navy-2) 55% 100%);
  border-radius: 6px 6px 0 0;
}

.marker-base {
  position: absolute;
  left: 50%; bottom: -2px;
  width: 54px; height: 16px;
  transform: translateX(-50%);
  background: var(--navy);
  border-radius: 8px 8px 2px 2px;
}

.marker-orb {
  position: absolute;
  left: 50%; top: -18px;
  width: 30px; height: 30px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #b9c6dc, #6e7f9e);
  border: 4px solid var(--navy);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.marker-flag {
  position: absolute;
  left: calc(50% + 6px);
  top: 70%;
  width: 54px; height: 36px;
  background: linear-gradient(180deg, var(--orange-2), var(--orange));
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  transform-origin: left center;
  transform: scaleX(0.35);
  opacity: 0.6;
  transition: top 0.7s cubic-bezier(.3, 1.4, .5, 1), transform 0.5s ease, opacity 0.3s;
}

.marker-plate {
  position: absolute;
  left: 50%; top: 36%;
  transform: translate(-50%, -50%);
  min-width: 44px;
  padding: 4px 8px 2px;
  background: var(--cream);
  border: var(--border);
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--navy);
  text-align: center;
  box-shadow: 3px 3px 0 rgba(27, 36, 64, 0.3);
  white-space: nowrap;
}

.marker.lit .marker-orb {
  background: radial-gradient(circle at 35% 35%, #fff6c9, var(--gold) 45%, var(--orange));
  box-shadow: 0 0 22px 8px rgba(255, 190, 80, 0.75);
}
.marker.lit .marker-flag { top: 4%; transform: scaleX(1); opacity: 1; }
.marker.here .marker-orb { animation: orb-pulse 1.6s ease-in-out infinite; }
.marker.here .marker-flag { animation: flag-wave 1.2s ease-in-out infinite; }

@keyframes orb-pulse {
  50% { box-shadow: 0 0 34px 14px rgba(255, 190, 80, 0.9); }
}
@keyframes flag-wave {
  50% { transform: scaleX(0.86) skewY(-4deg); }
}

/* start + finish gates: a banner between two posts */
.marker.gate { width: var(--gate-w); }
.marker.gate .marker-pole { left: 14px; transform: none; }
.marker.gate .marker-pole.right { left: auto; right: 14px; }
.marker.gate .marker-base { left: 20px; transform: translateX(-50%); }
.marker.gate .marker-base.right { left: auto; right: -7px; }
.gate-banner {
  position: absolute;
  left: 4px; right: 4px; top: 8%;
  padding: 8px 6px 6px;
  border: var(--border);
  border-radius: 12px;
  background: var(--orange);
  color: #fff;
  font-family: var(--font-display);
  font-size: 22px;
  text-align: center;
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 var(--navy);
  box-shadow: 4px 4px 0 rgba(27, 36, 64, 0.3);
  transition: transform 0.5s cubic-bezier(.3, 1.6, .5, 1), background 0.4s;
}
.marker.finish .gate-banner {
  background:
    repeating-conic-gradient(var(--navy) 0 25%, #fff 0 50%) 0 0 / 16px 16px;
}
.marker.finish .gate-banner span {
  background: var(--orange);
  padding: 2px 10px 0;
  border-radius: 8px;
  border: 3px solid var(--navy);
}
.marker.gate.lit .gate-banner { transform: translateY(-6px) rotate(-2deg); }

/* ---------- Kenny ---------- */
.kenny {
  position: absolute;
  left: var(--kenny-x);
  bottom: calc(var(--ground-h) - var(--sprite-h) * 0.047);
  height: var(--sprite-h);
  width: calc(var(--sprite-h) * 0.65625);
  transform: translateX(-50%);
  z-index: 2;
}
.kenny canvas { width: 100%; height: 100%; display: block; }
.kenny.flip canvas { transform: scaleX(-1); }
.kenny::after {   /* soft contact shadow */
  content: "";
  position: absolute;
  left: 22%; right: 22%;
  bottom: calc(var(--sprite-h) * 0.035);
  height: 10px;
  border-radius: 50%;
  background: rgba(15, 20, 40, 0.28);
  z-index: -1;
}

.fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

/* ---------- speech bubble ---------- */
.bubble {
  position: absolute;
  z-index: 4;
  /* sits above Kenny's head and stays left of the panel column */
  left: max(10px, calc(var(--kenny-x) - 112px));
  bottom: calc(var(--ground-h) + var(--sprite-h) * 0.92);
  width: max-content;
  max-width: 236px;
  min-height: 48px;
  padding: 12px 16px;
  background: var(--paper);
  border: var(--border);
  border-radius: 20px;
  box-shadow: 5px 5px 0 rgba(27, 36, 64, 0.28);
  font-weight: 800;
  font-size: 16px;
  line-height: 1.35;
  text-wrap: pretty;
  color: var(--navy);
  transform-origin: 104px 100%;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.18s ease, transform 0.35s cubic-bezier(.3, 1.6, .5, 1);
}
.bubble.show { opacity: 1; transform: scale(1); }
.bubble::before, .bubble::after {   /* tail */
  content: "";
  position: absolute;
  left: 96px;
  border-style: solid;
}
.bubble::before { bottom: -20px; border-width: 20px 16px 0 0; border-color: var(--navy) transparent transparent; }
.bubble::after  { bottom: -12px; left: 100px; border-width: 13px 10px 0 0; border-color: var(--paper) transparent transparent; }
.bubble-text::after {   /* typing caret */
  content: "▌";
  margin-left: 1px;
  color: var(--orange);
  animation: caret 0.8s steps(1) infinite;
}
.bubble.done .bubble-text::after { content: none; }
@keyframes caret { 50% { opacity: 0; } }

/* ==========================================================================
   HUD
   ========================================================================== */
.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--hud-h);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  pointer-events: none;
}
.hud > * { pointer-events: auto; }

.hud-logo { display: block; width: 40px; height: 40px; flex: none; filter: drop-shadow(3px 3px 0 rgba(27, 36, 64, 0.3)); }
.hud-logo svg { width: 100%; height: 100%; }

.dots {
  position: relative;
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 14px;
  background: rgba(255, 250, 241, 0.92);
  border: 3px solid var(--navy);
  border-radius: 999px;
  box-shadow: 4px 4px 0 rgba(27, 36, 64, 0.25);
  transform: translateX(-28px);   /* visually centre against the logo */
}
.dots-rail {
  position: absolute;
  left: 24px; right: 24px; top: 50%;
  height: 6px;
  transform: translateY(-50%);
  background: #d5dbe7;
  border-radius: 3px;
  overflow: hidden;
}
.dots-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--orange-2), var(--orange));
}
.dots-list {
  position: relative;
  display: flex;
  justify-content: space-between;
  list-style: none;
  margin: 0; padding: 0;
}
.dot {
  position: relative;
  width: 22px; height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 3px solid var(--navy);
  background: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s;
}
.dot:hover { transform: scale(1.15); }
.dot.visited { background: var(--orange-2); }
.dot.current { background: var(--orange); transform: scale(1.3); box-shadow: 0 0 0 4px rgba(240, 122, 42, 0.3); }
.dot.end { border-radius: 6px; }
.dot-label {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding: 4px 8px;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.dot:hover .dot-label, .dot:focus-visible .dot-label { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==========================================================================
   JOURNEY (scroll-snapping sections)
   ========================================================================== */
.journey {
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  outline: none;
}
.journey::-webkit-scrollbar { display: none; }

.stop {
  position: relative;
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.stop-inner {
  position: absolute;
  top: calc(var(--hud-h) + 14px);
  bottom: calc(var(--ground-h) + 18px);
  left: calc(var(--kenny-x) + var(--sprite-h) * 0.62);
  right: max(4vw, 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* ---------- dialog panel ---------- */
.panel {
  pointer-events: auto;
  width: min(820px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.86);
}
.stop.is-here .panel {
  visibility: visible;
  animation: panel-pop 0.6s cubic-bezier(.25, 1.4, .5, 1) forwards;
}
.stop.leaving .panel {
  visibility: visible;
  animation: panel-out 0.25s ease-in forwards;
}
@keyframes panel-pop {
  0%   { opacity: 0; transform: translateY(18px) scale(0.86); }
  60%  { opacity: 1; transform: translateY(-4px) scale(1.03); }
  80%  { transform: translateY(1px) scale(0.99); }
  100% { opacity: 1; transform: none; }
}
@keyframes panel-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(10px) scale(0.92); }
}

.panel-head, .tabs { flex: none; }
.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px 12px;
  background: var(--navy);
  color: #fff;
}
.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: 0.5px;
  line-height: 1.1;
}
.chip {
  display: inline-block;
  padding: 4px 10px 3px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.panel-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 20px 20px;
  overflow-y: auto;
  overscroll-behavior: auto;
  font-size: 16px;
  line-height: 1.55;
}
.panel-body > :first-child { margin-top: 0; }
.panel-body h3 { font-size: 17px; margin: 0 0 4px; color: var(--navy); line-height: 1.3; }
.panel-body p { margin: 0 0 12px; }

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  gap: 6px;
  padding: 10px 16px 0;
  background: #f2e8d8;
  border-bottom: 3px solid var(--navy);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab {
  flex: none;
  padding: 8px 14px 6px;
  border: 3px solid var(--navy);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: #e2d6c2;
  color: var(--navy);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: -3px;
}
.tab[aria-selected="true"] { background: var(--cream); padding-bottom: 9px; }
.tab-panel[hidden] { display: none; }

/* ---------- buttons, tags ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 9px;
  border: 3px solid var(--navy);
  border-radius: 12px;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--navy);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--navy); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--navy); }
.btn.alt { background: #fff; color: var(--navy); }
.btn.small { padding: 6px 12px 5px; font-size: 14px; border-radius: 10px; }
.btn svg { width: 18px; height: 18px; flex: none; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: #e7ecf5;
  border: 2px solid var(--denim-2);
  color: var(--denim-dark);
  font-size: 13px;
  font-weight: 700;
}

/* placeholders: anything written "[LIKE THIS]" in config.js */
.ph {
  outline: 2px dashed var(--orange);
  outline-offset: 1px;
  background: rgba(240, 122, 42, 0.1);
  border-radius: 4px;
  font-style: italic;
  color: #a1440c;
}

/* ---------- START title card ---------- */
.title-card {
  pointer-events: auto;
  text-align: center;
  color: #fff;
}
.title-card .kicker {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 14px 4px;
  background: var(--navy);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 2px;
}
.title-card h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(42px, 8vw, 110px);
  line-height: 0.95;
  color: #fff;
  -webkit-text-stroke: 3px var(--navy);
  paint-order: stroke fill;
  text-shadow: 6px 6px 0 var(--navy), 0 0 30px rgba(255, 255, 255, 0.35);
}
.title-card h1 span { display: block; color: var(--orange); }
.title-card .sub {
  display: inline-block;
  margin-top: 18px;
  padding: 8px 16px;
  background: var(--cream);
  border: var(--border);
  border-radius: 12px;
  box-shadow: 4px 4px 0 rgba(27, 36, 64, 0.3);
  color: var(--navy);
  font-weight: 800;
  font-size: clamp(14px, 1.5vw, 17px);
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--ground-h) * 0.5);
  transform: translate(-50%, 50%);
  padding: 10px 18px 8px;
  border: 3px solid var(--navy);
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--navy);
  animation: hint-bounce 1.3s ease-in-out infinite;
}
@keyframes hint-bounce {
  0%, 100% { transform: translate(-50%, 50%); }
  50%      { transform: translate(-50%, calc(50% + 8px)); }
}

/* ---------- ABOUT ---------- */
.about-lead {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  border-left: 6px solid var(--orange);
  padding-left: 12px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}
.stat {
  padding: 8px 12px;
  background: #fff;
  border: 3px solid var(--navy);
  border-radius: 12px;
}
.stat dt { font-family: var(--font-display); font-size: 11px; color: var(--orange); letter-spacing: 1px; }
.stat dd { margin: 2px 0 0; font-weight: 800; color: var(--navy); line-height: 1.3; }
.mini-title { font-family: var(--font-display); font-weight: 400; font-size: 13px; letter-spacing: 1px; color: var(--denim-dark); margin: 4px 0 8px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 4px; border-radius: 2px; background: var(--denim-2); }
.timeline > li { position: relative; margin-bottom: 18px; }
.timeline > li::before {
  content: "";
  position: absolute;
  left: -22px; top: 4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--orange);
  border: 3px solid var(--navy);
}
.when { display: inline-block; font-size: 13px; font-weight: 800; color: var(--orange); }
.where { margin: 0 0 6px !important; color: var(--muted); font-weight: 700; font-size: 14px; }
.timeline ul { margin: 0; padding-left: 18px; font-size: 15px; }
.timeline ul li { margin-bottom: 4px; }

.skill-group { margin-bottom: 14px; }

/* ---------- PROJECTS: level cards ---------- */
.levels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.level {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 3px solid var(--navy);
  border-radius: 14px;
  box-shadow: 4px 4px 0 rgba(27, 36, 64, 0.25);
  overflow: hidden;
  transition: transform 0.15s ease;
}
.level:hover { transform: translateY(-3px); }
.level-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--denim-dark);
  border-bottom: 3px solid var(--navy);
  overflow: hidden;
}
.level-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.level-art {
  width: 100%; height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 22px;
  color: #fff;
  text-shadow: 3px 3px 0 var(--navy);
  background:
    linear-gradient(180deg, transparent 62%, var(--navy) 62% 66%, var(--denim) 66%),
    radial-gradient(circle at 78% 30%, var(--gold) 0 9%, transparent 10%),
    linear-gradient(180deg, #5fb8f0, #f6c48c);
}
.level-num {
  position: absolute;
  left: 8px; top: 8px;
  padding: 3px 8px 1px;
  background: var(--navy);
  color: #fff;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 1px;
}
.level-info { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; flex: 1; }
.level-info p { font-size: 14.5px; margin: 0; }
.level-info .tags { margin-top: auto; }
.level-info .btn { align-self: flex-start; }
.level .meta { font-size: 13px; font-weight: 800; color: var(--muted); }

/* ---------- LINKS ---------- */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.link-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 3px solid var(--navy);
  border-radius: 14px;
  box-shadow: 4px 4px 0 rgba(27, 36, 64, 0.25);
  text-decoration: none;
  color: var(--navy);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s;
}
.link-tile:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 rgba(27, 36, 64, 0.3); background: #fff4e9; }
.link-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
}
.link-icon svg { width: 24px; height: 24px; }
.link-tile strong { display: block; font-size: 16px; }
.link-tile small { display: block; color: var(--muted); font-weight: 700; font-size: 13px; overflow-wrap: anywhere; }

/* ---------- AWARDS ---------- */
.badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  list-style: none;
  margin: 0; padding: 0;
}
.badge {
  position: relative;
  padding: 16px 14px 14px;
  text-align: center;
  background: #fff;
  border: 3px solid var(--navy);
  border-radius: 16px;
  box-shadow: 4px 4px 0 rgba(27, 36, 64, 0.25);
  opacity: 0;
}
.stop.is-here .badge { animation: badge-pop 0.55s cubic-bezier(.25, 1.6, .5, 1) forwards; animation-delay: calc(350ms + var(--i) * 160ms); }
@keyframes badge-pop {
  0%   { opacity: 0; transform: scale(0.3) rotate(-12deg); }
  70%  { opacity: 1; transform: scale(1.08) rotate(3deg); }
  100% { opacity: 1; transform: none; }
}
.badge-icon {
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff2b8, var(--gold) 50%, var(--orange));
  border: 3px solid var(--navy);
  box-shadow: 0 0 0 5px #fff, 0 0 0 8px var(--navy);
}
.badge-icon svg { width: 34px; height: 34px; }
.badge h3 { font-size: 16px !important; }
.badge p { font-size: 14px; margin: 4px 0 6px !important; }

/* ---------- GOALS: quest log ---------- */
.quests { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.quest {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 4px 12px;
  align-items: start;
  padding: 12px 14px;
  background: #fff;
  border: 3px solid var(--navy);
  border-radius: 14px;
}
.quest-box {
  grid-row: span 3;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border: 3px solid var(--navy);
  border-radius: 8px;
  background: #fff;
  font-weight: 900;
  color: #fff;
}
.quest.done .quest-box { background: var(--orange); }
.quest.done .quest-name { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--orange); }
.quest.active .quest-box::after {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--orange);
  animation: orb-pulse-small 1.2s ease-in-out infinite;
}
@keyframes orb-pulse-small { 50% { transform: scale(1.5); opacity: 0.6; } }
.quest-name { font-weight: 800; color: var(--navy); }
.quest-status { font-family: var(--font-display); font-size: 10px; letter-spacing: 1px; color: var(--orange); margin-left: 6px; vertical-align: 2px; }
.quest-note { font-size: 14px; color: var(--muted); font-weight: 700; }
.bar {
  height: 12px;
  margin-top: 4px;
  border: 2px solid var(--navy);
  border-radius: 999px;
  background: #e7ecf5;
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--orange-2), var(--orange));
  transition: width 1.1s cubic-bezier(.3, 1, .4, 1) 0.4s;
}
.stop.is-here .bar span { width: var(--p); }
.bar.indeterminate span {
  width: 100%;
  background: repeating-linear-gradient(-45deg, var(--orange) 0 10px, var(--orange-2) 10px 20px);
  background-size: 28px 28px;
  animation: stripes 0.9s linear infinite;
}
@keyframes stripes { to { background-position: 28px 0; } }

/* ---------- FINISH ---------- */
.finish-text { font-size: 17px; }
.finish-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 14px; }
.finish-mail a { font-weight: 800; color: var(--orange); }
.quote {
  margin: 16px 0 0;
  padding: 12px 16px;
  background: #fff;
  border: 3px dashed var(--denim-2);
  border-radius: 12px;
  font-style: italic;
}
.quote cite { display: block; margin-top: 6px; font-style: normal; font-weight: 800; color: var(--denim-dark); }
.foot { margin-top: 14px !important; font-size: 13px; color: var(--muted); }

.noscript { position: fixed; inset: 0; z-index: 20; padding: 40px 20px; background: var(--cream); text-align: center; }

/* ==========================================================================
   RESPONSIVE: phones stack the panel above Kenny
   ========================================================================== */
@media (max-width: 760px) {
  :root {
    --hud-h: 54px;
    --ground-h: 84px;
    --sprite-h: 148px;
    --kenny-x: 64px;
    --marker-h: calc(var(--sprite-h) * 0.6);
    --gate-w: 128px;
    --gate-shift: 74px;
  }
  .gate-banner { font-size: 13px; padding: 5px 4px 3px; border-width: 3px; }
  .marker.finish .gate-banner span { padding: 1px 5px 0; border-width: 2px; }
  .hud { gap: 10px; }
  .hud-logo { width: 34px; height: 34px; }
  .dots { transform: none; padding: 7px 10px; }
  .dot { width: 18px; height: 18px; }
  .dot-label { display: none; }

  .stop-inner {
    left: 12px; right: 12px;
    top: calc(var(--hud-h) + 8px);
    bottom: calc(var(--ground-h) + var(--sprite-h) * 0.64 + 66px);   /* room for a 2-line bubble */
    align-items: stretch;
  }
  .panel { width: 100%; }
  .panel-head { padding: 10px 14px 9px; gap: 8px; }
  .panel-body { padding: 14px; font-size: 15px; }
  .tabs { padding: 8px 10px 0; }
  .tab { padding: 6px 10px 4px; font-size: 13px; }

  /* bubble sits beside Kenny instead of above him */
  .bubble {
    left: calc(var(--kenny-x) + var(--sprite-h) * 0.26);
    bottom: calc(var(--ground-h) + var(--sprite-h) * 0.64);
    max-width: calc(100vw - var(--kenny-x) - var(--sprite-h) * 0.26 - 12px);
    font-size: 14px;
    padding: 9px 12px;
    transform-origin: 0 60%;
  }
  .bubble::before { left: -18px; bottom: 14px; border-width: 10px 18px 10px 0; border-color: transparent var(--navy) transparent transparent; }
  .bubble::after  { left: -11px; bottom: 17px; border-width: 7px 12px 7px 0; border-color: transparent var(--paper) transparent transparent; }

  .start .stop-inner { align-items: center; }
  .scroll-hint { left: auto; right: 14px; transform: translate(0, 50%); font-size: 12px; }
  @keyframes hint-bounce {
    0%, 100% { transform: translate(0, 50%); }
    50%      { transform: translate(0, calc(50% + 6px)); }
  }
  .levels, .badges, .link-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}

/* short landscape screens */
@media (max-height: 560px) and (min-width: 761px) {
  :root { --sprite-h: 150px; --ground-h: 70px; --hud-h: 52px; }
}

/* ==========================================================================
   Reduced motion: no bounces, no running, no parallax (JS also checks this)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
  .scroll-hint { animation: none; }
}

/* ==========================================================================
   Clickable cards + details pop-up (blurred background)
   ========================================================================== */
.level, .badge.has-photo { position: relative; cursor: pointer; }
.level-more {
  align-self: flex-start;
  margin-top: 2px;
  padding: 6px 12px 5px;
  border: 3px solid var(--navy);
  border-radius: 10px;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--navy);
}
.level-more::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }   /* whole card is the click target */
.level:hover .level-more, .badge.has-photo:hover .level-more { background: #ff8a3d; }
.level-more:focus-visible { outline-offset: 2px; }
.level:has(.level-more:focus-visible) { outline: 3px solid var(--orange); outline-offset: 3px; }

.badge-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 3px solid var(--navy);
  border-radius: 10px;
  margin-bottom: -26px;
}
.badge.has-photo .badge-icon { position: relative; width: 52px; height: 52px; }
.badge.has-photo .badge-icon svg { width: 28px; height: 28px; }

.modal {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: none;
  background: transparent;
  overflow: auto;
  overscroll-behavior: contain;
}
.modal::backdrop {
  background: rgba(27, 36, 64, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal[open] { animation: panel-pop 0.45s cubic-bezier(.25, 1.4, .5, 1); }
.modal[open]::backdrop { animation: fade-in 0.25s ease; }
@keyframes fade-in { from { opacity: 0; } }

.modal-card {
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-body);
}
.modal-media { margin: 0; background: var(--navy); border-bottom: var(--border); }
.modal-media img { width: 100%; max-height: 52dvh; object-fit: cover; object-position: top center; }
.modal-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 10px; }
.modal-body h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.15;
  color: var(--navy);
}
.modal-body .where { margin: 0 !important; }
.modal-chips { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.modal-list { margin: 0; padding-left: 20px; line-height: 1.55; }
.modal-list li { margin-bottom: 6px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

/* ---------- About: profile photo "player card" ---------- */
.profile { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.profile-photo {
  flex: none;
  margin: 0;
  width: clamp(96px, 11vw, 140px);
  aspect-ratio: 1;
  border: 4px solid var(--navy);
  border-radius: 18px;
  overflow: hidden;
  background: var(--denim-2);
  box-shadow: 5px 5px 0 var(--orange);
  transform: rotate(-2deg);
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-family: var(--font-display); font-weight: 400; font-size: 20px !important; letter-spacing: 0.5px; margin-bottom: 8px !important; }
.profile .about-lead { margin: 0; }
@media (max-width: 760px) {
  .profile { gap: 12px; align-items: flex-start; }
  .profile-photo { width: 84px; border-width: 3px; border-radius: 14px; box-shadow: 3px 3px 0 var(--orange); }
  .profile-name { font-size: 16px !important; }
  .profile .about-lead { font-size: 15px; }
}
