/* Scenes, banners, motion — visual density */
.scene-hero {
  position: relative; border-radius: 1.4rem; overflow: hidden;
  min-height: 280px; box-shadow: 0 22px 50px rgba(15,23,42,.18);
}
.scene-svg { display: block; width: 100%; height: auto; min-height: 240px; }
.scene-copy {
  position: absolute; inset: auto 0 0 0; padding: 1.4rem 1.5rem 1.5rem;
  background: linear-gradient(180deg, transparent, rgba(15,23,42,.82) 36%);
}
.scene-hero-alg .scene-copy { background: linear-gradient(180deg, transparent, rgba(15, 86, 72, .88) 40%); }
.orb { animation: orb-float 6s ease-in-out infinite; }
.orb.delay { animation-delay: 1.4s; }
@keyframes orb-float { 50% { transform: translateY(-8px); } }
.walker { transform-box: fill-box; transform-origin: center; animation: walkx 5s ease-in-out infinite; }
@keyframes walkx { 50% { transform: translateX(70px); } }
.pulse { animation: chip-pulse 2.2s ease-in-out infinite; }
@keyframes chip-pulse { 50% { filter: brightness(1.35); } }
.scan { animation: scanline 3.5s linear infinite; }
@keyframes scanline { 0% { opacity: .75; } 50% { opacity: 1; } 100% { opacity: .75; } }
.busline { animation: busglow 1.6s linear infinite; }
@keyframes busglow { 50% { opacity: .45; } }

.lesson-banner {
  position: relative; border-radius: 1.15rem; overflow: hidden; max-height: 168px;
  box-shadow: 0 12px 28px rgba(15,23,42,.12);
}
.lesson-banner .scene-svg { min-height: 168px; object-fit: cover; }
.lesson-banner-fade {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(15,23,42,.55), transparent 55%);
}
.lesson-banner-label {
  position: absolute; left: 1.1rem; bottom: .85rem; color: #fff;
  font-weight: 800; font-size: 1.25rem; text-shadow: 0 2px 10px rgba(0,0,0,.35);
}

.card-visor {
  height: 72px; margin: -1.15rem -1.2rem 0.85rem; border-radius: 1.15rem 1.15rem 0 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,.35), transparent 40%),
    linear-gradient(135deg, var(--topic), color-mix(in srgb, var(--topic) 40%, #0f172a));
  position: relative; overflow: hidden;
}
.card-visor::after {
  content: ""; position: absolute; inset: auto 12% 10px 12%; height: 8px; border-radius: 8px;
  background: rgba(255,255,255,.25);
}
.card-visor-cpu::before {
  content: ""; position: absolute; right: 16px; top: 16px; width: 28px; height: 28px;
  border: 2px solid rgba(255,255,255,.5); box-shadow: 0 0 12px rgba(251,191,36,.6);
}

.wonder-on { position: relative; }
.wonder-on::before {
  content: ""; pointer-events: none; position: fixed; inset: 0; z-index: 0; opacity: .45;
  background:
    radial-gradient(900px 400px at 10% -10%, rgba(251,191,36,.18), transparent 50%),
    radial-gradient(700px 360px at 110% 10%, rgba(45,212,191,.12), transparent 46%);
}
.wonder-on .main-panel, .wonder-on .guest-body { position: relative; z-index: 1; }

.wl-topic-card { overflow: hidden; }
.wl-quiz-card {
  background: linear-gradient(180deg, #fff, #fffbeb);
  border: 1px solid #fde68a !important;
}

/* Wonder labs — instrument-grade, paper + metal, science-accurate */
:root {
  --willo: #f59e0b;
  --lab: #0f766e;
  --ink: #1e293b;
  --paper: #fbfaf6;
  --grid: #dbe4ee;
  --metal: #64748b;
  --copper: #b45309;
}
.wonder-on .main-panel { background: linear-gradient(180deg, #fff7ed 0%, #f7f4ee 90px, #f7f4ee 100%); }

.wl-steps { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.wl-steps a {
  text-decoration: none; font-weight: 800; font-size: .72rem; letter-spacing: .06em;
  text-transform: uppercase; padding: .4rem .75rem; border-radius: 999px;
  background: #fff; border: 1px solid #e7d7b8; color: #7c4a12;
}
.wl-steps a:hover, .wl-steps a:focus-visible { background: #fff4d6; outline: 2px solid #c2410c; outline-offset: 2px; }

.willo-card {
  display: flex; gap: .9rem; align-items: center;
  background: linear-gradient(180deg, #fffdf5, #fff7e0);
  border: 1px solid #e8c56b; border-radius: 1.15rem; padding: .9rem 1.05rem;
  box-shadow: 0 8px 24px rgba(180, 83, 9, .06);
}
.willo-face { flex-shrink: 0; animation: willo-bob 3.2s ease-in-out infinite; filter: drop-shadow(0 4px 6px rgba(0,0,0,.08)); }
@keyframes willo-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.wl-lab-shell {
  background:
    linear-gradient(#fbfaf6, #fbfaf6) padding-box,
    linear-gradient(135deg, #cbd5e1, #e2e8f0) border-box;
  border: 1px solid #d6d3cd; border-radius: 1.2rem; padding: 1.05rem 1.1rem 1.2rem;
  box-shadow: 0 14px 36px rgba(15,23,42,.06);
}
.lab-kicker {
  font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #0f766e;
}
.lab-title { font-weight: 800; font-size: 1.05rem; margin: .15rem 0 .55rem; color: #0f172a; }
.lab-stage {
  min-height: 240px; border-radius: .95rem; padding: .85rem;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 18px 18px;
  border: 1px solid #c5d0dc;
  position: relative; overflow: hidden;
}
.lab-stage::before {
  content: "WONDER LAB"; position: absolute; top: 8px; right: 10px;
  font-size: .58rem; letter-spacing: .16em; font-weight: 800; color: #94a3b8;
}
.lab-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .75rem; }
.lab-btn {
  border: 0; border-radius: .7rem; padding: .48rem .85rem; font-weight: 800; font-size: .88rem;
  background: linear-gradient(180deg, #14b8a6, #0f766e); color: #fff; cursor: pointer;
  box-shadow: 0 2px 0 #115e59;
}
.lab-btn.ghost { background: #fff; color: #115e59; border: 1px solid #99f6e4; box-shadow: none; }
.lab-btn:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
.lab-note { font-size: .92rem; color: #334155; margin: .55rem 0 0; min-height: 1.4em; }
.sci-cap {
  margin-top: .65rem; padding: .55rem .7rem; border-left: 3px solid #0f766e;
  background: #f0fdfa; border-radius: 0 .55rem .55rem 0; font-size: .82rem; color: #134e4a;
}

.chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; min-height: 36px; padding: .3rem .5rem; border-radius: .55rem; font-weight: 800;
  background: #fff; border: 2px solid #cbd5e1; user-select: none; font-variant-numeric: tabular-nums;
}
.chip.x { background: #fff7ed; border-color: #ea580c; color: #9a3412; }
.chip.n { background: #eff6ff; border-color: #2563eb; color: #1e3a8a; }
.chip.y { background: #fdf2f8; border-color: #db2777; color: #9d174d; }
.unit-cube {
  width: 22px; height: 22px; border-radius: 4px; display: inline-block;
  background: linear-gradient(145deg, #93c5fd, #2563eb); border: 1px solid #1d4ed8;
  box-shadow: inset -2px -2px 0 rgba(0,0,0,.12);
}
.x-mass {
  min-width: 46px; height: 36px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #fdba74, #ea580c); color: #fff; font-weight: 900;
  border: 1px solid #9a3412; box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}

.scale-wrap { max-width: 520px; margin: 0 auto; }
.pan {
  min-height: 78px; border-radius: 50% / 18%; background: linear-gradient(180deg, #f8fafc, #e2e8f0);
  border: 2px solid #64748b; display: flex; flex-wrap: wrap; gap: 4px;
  align-items: center; justify-content: center; padding: .4rem; position: relative;
}
.scale-beam { height: 10px; background: linear-gradient(180deg, #94a3b8, #475569); border-radius: 4px; margin: .2rem 8% 0; position: relative; }
.scale-beam::after { content:""; position:absolute; left:50%; top:-6px; width:12px; height:12px; background:#334155; border-radius:50%; transform:translateX(-50%); }
.scale-base { width: 16px; height: 42px; background: linear-gradient(#475569,#1e293b); margin: 0 auto; clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%); }

.nl { position: relative; height: 92px; margin: 1.4rem .4rem .2rem; }
.nl-line { position: absolute; left: 0; right: 0; top: 40px; height: 3px; background: #0f172a; }
.nl-line::after { content:""; position:absolute; right:-2px; top:-5px; border:6px solid transparent; border-left-color:#0f172a; }
.nl-tick { position: absolute; top: 32px; width: 2px; height: 18px; background: #0f172a; }
.nl-tick.major { height: 22px; top: 30px; width: 2.5px; }
.nl-lab { position: absolute; top: 56px; font-size: .68rem; font-weight: 800; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.nl-zero { color: #b45309; }
.nl-token {
  position: absolute; top: 4px; min-width: 30px; height: 28px; padding: 0 6px; border-radius: 999px;
  background: #ea580c; color: #fff; font-size: .72rem; font-weight: 800;
  display: grid; place-items: center; transform: translateX(-50%); transition: left .4s ease;
  box-shadow: 0 4px 8px rgba(234,88,12,.3);
}
.nl-span {
  position: absolute; top: 36px; height: 8px; background: rgba(14,165,233,.35); border-top: 2px solid #0284c7;
}

.graph-box { background: #fff; border: 1px solid #cbd5e1; border-radius: .6rem; overflow: hidden; }
.graph-meta { display: flex; flex-wrap: wrap; gap: .6rem 1rem; margin-top: .55rem; font-size: .82rem; font-variant-numeric: tabular-nums; }

.apple-unit {
  width: 36px; height: 40px; display: inline-block; margin: 2px;
  background: radial-gradient(circle at 35% 30%, #86efac, #16a34a 55%, #166534);
  border-radius: 45% 45% 48% 48%; position: relative; box-shadow: inset -4px -3px 0 rgba(0,0,0,.12);
}
.apple-unit::after { content:""; position:absolute; top:-5px; left:16px; width:3px; height:8px; background:#365314; border-radius:2px; }

.desk-win {
  min-height: 260px; border-radius: .55rem .55rem .7rem .7rem; overflow: hidden;
  background: linear-gradient(180deg, #1e3a8a, #1d4ed8 30%, #2563eb);
  color: #fff; box-shadow: 0 16px 30px rgba(30,58,138,.25), inset 0 0 0 1px rgba(255,255,255,.08);
}
.desk-bar { background: #0f172a; padding: .28rem .55rem; font-size: .7rem; display:flex; justify-content:space-between; }
.desk-icons { display: flex; flex-wrap: wrap; gap: .55rem; padding: .7rem; }
.desk-icon { width: 76px; text-align: center; font-size: .72rem; cursor: pointer; }
.folder-open { background: #f8fafc; color: #0f172a; margin: 0 .7rem .7rem; border-radius: .45rem; min-height: 100px; padding: .6rem; font-size: .85rem; }

.arch { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: .45rem; font-size: .72rem; }
.arch-box { background: #fff; border: 1px solid #94a3b8; border-radius: .5rem; padding: .45rem .5rem; }
.arch-box h4 { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 .25rem; color: #64748b; }
.arch-cpu { background: #0f172a; color: #e2e8f0; border-color: #f59e0b; }
.bus { height: 8px; background: repeating-linear-gradient(90deg, #f59e0b 0 8px, #b45309 8px 10px); border-radius: 4px; margin: .35rem 0; position: relative; }
.bus i { position:absolute; top:-3px; width:12px; height:12px; background:#fde68a; border-radius:50%; animation: busbit 1.8s linear infinite; }
@keyframes busbit { from { left: 0; } to { left: 92%; } }

.net-map { display: grid; grid-template-columns: repeat(6, 1fr); gap: .3rem; align-items: stretch; }
.net-node {
  background: #fff; border: 1px solid #38bdf8; border-radius: .5rem; padding: .4rem .3rem;
  font-weight: 800; font-size: .68rem; text-align: center; min-height: 58px;
  display:flex; flex-direction:column; justify-content:center; gap: 2px;
}
.net-node span { font-weight: 600; font-size: .6rem; color: #0369a1; }
.pkt { width: 12px; height: 12px; border-radius: 2px; background: #f59e0b; position: relative; animation: pkt 3.2s linear infinite; box-shadow: 0 0 0 2px #fed7aa; }
@keyframes pkt { 0% { left: 0; } 100% { left: calc(100% - 14px); } }

.robot { width: 26px; height: 26px; border-radius: 5px 5px 4px 4px; background: #4f46e5; position: absolute; transition: left .28s, top .28s; box-shadow: inset 0 -4px 0 #312e81; }
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; max-width: 220px; background: #cbd5e1; padding: 3px; border-radius: 4px; }
.cell { aspect-ratio: 1; background: #f1f5f9; border-radius: 2px; }
.cell.goal { background: #86efac; box-shadow: inset 0 0 0 2px #16a34a; }

.loop-stars { font-size: 1.35rem; letter-spacing: .12rem; min-height: 2rem; }
.var-box { border: 2px solid #ea580c; border-radius: .7rem; padding: .75rem; text-align: center; background: #fff7ed; }
.tree-branch { border-left: 3px solid #0d9488; margin-left: 1rem; padding-left: .8rem; }

.journey { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.journey .node {
  padding: .4rem .7rem; border-radius: 999px; font-weight: 800; font-size: .82rem;
  background: #fff; border: 2px solid #cbd5e1; color: #475569;
}
.journey .node.done { background: #dcfce7; border-color: #22c55e; color: #166534; }
.journey .node.now { background: #ffedd5; border-color: #ea580c; color: #9a3412; }
.journey .arr { color: #94a3b8; font-weight: 800; }

.world-card { border-radius: 1.2rem; padding: 1.1rem 1.15rem; color: #fff; min-height: 140px; display: block; text-decoration: none; }
.world-card:hover { filter: brightness(1.05); color: #fff; }
.badge-pill { display: inline-flex; align-items: center; gap: .35rem; background: #fff; border-radius: 999px; padding: .25rem .6rem; font-size: .78rem; font-weight: 800; border: 1px solid #e2e8f0; }

.hero-art { width: 100%; max-width: 320px; height: auto; display: block; margin: 0 auto; filter: drop-shadow(0 12px 18px rgba(15,23,42,.12)); }

.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.pop { animation: pop .35s; }
@keyframes pop { 50% { transform: scale(1.08); } }

.wl-band-junior .wl-read { font-size: 1.16rem; }
.wl-band-senior .lab-note { font-size: .88rem; }

@media (max-width: 700px) {
  .lab-stage { min-height: 200px; }
  .chip { min-width: 48px; min-height: 44px; }
  .lab-btn { min-height: 44px; }
  .arch, .net-map { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .willo-face, .nl-token, .pkt, .robot, .shake, .pop, .bus i { animation: none !important; transition: none !important; }
}
html.reduce-motion .willo-face,
html.reduce-motion .nl-token,
html.reduce-motion .pkt,
html.reduce-motion .robot,
html.reduce-motion .bus i { animation: none !important; transition: none !important; }

.wl-lesson-list { border: 0 !important; }
.wl-lesson-list .list-group-item {
  font-size: 1.05rem; border: 1px solid #e7e0d4 !important; border-radius: .9rem !important;
  margin-bottom: .45rem; background: #fffef9;
  box-shadow: 0 6px 16px rgba(15,23,42,.04);
  transition: transform .15s ease, box-shadow .15s ease;
}
.wl-lesson-list .list-group-item:hover { transform: translateX(4px); box-shadow: 0 10px 22px rgba(15,23,42,.08); }
.wl-hero { position: relative; overflow: hidden; }
.wl-hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px;
  border-radius: 50%; background: radial-gradient(circle, rgba(251,191,36,.25), transparent 70%);
  pointer-events: none;
}

/* —— Kid magnet —— */
.kid-sticker {
  display: inline-block; background: #facc15; color: #78350f; font-weight: 900;
  border-radius: 999px; padding: .35rem .9rem; transform: rotate(-3deg);
  box-shadow: 3px 3px 0 #fb7185; margin-bottom: .6rem;
}
.btn-play {
  background: #facc15 !important; color: #78350f !important; border: 4px solid #fff !important;
  border-radius: 999px !important; font-weight: 900 !important; font-size: 1.2rem !important;
  padding: .65rem 1.4rem !important; box-shadow: 0 6px 0 #ea580c;
}
.btn-play:hover { transform: translateY(-2px) scale(1.03); color: #78350f !important; }
.btn-play-alt {
  background: #fff !important; color: #be185d !important; border: 4px solid #fda4af !important;
  border-radius: 999px !important; font-weight: 900 !important; padding: .65rem 1.2rem !important;
}
.play-tag {
  background: #fb7185; color: #fff; font-weight: 900; font-size: .72rem; letter-spacing: .08em;
  padding: .25rem .55rem; border-radius: 999px; box-shadow: 2px 2px 0 #9f1239;
}
.kid-num {
  font-size: 2rem; font-weight: 900; color: var(--topic, #ea580c); line-height: 1; opacity: .9;
}
.kid-bounce { animation: kidbob 1.6s ease-in-out infinite; }
@keyframes kidbob { 50% { transform: translateY(-5px) rotate(-6deg); } }
.willo-kid {
  background: linear-gradient(180deg, #fff7ed, #fecdd3) !important;
  border: 4px solid #fb923c !important; border-radius: 1.6rem !important;
  box-shadow: 8px 8px 0 #fdba74 !important;
}
.willo-name { font-weight: 900; color: #c2410c; font-size: 1.05rem; }
.willo-bubble { background: #fff; border-radius: 1.1rem; padding: .65rem .85rem; border: 2px dashed #fdba74; }
.kid-steps a {
  background: #fff !important; border: 3px solid #fdba74 !important; color: #9a3412 !important;
  font-size: .85rem !important; padding: .45rem .8rem !important;
}
.kid-steps a:nth-child(2) { border-color: #86efac !important; }
.kid-steps a:nth-child(3) { border-color: #93c5fd !important; }
.kid-steps a:nth-child(4) { border-color: #fde047 !important; }
.wl-topic-card {
  border-radius: 1.5rem !important; border: 4px solid #fff !important;
  box-shadow: 0 10px 0 color-mix(in srgb, var(--topic) 55%, #fff) !important;
}
.wl-topic-card:hover { transform: translateY(-8px) rotate(-1deg) !important; }
.card-visor { height: 88px !important; }
.wonder-on::after {
  content: "✦  ★  ✦  ★"; pointer-events: none; position: fixed; top: 12px; right: 18px;
  font-size: 1.2rem; opacity: .45; z-index: 2; animation: kidbob 3s ease-in-out infinite;
}
.scene-copy { padding-bottom: 1.7rem !important; }

/* Study desk + touch practice (content first, not decoration) */
.wl-goal-card, .wl-remember, .wl-example, .wl-mistake, .wl-paper-q, .wl-practice-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem 1.1rem;
}
.wl-goal-card { border-left: 6px solid #0d9488; background: #f0fdfa; }
.wl-remember { border-left: 6px solid #2563eb; background: #eff6ff; }
.wl-remember ul { padding-left: 1.15rem; }
.wl-example { margin-bottom: .85rem; border-left: 6px solid #ca8a04; background: #fffbeb; }
.wl-mistake { margin-bottom: .75rem; padding: .85rem 1rem; border-radius: .85rem; background: #fff7ed; border: 1px solid #fed7aa; }
.wl-paper-q { margin-bottom: .55rem; cursor: pointer; }
.wl-paper-q summary { cursor: pointer; list-style: none; }
.wl-paper-q summary::-webkit-details-marker { display: none; }
.wl-paper-q summary::after { content: " Reveal"; color: #0f766e; font-weight: 700; font-size: .85rem; }
.wl-paper-q[open] summary::after { content: " Hide"; }
.wl-practice-card { border: 2px solid #0f766e; background: linear-gradient(180deg, #f0fdfa, #fff); }
.prac-top { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; }
.prac-count { font-weight: 800; }
.prac-score { font-size: .9rem; color: #475569; }
.prac-bar { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin: .55rem 0 1rem; }
.prac-bar span { display: block; height: 100%; background: #0d9488; border-radius: 99px; }
.prac-prompt { font-size: 1.15rem; font-weight: 700; margin-bottom: .75rem; }
.prac-hint { background: #fef9c3; border-radius: .6rem; padding: .45rem .7rem; }
.prac-grid { display: grid; gap: .55rem; }
@media (min-width: 640px) { .prac-grid { grid-template-columns: 1fr 1fr; } }
.prac-opt {
  text-align: left; background: #fff; border: 2px solid #cbd5e1; border-radius: .85rem;
  padding: .7rem .85rem; font-weight: 600; color: #0f172a;
}
.prac-opt:hover:not(:disabled) { border-color: #0d9488; background: #f0fdfa; }
.prac-opt.is-ok { border-color: #16a34a; background: #dcfce7; }
.prac-opt.is-bad { border-color: #dc2626; background: #fee2e2; }
.prac-fb { margin-top: .85rem; padding: .7rem .85rem; border-radius: .75rem; }
.prac-fb.ok { background: #dcfce7; }
.prac-fb.bad { background: #fee2e2; }
.prac-picked { min-height: 48px; margin-top: .7rem; padding: .55rem; background: #f8fafc; border-radius: .7rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.prac-chip { background: #ccfbf1; border-radius: 999px; padding: .2rem .65rem; font-size: .9rem; font-weight: 700; }
.prac-review { display: grid; gap: .55rem; margin-top: 1rem; }
.prac-rev { padding: .65rem .8rem; border-radius: .7rem; }
.prac-rev.ok { background: #dcfce7; }
.prac-rev.bad { background: #ffedd5; }
.prac-type .form-control { max-width: 22rem; }
