/* =========================================================
   YourKnack: "Night Sky" flat-vector style
   Flat shapes, no outlines, two-tone shading, soft glows,
   vivid colours on a deep night-blue sky. Light mode = daytime sky.
   ========================================================= */
:root {
  --sky-1: #0A0F2E;
  --sky-2: #1B1F5E;
  --sky-3: #2B2475;
  --surface: #1D2566;
  --surface-2: #27317D;
  --surface-3: #313C92;
  --text: #F4F2FF;
  --muted: #AEB6E8;
  --ink: #0E1433;            /* text on bright fills */
  --hi: rgba(255, 255, 255, .07);
  --glow: 0 18px 40px -12px rgba(0, 0, 0, .55);

  --orange: #FF8A3D;
  --purple: #9B7BFF;
  --coral: #FF5E5B;
  --teal: #2FD6C3;
  --sky: #4FB3FF;
  --yellow: #FFC94A;
  --green: #4BE08A;

  --font-head: "Baloo 2", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 12px; --r-md: 18px; --r-lg: 28px; --r-pill: 999px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --sky-1: #CFE8FF;
  --sky-2: #EAF4FF;
  --sky-3: #FFF3E0;
  --surface: #FFFFFF;
  --surface-2: #EEF3FF;
  --surface-3: #DDE6FF;
  --text: #182052;
  --muted: #4A5590;
  --hi: rgba(24, 32, 82, .05);
  --glow: 0 18px 40px -16px rgba(24, 32, 82, .35);
  --orange: #FF7A2B; --purple: #8A66FF; --coral: #FF4F4C; --teal: #1FC7B3;
  --sky: #3AA3F5; --yellow: #FFBE2E; --green: #36CF77;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--sky-1); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  color: var(--text); font: 600 1.0625rem/1.55 var(--font-body);
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 55%, var(--sky-3) 100%) fixed;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.08; margin: 0 0 .4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.3rem, 6.5vw, 3.9rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 4vw, 2.05rem); font-weight: 800; }
h3 { font-size: 1.22rem; font-weight: 800; }
p { margin: 0 0 1em; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 8px; }
.muted { color: var(--muted); }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; border-radius: 8px; }
main { position: relative; z-index: 1; flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 8px 16px 56px; outline: none; }

/* ---------- Sky decoration (stars + glows) ---------- */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sky .star { position: absolute; border-radius: 50%; background: #fff; }
.sky .star.tw { animation: twinkle 3.5s ease-in-out infinite; }
.sky .glow { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; }
:root[data-theme="light"] .sky .star { display: none; }
:root[data-theme="light"] .sky .glow { opacity: .55; }
@keyframes twinkle { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------- Header / footer ---------- */
.site-header {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1280px; width: 100%; margin: 0 auto; padding: 14px 16px;
}
.logo { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.logo-word { font: 800 1.95rem/1 var(--font-head); letter-spacing: -0.02em; }
.logo-word b { color: var(--yellow); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { white-space: nowrap; text-decoration: none; font: 800 1rem/1 var(--font-head); padding: 11px 14px; border-radius: var(--r-pill); color: var(--muted); }
.nav a:hover { color: var(--text); background: var(--hi); }
.nav a.active { color: var(--text); background: var(--surface-2); }
.streak-chip { display: inline-flex; align-items: center; gap: 4px; font: 800 1rem/1 var(--font-head); padding: 9px 12px; border-radius: var(--r-pill); background: var(--surface); color: var(--orange); text-decoration: none; }
.streak-chip.cold { color: var(--muted); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.25rem; background: var(--surface); border: 0; border-radius: 50%; cursor: pointer; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.icon-btn:active { transform: translateY(2px); box-shadow: none; }
.site-footer { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 24px 16px 36px; text-align: center; font-size: .9rem; color: var(--muted); }

/* ---------- Buttons: flat fill + darker lip, no outline ---------- */
.btn {
  --b: var(--surface-3);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 22px; font: 800 1.08rem/1 var(--font-head);
  color: var(--text); background: var(--b); border: 0; border-radius: var(--r-md);
  box-shadow: 0 5px 0 0 color-mix(in srgb, var(--b) 55%, #000), inset 0 2px 0 rgba(255,255,255,.18);
  transform: translateY(0);
  transition: transform 150ms cubic-bezier(.3, .7, .4, 1.5), box-shadow 150ms, filter 150ms;
  cursor: pointer; text-decoration: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 7px 0 0 color-mix(in srgb, var(--b) 55%, #000), inset 0 2px 0 rgba(255,255,255,.18); }
.btn:active { transform: translateY(5px); box-shadow: 0 0 0 0 transparent; transition-duration: 34ms; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { --b: var(--yellow); color: var(--ink); }
.btn-orange { --b: var(--orange); color: var(--ink); }
.btn-teal { --b: var(--teal); color: var(--ink); }
.btn-coral { --b: var(--coral); color: var(--ink); }
:root[data-theme="light"] .btn:not(.btn-primary):not(.btn-orange):not(.btn-teal):not(.btn-coral) { --b: var(--surface-3); }
.btn-big { min-height: 60px; padding: 14px 28px; font-size: 1.2rem; }
.btn-small { min-height: 42px; padding: 8px 14px; font-size: .95rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.btn-row.center { justify-content: center; }

/* ---------- Cards ---------- */
.card {
  position: relative; background: var(--surface); border-radius: var(--r-lg); padding: 26px;
  box-shadow: var(--glow), inset 0 2px 0 var(--hi);
}
.card::before { /* two-tone shading: lighter top-left */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.06), transparent 45%);
}
.badge { display: inline-flex; align-items: center; gap: 6px; font: 800 .85rem/1 var(--font-head); padding: 7px 11px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text); }
.badge.bright { background: var(--yellow); color: var(--ink); }

/* category colours */
.c-speed { --c: var(--orange); }
.c-memory { --c: var(--purple); }
.c-music { --c: var(--coral); }
.c-vision { --c: var(--teal); }
.c-mind { --c: var(--sky); }
.c-timing { --c: var(--yellow); }
.icon-orb {
  width: 56px; height: 56px; flex: none; display: grid; place-items: center; font-size: 1.75rem; color: var(--ink);
  border-radius: 50%; background: var(--c);
  box-shadow: inset -6px -8px 0 color-mix(in srgb, var(--c) 70%, #000), inset 5px 6px 0 rgba(255,255,255,.28), 0 0 24px color-mix(in srgb, var(--c) 45%, transparent);
}

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: center; margin: 8px 0 28px; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 32em; }
.hero h1 .glow-word { color: var(--yellow); text-shadow: 0 0 28px color-mix(in srgb, var(--yellow) 55%, transparent); }
.hero-art { width: 100%; max-width: 440px; justify-self: center; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }

.daily { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; margin: 70px 0 34px; }
.daily h2 { margin: 0 0 4px; }
.daily .flame { font-size: 2.6rem; color: var(--orange); filter: drop-shadow(0 0 14px color-mix(in srgb, var(--orange) 60%, transparent)); }
.daily-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.daily-item { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: var(--r-pill); background: var(--surface-2); text-decoration: none; font: 800 .95rem/1 var(--font-head); }
.daily-item .mini { width: 30px; height: 30px; font-size: 1rem; box-shadow: none; }
.daily-item.done { opacity: .7; }
.daily-item.done .mini { background: var(--green); }

.cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.cat-tab { border: 0; cursor: pointer; padding: 9px 14px; border-radius: var(--r-pill); background: var(--surface); color: var(--muted); font: 800 .95rem/1 var(--font-head); display: inline-flex; gap: 6px; align-items: center; }
.cat-tab i { color: var(--c, var(--text)); }
.cat-tab[aria-pressed="true"] { background: var(--text); color: var(--sky-1); }
.cat-tab[aria-pressed="true"] i { color: inherit; }

.test-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.test-card {
  display: flex; flex-direction: column; gap: 10px; text-decoration: none; padding: 22px;
  transition: transform 180ms cubic-bezier(.3, .7, .4, 1.5), box-shadow 180ms;
}
.test-card:hover { transform: translateY(-5px); box-shadow: 0 26px 46px -14px rgba(0,0,0,.6), 0 0 0 3px var(--c), inset 0 2px 0 var(--hi); }
.test-card:active { transform: translateY(1px); }
.test-card .top { display: flex; align-items: center; justify-content: space-between; }
.test-card .cat { font: 800 .78rem/1 var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--c); }
.test-card h3 { margin: 0; }
.test-card p { margin: 0; color: var(--muted); font-size: .98rem; }
.test-card .card-foot { margin-top: auto; padding-top: 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.test-card .go { font: 800 1rem/1 var(--font-head); display: inline-flex; gap: 6px; align-items: center; color: var(--c); }
.test-card .new { position: absolute; top: 14px; right: 14px; }

.promises { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 44px; }
.promise { display: flex; gap: 12px; align-items: flex-start; }
.promise i { font-size: 1.7rem; color: var(--teal); }
.promise strong { font-family: var(--font-head); font-size: 1.1rem; display: block; }

/* ---------- Peeking mascot ---------- */
.peek-host { position: relative; margin-top: 84px; }
.peek {
  position: absolute; z-index: 3; width: 128px; top: -77px; right: 40px; pointer-events: none;
  transition: transform 400ms cubic-bezier(.3, .7, .4, 1.4);
}
.peek.left { right: auto; left: 40px; }
.peek.hide { transform: translateY(70px); }

/* ---------- Test page ---------- */
.test-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 6px; flex-wrap: wrap; justify-content: space-between; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font: 800 1rem/1 var(--font-head); color: var(--muted); }
.back:hover { color: var(--text); }
.test-title { display: flex; align-items: center; gap: 14px; }
.test-title h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); margin: 0; }
.test-title .cat { font: 800 .8rem/1 var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--c); }
.challenge-banner { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--r-md); background: var(--orange); color: var(--ink); font: 800 1.05rem/1.3 var(--font-head); margin: 12px 0 0; }
.challenge-banner i { font-size: 1.6rem; }

.intro ul { margin: 0 0 22px; padding-left: 1.2em; }
.intro li { margin-bottom: 6px; }
.intro .best-line { margin: -8px 0 18px; }
.sound-check { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 22px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); }
.sound-check span { flex: 1; min-width: 200px; font-size: .95rem; }

.stage { min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 20px 8px; }
.level-tag { font: 800 .95rem/1 var(--font-head); padding: 9px 14px; border-radius: var(--r-pill); background: var(--surface-2); }
.lives { display: inline-flex; gap: 4px; font-size: 1.35rem; color: var(--coral); }
.lives .lost { color: var(--muted); opacity: .3; }
.hud { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.q { font: 800 1.3rem/1.2 var(--font-head); }
.feedback-ok { font: 800 2.4rem/1 var(--font-head); color: var(--green); }

/* Reaction pad: colour changes are INSTANT on purpose */
.react-pad {
  min-height: 380px; border-radius: var(--r-lg); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 24px; cursor: pointer; user-select: none; touch-action: manipulation; color: var(--ink);
  transition: none !important;
}
.react-pad[data-state="idle"], .react-pad[data-state="result"] { background: var(--sky); }
.react-pad[data-state="wait"] { background: var(--coral); }
.react-pad[data-state="go"] { background: var(--green); }
.react-pad[data-state="early"] { background: var(--yellow); }
.react-big { font: 800 clamp(2.4rem, 8vw, 4.2rem)/1 var(--font-head); }
.react-small { font-weight: 800; font-size: 1.1rem; }
.dots { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--surface-3); }
.dot.on { background: var(--yellow); box-shadow: 0 0 10px var(--yellow); }

/* Number memory */
.big-number { font: 800 clamp(2.4rem, 9vw, 4.5rem)/1.1 var(--font-head); letter-spacing: .08em; word-break: break-all; }
.timebar { width: min(420px, 90%); height: 12px; border-radius: var(--r-pill); overflow: hidden; background: var(--surface-3); }
.timebar span { display: block; height: 100%; background: var(--yellow); transform-origin: left; animation: shrink linear forwards; }
@keyframes shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.num-input {
  font: 800 2rem/1 var(--font-head); letter-spacing: .1em; text-align: center; width: min(420px, 100%); padding: 14px;
  color: var(--text); background: var(--surface-2); border: 3px solid transparent; border-radius: var(--r-md);
}
.num-input:focus { outline: none; border-color: var(--yellow); }

/* Pitch / rhythm */
.notes { display: flex; gap: 18px; }
.note { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font: 800 2rem/1 var(--font-head); background: var(--surface-2); transition: transform 120ms cubic-bezier(.3, .7, .4, 1.5), background 80ms; }
.note.playing { background: var(--coral); color: var(--ink); transform: scale(1.14); box-shadow: 0 0 30px var(--coral); }
.tap-pad {
  width: min(360px, 100%); aspect-ratio: 1.6; border-radius: var(--r-lg); border: 0; cursor: pointer;
  background: var(--surface-2); font: 800 1.6rem/1 var(--font-head); color: var(--text); touch-action: manipulation; user-select: none;
  box-shadow: inset 0 -8px 0 rgba(0,0,0,.25); transition: none;
}
.tap-pad.flash { background: var(--c, var(--coral)); color: var(--ink); }
.tap-pad:disabled { cursor: default; opacity: .8; }

/* Colour grid / visual memory / sequence */
.color-grid { display: grid; gap: 8px; width: min(440px, 100%); aspect-ratio: 1; }
.color-tile { border: 0; border-radius: 12px; cursor: pointer; padding: 0; transition: none; }
.color-tile.reveal { outline: 4px dashed var(--text); outline-offset: 2px; }
.mem-tile { border: 0; border-radius: 12px; cursor: pointer; padding: 0; background: var(--surface-3); transition: background 120ms, transform 120ms; }
.mem-tile.lit { background: var(--purple); box-shadow: 0 0 22px var(--purple); transform: scale(1.04); }
.mem-tile.ok { background: var(--purple); }
.mem-tile.bad { background: var(--coral); }
.mem-tile:disabled { cursor: default; }

/* Aim */
.arena { position: relative; width: 100%; height: 400px; border-radius: var(--r-lg); background: var(--surface-2); overflow: hidden; touch-action: manipulation; cursor: crosshair; }
/* Aim arena: radar sweep, grid, cannon at the bottom, crosshair cursor */
.aim-arena {
  height: 440px; isolation: isolate;
  background:
    radial-gradient(circle at 50% 100%, rgba(255,79,79,.16), transparent 55%),
    linear-gradient(rgba(174,182,232,.07) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(174,182,232,.07) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--surface-2);
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Ccircle cx='18' cy='18' r='11' fill='none' stroke='%23fff' stroke-width='2.5'/%3E%3Ccircle cx='18' cy='18' r='11' fill='none' stroke='%23FF4F4F' stroke-width='1.2'/%3E%3Cpath d='M18 2v9M18 25v9M2 18h9M25 18h9' stroke='%23fff' stroke-width='2.5' stroke-linecap='round'/%3E%3Ccircle cx='18' cy='18' r='2' fill='%23FF4F4F'/%3E%3C/svg%3E") 18 18, crosshair;
}
.aim-arena.kick { animation: kick .12s ease-out; }
@keyframes kick { 0% { transform: translate(0, 0); } 40% { transform: translate(2px, 3px); } 100% { transform: translate(0, 0); } }
.aim-radar { position: absolute; left: 50%; top: 50%; width: 900px; height: 900px; margin: -450px 0 0 -450px; border-radius: 50%; pointer-events: none; z-index: -1;
  background: conic-gradient(from 0deg, rgba(255,79,79,.12), transparent 18%, transparent); animation: radar 6s linear infinite; }
@keyframes radar { to { transform: rotate(360deg); } }
.aim-cannon { position: absolute; left: 50%; bottom: -14px; width: 26px; height: 56px; transform: translateX(-50%); transform-origin: 50% 100%;
  border-radius: 13px 13px 6px 6px; background: linear-gradient(90deg, #C9CCEB, #F4F2FF 40%, #9EA3D6); box-shadow: 0 0 0 6px rgba(14,20,51,.35);
  transition: transform 90ms ease-out; pointer-events: none; z-index: 3; }
.aim-cannon::after { content: ""; position: absolute; left: 50%; top: 4px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #FF4F4F; box-shadow: 0 0 8px #FF4F4F; }
.tlayer, .fx { position: absolute; inset: 0; pointer-events: none; }
.tlayer .target { pointer-events: auto; }
.fx { z-index: 4; overflow: hidden; }

.target {
  position: absolute; width: 74px; height: 74px; margin: -37px 0 0 -37px; border: 0; padding: 0; background: none; border-radius: 50%;
  cursor: inherit; filter: drop-shadow(0 8px 14px rgba(0,0,0,.4)) drop-shadow(0 0 16px rgba(255,79,79,.45));
  animation: tgspawn .26s cubic-bezier(.3, .7, .4, 1.6) both;
}
.target svg, .target-dying svg { width: 100%; height: 100%; display: block; overflow: visible; }
.target .tg-orbit { transform-origin: 50px 50px; animation: radar 3s linear infinite; }
.target:hover { animation: tgspawn .26s cubic-bezier(.3, .7, .4, 1.6) both, tgpulse .8s ease-in-out .26s infinite; }
@keyframes tgspawn { 0% { transform: scale(0) rotate(-120deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes tgpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* Shot effects */
.beam { position: absolute; height: 4px; margin-top: -2px; transform-origin: 0 50%; border-radius: 4px;
  background: linear-gradient(90deg, transparent, var(--beam) 30%, #fff); box-shadow: 0 0 12px var(--beam), 0 0 4px #fff;
  animation: beam .22s ease-out forwards; }
@keyframes beam { 0% { opacity: 1; } 100% { opacity: 0; filter: blur(2px); } }
.target-dying { position: absolute; width: 74px; height: 74px; margin: -37px 0 0 -37px; animation: tgdie .3s ease-out forwards; }
@keyframes tgdie { 0% { transform: scale(1); opacity: 1; } 40% { transform: scale(1.25); opacity: .9; filter: brightness(1.8); } 100% { transform: scale(.4); opacity: 0; } }
.shock { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 4px solid #FFC94A;
  animation: shock .5s cubic-bezier(.2, .6, .3, 1) forwards; }
@keyframes shock { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(3.4); opacity: 0; border-width: 1px; } }
.flash { position: absolute; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%;
  background: radial-gradient(circle, #fff, rgba(255,201,74,.6) 35%, transparent 70%); animation: flashout .2s ease-out forwards; }
@keyframes flashout { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.shard { position: absolute; margin: -3px; border-radius: 2px; animation: shard .6s cubic-bezier(.15, .7, .35, 1) forwards; }
@keyframes shard { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), calc(var(--dy) + 30px)) rotate(var(--rot)); opacity: 0; } }
.split { position: absolute; transform: translate(-50%, -50%); font: 800 1.15rem/1 var(--font-head); color: #FFC94A; white-space: nowrap;
  text-shadow: 0 2px 0 rgba(0,0,0,.4), 0 0 12px rgba(255,201,74,.6); animation: splitup .8s ease-out forwards; }
.split.miss { color: #AEB6E8; font-size: .95rem; text-shadow: none; }
@keyframes splitup { 0% { transform: translate(-50%, -30%) scale(.7); opacity: 0; } 20% { transform: translate(-50%, -90%) scale(1.1); opacity: 1; } 100% { transform: translate(-50%, -200%) scale(1); opacity: 0; } }
.spark-miss { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  background: radial-gradient(circle, #fff 0 15%, #4FB3FF 30%, transparent 65%); border-radius: 50%; animation: flashout .45s ease-out forwards; }

/* Typing */
.type-box { position: relative; max-height: 210px; overflow: hidden; cursor: text; width: 100%; max-width: 760px; text-align: left; font: 700 1.45rem/1.7 var(--font-body); padding: 18px 20px; border-radius: var(--r-md); background: var(--surface-2); color: var(--muted); min-height: 150px; word-break: break-word; }
.type-box .ok { color: var(--text); }
.type-box .bad { color: var(--coral); text-decoration: underline; }
.type-box .cur { border-left: 3px solid var(--yellow); margin-left: -1.5px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { border-color: transparent; } }
.type-input { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* Dots (quick count) */
.dot-field { position: relative; width: min(440px, 100%); aspect-ratio: 1.3; border-radius: var(--r-lg); background: var(--surface-2); overflow: hidden; }
.dot-field i { position: absolute; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: var(--teal); }

/* Focus (word/colour) */
.word-tile { width: min(440px, 100%); padding: 34px 16px; border-radius: var(--r-lg); background: #0E1433; font: 800 clamp(2.6rem, 10vw, 4rem)/1 var(--font-head); letter-spacing: .04em; }
.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: min(440px, 100%); }
.countdown { font: 800 6rem/1 var(--font-head); }

/* Timing */
.clock { font: 800 clamp(3.4rem, 12vw, 5.5rem)/1 var(--font-head); font-variant-numeric: tabular-nums; }
.round-list { list-style: none; padding: 0; margin: 0; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.round-list li { font: 800 .95rem/1 var(--font-head); padding: 8px 12px; border-radius: var(--r-pill); background: var(--surface-2); }

/* ---------- Result ---------- */
.result { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.result-mascot { width: 170px; margin-top: -10px; }
.result-score { font: 800 clamp(3rem, 12vw, 5rem)/1 var(--font-head); text-shadow: 0 0 36px color-mix(in srgb, var(--c, var(--yellow)) 50%, transparent); }
.result-pct { font: 800 1.3rem/1.3 var(--font-head); }
.result-pct mark { background: var(--yellow); color: var(--ink); padding: 0 .3em; border-radius: 8px; }
.meter { width: min(440px, 100%); height: 18px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; margin: 6px 0 4px; }
.meter span { display: block; height: 100%; background: var(--c, var(--teal)); width: 0; border-radius: inherit; transition: width 900ms cubic-bezier(.3, .7, .4, 1.2); }
.result .detail { color: var(--muted); max-width: 32em; }
.result .note-small { font-size: .88rem; color: var(--muted); }
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; width: min(460px, 100%); padding: 14px; border-radius: var(--r-md); background: var(--surface-2); }
.versus .side { font: 800 1.1rem/1.2 var(--font-head); }
.versus .side small { display: block; color: var(--muted); font: 700 .85rem/1.2 var(--font-body); }
.versus .vs { font: 800 1.4rem/1 var(--font-head); color: var(--orange); }
.spark { width: min(320px, 100%); height: 64px; }
.spark path.line { fill: none; stroke: var(--c, var(--teal)); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.spark path.area { fill: var(--c, var(--teal)); opacity: .15; }
.spark circle { fill: var(--c, var(--teal)); }

/* ---------- Profile ---------- */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.radar-wrap { display: flex; justify-content: center; }
.radar { width: 100%; max-width: 460px; height: auto; overflow: visible; }
.radar .ring { fill: none; stroke: var(--muted); stroke-opacity: .22; stroke-width: 1.5; }
.radar .ring.outer { fill: var(--surface-2); stroke-opacity: .35; }
.radar .spoke { stroke: var(--muted); stroke-opacity: .22; stroke-width: 1.5; }
.radar .shape { fill: var(--yellow); fill-opacity: .55; stroke: var(--yellow); stroke-width: 3; stroke-linejoin: round; filter: drop-shadow(0 0 12px color-mix(in srgb, var(--yellow) 55%, transparent)); }
.radar .pt { stroke: var(--surface); stroke-width: 3; }
.radar .lbl { font: 800 15px var(--font-head); fill: var(--text); }
.radar .lbl-pct { font: 700 13px var(--font-body); fill: var(--muted); }
.archetype { font: 800 clamp(1.9rem, 5vw, 2.7rem)/1.05 var(--font-head); margin: 6px 0 10px; color: var(--yellow); }
.cat-block { margin-bottom: 18px; }
.cat-block h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--c); font-size: 1.05rem; }
.skill-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.test-icon { display: block; flex: none; filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--c, #000) 35%, transparent)); }
.test-card:hover .test-icon { animation: iconbounce .5s cubic-bezier(.3, .7, .4, 1.5); }
@keyframes iconbounce { 0% { transform: scale(1) rotate(0); } 40% { transform: scale(1.12) rotate(-6deg); } 100% { transform: scale(1) rotate(0); } }
.daily-item .test-icon { filter: none; }
.skill-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; text-decoration: none; }
.skill-row .bar { height: 10px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.skill-row .bar span { display: block; height: 100%; background: var(--c); border-radius: inherit; }
.skill-row .val { font: 800 1rem/1 var(--font-head); min-width: 3.2em; text-align: right; }
.skill-name { font: 800 .98rem/1.2 var(--font-head); display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.share-preview { width: 100%; max-width: 300px; border-radius: var(--r-md); box-shadow: var(--glow); display: block; margin: 0 auto 16px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--text); color: var(--sky-1); padding: 12px 18px; border-radius: var(--r-pill); font: 800 1rem/1 var(--font-head); transition: opacity 200ms, transform 200ms; pointer-events: none; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mascot animation ---------- */
.mascot { display: block; width: 100%; height: auto; overflow: visible; }
.mascot .whole { transform-origin: 80px 170px; }
.mascot.idle .whole { animation: bob 2.8s ease-in-out infinite; }
.mascot.happy .whole { animation: hop .7s cubic-bezier(.3, .7, .4, 1.5) 2; }
.mascot.oops .whole { animation: wobble .6s ease-in-out 1; }
.mascot .wave { transform-origin: 122px 100px; animation: wave 1.4s ease-in-out infinite; }
.mascot .spark-g { transform-origin: 92px 22px; animation: pulse 2s ease-in-out infinite; }
.mascot.peek-svg .whole { animation: none; transform-origin: 80px 110px; }
.mascot.peek-svg.happy .whole { animation: peekhop .5s cubic-bezier(.3, .7, .4, 1.5) 1; }
.mascot.peek-svg.oops .whole { animation: wobble .5s ease-in-out 1; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes hop { 0% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(0) scale(1.08, .9); } 60% { transform: translateY(-18px) scale(.95, 1.06); } 100% { transform: translateY(0) scale(1, 1); } }
@keyframes peekhop { 0% { transform: translateY(0); } 50% { transform: translateY(-12px); } 100% { transform: translateY(0); } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(5deg); } }
@keyframes wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-22deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.2); opacity: .8; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.shake { animation: shake .3s ease-in-out; }
.pop-in { animation: popin .45s cubic-bezier(.3, .7, .4, 1.5) both; }
@keyframes popin { from { transform: scale(.88); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.float { animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

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

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; text-align: center; gap: 0; }
  .hero-art { max-width: 300px; order: -1; }
  .hero .btn-row, .pills { justify-content: center; }
  .daily { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .daily-list { justify-content: center; }
  .profile-grid { grid-template-columns: 1fr; }
  .logo-word { font-size: 1.6rem; }
  .nav a { padding: 9px 9px; font-size: .92rem; }
  .card { padding: 20px 16px; }
  .peek { width: 104px; right: 18px; top: -62px; }
  .peek-host { margin-top: 70px; }
  .arena { height: 340px; }
  .type-box { font-size: 1.2rem; }
}

/* ---------- Side decorations: only on screens wide enough to have empty sides ---------- */
.sky .deco { position: absolute; display: none; opacity: .9; }
.sky .deco svg { display: block; filter: drop-shadow(0 10px 24px rgba(0,0,0,.35)); }
.sky .deco .flame { transform-origin: 40px 96px; animation: flicker .18s ease-in-out infinite alternate; }
.sky .comet { animation: comet 14s linear infinite; opacity: 0; }
@keyframes flicker { from { transform: scaleY(.85); } to { transform: scaleY(1.1); } }
@keyframes comet { 0%, 70% { transform: translate(-120px, -60px); opacity: 0; } 75% { opacity: .9; } 90% { transform: translate(140px, 70px); opacity: .9; } 100% { transform: translate(180px, 90px); opacity: 0; } }
@media (min-width: 1500px) { .sky .deco { display: block; } }
:root[data-theme="light"] .sky .deco { opacity: .75; }
.twinkle-star { transform-origin: 200px 63px; animation: pulse 2.4s ease-in-out infinite; }

/* ---------- Wide screens: more room for the hero and 4 cards per row ---------- */
@media (min-width: 1200px) {
  .hero { grid-template-columns: 1.15fr .85fr; }
  .hero-art { max-width: 470px; }
  .test-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Phone header: keep everything on one line ---------- */
@media (max-width: 520px) {
  .site-header { padding: 12px 12px; gap: 6px; }
  .nav { gap: 4px; }
  .nav a[data-nav="home"] { display: none; }
  .nav a { padding: 8px 8px; }
  .icon-btn { width: 38px; height: 38px; font-size: 1.1rem; }
  .streak-chip { padding: 8px 9px; font-size: .92rem; }
  .logo-word { font-size: 1.45rem; }
  .logo [data-mascot] { width: 34px !important; }
}
