/* My 1st Cyber Awareness: deep indigo + glass, with bright, playful mission colours. */
:root {
  color-scheme: dark;
  --bg-0: #0d0a2e;
  --bg-1: #1a1150;
  --violet: #7c5cff;
  --magenta: #d94bd6;
  --ink: #f5f3ff;
  --muted: #b9b3e6;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.1);
  --edge: rgba(255, 255, 255, 0.16);
  --edge-bright: rgba(255, 255, 255, 0.32);
  --good: #4ade80;
  --bad: #fb7185;
  --radius: 22px;
  --accent: var(--violet);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg-0); }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font-size: 18px; line-height: 1.5;
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(217, 75, 214, 0.45), transparent 60%),
    radial-gradient(50rem 40rem at -10% 20%, rgba(91, 70, 255, 0.45), transparent 60%),
    radial-gradient(40rem 30rem at 60% 110%, rgba(56, 100, 255, 0.35), transparent 60%),
    linear-gradient(160deg, var(--bg-1), var(--bg-0) 70%);
  background-attachment: fixed;
}
main { max-width: 960px; margin: 0 auto; padding: 8px 16px 72px; outline: none; }
h1, h2 { line-height: 1.15; margin: 0.4em 0; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; margin-top: 1.8em; }
a { color: #c4b5fd; }
.muted { color: var(--muted); }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px max(16px, calc((100vw - 960px) / 2 + 16px));
  background: rgba(13, 10, 46, 0.55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--edge); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 1.35rem; letter-spacing: -0.02em; }
.brand b { background: linear-gradient(90deg, #a78bfa, #f0abfc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mark { width: 30px; height: 30px; color: #fff; }
.grown-ups { color: var(--ink); text-decoration: none; font-size: 0.85rem; font-weight: 700; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--edge-bright); background: var(--glass); }

/* Glass surface */
.glass, .bubble, .name-form, .stats, .card, .opt, .parents details, .takeaway li, .progress {
  background: var(--glass); border: 1px solid var(--edge);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

/* Buttons */
.btn { display: inline-block; border: 0; border-radius: 999px; padding: 12px 26px; font: inherit; font-weight: 800;
  color: #fff; cursor: pointer; text-decoration: none;
  background: linear-gradient(135deg, var(--violet), var(--magenta));
  box-shadow: 0 8px 24px rgba(160, 80, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform .1s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(160, 80, 255, 0.6), inset 0 1px 0 rgba(255,255,255,.35); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--glass-strong); border: 1px solid var(--edge-bright); box-shadow: none; }
.btn.big { font-size: 1.15rem; padding: 15px 32px; }
.say { border: 1px solid var(--edge-bright); background: var(--glass-strong); color: #fff; border-radius: 50%;
  width: 44px; height: 44px; font-size: 1.2rem; cursor: pointer; flex: none; }
:focus-visible { outline: 3px solid #f0abfc; outline-offset: 3px; }

/* Hero */
.hero { text-align: center; padding: 28px 0 8px; }
.kicker { margin: 0; font-size: clamp(1.1rem, 3.5vw, 1.6rem); color: #e4defc; }
.headline { font-size: clamp(3rem, 13vw, 6rem); font-weight: 800; letter-spacing: -0.04em; margin: 0 0 0.2em;
  background: linear-gradient(180deg, #fff 30%, #d8ccff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.headline .shine { -webkit-text-fill-color: initial; color: initial; display: inline-block; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(8deg); } }
.hero-bolt { display: flex; gap: 14px; align-items: center; max-width: 640px; margin: 0 auto 22px; text-align: left; }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 14px; border-radius: 28px;
  max-width: 720px; margin: 0 auto; background: rgba(10, 8, 40, 0.55); border-color: var(--edge-bright);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.04), 0 20px 60px rgba(0, 0, 0, 0.35); }
.stat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 18px 8px;
  border-radius: 16px; background: rgba(40, 34, 120, 0.45); border: 1px solid rgba(160, 150, 255, 0.35); }
.stat b { font-size: clamp(2rem, 7vw, 2.8rem); font-weight: 600; line-height: 1; }
.stat b small { font-size: 0.5em; color: var(--muted); }
.stat span { font-size: 0.95rem; color: #e4defc; }
.stat i { display: block; font-style: normal; font-size: 0.8em; color: var(--muted); }
.fine { color: var(--muted); font-size: 0.95rem; margin-top: 16px; }

/* Characters & bubbles */
.char { width: 120px; height: auto; aspect-ratio: 200 / 220; flex: none; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35)); overflow: visible; }
.bubble { position: relative; border-radius: var(--radius); padding: 14px 18px; flex: 1; }
.bubble p { margin: 0.3em 0 0.6em; font-size: 1.2rem; }
.bubble .who { color: #f0abfc; font-size: 0.95rem; }
.scene { display: flex; gap: 14px; align-items: center; margin: 14px 0; }
.scene.fox .bubble { border-color: rgba(251, 146, 60, 0.55); box-shadow: 0 0 30px rgba(251, 146, 60, 0.15); }
.scene.fox .who { color: #fdba74; }
.scene.small .char { width: 76px; }
.scene.small .bubble p { font-size: 1.05rem; }

/* Name form */
.name-form { border-radius: var(--radius); padding: 18px; margin: 24px auto 0; max-width: 720px; border-style: dashed; border-color: var(--edge-bright); }
.name-form label { display: block; font-weight: 700; margin-bottom: 10px; }
.name-form small { font-weight: 400; color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
input { font: inherit; padding: 11px 18px; border-radius: 999px; border: 1px solid var(--edge-bright); background: rgba(0, 0, 0, 0.25);
  color: var(--ink); flex: 1; min-width: 0; }
input::placeholder { color: var(--muted); }

/* Mission colours: bright on dark */
.blue   { --accent: #60a5fa; }
.teal   { --accent: #2dd4bf; }
.purple { --accent: #a78bfa; }
.green  { --accent: #4ade80; }
.pink   { --accent: #f472b6; }
.orange { --accent: #fb923c; }
.gold   { --accent: #facc15; }

/* Mission grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 44%), 1fr)); gap: 12px; }
.card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--radius);
  text-decoration: none; color: var(--ink); min-height: 180px; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, transparent), rgba(255, 255, 255, 0.04) 60%);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  transition: transform .15s, box-shadow .2s; }
.card::after { content: ''; position: absolute; width: 140px; height: 140px; right: -50px; top: -50px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%); }
a.card:hover { transform: translateY(-4px) rotate(-0.6deg); box-shadow: 0 14px 40px color-mix(in srgb, var(--accent) 35%, transparent); }
.card .emoji { font-size: 2.6rem; position: relative; z-index: 1; }
.card strong { font-size: 1.1rem; }
.card small { color: var(--muted); }
.card .num { position: absolute; top: 12px; right: 16px; font-weight: 800; color: var(--accent); z-index: 1; }
.card.locked { filter: grayscale(1); opacity: 0.45; }
.tag { margin-top: auto; align-self: flex-start; font-size: 0.85rem; font-weight: 800; padding: 4px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid var(--edge); }
.tag.go { background: var(--accent); color: #140e3c; border-color: transparent; box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 60%, transparent); }
.tag.done { color: var(--good); }

/* Badges */
.shelf { display: flex; flex-wrap: wrap; gap: 12px; }
.badge { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 2.1rem; text-decoration: none;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 45%, transparent), rgba(255,255,255,0.05));
  border: 2px solid var(--accent); box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 45%, transparent); }

/* Play screen */
.play-head { display: flex; align-items: center; gap: 12px; font-weight: 800; padding-top: 14px; }
.home-link { text-decoration: none; font-size: 1.4rem; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; background: var(--glass-strong); border: 1px solid var(--edge); }
.progress { height: 12px; border-radius: 999px; overflow: hidden; margin: 14px 0 8px; }
.bar { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .35s;
  background: linear-gradient(90deg, var(--accent), #f0abfc); box-shadow: 0 0 14px var(--accent); }
.nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.nav.center { justify-content: center; }
.question { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 20px; }
.question h2 { font-size: clamp(1.4rem, 5vw, 1.9rem); margin: 0; }
.options { display: grid; gap: 14px; margin: 20px 0; }
.options.game { grid-template-columns: 1fr 1fr; }
.opt { font: inherit; font-size: 1.2rem; font-weight: 800; padding: 22px 16px; border-radius: var(--radius); cursor: pointer;
  color: var(--ink); border: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); word-break: break-word;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12); transition: transform .1s, opacity .2s, box-shadow .2s; }
.opt:hover:not(:disabled) { box-shadow: 0 0 26px color-mix(in srgb, var(--accent) 45%, transparent); transform: translateY(-2px); }
.opt:active { transform: translateY(2px); }
.opt.right { background: linear-gradient(135deg, #22c55e, #16a34a); border-color: #86efac; color: #fff;
  box-shadow: 0 0 30px rgba(74, 222, 128, 0.55); animation: pop .35s; }
.opt.wrong { opacity: 0.35; border-color: var(--bad); animation: shake .35s; }
.opt:disabled { cursor: default; }
@keyframes pop { 50% { transform: scale(1.05); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Finish */
.finish { text-align: center; padding-top: 18px; }
.medal { width: 150px; height: 150px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 4.6rem;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 55%, transparent), rgba(255,255,255,.04));
  border: 3px solid var(--accent); box-shadow: 0 0 0 10px rgba(255,255,255,.05), 0 0 60px color-mix(in srgb, var(--accent) 60%, transparent);
  animation: pop .6s; }
.finish h2 { font-size: 2.2rem; }
.stars { font-size: 2rem; letter-spacing: 4px; margin: 8px 0; }
.takeaway { list-style: none; padding: 0; display: grid; gap: 8px; max-width: 460px; margin: 18px auto; text-align: left; }
.takeaway li { border-radius: 14px; padding: 11px 16px; font-weight: 700; border-left: 4px solid var(--accent); }
.takeaway li::before { content: '✓ '; color: var(--good); }

/* Confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 10; }
.confetti i { position: absolute; top: -20px; left: var(--x); width: 10px; height: 16px; background: var(--c);
  border-radius: 3px; animation: fall var(--d) linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(var(--r)); } }

/* Certificate: paper on a glass desk */
.cert-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 18px 0; }
.cert-tools label { display: flex; gap: 8px; align-items: center; font-weight: 700; flex: 1; min-width: 220px; }
.certificate { --accent: #5b3fd9; background: #fffdf8; color: #1b1740; padding: 14px; border-radius: 14px;
  border: 6px solid var(--accent); aspect-ratio: 1.414 / 1; box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 0 10px rgba(255,255,255,.06); }
.certificate.blue { --accent: #2563eb; } .certificate.teal { --accent: #0d9488; } .certificate.purple { --accent: #7c3aed; }
.certificate.green { --accent: #16a34a; } .certificate.pink { --accent: #db2777; } .certificate.orange { --accent: #ea580c; }
.certificate.gold { --accent: #b8860b; }
.cert-border { height: 100%; border: 3px dashed var(--accent); border-radius: 8px; padding: 4% 6%; text-align: center;
  display: flex; flex-direction: column; justify-content: center; }
.cert-border p { margin: 0.2em 0; }
.cert-kicker { text-transform: uppercase; letter-spacing: 3px; font-weight: 800; color: var(--accent); font-size: 0.85rem; }
.certificate h1 { font-size: clamp(1.4rem, 4.5vw, 2.6rem); }
.cert-name { font-size: clamp(1.6rem, 6vw, 3.2rem); font-weight: 900; color: var(--accent); border-bottom: 3px solid var(--accent);
  display: inline-block; margin: 0.2em auto !important; padding: 0 0.6em; }
.cert-title { font-size: clamp(1.1rem, 3.5vw, 1.8rem); font-weight: 800; }
.cert-foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 3%; font-size: 0.85rem; }
.cert-foot > div { display: flex; flex-direction: column; align-items: center; }
.cert-foot .char { width: 60px; filter: none; }
.cert-date { font-weight: 800; border-bottom: 2px solid #1b1740; padding: 0 1em; }

/* Parents */
.parents { padding-top: 12px; }
.parents details { border-radius: 16px; padding: 12px 16px; margin: 10px 0; }
.parents summary { cursor: pointer; }


/* Programme switch (top bar pill + segmented control) */
.top-actions { display: flex; align-items: center; gap: 8px; }
.track-pill { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 0.85rem; font-weight: 800; color: #fff; cursor: pointer;
  padding: 6px 8px 6px 14px; border-radius: 999px; border: 1px solid transparent;
  background: linear-gradient(135deg, var(--violet), var(--magenta)); box-shadow: 0 4px 16px rgba(160, 80, 255, 0.4); }
.pill-swap { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); }
.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; margin: 0 auto 18px;
  background: rgba(10, 8, 40, 0.55); border: 1px solid var(--edge-bright); }
.seg { font: inherit; font-weight: 800; font-size: 0.95rem; color: var(--muted); background: transparent; border: 0; cursor: pointer;
  padding: 9px 18px; border-radius: 999px; transition: background .2s, color .2s; }
.seg.on { color: #fff; background: linear-gradient(135deg, var(--violet), var(--magenta)); box-shadow: 0 4px 16px rgba(160, 80, 255, 0.45); }
.parents .segmented { margin: 4px 0 8px; }

/* First-visit chooser */
.choose { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 720px; margin: 0 auto; }
.choose.four { grid-template-columns: repeat(4, 1fr); max-width: 1100px; }
.choice { font: inherit; color: var(--ink); text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px;
  padding: 22px; border-radius: 24px; background: var(--glass); border: 1px solid var(--edge-bright);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform .15s, box-shadow .2s; }
.choice.younger { --accent: #60a5fa; background: linear-gradient(160deg, rgba(96,165,250,.25), rgba(255,255,255,.04) 60%); }
.choice.older { --accent: #f472b6; background: linear-gradient(160deg, rgba(244,114,182,.25), rgba(255,255,255,.04) 60%); }
.choice.senior { --accent: #fbbf24; background: linear-gradient(160deg, rgba(251,191,36,.2), rgba(255,255,255,.04) 60%); }
.choice.teen { --accent: #34d399; background: linear-gradient(160deg, rgba(52,211,153,.22), rgba(255,255,255,.04) 60%); }
.choice:hover { transform: translateY(-4px); box-shadow: 0 14px 40px color-mix(in srgb, var(--accent) 35%, transparent); }
.choice-emoji { font-size: 2.6rem; }
.choice b { font-size: 1.6rem; }
.choice-name { color: var(--accent); font-weight: 800; }
.choice-blurb { color: var(--muted); font-size: 0.95rem; }
.choice .tag { margin-top: 8px; }

/* Mission header: auto-read toggle */
.play-title { flex: 1; min-width: 0; }
.auto { font: inherit; font-size: 0.8rem; font-weight: 800; color: var(--muted); cursor: pointer; white-space: nowrap;
  padding: 7px 12px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--edge); }
.auto.on { color: #140e3c; background: var(--accent); border-color: transparent; box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 50%, transparent); }

/* Voice settings */
.voices { display: grid; gap: 10px; padding: 14px; border-radius: 18px; background: var(--glass); border: 1px solid var(--edge); }
.voice-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center; }
select { font: inherit; font-size: 0.95rem; color: var(--ink); background: rgba(0, 0, 0, 0.3); border: 1px solid var(--edge-bright);
  border-radius: 12px; padding: 9px 12px; min-width: 0; width: 100%; }
select option { color: #111; }
input[type=range] { padding: 0; accent-color: var(--magenta); }
.btn.small { padding: 8px 16px; font-size: 0.9rem; }
.programme { border-color: var(--edge-bright) !important; }
.programme > summary { font-size: 1.1rem; }
h2 small { font-size: 0.85rem; font-weight: 600; margin-left: 6px; }


/* ---------- Characters: idle animation ---------- */
.char .head, .char .tail, .char .ear-l, .char .ear-r, .char .blink, .char .spark { transform-box: fill-box; }
.char .head { transform-origin: 50% 90%; animation: nod 4s ease-in-out infinite; }
.char .blink { transform-origin: center; animation: blink 5s infinite; }
.char-bolt .ear-l { transform-origin: 70% 10%; animation: flop 3s ease-in-out infinite; }
.char-bolt .ear-r { transform-origin: 30% 10%; animation: flop 3s ease-in-out infinite reverse; }
.char-fox .tail { transform-origin: 10% 90%; animation: swish 2.6s ease-in-out infinite; }
.char .spark { transform-origin: center; animation: twinkle 1.6s ease-in-out infinite; }
.mood-cheer .head { animation: hop .9s ease-in-out infinite; }
.mood-shock .head { animation: shake .4s ease-in-out 2; }
.mood-sad .head { transform: rotate(-4deg) translateY(4px); animation: none; }
@keyframes nod { 50% { transform: rotate(-2.5deg); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
@keyframes flop { 50% { transform: rotate(6deg); } }
@keyframes swish { 50% { transform: rotate(-12deg); } }
@keyframes twinkle { 50% { transform: scale(1.25); opacity: .7; } }
@keyframes hop { 50% { transform: translateY(-6px) rotate(2deg); } }

/* ---------- Welcome ---------- */
.welcome { text-align: center; padding-top: 18px; }
.welcome .nav { align-items: center; }
.dots { display: flex; justify-content: center; gap: 8px; margin: 6px 0 14px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--edge-bright); }
.dots i.on { width: 28px; border-radius: 999px; background: linear-gradient(90deg, var(--violet), var(--magenta)); }
.slide { min-height: 420px; }
.headline.small { font-size: clamp(2rem, 8vw, 3.4rem); }
.welcome-hero .char { width: 180px; margin: 0 auto; }
.bubble.center { text-align: center; max-width: 620px; margin: 10px auto 0; }
.lead { font-size: 1.25rem; color: #e4defc; }
.meet { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: center; text-align: left; max-width: 720px; margin: 0 auto;
  padding: 20px; border-radius: 28px; background: var(--glass); border: 1px solid var(--edge-bright); }
.meet.bolt { background: linear-gradient(160deg, rgba(96,165,250,.28), rgba(255,255,255,.04) 65%); }
.meet.fox { background: linear-gradient(160deg, rgba(251,146,60,.28), rgba(255,255,255,.04) 65%); }
.meet-art .char { width: 100%; }
.meet h2 { font-size: 2.4rem; margin: 6px 0 0; }
.role { margin: 0 0 12px; color: var(--muted); font-weight: 700; }
.side-tag { display: inline-block; font-size: 0.8rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; padding: 4px 12px; border-radius: 999px; }
.side-tag.bolt { background: #60a5fa; color: #0d1b45; }
.side-tag.fox { background: #fb923c; color: #3a1a0c; }
.how { list-style: none; padding: 0; margin: 18px auto; display: grid; gap: 12px; max-width: 620px; text-align: left; counter-reset: how; }
.how li { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 18px; background: var(--glass); border: 1px solid var(--edge); position: relative; }
.how li::before { counter-increment: how; content: counter(how); position: absolute; left: -10px; top: -10px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 900; font-size: .85rem; background: linear-gradient(135deg, var(--violet), var(--magenta)); }
.how-ico { font-size: 2.2rem; }
.how li > div > b { display: block; font-size: 1.15rem; }
.how li > div > span { color: #e4defc; }
.ladder { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 18px auto; max-width: 720px; }
.rung { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 120px; padding: 12px 6px; border-radius: 18px;
  background: rgba(40, 34, 120, 0.45); border: 1px solid rgba(160, 150, 255, 0.35); transform: translateY(calc(var(--i) * -6px)); }
.rung span { font-size: 2rem; }
.rung b { font-size: .9rem; }
.rung small { color: var(--muted); }
.rung:last-child { background: linear-gradient(160deg, rgba(250,204,21,.35), rgba(255,255,255,.05)); border-color: #facc15; }
.welcome-duo { display: flex; justify-content: center; gap: 10px; }
.welcome-duo .char { width: 140px; }

/* ---------- Home: player card, CTA, quest map ---------- */
.player { display: flex; gap: 14px; align-items: center; max-width: 720px; margin: 0 auto 8px; padding: 14px 18px; border-radius: 24px; text-align: left;
  background: rgba(10, 8, 40, 0.55); border: 1px solid var(--edge-bright); }
.rank-badge { flex: none; width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; font-size: 2.2rem;
  background: radial-gradient(circle at 30% 30%, rgba(240,171,252,.5), rgba(124,92,255,.3)); border: 2px solid #f0abfc; box-shadow: 0 0 24px rgba(217,75,214,.45); }
.player-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.player-name { font-size: 1.3rem; }
.player-rank { color: #f0abfc; font-weight: 800; font-size: .95rem; }
.xpbar { height: 12px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; border: 1px solid var(--edge); }
.xpbar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #facc15, #f0abfc); box-shadow: 0 0 12px #facc15; }
.cta { display: block; max-width: 720px; margin: 6px auto 22px; font-size: 1.2rem; padding: 18px 24px; animation: pulse 2.2s ease-in-out infinite; }
.btn.gold { background: linear-gradient(135deg, #facc15, #f59e0b); color: #3a2a00; box-shadow: 0 8px 24px rgba(250, 204, 21, .45); }
@keyframes pulse { 50% { box-shadow: 0 8px 40px rgba(217, 75, 214, .75), inset 0 1px 0 rgba(255,255,255,.35); transform: scale(1.015); } }
.map { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 26px; padding: 10px 0 20px; }
.map-line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-line path { fill: none; stroke: rgba(240, 171, 252, .45); stroke-width: 4; stroke-dasharray: 2 12; stroke-linecap: round; }
.node { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink);
  width: min(340px, 72%); margin-left: calc(50% - min(340px, 72%) / 2 + var(--x) * min(13%, 120px)); }
.node-dot { position: relative; flex: none; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-size: 2.1rem;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 55%, transparent), rgba(20,14,60,.9) 75%);
  border: 3px solid var(--accent); box-shadow: 0 6px 0 color-mix(in srgb, var(--accent) 50%, #000), 0 0 22px color-mix(in srgb, var(--accent) 35%, transparent); }
.node-label { display: flex; flex-direction: column; line-height: 1.2; }
.node-label small { color: var(--muted); font-weight: 700; }
.node-label b { font-size: 1.05rem; }
.node-label em { font-style: normal; font-size: .85rem; margin-top: 2px; }
.node-label em.go { color: #140e3c; background: var(--accent); align-self: flex-start; padding: 2px 10px; border-radius: 999px; font-weight: 900; }
.node .tick { position: absolute; right: -4px; bottom: -4px; width: 26px; height: 26px; border-radius: 50%; background: var(--good); color: #052e16;
  font-style: normal; font-weight: 900; font-size: .9rem; display: grid; place-items: center; border: 2px solid #0d0a2e; }
.node.current .node-dot { width: 92px; height: 92px; font-size: 2.6rem; animation: pulse-node 1.6s ease-in-out infinite; }
@keyframes pulse-node { 50% { box-shadow: 0 6px 0 color-mix(in srgb, var(--accent) 50%, #000), 0 0 0 12px color-mix(in srgb, var(--accent) 25%, transparent); } }
.node.locked { filter: grayscale(1); opacity: .45; }
.node-bolt { position: absolute; left: -64px; top: -18px; }
.node-bolt .char { width: 64px; }
a.node:hover .node-dot { transform: translateY(-3px); }
.hero-bolt.compact { margin-bottom: 12px; }
.hero-bolt.compact .char { width: 90px; }
.hero-bolt.compact .bubble p { font-size: 1.05rem; }
.help-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 28px; }

/* ---------- Mission: briefing and learn cards ---------- */
.brief { text-align: center; padding: 22px 18px; margin-top: 14px; border-radius: 28px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 28%, transparent), rgba(255,255,255,.04) 65%); border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); }
.brief-kicker { text-transform: uppercase; letter-spacing: .12em; font-weight: 900; font-size: .8rem; color: var(--accent); }
.brief-emoji { font-size: 4rem; margin: 6px 0; }
.brief h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); margin: 0; }
.brief-steps { list-style: none; padding: 0; margin: 16px auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 520px; text-align: left; }
.brief-steps li { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(0,0,0,.2); font-weight: 700; font-size: .95rem; }
.brief-steps span { font-size: 1.4rem; }
.reward { margin: 4px 0 0; color: #fde68a; }
.learn { text-align: center; padding: 26px 20px; margin-top: 16px; border-radius: 28px; background: rgba(10, 8, 40, 0.55); border: 1px solid var(--edge-bright); }
.learn-step { display: inline-block; font-size: .85rem; font-weight: 800; color: var(--muted); padding: 4px 12px; border-radius: 999px; background: var(--glass); }
.learn-icon { width: 120px; height: 120px; margin: 16px auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 3.8rem;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 55%, transparent), rgba(20,14,60,.6)); border: 3px solid var(--accent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 40%, transparent); animation: pop .5s; }
.learn h2 { font-size: clamp(1.6rem, 6vw, 2.2rem); margin: 8px 0; }
.learn p { font-size: 1.25rem; max-width: 560px; margin: 0 auto 12px; color: #f1edff; }

/* ---------- Mission: story stage ---------- */
.stage { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-top: 14px; padding: 0 6px; }
.actor { position: relative; display: flex; flex-direction: column; align-items: center; transition: transform .3s, opacity .3s, filter .3s; opacity: .45; filter: saturate(.6); transform: scale(.85); }
.actor.active { opacity: 1; filter: none; transform: scale(1); }
.actor .char { width: 150px; }
.nametag { margin-top: -6px; font-size: .8rem; font-weight: 900; padding: 3px 12px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--edge); }
.actor.bolt.active .nametag { background: #60a5fa; color: #0d1b45; }
.actor.fox.active .nametag { background: #fb923c; color: #3a1a0c; }
.bubble.speech { margin-top: 14px; }
.bubble.speech { border-top-width: 4px; }
.bubble.speech.from-bolt { border-top-color: #60a5fa; }
.bubble.speech.from-bolt .who { color: #93c5fd; }
.bubble.speech.from-fox .who { color: #fdba74; }
.bubble.speech.from-fox { border-color: rgba(251, 146, 60, 0.55); border-top-color: #fb923c; }
.bubble.speech h2 { margin: 4px 0; }

/* ---------- Mission: games and quiz ---------- */
.hud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hud-chip { font-size: .85rem; font-weight: 800; padding: 5px 12px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--edge); }
.hud-chip.fire { background: linear-gradient(135deg, #f97316, #ef4444); border-color: transparent; animation: pop .4s; }
.hud-chip.xp { margin-left: auto; color: #fde68a; }
.q-fox .char { width: 70px; }
.question .q-fox { flex: none; }
.tap-hint { margin: 6px 0 0; color: var(--muted); font-weight: 700; font-size: .95rem; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(-3px); } }
.xp-float { position: absolute; z-index: 20; transform: translate(-50%, 0); font-weight: 900; font-size: 1.4rem; color: #fde68a; text-shadow: 0 2px 12px rgba(250,204,21,.8);
  pointer-events: none; animation: rise 1.2s ease-out forwards; }
@keyframes rise { to { transform: translate(-50%, -70px); opacity: 0; } }

/* ---------- Mission: finish ---------- */
.finish-duo { display: flex; justify-content: center; align-items: flex-end; gap: 6px; }
.finish-duo .actor { opacity: 1; filter: none; transform: none; }
.finish-duo .actor .char { width: 120px; }
.finish-duo .actor.fox { opacity: .85; }
.fox-says { font-size: .8rem; font-weight: 800; color: #fdba74; }
.results { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.results > div { display: flex; flex-direction: column; align-items: center; min-width: 110px; padding: 12px; border-radius: 16px;
  background: rgba(40, 34, 120, 0.45); border: 1px solid rgba(160, 150, 255, 0.35); }
.results b { font-size: 1.4rem; }
.results span { color: var(--muted); font-size: .85rem; }
.levelup { display: flex; gap: 12px; align-items: center; justify-content: center; max-width: 420px; margin: 0 auto 12px; padding: 12px 18px; border-radius: 20px;
  background: linear-gradient(135deg, #facc15, #f59e0b); color: #3a2a00; animation: pop .6s; box-shadow: 0 0 40px rgba(250,204,21,.5); }
.levelup span { font-size: 2.4rem; }
.levelup small { display: block; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.cert-xp { font-weight: 800; }

/* Phones */
@media (max-width: 560px) {
  body { font-size: 17px; }
  .hero-bolt { flex-direction: column; text-align: center; }
  .scene { flex-direction: column; text-align: center; }
  .scene.small { flex-direction: row; text-align: left; }
  .char { width: 96px; }
  .options.game { grid-template-columns: 1fr; }
  .stats { gap: 8px; padding: 10px; border-radius: 22px; }
  .stat { padding: 14px 4px; }
  .stat span { font-size: 0.8rem; line-height: 1.25; }
  .brand { font-size: 1.15rem; }
  .brand span { display: none; }
  .meet { grid-template-columns: 1fr; text-align: center; }
  .meet-art .char { width: 170px; margin: 0 auto; }
  .actor .char { width: 118px; }
  .brief-steps { grid-template-columns: 1fr; }
  .slide { min-height: 0; }
  .welcome-duo .char { width: 110px; }
  .rung { width: calc(33% - 8px); transform: none; }
  .hero-bolt.compact { flex-direction: row; text-align: left; }
  .hero-bolt.compact .char { width: 72px; }
  .node-bolt { display: none; }
  .finish-duo .actor .char { width: 90px; }
  .medal { width: 110px; height: 110px; font-size: 3.4rem; }
  .certificate { aspect-ratio: auto; padding: 8px; }
  .cert-border { padding: 20px 12px; gap: 2px; }
  .cert-kicker { font-size: 0.7rem; letter-spacing: 2px; }
  .cert-foot { margin-top: 14px; }
  .cert-tools label { order: 3; flex-basis: 100%; }
  .cert-tools label input { flex: 1; }
  .grown-ups { padding: 6px 10px; font-size: 0.8rem; }
  .choose { grid-template-columns: 1fr; }
  .seg { padding: 8px 12px; font-size: 0.88rem; }
  .voice-row { grid-template-columns: 1fr auto; }
  .voice-row label { grid-column: 1 / -1; }
  .auto { padding: 6px 9px; }
  .card { min-height: 160px; padding: 14px; }
  .card .emoji { font-size: 2.2rem; }
  .card strong { font-size: 1rem; line-height: 1.25; }
  .card small { font-size: 0.8rem; line-height: 1.3; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confetti { display: none; }
}

/* Print: just the certificate, A4 landscape */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  :root { color-scheme: light; }
  html, body { background: #fff !important; }
  .no-print, .topbar { display: none !important; }
  main { max-width: none; padding: 0; }
  .certificate { box-shadow: none; width: 100%; height: 185mm; aspect-ratio: auto; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .certificate h1 { font-size: 34pt; }
  .cert-name { font-size: 40pt; }
  .cert-title { font-size: 22pt; }
}

/* Colouring-in certificate: black outlines on white, ready for crayons. */
.certificate.colouring { --accent: #1b1740; background: #fff; }
.certificate.colouring .cert-border { border: 4px solid #1b1740; }
.certificate.colouring .char * { fill: #fff !important; stroke: #1b1740 !important; stroke-width: 2.5px; }
.certificate.colouring .char { filter: none; }
.hollow { color: #fff !important; -webkit-text-stroke: 2px #1b1740; paint-order: stroke fill; font-weight: 900; letter-spacing: 1px; }
.certificate.colouring h1.hollow { font-size: clamp(2rem, 7vw, 3.6rem); }
.certificate.colouring .cert-name { border-bottom: 3px dashed #1b1740; }
.colour-duo { display: grid; grid-template-columns: 1fr 3fr 1fr; gap: 10px; align-items: center; margin-top: 8px; }
.colour-duo .char { width: 100%; max-width: 140px; justify-self: center; }
.colour-chart { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
.colour-spot { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.colour-spot .spot { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #1b1740; display: grid; place-items: center;
  font-weight: 900; font-size: 1.1rem; color: #1b1740; background: #fff; }
.colour-spot.done .spot { font-size: 1.9rem; color: #fff; -webkit-text-stroke: 1.5px #1b1740; }
.colour-spot:not(.done) .spot { border-style: dashed; opacity: .55; }
.colour-spot small { font-size: 0.62rem; line-height: 1.1; text-align: center; }
@media (max-width: 600px) { .colour-duo { grid-template-columns: 1fr 1fr; } .colour-chart { grid-column: 1 / -1; grid-row: 1; } }
@media print { .certificate.colouring { -webkit-print-color-adjust: economy; print-color-adjust: economy; } .colour-spot small { font-size: 8pt; } }
.colour-tip { font-weight: 800; color: #1b1740; margin-top: 6px !important; }

/* ---------- Real-life examples (mini phone screens with tappable hot spots) ---------- */
.example { margin: 14px auto 4px; max-width: 320px; text-align: center; }
.example figcaption { font-weight: 800; color: var(--muted); font-size: .9rem; margin-bottom: 6px; }
.ex-phone { --ex-ink: #1b1740; position: relative; text-align: left; color: var(--ex-ink); background: #f7f6ff; border: 8px solid #0b0920;
  border-radius: 30px; overflow: hidden; box-shadow: 0 14px 40px rgba(0,0,0,.45), 0 0 0 1px var(--edge-bright); font-size: .88rem; line-height: 1.3; }
.ex-phone.dark, .ex-phone.dark .ex-screen { background: linear-gradient(160deg, #2a2366, #0d0a2e); color: #fff; }
.ex-status { display: flex; justify-content: space-between; align-items: center; padding: 6px 14px 4px; font-size: .7rem; font-weight: 800; }
.ex-notch { width: 60px; height: 14px; background: #0b0920; border-radius: 0 0 10px 10px; margin-top: -6px; }
.ex-screen { position: relative; min-height: 230px; padding: 8px 10px 12px; }
.ex-phone.game .ex-screen { background: linear-gradient(#7dd3fc, #bbf7d0); }
.ex-game { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-weight: 800; background: rgba(255,255,255,.75); border-radius: 10px; padding: 5px 8px; flex-wrap: wrap; }
.ex-game-world { font-size: 1.9rem; text-align: center; margin-top: 70px; letter-spacing: 4px; }

/* Hot spots: glow until found */
/* A white ring inside a bright violet ring: stands out on white, orange, blue or dark screens. */
.example .hot { position: relative; cursor: pointer; border-radius: 8px; display: inline-block;
  outline: 3px solid #fff; outline-offset: 1px; box-shadow: 0 0 0 4px #7c3aed, 0 0 14px 4px rgba(124,58,237,.6);
  animation: hotglow 1.2s ease-in-out infinite; }
.example .hot.seen { outline-color: #fff; box-shadow: 0 0 0 4px #16a34a; animation: none; }
.example .hot.on { box-shadow: 0 0 0 4px #16a34a, 0 0 0 9px rgba(22,163,74,.35); }
.example .hot:focus-visible { outline: 3px solid #fff; box-shadow: 0 0 0 6px #1b1740; }
.example .hot.seen::after { content: '✓'; position: absolute; top: -9px; right: -9px; width: 18px; height: 18px; border-radius: 50%;
  background: #16a34a; color: #fff; border: 2px solid #fff; font: 900 11px/14px system-ui, sans-serif; text-align: center; z-index: 1; }
.example .hot.ex-adtag, .example .hot.ex-paid { position: absolute; }
@keyframes hotglow { 50% { box-shadow: 0 0 0 7px #a78bfa, 0 0 22px 8px rgba(124,58,237,.75); } }
.ex-hint { font-size: .85rem; font-weight: 700; color: var(--muted); margin: 8px 0 0; }
.ex-found { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--glass-strong); }
.example.all-found .ex-found { background: #22c55e; color: #052e16; }
.ex-tip { text-align: left; margin-top: 8px; padding: 10px 12px; border-radius: 14px; background: rgba(96,165,250,.15); border: 1px solid #60a5fa; font-size: 1rem; }
.ex-tip b { color: #93c5fd; }

/* Advert */
.ex-ad { position: absolute; top: 44px; right: 14px; bottom: 14px; left: 14px; background: linear-gradient(160deg, #fde047, #f97316 60%, #db2777); color: #fff; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: adpop .5s ease-out; }
@keyframes adpop { from { transform: scale(.6); opacity: 0; } }
.ex-ad-art { font-size: 2.4rem; animation: wiggle 1s ease-in-out infinite; }
@keyframes wiggle { 50% { transform: rotate(-6deg) scale(1.08); } }
.ex-ad-title { font-size: 1.35rem; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.ex-cta { background: #22c55e; color: #fff; font-weight: 900; padding: 8px 18px; border-radius: 999px; box-shadow: 0 4px 0 #15803d; font-size: 1rem; }
.ex-x { position: absolute; top: 6px; right: 8px; font-size: .7rem; color: rgba(255,255,255,.8); opacity: 0; animation: xin .4s 3s forwards; }
.ex-x .hot { padding: 1px 5px; }
@keyframes xin { to { opacity: 1; } }
.ex-adtag { position: absolute; top: 6px; left: 8px; font-size: .62rem; background: rgba(0,0,0,.35); padding: 1px 5px; }

/* Shop */
.ex-shop-head { font-weight: 900; font-size: 1.05rem; margin-bottom: 6px; }
.ex-shop-item { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; background: #fff; border-radius: 12px; padding: 8px; margin-bottom: 6px; }
.ex-shop-icon { font-size: 1.5rem; }
.ex-price { font-weight: 900; color: #b91c1c; padding: 0 3px; }
.ex-buy { background: #f59e0b; color: #fff; font-weight: 900; border-radius: 8px; padding: 4px 8px; font-size: .75rem; }

/* Messages */
.ex-msg-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; font-size: .8rem; color: #2563eb; border-bottom: 1px solid #e3e1f5; padding-bottom: 6px; }
.ex-msg-head b { color: var(--ex-ink); }
.ex-msgs { padding: 10px 2px; min-height: 150px; }
.ex-time { display: block; text-align: center; color: #888; font-size: .7rem; margin-bottom: 6px; }
.ex-bubble { max-width: 88%; padding: 8px 11px; border-radius: 16px; background: #e9e7f5; line-height: 1.45; }
.ex-bubble .hot { display: inline; }
.ex-msg-input { border: 1px solid #d6d3ee; border-radius: 999px; padding: 5px 12px; color: #999; font-size: .8rem; }

/* Game chat */
.ex-chip { font-size: .7rem; background: #fff; padding: 2px 6px; margin-left: 2px; }
.ex-chat { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.ex-chat-line { background: rgba(255,255,255,.85); border-radius: 10px; padding: 6px 8px; }
.ex-chat-line b { color: #7c3aed; margin-right: 4px; }
.ex-chat-line.me { background: #dbeafe; align-self: flex-end; }
.ex-chat-line .hot, .ex-result .hot, .ex-comment .hot:not(:last-child) { display: inline; }

/* Browser + search */
.ex-url { display: flex; gap: 6px; align-items: center; background: #e9e7f5; border-radius: 10px; padding: 6px 9px; font-size: .82rem; overflow: hidden; white-space: nowrap; }
.ex-page { padding: 18px 6px; text-align: center; }
.ex-page b { font-size: 1.2rem; display: block; margin-bottom: 8px; }
.ex-results { margin-top: 8px; }
.ex-result { padding: 7px 4px; border-bottom: 1px solid #e3e1f5; }
.ex-result small { color: #15803d; font-size: .7rem; }
.ex-result b { display: block; color: #1d4ed8; }
.ex-result p { margin: 2px 0 0; font-size: .78rem; color: #555; }

/* Video */
.ex-video { position: relative; height: 120px; border-radius: 12px; background: linear-gradient(135deg, #f472b6, #8b5cf6); display: grid; place-items: center; }
.ex-play { font-size: 2rem; color: #fff; }
.ex-paid { position: absolute; left: 8px; bottom: 8px; font-size: .68rem; background: rgba(0,0,0,.55); color: #fff; padding: 2px 6px; }
.ex-vid-info { padding: 6px 2px; }
.ex-vid-info small { display: block; color: #777; }
.ex-upnext { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; background: #ece9ff; border-radius: 12px; padding: 7px; }
.ex-upnext small { display: block; color: #555; margin-top: 3px; }
.ex-count { display: grid; place-items: center; width: 62px; height: 46px; border-radius: 8px; background: #1b1740; color: #fff; font-size: .68rem; font-weight: 800; text-align: center; }

/* Updates, alerts, settings */
.ex-notify { display: flex; gap: 8px; align-items: center; background: #fff; border-radius: 14px; padding: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.12); font-size: 1.3rem; }
.ex-notify b, .ex-notify small { display: block; font-size: .85rem; }
.ex-settings { margin-top: 12px; background: #fff; border-radius: 14px; padding: 12px; text-align: center; }
.ex-settings p { margin: 6px 0 10px; font-size: .8rem; }
.ex-btn { display: inline-block; background: #2563eb; color: #fff; font-weight: 800; padding: 6px 14px; border-radius: 999px; }
.ex-btn.ghost { background: #fff; color: #2563eb; border: 2px solid #2563eb; }
.ex-fake { margin-top: 10px; background: #fee2e2; border: 3px solid #dc2626; border-radius: 12px; padding: 12px; text-align: center; color: #7f1d1d; animation: shake .5s 2; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.ex-fake b { font-size: 1.05rem; }
.ex-fake .ex-cta { background: #dc2626; box-shadow: 0 4px 0 #7f1d1d; }

/* App store */
.ex-app-head { display: flex; gap: 10px; align-items: flex-start; }
.ex-app-icon { font-size: 2.4rem; background: linear-gradient(135deg, #a5f3fc, #c4b5fd); border-radius: 16px; width: 64px; height: 64px; display: grid; place-items: center; flex-shrink: 0; }
.ex-app-head small { display: block; color: #777; }
.ex-get { display: inline-block; margin: 4px 6px 0 0; background: #2563eb; color: #fff; font-weight: 900; border-radius: 999px; padding: 2px 14px; font-size: .8rem; }
.ex-iap { font-size: .65rem; color: #666; padding: 1px 3px; }
.ex-store { display: inline-block; margin-top: 10px; font-size: .78rem; font-weight: 700; }
.ex-sheet { margin-top: 12px; background: #fff; border-radius: 16px; padding: 12px; text-align: center; box-shadow: 0 -4px 16px rgba(0,0,0,.12); }
.ex-sheet p { margin: 4px 0 8px; font-size: .8rem; }
.ex-sheet.big { margin-top: 30px; text-align: left; }
.ex-sheet ul { margin: 8px 0; padding-left: 18px; display: grid; gap: 5px; }
.ex-row { display: flex; gap: 8px; justify-content: center; margin: 8px 0; }

/* Lock screen, login, code */
.ex-lock { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 6px; }
.ex-clock { font-size: 2.2rem; font-weight: 300; }
.ex-dots { letter-spacing: 3px; padding: 2px 6px; }
.ex-pad { display: grid; grid-template-columns: repeat(3, 40px); gap: 6px; }
.ex-pad span { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.14); display: grid; place-items: center; font-weight: 700; }
.ex-pad span:empty { background: none; }
.ex-login { display: flex; flex-direction: column; gap: 8px; padding: 8px 4px; }
.ex-login > b { font-size: 1.1rem; text-align: center; }
.ex-login label { display: flex; flex-direction: column; gap: 3px; font-size: .75rem; font-weight: 700; color: #555; }
.ex-field { background: #fff; border: 1px solid #d6d3ee; border-radius: 10px; padding: 7px 9px; color: var(--ex-ink); font-size: .9rem; overflow-wrap: anywhere; }
.ex-meter { display: block; width: 100%; height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.ex-meter i { display: block; height: 100%; width: 20%; background: #ef4444; }
.ex-meter.strong i { width: 100%; background: #22c55e; }
.ex-login .hot:last-child { display: block; padding: 4px; }
.ex-code { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.ex-code span { height: 36px; border: 2px solid #c4b5fd; border-radius: 8px; background: #fff; }

/* Comments, profile */
.ex-post { background: #fff; border-radius: 12px; padding: 10px; text-align: center; }
.ex-post-art { display: block; font-size: 2.2rem; }
.ex-comments { margin-top: 8px; display: grid; gap: 6px; }
.ex-comment { display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; align-items: center; background: #fff; border-radius: 10px; padding: 6px 8px; border-left: 4px solid #22c55e; }
.ex-comment.unkind { border-left-color: #ef4444; }
.ex-comment b { grid-column: 1; font-size: .75rem; color: #7c3aed; }
.ex-comment > span:not(.hot) { grid-column: 1; }
.ex-comment > .hot:last-child { grid-column: 2; grid-row: 1 / span 2; }
.ex-profile { background: rgba(255,255,255,.85); border-radius: 16px; padding: 14px; margin-top: 10px; text-align: center; }
.ex-avatar { display: block; font-size: 2.6rem; }
.ex-profile > b { display: inline-block; font-size: 1.1rem; margin: 6px 0; }
.ex-fields { display: grid; gap: 4px; font-size: .8rem; text-align: left; }
.ex-fields i { color: #999; }

/* Story screens with an example: smaller characters so it all fits */
.stage.with-ex .actor .char { width: 92px; }
.learn .example { margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { .hot, .ex-ad, .ex-ad-art, .ex-fake { animation: none; } .ex-x { opacity: 1; animation: none; } }

/* Links in fine print */
.fine a, .parents a:not(.btn) { color: #d8ccff; }

/* Narrow screens: three programmes stack; the Teachers link moves into the pages */
@media (max-width: 1000px) { .choose.four { grid-template-columns: 1fr 1fr; max-width: 720px; } }
@media (max-width: 600px) { .choose.four { grid-template-columns: 1fr; max-width: 520px; } }
@media (max-width: 640px) { .seg-word { display: none; } .seg { padding: 8px 10px; } }
@media (max-width: 520px) { .teachers-link, .code-link { display: none; } }
@media (min-width: 521px) and (max-width: 640px) { .code-link { display: none; } }

/* Tick boxes in settings */
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--magenta); flex: none; }

/* For teachers */
.t-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 8px; }
.t-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 18px; background: var(--glass); border: 1px solid var(--edge); }
.t-card span { color: var(--muted); font-size: 0.95rem; }
.t-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.t-table td { padding: 10px 6px; border-top: 1px solid var(--edge); vertical-align: middle; }
.t-table td:first-child { width: 2em; color: var(--muted); font-weight: 800; }
.t-table td:last-child { text-align: right; white-space: nowrap; }
@media (max-width: 700px) { .t-cards { grid-template-columns: 1fr; } }

/* Lesson sheet: readable on screen, prints on A4 portrait */
.lesson { background: #fff; color: #1d1747; border-radius: 20px; padding: 28px; margin: 12px 0 32px; }
.lesson .muted { color: #5d5791; }
.lesson h1 { margin: 2px 0 4px; font-size: 1.9rem; }
.lesson h2 { font-size: 1.15rem; margin: 18px 0 6px; color: #3b2a99; }
.lesson .kicker { color: #6d5bd0; margin: 0; font-size: 0.9rem; letter-spacing: 0; text-transform: none; }
.lesson-head { display: flex; gap: 16px; align-items: center; justify-content: space-between; border-bottom: 3px solid #ece8ff; padding-bottom: 12px; }
.lesson-art .char { width: 90px; }
.keywords { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 6px 14px; margin: 0; }
.keywords dt { font-weight: 800; }
.keywords dd { margin: 0; }
.sequence li, .answers li { margin-bottom: 8px; }
.lesson-note { background: #fff6d6; border: 1px solid #f1d27a; border-radius: 12px; padding: 10px 14px; margin-top: 16px; }
@media (max-width: 560px) { .lesson { padding: 18px; } .keywords { grid-template-columns: 1fr; } .lesson-art { display: none; } }
@page lesson { size: A4 portrait; margin: 14mm; }
@media print {
  .lesson { page: lesson; padding: 0; margin: 0; border-radius: 0; font-size: 10.5pt; }
  .lesson section { break-inside: avoid; }
  .lesson h1 { font-size: 20pt; }
}

/* Privacy */
.privacy .lead { font-size: 1.15rem; }

/* ---------- Code Lab ---------- */
.zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin: 18px 0; }
.zone { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 22px; text-decoration: none; color: var(--ink);
  background: var(--glass); border: 1px solid var(--edge-bright); transition: transform .15s, box-shadow .2s; }
.zone:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(124, 92, 255, .3); }
.zone.rec { border-color: var(--magenta); background: linear-gradient(160deg, rgba(217,75,214,.22), rgba(255,255,255,.04) 60%); }
.zone-emoji { font-size: 2.2rem; }
.zone b { font-size: 1.25rem; }
.zone-idea { color: #d8ccff; font-weight: 700; }
.zone-meta, .zone-stars { color: var(--muted); font-size: .9rem; }
.zone .tag { align-self: flex-start; margin-top: 6px; }
.guide-card { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 20px; text-decoration: none; color: var(--ink);
  background: rgba(255, 210, 63, .1); border: 1px solid rgba(255, 210, 63, .35); }
.guide-card > span { font-size: 2rem; }
.guide-card small { display: block; color: var(--muted); font-size: .95rem; }

.lab-learn { color: #e4defc; margin: 10px 0 14px; }
.lab-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
@media (max-width: 820px) { .lab-grid { grid-template-columns: 1fr; } }
.board { display: grid; grid-template-columns: repeat(var(--cols, 5), var(--cell, 56px)); gap: 4px; justify-content: center;
  padding: 10px; border-radius: 18px; background: rgba(0, 0, 0, .28); border: 1px solid var(--edge); width: max-content; max-width: 100%; margin: 0 auto; }
.cell { width: var(--cell, 56px); height: var(--cell, 56px); border-radius: 10px; display: grid; place-items: center; position: relative;
  background: rgba(255, 255, 255, .08); font-size: calc(var(--cell, 56px) * .5); }
.cell.wall { background: rgba(251, 113, 133, .16); }
.cell.goal { background: rgba(74, 222, 128, .18); box-shadow: inset 0 0 0 2px rgba(74, 222, 128, .5); }
.cell .bot .char { width: calc(var(--cell, 56px) * .95); filter: none; }
.cell.here { background: rgba(124, 92, 255, .3); }
.bot { display: grid; place-items: center; animation: pop .25s ease-out; }
.bump-r { animation: bumpR .35s; } .bump-l { animation: bumpL .35s; } .bump-u { animation: bumpU .35s; } .bump-d { animation: bumpD .35s; }
@keyframes pop { from { transform: scale(.85); } to { transform: scale(1); } }
@keyframes bumpR { 50% { transform: translateX(22%); } } @keyframes bumpL { 50% { transform: translateX(-22%); } }
@keyframes bumpU { 50% { transform: translateY(-22%); } } @keyframes bumpD { 50% { transform: translateY(22%); } }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; color: var(--muted); font-size: .85rem; margin: 8px 0; }

.palette { display: flex; flex-wrap: wrap; gap: 8px; }
.pal { font: inherit; font-weight: 800; color: #fff; cursor: pointer; border: 0; border-radius: 14px; padding: 10px 14px; min-height: 52px;
  background: linear-gradient(135deg, #3b82f6, #2563eb); box-shadow: 0 4px 0 #1e3a8a; }
.pal.mv { font-size: 1.5rem; min-width: 56px; }
.pal.rep { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 4px 0 #92400e; }
.pal.if { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 4px 0 #065f46; }
.pal.fn { background: linear-gradient(135deg, #d946ef, #a21caf); box-shadow: 0 4px 0 #701a75; }
.pal:active { transform: translateY(3px); box-shadow: none; }
.adding { color: var(--muted); font-size: .9rem; margin: 10px 0 6px; }
.link { font: inherit; color: #d8ccff; background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 0; }
.prog { border-radius: 16px; padding: 10px; background: rgba(0, 0, 0, .25); border: 2px dashed var(--edge); margin-bottom: 10px; cursor: pointer; }
.prog.target, .blk.rep.target > .rep-body { border-color: #ffd23f; border-style: solid; }
.prog-head { display: flex; justify-content: space-between; color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.prog-head b { color: var(--ink); }
.prog-head .over { color: var(--bad); font-weight: 800; }
.blocks, .rep-body { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.empty { color: var(--muted); font-size: .9rem; font-style: italic; padding: 6px; }
.blk { position: relative; display: inline-flex; align-items: center; gap: 6px; border-radius: 12px; padding: 6px 26px 6px 10px; font-weight: 800;
  background: #2563eb; color: #fff; min-height: 44px; transition: box-shadow .15s, transform .15s; }
.blk.mv span { font-size: 1.4rem; }
.blk.if { background: #059669; flex-wrap: wrap; }
.blk.fn { background: #a21caf; }
.blk.rep { background: #d97706; flex-direction: column; align-items: stretch; padding: 6px 8px 8px; width: 100%; }
.rep-head { display: flex; align-items: center; gap: 8px; padding-right: 20px; }
.rep-body { min-height: 48px; padding: 6px; border-radius: 10px; background: rgba(0, 0, 0, .22); border: 2px dashed rgba(255, 255, 255, .3); }
.blk.now { box-shadow: 0 0 0 3px #ffd23f, 0 0 18px #ffd23f; transform: scale(1.06); }
.blk .x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, .3); color: #fff; font-size: .7rem; line-height: 20px; padding: 0; }
.pick { font: inherit; font-weight: 800; color: #111; background: #fff; border: 0; border-radius: 8px; padding: 2px 8px; cursor: pointer; min-height: 30px; }
.runbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; }
.pycode summary { cursor: pointer; color: #d8ccff; font-weight: 700; }
.pycode pre, .realcode { margin: 8px 0 0; padding: 14px; border-radius: 14px; background: #0b0920; border: 1px solid var(--edge); overflow-x: auto;
  font: 600 0.95rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #c7f9d4; }
.realcode { font-size: 1.1rem; margin: 6px 0 16px; }
.lab.real .options { max-width: 640px; }

/* Coding guide */
.stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.stage { padding: 16px; border-radius: 18px; background: var(--glass); border: 1px solid var(--edge); }
.stage-head { display: flex; gap: 10px; align-items: center; }
.stage-head > span { font-size: 1.8rem; }
.stage-head small { display: block; color: var(--muted); }
.stage p { color: #e4defc; }
.chip { display: inline-block; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin: 0 6px 6px 0;
  background: rgba(124, 92, 255, .25); color: #e9e3ff; }
.words .word summary .muted { display: block; font-size: .9rem; margin-left: 2em; }

/* Code Lab help */
.blk.bug { box-shadow: 0 0 0 3px var(--bad), 0 0 16px var(--bad); animation: wobble .5s 2; }
@keyframes wobble { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
.scene.is-bug .bubble { border-color: rgba(251, 113, 133, .6); }
.trace summary, .how summary { cursor: pointer; color: #d8ccff; font-weight: 700; margin: 6px 0; }
.trace-body { max-height: 220px; overflow-y: auto; padding: 8px 12px; border-radius: 12px; background: rgba(0, 0, 0, .25); border: 1px solid var(--edge); }
.trace-list { margin: 0; padding-left: 1.6em; font-size: .95rem; }
.trace-list li { margin: 2px 0; }
.trace-list li.bad { color: #fecdd3; font-weight: 800; }
.walk { margin: 6px 0 0; padding-left: 1.4em; }
.realcode .ln { display: inline-block; width: 1.8em; color: #6b6894; user-select: none; }
.realcode.small { font-size: .85rem; padding: 8px 10px; }
.small { font-size: .9rem; }
.answers-page h2 small { color: var(--muted); }
@media print { .answers-page { color: #111; } .answers-page .realcode { background: #f4f4f8; color: #111; } }

/* After a wrong answer, the right one glows so nobody is stuck */
.opt.glow { box-shadow: 0 0 0 3px #4ade80, 0 0 22px rgba(74, 222, 128, .7); animation: glowPulse 1.2s ease-in-out infinite; }
@keyframes glowPulse { 50% { box-shadow: 0 0 0 3px #4ade80, 0 0 6px rgba(74, 222, 128, .3); } }
@media (prefers-reduced-motion: reduce) { .opt.glow, .blk.bug { animation: none; } }

/* ---------- Information pages (built for search engines) ---------- */
.skip { position: absolute; left: -999px; top: 8px; z-index: 10; background: #fff; color: #111; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.static .top-actions a { text-decoration: none; }
.static .top-actions .track-pill { padding: 6px 14px; }
.static .top-actions a.on { border-color: #ffd23f; }
.static-main { padding-top: 16px; }
.static-main h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); line-height: 1.1; margin: 8px 0 12px; }
.static-main h2 { margin-top: 28px; }
.static-hero { text-align: center; padding: 18px 0 8px; }
.static-hero .lead { max-width: 720px; margin-left: auto; margin-right: auto; }
.duo { display: flex; justify-content: center; gap: 8px; }
.duo .char { width: 120px; }
.cta-row { text-align: center; margin: 18px 0; }
.seo-home .choose { margin-top: 18px; }
.seo-home a.choice { text-decoration: none; }
.mission-list { padding-left: 1.2em; }
.mission-list > li { margin: 0 0 12px; padding: 14px 16px; border-radius: 16px; background: var(--glass); border: 1px solid var(--edge); }
.mission-list h3 { margin: 0 0 2px; }
.mission-list p { margin: 6px 0; }
.features { padding-left: 1.2em; }
.features li { margin: 6px 0; }
.faq { border-radius: 14px; padding: 10px 14px; margin: 8px 0; background: var(--glass); border: 1px solid var(--edge); }
.faq summary { cursor: pointer; font-weight: 800; }
.glossary dt { font-weight: 800; font-size: 1.1rem; margin-top: 14px; }
.glossary dd { margin: 4px 0 0 1.6em; }
.glossary dd p { margin: 4px 0; }
.site-foot { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--edge); }
.site-foot a { color: #d8ccff; }
.static-main a:not(.btn):not(.choice) { color: #d8ccff; }
.legal h2 { margin-top: 22px; }

/* Privacy promise */
.device-note { margin: 18px auto 0; max-width: 640px; padding: 10px 14px; border-radius: 14px; text-align: center;
  background: rgba(74, 222, 128, .1); border: 1px solid rgba(74, 222, 128, .35); color: #dcfce7; font-size: .95rem; }
.device-note a { color: #bbf7d0; }
.device-promise { padding: 16px 18px; border-radius: 18px; background: rgba(74, 222, 128, .1); border: 1px solid rgba(74, 222, 128, .35); margin: 14px 0; }
.device-promise .big { font-size: 1.25rem; font-weight: 800; margin: 0 0 6px; }

.notice { padding: 12px 14px; border-radius: 14px; background: rgba(255, 210, 63, .08); border: 1px solid rgba(255, 210, 63, .3); }
.school-note { margin: 16px 0 20px; }
.school-note p { margin: 0 0 8px; }
.school-note p:last-child { margin-bottom: 0; }

/* "You've still got something to tap" nudge */
.nudge-msg { margin: 12px 0 0; padding: 12px 14px; border-radius: 16px; background: #fde047; color: #1b1740; font-weight: 700; font-size: 1.05rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.35); animation: nudgein .35s ease-out; }
@keyframes nudgein { from { transform: translateY(8px); opacity: 0; } }
.example.nudge .hot:not(.seen) { animation: hotglow 1.2s ease-in-out infinite, nudgewiggle .5s ease-in-out 3; }
@keyframes nudgewiggle { 25% { transform: rotate(-4deg) scale(1.08); } 75% { transform: rotate(4deg) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .nudge-msg, .example.nudge .hot { animation: none; } }
.example.nudge .ex-x { opacity: 1; animation: none; }
.email-link { white-space: nowrap; }

/* Contact email: shown after a quick Turnstile robot check (js/email.js) */
.email-check { width: min(92vw, 380px); padding: 22px; border: 1px solid var(--edge-bright); border-radius: var(--radius);
  background: var(--bg-1); color: var(--ink); text-align: center; }
.email-check::backdrop { background: rgba(13, 10, 46, 0.7); }
.email-check h2 { margin-top: 0; }
.email-check-widget { display: flex; justify-content: center; min-height: 70px; margin: 12px 0; }
.email-address { display: inline-block; margin: 6px 0 16px; font-weight: 800; font-size: 1.1rem; word-break: break-all; }

/* Glossary */
.glossary abbr { text-decoration: none; }
.glossary dt .muted { font-weight: 600; font-size: .95rem; }
.glossary dt { scroll-margin-top: 80px; }
.glossary-filter { margin: 12px 0 4px; }
.glossary-filter label { font-weight: 800; margin-right: 6px; }
.glossary-filter input { font: inherit; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--edge); background: var(--glass); color: inherit; width: min(100%, 320px); }

/* Browser's own warning page, sign-out prompt and security app */
.ex-warn { margin-top: 10px; background: #b91c1c; color: #fff; border-radius: 12px; padding: 16px 12px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.ex-warn-icon { font-size: 2rem; }
.ex-warn b { font-size: 1.05rem; }
.ex-warn p { margin: 0; font-size: .8rem; }
.ex-warn .ex-btn { background: #fff; color: #b91c1c; }
.ex-warn small { font-size: .72rem; opacity: .85; text-decoration: underline; }
.ex-out { display: inline-block; margin-top: 4px; font-weight: 800; color: #b91c1c; border: 2px solid #b91c1c; border-radius: 999px; padding: 5px 14px; background: #fff; }
.ex-login .ex-sheet { position: static; margin: 4px 0; }
.ex-scan { text-align: left; }
.ex-scan p { margin: 8px 0; font-size: .85rem; }

/* Change name */
.name-edit { margin-left: 8px; font: inherit; font-size: .8rem; font-weight: 700; color: #d8ccff; background: none; border: 1px solid currentColor; border-radius: 999px; padding: 2px 10px; cursor: pointer; vertical-align: middle; }
.name-edit:hover, .name-edit:focus-visible { background: rgba(216, 204, 255, .15); }
.name-form small.muted { display: block; margin-top: 6px; }
.name-form .row { flex-wrap: wrap; }
.name-form .row input { flex: 1 1 150px; min-width: 0; }
