:root {
  --bg: #0d1220;        /* deep night navy; run.gif is flattened on this exact colour */
  --panel: #161d33;
  --line: #2c3654;
  --text: #f5f0e6;
  --muted: #c3c8d6;
  --orange: #f08a3c;    /* Oibii's ears */
  --orange-dark: #1a0e05;
  --teal: #3fe0c8;      /* rift belly */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 18px/1.55 "Nunito", system-ui, sans-serif;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--teal); text-underline-offset: 3px; }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

h1, h2 { font-family: "Fredoka", "Nunito", sans-serif; font-weight: 700; line-height: 1.1; margin: 0; }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 16px; }

/* ---------- Hero ---------- */
.hero {
  padding: 32px 0 48px;
  border-bottom: 1px solid var(--line);
}
.logo {
  font-size: clamp(4.5rem, 16vw, 9rem);
  letter-spacing: 0.01em;
  color: var(--text);
  /* Orange underline bar echoes the ears without putting text on colour; it springs open on load. */
  display: inline-block;
  position: relative;
  padding-bottom: 14px;
  cursor: default;
}
.logo::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 10px;
  background: var(--orange);
  border-radius: 5px;
  animation: bar-in 0.8s 0.2s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.logo span { display: inline-block; }
.logo:hover span { animation: wave 0.6s ease; animation-delay: calc(var(--i) * 70ms); }
@keyframes bar-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes wave { 0%, 100% { transform: none; } 40% { transform: translateY(-14%) rotate(-4deg); } }
.say { margin: 16px 0 0; font-size: 1.25rem; color: var(--muted); }
.say strong { color: var(--teal); font-weight: 700; }
.tagline { font: 700 clamp(1.6rem, 4.4vw, 2.4rem)/1.15 "Fredoka", sans-serif; margin: 20px 0 0; }
.pitch { font-size: clamp(1.1rem, 2.4vw, 1.35rem); margin: 12px 0 0; max-width: 44ch; color: var(--muted); }
.hl { color: var(--orange); font-weight: 700; }

.cta { margin-top: 28px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 700 1.1rem "Fredoka", sans-serif;
  padding: 14px 22px;
  border-radius: 12px;
  border: 3px solid #000;
  background: var(--orange);
  color: var(--orange-dark);
  text-decoration: none;
  cursor: pointer;
}
.btn-steam[aria-disabled="true"] { cursor: not-allowed; }
.soon {
  font: 700 0.8rem "Nunito", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg);
  color: var(--text);
  padding: 3px 8px;
  border-radius: 6px;
}

/* ---------- Costumes ---------- */
.costumes, .signup, .social { padding-top: 48px; padding-bottom: 8px; }
.note { color: var(--muted); margin: 0 0 20px; }
.note strong { color: var(--text); }

.strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 16px;
}
.strip li {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 16px 12px 14px;
  text-align: center;
}
.strip img { height: 170px; width: auto; margin: 0 auto 12px; object-fit: contain; }
.strip p { margin: 0; }
.name { font: 700 1.3rem "Fredoka", sans-serif; }
.strip .mystery { border-style: dashed; display: flex; flex-direction: column; justify-content: flex-end; }
.strip .q {
  height: 170px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  font: 700 6rem "Fredoka", sans-serif; color: var(--teal);
}
.strip .mystery .name { color: var(--muted); }

/* ---------- Sign-up ---------- */
.form { max-width: 520px; }
.form label { display: block; font-weight: 700; margin-bottom: 6px; }
.form .row { display: flex; gap: 10px; flex-wrap: wrap; }
.form input {
  flex: 1 1 220px;
  min-width: 0;
  font: inherit;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--text);
}
.form .btn[disabled] { cursor: wait; opacity: 0.7; }
.form input:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-color: var(--teal); }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-msg { margin: 12px 0 0; min-height: 1.5em; font-weight: 700; }
.form-msg.ok { color: var(--teal); }
.form-msg.ok::before { content: "¹3  "; }   /* a tick, so it doesn't rely on colour alone */
.form-msg.err { color: var(--orange); }
.form-msg.err::before { content: "!  "; }
.form.done .row { display: none; }
.form.done .form-msg { font-size: 1.2rem; animation: pick 0.4s ease; }

/* ---------- Social ---------- */
.links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.links a {
  display: inline-block;
  padding: 10px 16px;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.links a:hover, .links a:focus-visible { border-color: var(--teal); transform: translateY(-3px); }
.links a:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.links span { color: var(--muted); font-weight: 400; margin-left: 6px; }

/* ---------- Footer ---------- */
.foot {
  margin-top: 56px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.foot p { margin: 0; }

/* ---------- Phone ---------- */
@media (max-width: 720px) {
  .hero { padding-top: 24px; padding-bottom: 36px; }
  .strip { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .strip img, .strip .q { height: 140px; }
  .btn { width: 100%; justify-content: center; }
  .form .btn { width: auto; }
}

/* ---------- Oibii's band (runner.js) ---------- */
/* Full-width strip across the top with a ground line; he runs, flips and kicks off its edges.
   Nothing else is drawn here, so he never covers text. His height = (band - ground) / 1.75 (runner.js). */
.band {
  --band-h: clamp(180px, 22vw, 280px);
  position: relative;
  height: var(--band-h);
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.band:focus-visible { outline: 3px solid var(--teal); outline-offset: -3px; }
.band canvas { position: absolute; inset: 0; width: 100%; height: 100%; visibility: hidden; }
.band.ready canvas { visibility: visible; }
.band-still {
  position: absolute; left: 30%; bottom: 14px; transform: translateX(-50%);
  height: calc((var(--band-h) - 14px) / 1.75); width: auto;
}
.band.ready .band-still { display: none; }
.ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 16px;
  border-top: 2px solid var(--line);
  background: linear-gradient(var(--panel), var(--bg));
  pointer-events: none;
}

/* ---------- Press kit ---------- */
.press { padding-bottom: 0; }
.press-head { padding-top: 32px; }
.press-head h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); margin-top: 8px; }
.press main section { padding-top: 36px; }
.press main p { max-width: 68ch; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; }
.facts dt { font-weight: 700; color: var(--muted); }
.facts dd { margin: 0; }
.press-art { margin-top: 20px; max-width: 560px; }
@media (max-width: 720px) {
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }
}

/* Hero words centred under Oibii's band. */
.hero .wrap { text-align: center; }
.hero .pitch { margin-left: auto; margin-right: auto; }

[hidden] { display: none !important; }

/* ---------- Juice ---------- */
.band canvas { z-index: 1; }   /* above the ground strip, so his shadow and dust sit on it */
.strip li { transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease; }
.strip li[data-costume], .strip .mystery { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.strip li[data-costume]:hover, .strip li[data-costume]:focus-visible,
.strip .mystery:hover, .strip .mystery:focus-visible {
  transform: translateY(-6px) rotate(-1deg);
  border-color: var(--teal);
  box-shadow: 0 10px 0 -4px rgba(63, 224, 200, 0.22);
}
.strip li:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.strip li[data-costume]:hover img { animation: bob 0.5s ease-in-out infinite alternate; }
.strip li.picked { animation: pick 0.35s ease; }
.strip .mystery.shake { animation: shake 0.5s ease; }
.strip .mystery.shake .q { animation: qspin 0.5s ease; }
@keyframes bob { to { transform: translateY(-5px); } }
@keyframes pick { 50% { transform: translateY(-12px) scale(1.05); } }
@keyframes shake {
  0%, 100% { transform: none; } 20% { transform: translateX(-7px) rotate(-2deg); }
  40% { transform: translateX(7px) rotate(2deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); }
}
@keyframes qspin { 50% { transform: rotate(-14deg) scale(1.2); } }
.strip li.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.5s ease, transform 0.5s ease; transition-delay: calc(var(--i, 0) * 70ms); }
.strip li.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .logo::after, .logo:hover span, .strip li, .strip li img, .strip .q { animation: none !important; transition: none !important; }
  .strip li[data-costume]:hover, .strip li[data-costume]:focus-visible,
  .strip .mystery:hover, .strip .mystery:focus-visible { transform: none; }
}

/* ---------- Lost in the rift (404.html) ---------- */
.lost-main { text-align: center; padding-top: 40px; padding-bottom: 48px; }
.lost-main h1 { font-size: clamp(2.4rem, 8vw, 4rem); margin-top: 20px; }
.lost-main .pitch { margin-left: auto; margin-right: auto; }
.lost-scene { position: relative; height: 240px; max-width: 360px; margin: 0 auto; }
.lost-scene .ground { left: -16px; right: -16px; }
.lost-oibii { position: absolute; bottom: 14px; left: 34%; transform: translateX(-50%); height: 170px; width: auto;
  animation: lost-look 3.2s ease-in-out infinite; }
.lost-rift { position: absolute; bottom: 24px; right: 18%; height: 200px; width: auto; }
.lost-rift .glow { fill: var(--teal); opacity: 0.16; animation: rift-pulse 2.4s ease-in-out infinite; }
.lost-rift .crack-out { fill: none; stroke: var(--teal); stroke-width: 7; stroke-linejoin: round; stroke-linecap: round; opacity: 0.6; }
.lost-rift .crack-in { fill: none; stroke: var(--text); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
@keyframes lost-look { 0%, 40%, 100% { transform: translateX(-50%); } 50%, 90% { transform: translateX(-50%) scaleX(-1); } }
@keyframes rift-pulse { 50% { opacity: 0.32; } }
@media (prefers-reduced-motion: reduce) { .lost-oibii, .lost-rift .glow { animation: none; } }

/* Nine world cards: two even rows of 5 + 4 on wide screens (2 columns on phones, set above). */
@media (min-width: 721px) { .costumes .strip { grid-template-columns: repeat(5, 1fr); } }
.strip .mystery.cracked { border-style: solid; border-color: var(--teal); }
.strip .mystery.cracked .q { animation: qglow 0.9s ease-in-out 4; text-shadow: 0 0 22px var(--teal); }
.strip .mystery.cracked .name { color: var(--teal); }
@keyframes qglow { 50% { transform: scale(1.12) rotate(6deg); text-shadow: 0 0 36px var(--teal); } }
@media (prefers-reduced-motion: reduce) { .strip .mystery.cracked .q { animation: none !important; } }
