/* Astra Bleeps: a warm handheld-console look. Cream body, bold outlines, chunky buttons,
   Game Boy green LCD panels, one colour per robot. */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@400;500;600;700;800&family=Press+Start+2P&display=swap');

:root {
  --bg: #ece6da;
  --bg-2: #e2dbcc;
  --bg-3: #d8d0bf;
  --card: #fbf8f2;
  --card-2: #f4efe5;
  --ink: #1b1b24;
  --ink-2: #4a4a58;
  --ink-3: #87849a;
  --line: #d3cbbb;
  --edge: #1b1b24;
  --lcd: #9bbc0f;
  --lcd-2: #8bac0f;
  --lcd-dark: #306230;
  --lcd-ink: #0f380f;
  --bezel: #4b4b5c;
  --a: #b0246a;            /* the console's A button: main actions */
  --a-dark: #7c1449;
  --a-soft: #f7d9e8;
  --go: #1fa35c;
  --go-dark: #12733f;
  --bleep: #ff4f45; --bleep-dark: #c4271f; --bleep-soft: #ffe1de;
  --hoot: #3b82f6; --hoot-dark: #1d56c9; --hoot-soft: #dde9ff;
  --buzz: #f5b400; --buzz-dark: #b07e00; --buzz-soft: #fff1c7;
  --fizz: #8b5cf6; --fizz-dark: #6232d9; --fizz-soft: #ece4ff;
  --crew: #14b8a6; --crew-dark: #0b7f73; --crew-soft: #d5f5f1;
  --cmd: #f5b400;          /* Commander */
  --cop: #e2459a;          /* Co-pilot */
  --eng: #3b82f6;          /* Sound Engineer */
  --radius: 22px;
  --font: 'Lexend', system-ui, sans-serif;
  --pixel: 'Press Start 2P', ui-monospace, monospace;
  --pop: 4px 5px 0 var(--edge);
  --pop-sm: 3px 3px 0 var(--edge);
  --top: 76px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 22px; line-height: 1.35;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
body { overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
input, textarea { user-select: text; -webkit-user-select: text; font-family: var(--font); }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(36px, 4vw, 54px); line-height: 1.05; }
h2 { font-size: clamp(28px, 2.8vw, 38px); line-height: 1.1; }
h3 { font-size: 25px; line-height: 1.2; }
p { margin: 0 0 0.5em; }
button { font-family: var(--font); color: inherit; }
svg { display: block; }
.pixel { font-family: var(--pixel); letter-spacing: 0; font-weight: 400; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap { gap: 16px; }
.gap-s { gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.center { justify-content: center; }
.lead { font-size: 26px; line-height: 1.35; }
.hidden { display: none !important; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.scroll { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 64px; padding: 0 26px; border-radius: 18px; border: 3px solid var(--edge);
  background: var(--card); color: var(--ink); font-size: 22px; font-weight: 700; cursor: pointer;
  box-shadow: 0 5px 0 var(--edge); transform: translateY(0); transition: transform .06s, box-shadow .06s, background .15s;
  white-space: nowrap; text-decoration: none; touch-action: manipulation;
}
.btn svg { width: 28px; height: 28px; flex: none; }
.btn:active, .btn.press { transform: translateY(4px); box-shadow: 0 1px 0 var(--edge); }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: 0 5px 0 var(--edge); }
.btn.primary { background: var(--a); color: #fff; }
.btn.go { background: var(--go); color: #fff; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--line); }
.btn.ghost:active { transform: translateY(2px); }
.btn.big { min-height: 80px; font-size: 27px; padding: 0 34px; border-radius: 22px; }
.btn.small { min-height: 52px; font-size: 19px; padding: 0 18px; border-radius: 14px; }
.btn.small svg { width: 24px; height: 24px; }
.btn.round { width: 64px; padding: 0; border-radius: 50%; }
.btn.round.small { width: 52px; }
.btn.on { background: var(--ink); color: #fff; }
.btn.glow { animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 5px 0 var(--edge), 0 0 0 0 rgba(176, 36, 106, .45); } 50% { box-shadow: 0 5px 0 var(--edge), 0 0 0 12px rgba(176, 36, 106, 0); } }

.speak-btn {
  width: 58px; height: 58px; flex: none; border-radius: 50%; border: 3px solid var(--edge); background: var(--card);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 0 var(--edge); color: var(--ink);
}
.speak-btn svg { width: 28px; height: 28px; }
.speak-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.speak-btn.on { background: var(--a); color: #fff; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.07); } }

/* ---------------- Cards and panels ---------------- */
.card { background: var(--card); border: 3px solid var(--edge); border-radius: var(--radius); box-shadow: var(--pop); padding: 24px; }
.card.flat { box-shadow: none; }
.panel { background: var(--bg-2); border-radius: var(--radius); padding: 18px; }
.eyebrow { font-family: var(--pixel); font-size: 13px; color: var(--ink-2); letter-spacing: .5px; text-transform: uppercase; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; border: 2.5px solid var(--edge); background: var(--card); font-weight: 700; font-size: 18px; }
.chip svg { width: 22px; height: 22px; }
.who { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 999px; border: 3px solid var(--edge); font-weight: 800; font-size: 22px; background: var(--card); }
.who::before { content: ''; width: 14px; height: 14px; border-radius: 4px; background: currentColor; }
.who.commander { background: #fff1c7; color: var(--ink); }
.who.commander::before { background: var(--cmd); }
.who.copilot { background: #fde0ef; color: var(--ink); }
.who.copilot::before { background: var(--cop); }
.who.engineer { background: #dde9ff; color: var(--ink); }
.who.engineer::before { background: var(--eng); }
.who.everyone { background: #e6f6ee; }
.who.everyone::before { background: var(--go); }

.lcd {
  background: var(--lcd); border-radius: 14px; border: 10px solid var(--bezel); box-shadow: inset 0 0 0 2px rgba(0,0,0,.15);
  color: var(--lcd-ink); font-family: var(--pixel); image-rendering: pixelated;
}
.lcdwave { width: 100%; height: auto; }

/* ---------------- Top bar ---------------- */
.topbar {
  height: var(--top); flex: none; display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: var(--bg); border-bottom: 3px solid var(--edge); position: relative; z-index: 5;
}
.topbar .title { font-weight: 800; font-size: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo .mark { width: 46px; height: 46px; }
.logo .word { font-family: var(--pixel); font-size: 18px; line-height: 1.25; }
.logo .word span { color: var(--a); }

/* ---------------- Toast and modal ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 100;
  background: var(--ink); color: #fff; padding: 16px 28px; border-radius: 18px; font-weight: 700; font-size: 22px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: toastIn .25s ease-out; max-width: 90vw; text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }
.modal-back { position: fixed; inset: 0; background: rgba(27, 27, 36, .45); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: var(--card); border: 3px solid var(--edge); border-radius: 26px; box-shadow: 6px 8px 0 var(--edge); padding: 26px; width: min(720px, 100%); max-height: 92vh; overflow: auto; }
.modal.wide { width: min(1100px, 100%); }
.modal { --notch: var(--card); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }

/* ---------------- Bots ---------------- */
.bot { position: relative; display: inline-flex; flex-direction: column; align-items: center; cursor: pointer; touch-action: manipulation; }
.bot .botsvg { width: 100%; height: auto; overflow: visible; }
.bot .body { transform-origin: 60px 120px; transform-box: view-box; }
.bot.sing .body { animation: hop .32s ease-out 2; }
.bot.sing .mouth { animation: talk .12s steps(2) infinite; }
.bot.sing .antenna { animation: wiggle .2s ease-in-out infinite; transform-origin: 60px 30px; transform-box: view-box; }
.bot .eyes { animation: blink 5s infinite; transform-origin: center 50px; transform-box: view-box; }
.bot .zzz text { animation: zz 2s ease-in-out infinite; }
.bot .zzz text:nth-child(2) { animation-delay: .5s; }
.bot .name { font-weight: 800; font-size: 22px; margin-top: 4px; }
@keyframes hop { 0% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(-14px) scale(.96, 1.05); } 70% { transform: translateY(0) scale(1.05, .95); } 100% { transform: none; } }
@keyframes talk { 0% { transform: scaleY(1.7); } 100% { transform: scaleY(.6); } }
@keyframes wiggle { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes zz { 0%, 100% { opacity: .2; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .bot.sing .body, .bot.sing .mouth, .bot .eyes { animation: none !important; } }

.sticker { width: 100%; height: 100%; }

/* ---------------- Crew setup ---------------- */
.setup { padding: 20px; }
.setup .card { margin: auto; width: min(1080px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 22px 36px; }
.setup h1 { font-size: clamp(32px, 3.6vw, 46px); }
.setup .field input { min-height: 58px; }
.setup .hero { display: flex; gap: 6px; align-items: flex-end; }
.setup .hero .bot { width: 25%; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 800; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.field label small { font-weight: 500; color: var(--ink-2); font-size: 17px; }
.field input {
  min-height: 64px; border-radius: 16px; border: 3px solid var(--edge); padding: 0 18px; font-size: 26px; font-weight: 700; background: #fff; color: var(--ink);
}
.field input:focus { outline: 4px solid var(--a-soft); }
.rules { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.rules li { display: flex; gap: 14px; align-items: flex-start; font-size: 21px; }
.rules .n { flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--ink); color: #fff; font-family: var(--pixel); font-size: 14px; display: flex; align-items: center; justify-content: center; }

/* ---------------- Home: Sound Station ---------------- */
.home { padding: 22px 26px 40px; display: flex; flex-direction: column; gap: 26px; }
.home-top { display: grid; grid-template-columns: 1.35fr 1fr; gap: 22px; }
.stage {
  background: linear-gradient(#2a2440, #1b1b2e); border: 3px solid var(--edge); border-radius: 26px; box-shadow: var(--pop);
  padding: 18px 20px 0; position: relative; overflow: hidden; min-height: 300px; display: flex; flex-direction: column;
}
.stage .stars { position: absolute; inset: 0; pointer-events: none; }
.stage .stagehead { display: flex; align-items: center; justify-content: space-between; color: #fff; position: relative; z-index: 1; }
.stage .stagehead .pixel { font-size: 15px; color: #ffd76a; }
.stage .bots { flex: 1; display: flex; align-items: flex-end; justify-content: space-around; gap: 4px; position: relative; z-index: 1; }
.stage .bots .bot { width: 19%; max-width: 150px; }
.stage .bots .bot .name { color: #fff; font-size: 20px; margin: 2px 0 6px; }
.stage .floor { height: 22px; background: repeating-linear-gradient(90deg, #3a3358 0 22px, #332d4f 22px 44px); margin: 0 -20px; border-top: 3px solid #120f1f; position: relative; z-index: 1; }

.cart {
  position: relative; background: #8d8a9c; border: 3px solid var(--edge); border-radius: 18px 18px 10px 10px; box-shadow: var(--pop);
  padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 12px; color: #fff;
}
.cart::before { content: ''; position: absolute; right: -3px; top: -3px; width: 34px; height: 34px; background: var(--bg); border-left: 3px solid var(--edge); border-bottom: 3px solid var(--edge); border-bottom-left-radius: 8px; }
.cart .label { background: var(--card); color: var(--ink); border: 3px solid var(--edge); border-radius: 12px; padding: 12px 14px; display: flex; gap: 14px; align-items: center; }
.cart .label .art { width: 120px; height: 72px; border-radius: 8px; overflow: hidden; border: 3px solid var(--edge); flex: none; background: #1b1b2e; }
.cart .label h3 { font-size: 26px; }
.cart .slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot { background: #6f6c80; border: 2.5px solid var(--edge); border-radius: 10px; padding: 6px 4px; text-align: center; font-size: 15px; font-weight: 700; color: #e9e6f2; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.slot .led { width: 14px; height: 14px; border-radius: 4px; background: #4a475a; border: 2px solid var(--edge); }
.slot.full { background: var(--card); color: var(--ink); }
.slot.full .led { background: var(--lcd); box-shadow: 0 0 8px var(--lcd); }
.cart .ridges { display: flex; gap: 6px; justify-content: center; }
.cart .ridges i { width: 18px; height: 6px; background: #6f6c80; border-radius: 3px; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-title h2 { font-size: 30px; }
.missions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.mcard {
  position: relative; border: 3px solid var(--edge); border-radius: 18px 18px 10px 10px; box-shadow: var(--pop); padding: 12px 12px 12px; cursor: pointer;
  display: flex; flex-direction: column; gap: 10px; text-align: left; min-height: 210px; color: var(--ink);
}
.mcard:active { transform: translateY(3px); box-shadow: 1px 2px 0 var(--edge); }
.mcard .num { position: absolute; top: 10px; left: 12px; font-family: var(--pixel); font-size: 13px; background: var(--ink); color: #fff; padding: 6px 7px; border-radius: 6px; z-index: 2; }
.mcard .pic { height: 108px; border-radius: 10px; border: 3px solid var(--edge); background: var(--card); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.mcard .pic svg.sticker { width: 84px; height: 84px; }
.mcard .pic .botsvg { height: 104px; width: auto; }
.mcard h3 { font-size: 22px; line-height: 1.15; }
.mcard .tag { font-size: 16px; color: var(--ink-2); font-weight: 600; }
.mcard .done { position: absolute; top: 8px; right: 8px; width: 46px; height: 46px; z-index: 2; }
.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tool {
  border: 3px solid var(--edge); border-radius: 20px; box-shadow: var(--pop); background: var(--card); padding: 14px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 14px; text-align: left; min-height: 96px; color: var(--ink);
}
.tool:active { transform: translateY(3px); box-shadow: 1px 2px 0 var(--edge); }
.tool .ic { width: 66px; height: 66px; flex: none; border-radius: 16px; border: 3px solid var(--edge); display: flex; align-items: center; justify-content: center; }
.tool .ic svg { width: 40px; height: 40px; }
.tool h3 { font-size: 22px; }
.tool p { margin: 2px 0 0; font-size: 16px; color: var(--ink-2); line-height: 1.25; }
.patchwall { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.patchwall .p { width: 104px; height: 104px; }
.homefoot { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* ---------------- Mission runner ---------------- */
.runner { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pips { display: flex; gap: 6px; align-items: center; }
.pips i { width: 14px; height: 14px; border-radius: 4px; background: var(--bg-3); border: 2px solid var(--edge); }
.pips i.on { background: var(--a); }
.pips i.now { background: var(--buzz); transform: scale(1.25); }
.stagearea { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.step { position: absolute; inset: 0; display: flex; flex-direction: column; }
.step.pad { padding: 22px 28px; overflow-y: auto; }
.bottombar {
  height: 92px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 18px; border-top: 3px solid var(--edge); background: var(--bg); z-index: 5;
}
.bottombar .mid { flex: 1; display: flex; align-items: center; justify-content: center; gap: 12px; min-width: 0; font-size: 20px; color: var(--ink-2); }
.bottombar .mid .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bottombar .mid .label.compact { white-space: normal; font-size: 18px; line-height: 1.25; color: var(--ink); font-weight: 600; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.bottombar .mid .speak-btn { width: 52px; height: 52px; }

/* Story */
.story { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center; min-height: 0; }
.story.noart { grid-template-columns: 1fr; max-width: 980px; margin: 0 auto; width: 100%; }
.story .art { height: 100%; max-height: 560px; min-height: 0; display: flex; align-items: center; justify-content: center; }
.story .art .frame { width: 100%; height: 100%; border: 3px solid var(--edge); border-radius: 22px; box-shadow: var(--pop); overflow: hidden; background: var(--card); display: flex; align-items: center; justify-content: center; position: relative; }
.story .art .frame img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.story .art .frame .credit { position: absolute; right: 8px; bottom: 6px; font-size: 12px; background: rgba(255,255,255,.85); padding: 2px 8px; border-radius: 6px; color: var(--ink-2); }
.story .art .botrow { display: flex; align-items: flex-end; justify-content: center; gap: 10px; width: 100%; }
.story .art .botrow .bot { width: 30%; max-width: 220px; }
.story .art .one .bot { width: 260px; }
.story .art .stk { width: 300px; height: 300px; }
.story .art .waverow { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.story .art .waverow .wv { display: flex; align-items: center; gap: 16px; }
.story .art .waverow .frame { height: auto; flex: 1; }
.story .art .waverow .name { font-weight: 800; font-size: 24px; width: 110px; }
.story .text .card { display: flex; flex-direction: column; gap: 16px; }
.story h2 { font-size: 38px; }
.story .say { font-size: 29px; line-height: 1.4; font-weight: 500; }
.wow { background: var(--lcd); border: 3px solid var(--edge); border-radius: 16px; padding: 14px 18px; font-weight: 700; font-size: 23px; color: var(--lcd-ink); display: flex; gap: 12px; align-items: flex-start; }
.wow .src { font-size: 13px; font-weight: 500; color: var(--lcd-dark); display: block; margin-top: 4px; word-break: break-all; }
.dadline { display: flex; gap: 12px; align-items: flex-start; font-size: 20px; color: var(--ink-2); border-top: 2px dashed var(--line); padding-top: 12px; }
.dadline b { color: var(--eng); white-space: nowrap; }
.playbig {
  display: inline-flex; align-items: center; gap: 14px; min-height: 84px; padding: 0 30px 0 18px; border-radius: 999px; border: 3px solid var(--edge);
  background: var(--go); color: #fff; font-weight: 800; font-size: 26px; cursor: pointer; box-shadow: 0 6px 0 var(--edge);
}
.playbig .disc { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; }
.playbig .disc svg { width: 30px; height: 30px; }
.playbig:active, .playbig.press { transform: translateY(4px); box-shadow: 0 2px 0 var(--edge); }
.playbig.playing { background: var(--a); }

/* Guess and Big Question */
.ask { display: flex; flex-direction: column; gap: 18px; max-width: 1220px; margin: 0 auto; width: 100%; flex: 1; min-height: 0; }
.ask .prompt { font-size: 32px; font-weight: 800; line-height: 1.2; }
.ask .scenario { font-size: 25px; line-height: 1.4; }
.choices { display: grid; gap: 18px; grid-template-columns: repeat(var(--n, 3), 1fr); }
.choice {
  position: relative; border: 3px solid var(--edge); border-radius: 22px; background: var(--card); box-shadow: var(--pop); padding: 14px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-size: 23px; font-weight: 700; min-height: 150px; color: var(--ink);
  transition: transform .08s, box-shadow .08s, opacity .2s;
}
.choice:active { transform: translateY(3px); box-shadow: 1px 2px 0 var(--edge); }
.choice .pic { width: 100%; height: 150px; display: flex; align-items: center; justify-content: center; }
.choice .pic svg.sticker { width: 130px; height: 130px; }
.choice .pic .bot { height: 150px; width: auto; }
.choice .pic .bot .botsvg { height: 150px; width: auto; }
.choice .pic .lcdwave { height: 110px; width: auto; max-width: 100%; }
.choice .detail { font-size: 17px; font-weight: 500; color: var(--ink-2); }
.choice .listen { position: absolute; top: 10px; right: 10px; width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--edge); background: var(--go); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 var(--edge); }
.choice .listen svg { width: 26px; height: 26px; }
.choice .key { position: absolute; top: 10px; left: 12px; font-family: var(--pixel); font-size: 14px; background: var(--ink); color: #fff; padding: 6px 8px; border-radius: 6px; }
.choice .badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; min-height: 34px; }
.badge { display: inline-flex; align-items: center; padding: 3px 12px; border-radius: 999px; border: 2.5px solid var(--edge); font-size: 17px; font-weight: 800; animation: pop .25s ease-out; }
.badge.commander { background: var(--cmd); }
.badge.copilot { background: var(--cop); color: #fff; }
.badge.engineer { background: var(--eng); color: #fff; }
@keyframes pop { from { transform: scale(.4); } 70% { transform: scale(1.12); } }
.choice.answer { outline: 6px solid var(--go); outline-offset: 3px; }
.choice.dim { opacity: .5; }
.turnrow { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; min-height: 72px; }
.turnrow .ask-line { font-size: 24px; font-weight: 700; }
.reveal { display: flex; gap: 18px; align-items: stretch; }
.reveal .card { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.reveal .big { font-size: 28px; font-weight: 800; }
.reveal p { font-size: 24px; margin: 0; }
.mindrow { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* At home */
.athome { display: grid; grid-template-columns: 1fr 1.4fr; gap: 22px; max-width: 1220px; margin: 0 auto; width: 100%; }
.athome ul, .athome ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; font-size: 22px; }
.athome li { display: flex; gap: 12px; align-items: flex-start; }
.athome .tick { width: 40px; height: 40px; flex: none; border-radius: 10px; border: 3px solid var(--edge); background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.athome .tick.on { background: var(--go); color: #fff; }
.athome .tick svg { width: 26px; height: 26px; }
.athome .n { width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--ink); color: #fff; font-family: var(--pixel); font-size: 14px; display: flex; align-items: center; justify-content: center; }
.athome .safe { background: #fff1c7; border: 2.5px solid var(--edge); border-radius: 14px; padding: 10px 14px; font-size: 19px; }

/* Finish */
.finish { flex: 1; display: grid; grid-template-columns: 420px 1fr; gap: 36px; align-items: center; max-width: 1200px; margin: 0 auto; width: 100%; }
.finish .patchbig { width: 400px; height: 400px; filter: drop-shadow(6px 8px 0 rgba(27,27,36,.9)); animation: patchIn .7s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes patchIn { from { transform: scale(.3) rotate(-30deg); opacity: 0; } }
.debrief { display: flex; flex-direction: column; gap: 12px; }
.debrief .q { display: flex; gap: 14px; align-items: center; font-size: 25px; font-weight: 600; }

/* Toy host inside a step */
.toyhost { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.toyintro { display: flex; align-items: center; gap: 14px; padding: 14px 24px 0; }
.toyintro .t { font-size: 25px; font-weight: 700; line-height: 1.25; }
.toybody { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }

/* Video */
.video { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; align-items: center; max-width: 1240px; margin: 0 auto; width: 100%; flex: 1; }
.vframe { position: relative; aspect-ratio: 16 / 9; border: 3px solid var(--edge); border-radius: 22px; overflow: hidden; background: #000; box-shadow: var(--pop); }
.vframe img, .vframe iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.vframe .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 110px; height: 110px; border-radius: 50%; background: var(--a); color: #fff; border: 4px solid #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.vframe .play svg { width: 50px; height: 50px; }

/* Notes and log */
.notes { padding: 24px 30px 60px; max-width: 1100px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 20px; }
.notes h2 { font-size: 30px; margin-bottom: 8px; }
.notes p, .notes li { font-size: 20px; line-height: 1.45; }
.notes table { border-collapse: collapse; width: 100%; font-size: 18px; }
.notes td, .notes th { border-bottom: 2px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.notes a { color: var(--a); }
.logitem { display: flex; gap: 14px; padding: 10px 0; border-bottom: 2px dashed var(--line); font-size: 19px; }
.logitem time { color: var(--ink-3); white-space: nowrap; font-size: 16px; padding-top: 2px; }

/* ---------------- Song cartridges (Song Maker save box, Jukebox) ---------------- */
.cartridge { position: relative; background: var(--cc); border: 3px solid var(--edge); border-radius: 16px 16px 8px 8px; padding: 26px 18px 18px; box-shadow: var(--pop); }
.cartridge::before { content: ''; position: absolute; right: -3px; top: -3px; width: 30px; height: 30px; background: var(--notch, var(--bg)); border-left: 3px solid var(--edge); border-bottom: 3px solid var(--edge); border-bottom-left-radius: 8px; }
.cartridge .ct-top { position: absolute; top: 8px; left: 18px; display: flex; gap: 5px; }
.cartridge .ct-top i { width: 22px; height: 6px; border-radius: 3px; background: rgba(0,0,0,.25); }
.cartridge .ct-label { background: var(--card); border: 3px solid var(--edge); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.cartridge .ct-art { width: 92px; height: 92px; }
.cartridge .ct-name { font-weight: 800; font-size: 22px; line-height: 1.1; word-break: break-word; }
.cartridge .ct-by { font-size: 13px; color: var(--ink-2); }
.cartridge .ct-foot { height: 14px; margin: 12px 20px 0; border-radius: 4px; background: repeating-linear-gradient(90deg, rgba(0,0,0,.28) 0 10px, transparent 10px 16px); }

/* ---------------- Studio shell ---------------- */
.studio { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* Responsive */
@media (max-width: 1100px) {
  .missions, .tools { grid-template-columns: repeat(3, 1fr); }
  .home-top { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --top: 68px; }
  html, body { font-size: 20px; }
  .missions, .tools { grid-template-columns: repeat(2, 1fr); }
  .story { grid-template-columns: 1fr; }
  .story .art { max-height: 300px; }
  .setup .card { grid-template-columns: 1fr; }
  .finish { grid-template-columns: 1fr; justify-items: center; }
  .finish .patchbig { width: 260px; height: 260px; }
  .athome { grid-template-columns: 1fr; }
  .video { grid-template-columns: 1fr; }
  .choices { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-height: 700px) {
  .bottombar { height: 80px; }
  .story h2 { font-size: 32px; }
  .story .say { font-size: 25px; }
}
