/* Astra Architect: white work surfaces, bold room colours, big friendly targets. */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f3f0e9;
  --bg-2: #e9e4d8;
  --paper: #ffffff;
  --paper-2: #f7f5f0;
  --line: #e2ddd1;
  --line-2: #cfc8b8;
  --ink: #1f2229;
  --ink-2: #4c5160;
  --ink-3: #8a8f9c;
  --blue: #2f6fe4;
  --blue-soft: #e5eefc;
  --green: #22a565;
  --green-soft: #e3f5eb;
  --red: #e5483d;
  --red-soft: #fde9e6;
  --orange: #f28c28;
  --yellow: #ffc93c;
  --teal: #12857e;
  --plum: #7b5ea7;
  --gold: #ffc93c;
  --accent: var(--blue);
  --go: #22a565;
  --radius: 22px;
  --tap: 64px;
  --font: 'Lexend', system-ui, sans-serif;
  --shadow: 0 10px 30px rgba(40, 33, 20, 0.12);
  --shadow-lg: 0 20px 50px rgba(40, 33, 20, 0.18);
  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: 20px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
body { overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
input, textarea { user-select: text; -webkit-user-select: text; font-family: var(--font); }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(32px, 4vw, 50px); line-height: 1.05; }
h2 { font-size: clamp(25px, 2.6vw, 34px); line-height: 1.12; }
h3 { font-size: 22px; line-height: 1.2; }
p { margin: 0 0 0.6em; }
button { font-family: var(--font); }
img.emo { width: 1.25em; height: 1.25em; vertical-align: -0.25em; display: inline-block; }

#app { position: fixed; inset: 0; overflow: hidden; }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.eyebrow { font-size: 15px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }

/* Buttons */
.btn {
  appearance: none; border: 0; cursor: pointer; font: 600 20px/1 var(--font); color: #fff; background: var(--blue);
  min-height: var(--tap); padding: 0 26px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.16); transition: transform .08s, box-shadow .08s, background .15s; white-space: nowrap;
}
.btn svg { width: 26px; height: 26px; flex: none; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.16); }
.btn.go { background: var(--go); }
.btn.warn { background: var(--red); }
.btn.ghost { background: var(--paper); color: var(--ink); box-shadow: 0 0 0 2px var(--line) inset, 0 3px 0 rgba(0, 0, 0, 0.06); }
.btn.ghost.on { background: var(--blue-soft); box-shadow: 0 0 0 3px var(--blue) inset; color: var(--blue); }
.btn.round { width: var(--tap); padding: 0; }
.btn.small { min-height: 48px; font-size: 17px; padding: 0 18px; }
.btn.small.round { width: 48px; }
.btn.big { min-height: 76px; font-size: 24px; padding: 0 34px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.glow { animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 4px 0 rgba(0,0,0,.16), 0 0 0 0 rgba(47,111,228,.5); } 50% { box-shadow: 0 4px 0 rgba(0,0,0,.16), 0 0 0 12px rgba(47,111,228,0); } }
.speak-btn {
  appearance: none; border: 0; cursor: pointer; width: 56px; height: 56px; flex: none; border-radius: 50%;
  background: var(--paper-2); color: var(--ink-2); display: grid; place-items: center; box-shadow: 0 0 0 2px var(--line) inset;
}
.speak-btn svg { width: 28px; height: 28px; }
.speak-btn.on { background: var(--blue); color: #fff; box-shadow: none; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

.card { background: var(--paper); border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow); }
.headrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--paper-2); font-size: 16px; font-weight: 600; }

.toast {
  position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 100; background: var(--ink); color: #fff;
  padding: 14px 24px; border-radius: 999px; font-weight: 600; font-size: 19px; box-shadow: var(--shadow-lg); animation: toast 2.7s forwards; pointer-events: none;
  display: flex; align-items: center; gap: 10px; max-width: 90vw;
}
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -10px); } 8%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(30, 26, 18, 0.45); display: grid; place-items: center; padding: 24px; }
.modal { width: min(760px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }

/* ---------- Home ---------- */
.home { background: var(--bg); }
.home .scroll { flex: 1; padding: 28px 40px 40px; }
.home-head { display: flex; align-items: center; gap: 20px; margin-bottom: 22px; }
.wordmark { display: flex; align-items: center; gap: 16px; }
.wordmark .mark { width: 64px; height: 64px; border-radius: 18px; background: var(--ink); display: grid; place-items: center; }
.wordmark .mark img { width: 42px; height: 42px; }
.wordmark .t1 { font-size: 15px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.wordmark .t2 { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.home-head .spacer { flex: 1; }
.home-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; align-items: stretch; }
.studio-card {
  position: relative; border-radius: 28px; overflow: hidden; min-height: 300px; background: #cfe3d2 center/cover no-repeat; cursor: pointer;
  box-shadow: var(--shadow); display: flex; align-items: flex-end;
}
.studio-card .veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(10,14,20,0.72)); }
.studio-card .body { position: relative; padding: 26px 28px; color: #fff; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; width: 100%; }
.studio-card h2 { font-size: 38px; }
.studio-card p { margin: 6px 0 0; font-size: 19px; opacity: .92; }
.brief-card h3 { margin-bottom: 12px; }
.brief-list { display: flex; flex-direction: column; gap: 10px; }
.brief-item { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 16px; background: var(--paper-2); font-size: 19px; font-weight: 500; }
.brief-item img { width: 36px; height: 36px; }
.brief-item .tick { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line-2); display: grid; place-items: center; flex: none; }
.brief-item.done { background: var(--green-soft); }
.brief-item.done .tick { background: var(--green); border-color: var(--green); color: #fff; }
.brief-item .tick svg { width: 20px; height: 20px; }
.section-title { display: flex; align-items: baseline; gap: 14px; margin: 30px 0 14px; }
.section-title h2 { font-size: 28px; }
.missions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mission-tile {
  background: var(--paper); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; box-shadow: var(--shadow);
  position: relative; border-top: 8px solid var(--mc, var(--blue)); min-height: 190px;
}
.mission-tile .num { font-size: 14px; font-weight: 700; color: var(--ink-3); letter-spacing: .1em; text-transform: uppercase; }
.mission-tile .pic { display: flex; gap: 4px; }
.mission-tile .pic img { width: 46px; height: 46px; }
.mission-tile h3 { font-size: 22px; }
.mission-tile .idea { font-size: 16px; color: var(--ink-2); }
.mission-tile .done { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; }
.mission-tile .done svg { width: 24px; height: 24px; }
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.patch-wall { display: flex; flex-wrap: wrap; gap: 14px; }
.patch-wall .p { width: 104px; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.patch-wall svg { width: 104px; height: 104px; }
.patch-wall .empty { color: var(--ink-3); font-size: 18px; }

/* ---------- Setup ---------- */
.setup { display: grid; place-items: center; padding: 24px; background: var(--bg); }
.setup .card { width: min(720px, 100%); display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-weight: 600; font-size: 18px; color: var(--ink-2); }
.textin { font-size: 24px; padding: 16px 20px; border-radius: 16px; border: 3px solid var(--line); background: var(--paper-2); color: var(--ink); width: 100%; }
.textin:focus { outline: none; border-color: var(--blue); background: #fff; }

/* ---------- Mission runner ---------- */
.runner { background: var(--bg); }
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 18px; background: var(--paper); box-shadow: 0 2px 0 var(--line); z-index: 5; min-height: 78px; }
.topbar .title { font-weight: 700; font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title img { width: 32px; height: 32px; vertical-align: -7px; margin-right: 6px; }
.topbar .spacer { flex: 1; }
.dots { display: flex; gap: 8px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; background: var(--line); cursor: pointer; }
.dots i.done { background: var(--accent); opacity: .5; }
.dots i.now { background: var(--accent); transform: scale(1.3); }
.stage { flex: 1; position: relative; overflow-y: auto; }
.step { min-height: 100%; position: relative; }
.step.pad { padding: 28px 36px; }
.bottombar { display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: var(--paper); box-shadow: 0 -2px 0 var(--line); min-height: 84px; }
.bottombar .steplabel { flex: 1; text-align: center; font-weight: 700; font-size: 16px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }

.story { display: grid; grid-template-columns: minmax(280px, 0.9fr) 1.1fr; gap: 30px; align-items: center; max-width: 1180px; margin: 0 auto; min-height: 100%; }
.story.noimg { grid-template-columns: 1fr; max-width: 860px; }
.story .picture { aspect-ratio: 1 / 1; border-radius: 30px; background: var(--paper); box-shadow: var(--shadow); display: grid; place-items: center; overflow: hidden; position: relative; }
.story .picture.has-img { aspect-ratio: 4 / 3; }
.story .picture img.full { width: 100%; height: 100%; object-fit: cover; }
.story .picture .emos { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; padding: 30px; }
.story .picture .emos img { width: 150px; height: 150px; }
.story .picture .emos.n2 img { width: 140px; height: 140px; }
.story .picture .emos.n3 img { width: 118px; height: 118px; }
.story .lead { font-size: 27px; line-height: 1.42; margin: 14px 0 0; }
.wow { margin-top: 18px; font-size: 25px; font-weight: 700; color: var(--accent); }
.dadline { margin-top: 18px; display: flex; gap: 12px; align-items: baseline; font-size: 20px; padding: 14px 18px; background: var(--paper-2); border-radius: 16px; }
.dadline b { color: var(--accent); white-space: nowrap; }
.source-link { display: inline-block; margin-top: 12px; font-size: 14px; color: var(--ink-3); }

.ask { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.ask .prompt { font-size: 30px; font-weight: 700; line-height: 1.2; margin-top: 6px; }
.ask .scenario { font-size: 25px; line-height: 1.4; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.choice {
  appearance: none; border: 0; cursor: pointer; background: var(--paper); border-radius: 22px; padding: 22px 18px 20px; box-shadow: var(--shadow), 0 0 0 3px transparent inset;
  font: 600 22px/1.25 var(--font); color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; text-align: center; min-height: 170px; justify-content: center;
}
.choice .cemo { width: 78px; height: 78px; }
.choice .detail { font-size: 17px; font-weight: 400; color: var(--ink-2); }
.choice .key { position: absolute; top: 12px; left: 14px; font-size: 15px; font-weight: 800; color: var(--ink-3); }
.choice .badges { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.badge { font-size: 14px; font-weight: 700; padding: 4px 10px; border-radius: 999px; color: #fff; }
.badge.cmd { background: var(--blue); }
.badge.eng { background: var(--orange); }
.choice.pick-cmd { box-shadow: var(--shadow), 0 0 0 4px var(--blue) inset; }
.choice.pick-eng { box-shadow: var(--shadow), 0 0 0 4px var(--orange) inset; }
.choice.pick-cmd.pick-eng { box-shadow: var(--shadow), 0 0 0 4px var(--blue) inset, 0 0 0 8px var(--orange) inset; }
.choice.answer { box-shadow: var(--shadow), 0 0 0 5px var(--green) inset; }
.choice.dim { opacity: .5; }
.turn { display: flex; align-items: center; gap: 14px; justify-content: center; font-size: 22px; flex-wrap: wrap; min-height: 64px; }
.turn .who { font-weight: 700; padding: 6px 16px; border-radius: 999px; color: #fff; }
.turn .who.cmd { background: var(--blue); }
.turn .who.eng { background: var(--orange); }
.reveal .card { border-left: 8px solid var(--green); }
.reveal .big { font-size: 26px; font-weight: 700; }
.whybox { display: flex; gap: 12px; width: 100%; }
.mindrow { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; }
.athome { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px; }
.athome ul, .athome ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: 21px; }
.athome li { display: flex; gap: 12px; align-items: flex-start; }
.athome .tick { width: 34px; height: 34px; border-radius: 10px; border: 3px solid var(--line-2); flex: none; display: grid; place-items: center; cursor: pointer; }
.athome .tick.on { background: var(--green); border-color: var(--green); color: #fff; }
.athome .tick svg { width: 20px; height: 20px; }
.athome .n { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: grid; place-items: center; flex: none; font-size: 18px; }
.finish { display: grid; grid-template-columns: 340px 1fr; gap: 36px; max-width: 1100px; margin: 0 auto; align-items: center; min-height: 100%; }
.finish .patchbig svg { width: 100%; height: auto; filter: drop-shadow(0 18px 30px rgba(0,0,0,.2)); }
.debrief { display: flex; flex-direction: column; gap: 14px; font-size: 22px; }
.debrief .q { display: flex; align-items: center; gap: 14px; }
.play-host { position: absolute; inset: 0; }

/* ---------- Studio ---------- */
.studio { position: absolute; inset: 0; background: #dbe8f1; overflow: hidden; }
.studio .viewport { position: absolute; inset: 0; }
.world-canvas { position: absolute; inset: 0; display: block; touch-action: none; }
.world-labels { position: absolute; inset: 0; pointer-events: none; }
.plan-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: none; background: #f4f1ea; }
.studio.plan .plan-canvas { display: block; }

.rail { position: absolute; top: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 6; pointer-events: none; }
.rail > * { pointer-events: auto; }
.rail.left { left: 12px; width: 300px; }
.rail.right { right: 12px; width: 76px; align-items: center; }
.tray { background: rgba(255,255,255,0.94); border-radius: 26px; padding: 10px; box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; overflow-y: auto; max-height: 100%; scrollbar-width: none; }
.tray::-webkit-scrollbar { display: none; }
.tray .tt { grid-column: 1 / -1; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding: 8px 6px 0; }
.tile-btn { appearance: none; border: 0; cursor: pointer; background: var(--paper-2); border-radius: 20px; padding: 6px 6px 8px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; font: 700 15px/1.1 var(--font); color: var(--ink); min-height: 128px; position: relative; text-align: center; }
.tile-btn .blk { position: relative; width: 86px; height: 86px; display: grid; place-items: center; }
.tile-btn .blk svg.iso { width: 86px; height: 86px; }
.tile-btn .blk img.stk { position: absolute; width: 36px; height: 36px; left: 50%; top: 13px; transform: translateX(-50%); filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
.tile-btn .lbl { min-height: 2.2em; display: flex; align-items: center; }
.tile-btn.on { background: #fff; box-shadow: 0 0 0 4px var(--blue) inset, var(--shadow); }
.tile-btn.tool { flex-direction: row; min-height: 62px; justify-content: center; gap: 8px; font-size: 15px; }
.tile-btn.tool svg { width: 30px; height: 30px; flex: none; }
.tile-btn.tool.bin { background: var(--red-soft); color: var(--red); }
.tile-btn.tool.bin.on { background: #fff; box-shadow: 0 0 0 4px var(--red) inset, var(--shadow); }
.tile-btn:active { transform: scale(.96); }
.shape-strip { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.96); padding: 6px 10px 6px 16px; border-radius: 26px; box-shadow: var(--shadow); flex-basis: 100%; justify-content: center; flex-wrap: wrap; }
.shape-strip .tt { font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-right: 4px; }
.shape-btn { appearance: none; border: 0; cursor: pointer; background: var(--paper-2); border-radius: 18px; width: 84px; height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 700 12px/1 var(--font); color: var(--ink); }
.shape-btn svg { width: 54px; height: 54px; transition: transform .2s; }
.shape-btn.on { background: #fff; box-shadow: 0 0 0 4px var(--blue) inset; }
.shape-btn.turn { background: var(--blue-soft); color: var(--blue); }
.shape-btn.turn svg { width: 32px; height: 32px; }
.ghost-tag.flash { animation: flashin .25s; }
@keyframes flashin { from { transform: scale(.6); opacity: 0; } }
.topright { position: absolute; top: 12px; right: 100px; z-index: 6; display: flex; gap: 8px; }
.rbtn {
  appearance: none; border: 0; cursor: pointer; width: 66px; min-height: 60px; border-radius: 20px; background: rgba(255,255,255,0.95); color: var(--ink); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 600 11.5px/1 var(--font); padding: 6px 2px;
}
.rbtn svg { width: 30px; height: 30px; }
.rbtn.on { background: var(--blue); color: #fff; }
.rbtn:active { transform: scale(.95); }
.rgroup { display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,0.6); padding: 5px; border-radius: 24px; }
.rgroup .rbtn { box-shadow: none; }
.rspacer { flex: 1; min-height: 6px; }

.studio .topstrip { position: absolute; top: 12px; left: 326px; right: 470px; display: flex; justify-content: center; gap: 10px; z-index: 6; pointer-events: none; flex-wrap: wrap; }
.studio .topstrip > * { pointer-events: auto; }
.brief-chips { display: flex; gap: 6px; background: rgba(255,255,255,0.94); padding: 6px; border-radius: 999px; box-shadow: var(--shadow); }
.brief-chip { appearance: none; border: 0; background: var(--paper-2); width: 54px; height: 54px; border-radius: 50%; position: relative; cursor: pointer; display: grid; place-items: center; }
.brief-chip img { width: 34px; height: 34px; filter: grayscale(0.6); opacity: .65; }
.brief-chip.done { background: var(--green-soft); }
.brief-chip.done img { filter: none; opacity: 1; }
.brief-chip.done::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/16px no-repeat; border: 2px solid #fff; }
.brief-chip.pop { animation: pop .7s; }
@keyframes pop { 30% { transform: scale(1.35); } 60% { transform: scale(.92); } }
.pill { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.94); padding: 6px 8px 6px 16px; border-radius: 999px; box-shadow: var(--shadow); font-weight: 600; font-size: 17px; }
.pill input[type=range] { width: 220px; height: 44px; accent-color: var(--orange); }
.pill img { width: 30px; height: 30px; }

.tasks { order: -1; flex-basis: 100%; max-width: 520px; display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,0.97); border-radius: 999px; box-shadow: var(--shadow); padding: 6px 18px 6px 6px; cursor: pointer; }
.tasks .speak-btn { width: 52px; height: 52px; }
.tasks .tnow { flex: 1; display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; line-height: 1.2; }
.tasks .tnow img { width: 40px; height: 40px; flex: none; }
.tasks .tdots { display: flex; gap: 5px; flex: none; }
.tasks .tdots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.tasks .tdots i.done { background: var(--green); }
.tasks .tdots i.now { background: var(--blue); transform: scale(1.3); }
.tasks.alldone { background: var(--green-soft); box-shadow: 0 0 0 3px var(--green), var(--shadow); }
.tasks .tt { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; min-height: 28px; }
.tasks .tt .fold svg { width: 20px; height: 20px; transition: transform .2s; }
.tasks.folded .task { display: none; }
.tasks.folded .tt .fold svg { transform: rotate(180deg); }
.task { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 500; }
.task .box { width: 30px; height: 30px; border-radius: 9px; border: 3px solid var(--line-2); flex: none; display: grid; place-items: center; }
.task.done .box { background: var(--green); border-color: var(--green); color: #fff; }
.task.done span { color: var(--ink-3); text-decoration: line-through; }
.task .box svg { width: 18px; height: 18px; }
.task.now span { font-weight: 700; }

.floatbar { position: absolute; z-index: 7; display: flex; gap: 8px; transform: translate(-50%, -100%); pointer-events: auto; background: rgba(255,255,255,0.97); padding: 8px; border-radius: 999px; box-shadow: var(--shadow-lg); }
.floatbar .fb { appearance: none; border: 0; cursor: pointer; min-width: 64px; height: 64px; border-radius: 999px; background: var(--paper-2); display: flex; align-items: center; justify-content: center; gap: 8px; font: 700 18px var(--font); color: var(--ink); padding: 0 14px; }
.floatbar .fb svg { width: 28px; height: 28px; }
.floatbar .fb img { width: 30px; height: 30px; }
.floatbar .fb.go { background: var(--go); color: #fff; padding: 0 22px; }
.floatbar .fb.no { background: var(--red-soft); color: var(--red); }
.floatbar .fb.bad { background: var(--red); color: #fff; }

.label3d { pointer-events: auto; transform: translateY(-14px); }
.face3d { width: 46px; height: 46px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0,0,0,.2); cursor: pointer; }
.face3d img { width: 36px; height: 36px; }
.face3d.sad { box-shadow: 0 0 0 4px var(--red), 0 4px 12px rgba(0,0,0,.2); }
.face3d.happy { box-shadow: 0 0 0 4px var(--green), 0 4px 12px rgba(0,0,0,.2); }
.ghost-tag { background: #fff; border-radius: 999px; padding: 6px 12px 6px 6px; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.2); white-space: nowrap; }
.ghost-tag img { width: 32px; height: 32px; }
.bubble3d { background: #fff; border-radius: 16px; padding: 4px 6px; box-shadow: 0 3px 10px rgba(0,0,0,.25); display: flex; align-items: center; gap: 2px; position: relative; pointer-events: none; }
.bubble3d::after { content: ''; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); border: 7px solid transparent; border-top-color: #fff; border-bottom: 0; }
.bubble3d img { width: 26px; height: 26px; }
.bubble3d .nm { font-size: 12px; font-weight: 700; padding: 0 4px; }
.bubble3d.stuck { background: #fff1ee; box-shadow: 0 0 0 3px var(--red), 0 3px 10px rgba(0,0,0,.25); }
.bubble3d.me { box-shadow: 0 0 0 3px var(--blue), 0 3px 10px rgba(0,0,0,.25); }

.sheet-panel { position: absolute; z-index: 9; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(980px, calc(100% - 40px)); background: rgba(255,255,255,0.98); border-radius: 26px; box-shadow: var(--shadow-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; max-height: 70%; }
.sheet-panel .head { display: flex; align-items: center; gap: 12px; }
.sheet-panel .head h3 { flex: 1; }
.optrow { display: flex; gap: 10px; flex-wrap: wrap; overflow-x: auto; }
.opt { appearance: none; border: 0; cursor: pointer; background: var(--paper-2); border-radius: 18px; min-width: 92px; min-height: 92px; padding: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: 600 14px/1.1 var(--font); color: var(--ink); }
.opt img { width: 44px; height: 44px; }
.opt svg.form { width: 54px; height: 54px; }
.opt.on { background: #fff; box-shadow: 0 0 0 4px var(--blue) inset; }
.opt .sw { width: 44px; height: 44px; border-radius: 12px; }

.section-slider { position: absolute; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 6; }
.section-slider input { width: min(560px, 60vw); }
.walk-pad { position: absolute; left: 84px; bottom: 26px; width: 180px; height: 180px; z-index: 7; }
.walk-dest { position: absolute; left: 290px; right: 100px; bottom: 16px; z-index: 6; display: flex; gap: 8px; background: rgba(255,255,255,0.94); padding: 8px; border-radius: 26px; box-shadow: var(--shadow); overflow-x: auto; scrollbar-width: none; }
.walk-dest .opt { min-width: 76px; min-height: 76px; }
.walk-dest .opt img { width: 36px; height: 36px; }
.walk-act { position: absolute; right: 110px; bottom: 120px; z-index: 6; display: flex; flex-direction: column; gap: 10px; }
.crosshair { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: rgba(255,255,255,.8); box-shadow: 0 0 0 2px rgba(0,0,0,.25); pointer-events: none; z-index: 5; }

/* ---------- School day ---------- */
.day { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; background: rgba(255,255,255,0.98); border-radius: 28px 28px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.15); padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.day .row { display: flex; align-items: center; gap: 10px; }
.day h3 { font-size: 20px; }
.pupils { display: flex; gap: 8px; overflow-x: auto; padding: 4px; scrollbar-width: none; }
.pupil-chip { appearance: none; border: 0; cursor: pointer; background: var(--paper-2); border-radius: 999px; padding: 6px 14px 6px 6px; display: flex; align-items: center; gap: 8px; font: 700 17px var(--font); color: var(--ink); white-space: nowrap; }
.pupil-chip .av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 18px; }
.pupil-chip.on { background: #fff; box-shadow: 0 0 0 4px var(--blue) inset; }
.pupil-chip .coded { width: 22px; height: 22px; }
.strip { display: flex; align-items: center; gap: 8px; background: var(--paper-2); border-radius: 22px; padding: 10px; min-height: 102px; overflow-x: auto; }
.ctile {
  appearance: none; border: 0; cursor: pointer; width: 84px; height: 84px; flex: none; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font: 700 12px/1 var(--font); color: #fff; position: relative; box-shadow: 0 4px 0 rgba(0,0,0,.18);
}
.ctile img { width: 46px; height: 46px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.2)); }
.ctile.go { background: #2f6fe4; }
.ctile.do { background: #22a565; }
.ctile.wait { background: #f28c28; }
.ctile.again { background: #e9b10e; color: #3a2d00; }
.ctile.start { background: #1f2229; }
.ctile .arrow { position: absolute; left: 6px; top: 6px; width: 18px; height: 18px; }
.ctile .dots3 { display: flex; gap: 4px; }
.ctile .dots3 i { width: 9px; height: 9px; border-radius: 50%; background: #3a2d00; }
.ctile.now { outline: 5px solid #ffe066; outline-offset: 2px; transform: translateY(-4px); }
.ctile.bad { outline: 5px solid var(--red); outline-offset: 2px; }
.ctile.small { width: 70px; height: 70px; }
.ctile.small img { width: 38px; height: 38px; }
.ctray { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; }
.ctray .grp { display: flex; gap: 6px; padding-right: 10px; margin-right: 4px; border-right: 2px solid var(--line); }
.ctray .grp:last-child { border-right: 0; }
.daybar { display: flex; align-items: center; gap: 10px; }
.bells { display: flex; gap: 6px; }
.bell { appearance: none; border: 0; cursor: pointer; width: 70px; height: 70px; border-radius: 18px; background: var(--paper-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 700 12px var(--font); color: var(--ink-2); position: relative; }
.bell img { width: 36px; height: 36px; }
.bell.now { background: #fff6d6; box-shadow: 0 0 0 4px var(--yellow) inset; }
.bell.past { opacity: .5; }
.bell .n { position: absolute; top: 4px; left: 6px; font-size: 11px; color: var(--ink-3); }
.clock { font-weight: 800; font-size: 22px; min-width: 120px; }
.report { display: flex; flex-direction: column; gap: 10px; }
.report .line { display: flex; gap: 12px; align-items: center; font-size: 21px; padding: 10px 14px; border-radius: 16px; background: var(--paper-2); }
.report .line img { width: 34px; height: 34px; flex: none; }
.report .line.good { background: var(--green-soft); }
.report .line.fix { background: #fff4df; }

/* ---------- Sort game & shape lab ---------- */
.sortgame { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 18px; padding: 22px 30px; }
.hoops { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; flex: 1; min-height: 0; }
.hoop { border-radius: 36px; border: 5px dashed var(--line-2); background: rgba(255,255,255,.6); display: flex; flex-direction: column; align-items: center; padding: 16px; gap: 12px; cursor: pointer; transition: background .15s; }
.hoop.ready { border-color: var(--blue); background: var(--blue-soft); }
.hoop h3 { display: flex; align-items: center; gap: 10px; font-size: 26px; }
.hoop h3 img { width: 44px; height: 44px; }
.hoop .in { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-content: flex-start; }
.rcards { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; min-height: 112px; }
.rcard { appearance: none; border: 0; cursor: pointer; background: var(--paper); border-radius: 20px; box-shadow: var(--shadow); width: 112px; height: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font: 600 14px/1.1 var(--font); color: var(--ink); border-top: 7px solid var(--rc); }
.rcard img { width: 50px; height: 50px; }
.rcard.on { box-shadow: 0 0 0 4px var(--blue), var(--shadow-lg); transform: translateY(-6px); }
.rcard.small { width: 92px; height: 92px; font-size: 12px; }
.rcard.small img { width: 40px; height: 40px; }

.shapelab { position: absolute; inset: 0; }
.shapelab .lab-ui { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 10px; z-index: 5; flex-wrap: wrap; padding: 0 16px; }
.shapelab .lab-card { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 5; width: min(760px, 90%); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 20px; }
.shapelab .lab-card .extras { width: 100%; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.shapelab .lab-card p { margin: 0; font-size: 21px; flex: 1 1 60%; }

.sheet-preview { width: 100%; border-radius: 16px; box-shadow: var(--shadow); background: #fff; }
.ideas-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.idea-card { display: flex; flex-direction: column; gap: 10px; }
.idea-card .top { display: flex; gap: 14px; align-items: center; }
.idea-card .top img { width: 54px; height: 54px; }
.idea-card .num { font-size: 18px; background: var(--paper-2); border-radius: 14px; padding: 10px 14px; }
.idea-card .meta { font-size: 15px; color: var(--ink-3); }
.loglist { display: flex; flex-direction: column; gap: 10px; }
.logitem { display: flex; gap: 14px; font-size: 18px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.logitem .when { color: var(--ink-3); white-space: nowrap; font-size: 15px; min-width: 110px; }

@media (max-width: 1000px) {
  .missions { grid-template-columns: repeat(2, 1fr); }
  .home-grid { grid-template-columns: 1fr; }
  .story { grid-template-columns: 1fr; }
  .rail.left { width: 160px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Style workshop */
.style-panel { gap: 10px; }
.style-panel .tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.stab { appearance: none; border: 0; cursor: pointer; background: var(--paper-2); border-radius: 18px; min-width: 96px; height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 700 14px/1 var(--font); color: var(--ink-2); }
.stab svg.sty { width: 42px; height: 42px; }
.stab.on { background: var(--blue); color: #fff; }
.sopt svg.sty { width: 58px; height: 58px; }
.sopt { min-width: 100px; min-height: 100px; }
.floatbar .fb.style { background: linear-gradient(135deg, #e76f51, #f4a261 45%, #2a9d8f); color: #fff; }

.ghost-tag.happy { box-shadow: 0 0 0 3px #6ab04c, 0 4px 14px rgba(0,0,0,.2); }

/* Round 1 polish */
.tgroups { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; background: var(--paper-2); border-radius: 18px; padding: 4px; }
.tgroup { appearance: none; border: 0; cursor: pointer; background: transparent; border-radius: 14px; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 700 10.5px/1 var(--font); color: var(--ink-2); padding: 4px 0; }
.tgroup img { width: 28px; height: 28px; }
.tgroup.on { background: #fff; color: var(--blue); box-shadow: 0 0 0 3px var(--blue) inset; }
.floatbar .fb.lab { flex-direction: column; gap: 1px; padding: 0 8px; min-width: 60px; }
.floatbar .fb.lab svg { width: 26px; height: 26px; }
.floatbar .fb small { font-size: 11px; font-weight: 700; line-height: 1; }
.style-panel { height: 330px; }
.style-panel .optrow { flex: 1; overflow-y: auto; align-content: flex-start; }
.style-panel .tabs { background: #e9eef8; padding: 5px; border-radius: 24px; gap: 4px; flex: none; }
.style-panel .stab { background: transparent; height: 66px; }
.style-panel .stab.on { background: var(--blue); color: #fff; box-shadow: 0 3px 8px rgba(47,111,228,.35); }
.next-btn.wait { background: var(--paper); color: var(--blue); box-shadow: 0 0 0 3px var(--blue) inset; }
.mission-tile.next { box-shadow: 0 0 0 4px var(--mc), var(--shadow-lg); }
.mission-tile .ribbon { position: absolute; top: -14px; right: 14px; background: var(--go); color: #fff; font-weight: 800; font-size: 17px; padding: 6px 14px 6px 10px; border-radius: 999px; display: flex; align-items: center; gap: 4px; box-shadow: 0 4px 0 rgba(0,0,0,.16); animation: pulse 1.6s infinite; }
.mission-tile .ribbon svg { width: 20px; height: 20px; }
.studio-card { min-height: 230px; }
.brief-item { cursor: pointer; padding: 8px 12px; }
.brief-item .tick.say { border: 0; background: var(--paper); color: var(--ink-3); }
.brief-item .tick.say svg { width: 20px; height: 20px; }
.choice .cpic { width: 96px; height: 96px; display: grid; place-items: center; flex: none; }
.choice .cpic svg { width: 96px; height: 96px; }
.choice .cpic.crop { width: 150px; height: 104px; border-radius: 16px; background: url('../assets/site/map.jpg') no-repeat; background-size: 520% auto; box-shadow: inset 0 0 0 3px rgba(255,255,255,.7); }
.choice img.cemo { width: 84px; height: 84px; }
.ctile .foot { position: absolute; right: 4px; top: 4px; width: 20px; height: 20px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.ctile .blk svg { width: 50px; height: 50px; }
.ctile.small .blk svg { width: 40px; height: 40px; }
.ctray.rows { flex-direction: column; gap: 6px; overflow: visible; }
.ctray .trow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ctray .tlabel { display: flex; align-items: center; gap: 6px; font-size: 15px; min-width: 92px; color: var(--ink-2); }
.ctray .tlabel img { width: 28px; height: 28px; }
.ctray.rows .grp { flex-wrap: wrap; }
.btn.gobtn { min-width: 150px; }
.walk-pad { bottom: 86px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.0) 54%, rgba(255,255,255,.55) 55%, rgba(255,255,255,.55) 62%, rgba(255,255,255,0) 63%); }
.walk-pad::before { content: ''; position: absolute; inset: -18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%232f6fe4' opacity='.8'%3E%3Cpath d='M50 2l7 9H43zM50 98l7-9H43zM2 50l9-7v14zM98 50l-9-7v14z'/%3E%3C/g%3E%3C/svg%3E") center/100% no-repeat; pointer-events: none; }
.walk-dest { flex-wrap: wrap; max-height: 190px; overflow-y: auto; }

.day { gap: 8px; padding: 10px 16px 12px; }
.daybar { flex-wrap: wrap; row-gap: 6px; }
.daybar .dtabs, .daybar .pslot { display: flex; gap: 6px; }
.daybar .pslot .pupils { padding: 0; }
.day .strip { min-height: 88px; padding: 6px 8px; }
.day .strip .ctile { width: 76px; height: 76px; }
.day .strip .ctile img { width: 40px; height: 40px; }
.ctile.small { width: 56px; height: 56px; font-size: 10px; border-radius: 14px; }
.ctile.small img { width: 30px; height: 30px; }
.ctile.small .foot { width: 16px; height: 16px; right: 2px; top: 2px; }
.ctray .tlabel { min-width: 72px; font-size: 14px; }
.ctray .trow, .ctray.rows .grp { gap: 4px; }
.ctray.rows .grp { padding-right: 6px; margin-right: 2px; }
.day .btn.gobtn { min-height: 60px; font-size: 22px; }

.sayline { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 700; background: var(--paper); padding: 6px 18px 6px 6px; border-radius: 999px; box-shadow: var(--shadow); }
.hand-hint { position: absolute; left: 50%; top: 150px; z-index: 5; pointer-events: none; animation: handmove 2.2s ease-in-out infinite; }
.hand-hint img { width: 72px; height: 72px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); }
.hand-hint.two { animation-name: handhoop; }
@keyframes handmove { 0% { transform: translate(-120px, 0); } 40% { transform: translate(-120px, 10px) scale(.9); } 100% { transform: translate(-260px, 300px); } }
@keyframes handhoop { 0%, 100% { transform: translate(-260px, 260px); } 50% { transform: translate(-260px, 290px) scale(.9); } }

.tasks.nudge { animation: nudge 1.4s ease-in-out infinite; }
.tasks.nudge .speak-btn { background: var(--blue); color: #fff; box-shadow: none; }
@keyframes nudge { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-2deg) scale(1.03); } 20% { transform: rotate(2deg) scale(1.03); } 30% { transform: rotate(0); } }
.strip .tcount { margin-left: auto; display: grid; grid-template-columns: repeat(4, 12px); gap: 4px; padding: 0 6px; flex: none; }
.strip .tcount i { width: 12px; height: 12px; border-radius: 4px; background: var(--line); }
.strip .tcount i.on { background: var(--blue); }
.strip .tcount.full i.on { background: var(--orange); }

/* Round 2 */
.tgroup.hint { animation: hintpulse 1.2s ease-in-out infinite; }
@keyframes hintpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(47,111,228,.55); } 50% { box-shadow: 0 0 0 6px rgba(47,111,228,0); background: var(--blue-soft); } }
.tasks.picks .tnow::after { content: 'Tap me!'; margin-left: 6px; font-size: 13px; font-weight: 800; color: var(--blue); background: var(--blue-soft); padding: 4px 8px; border-radius: 999px; white-space: nowrap; }
.tray .shape-strip { grid-column: 1 / -1; box-shadow: none; background: var(--paper-2); border-radius: 20px; padding: 8px; justify-content: flex-start; gap: 6px; }
.tray .shape-strip .tt { flex-basis: 100%; }
.tray .shape-btn { width: 60px; height: 64px; font-size: 10px; }
.tray .shape-btn svg { width: 40px; height: 40px; }
.tray .shape-btn.turn svg { width: 26px; height: 26px; }
.sheet-panel.style-panel { left: auto; right: 100px; top: 84px; bottom: 14px; transform: none; width: 392px; height: auto; max-height: none; }
.style-panel .tabs { display: grid; grid-template-columns: repeat(5, 1fr); }
.style-panel .stab { min-width: 0; height: 70px; font-size: 10.5px; padding: 0 2px; text-align: center; line-height: 1.05; }
.style-panel .stab svg.sty { width: 36px; height: 36px; }
.style-panel .optrow { display: grid; grid-template-columns: repeat(3, 1fr); overflow-y: auto; align-content: start; }
.style-panel .sopt { min-width: 0; }
.brief-chips .bl { display: flex; align-items: center; gap: 4px; padding: 0 8px 0 6px; font-size: 13px; color: var(--ink-2); }
.brief-chips .bl img { width: 20px; height: 20px; }
.ctile.mid { width: 72px; height: 72px; font-size: 11.5px; }
.ctile.mid img { width: 38px; height: 38px; }
.ctile.mid .blk svg { width: 44px; height: 44px; }
.ctile .dots3 i.on { background: #fff; box-shadow: 0 0 0 2px #3a2d00; }
.ctile.lap { animation: lap .6s; }
@keyframes lap { 30% { transform: translateY(-8px) scale(1.12); } }
.ctile.again span:last-child { font-size: 10px; }
.bell.pick { box-shadow: 0 0 0 4px var(--blue) inset, 0 6px 14px rgba(47,111,228,.3); background: #fff; transform: translateY(-3px); }
.report .line { position: relative; }
.report .line .fixit { margin-left: auto; flex: none; }
.opt.guess .blk svg { width: 50px; height: 50px; }
.mission-tile .ribbon { font-size: 20px; padding: 8px 18px 8px 12px; top: -18px; }
.mission-tile .ribbon svg { width: 22px; height: 22px; }
