body { background: #f4f2fb; }
main { max-width: 1120px; }
header { max-width: 1120px; }
.lobby { padding: 12px 0 2px; }
.lobby h1 { margin-bottom: 6px; }
.world-card { padding: 0; overflow: hidden; border-color: #dcd4eb; box-shadow: 0 12px 34px #33265b12; }
.world-card > .btn { margin: 0; width: 100%; border-radius: 0; min-height: 56px; }
.world.fifth { --world-canvas: #141036; --world-faint: #2d235b; --action: #4a2eab; --buddy-bg: #efebfe; --buddy-text: #302359; --art: url("art/arena.webp"); }
.world.first { --world-canvas: #32213b; --world-faint: #673450; --world-accent: #ffd3a7; --action: #9a3057; --buddy-bg: #ffeef3; --buddy-text: #55243c; --art: url("art/yard.webp"); }
.world .btn:not(.secondary) { background: var(--action); }
.world .btn:not(.secondary):hover { filter: brightness(.87); }
.world-cover { color: #fff; min-height: 310px; display: flex; flex-direction: column; justify-content: flex-end; padding: 26px; background: var(--world-canvas); }
.world-card .world-cover { border-radius: 0; }
.world-cover::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg,#140f2cdb,transparent 85%),linear-gradient(0deg,#130e2bd9,transparent 70%),var(--art) center / cover; }
.world-cover .stats span { background: #180e2de0; color: white; }
.world-cover .tag { color: var(--world-accent); }
.world-cover h2 { font-size: clamp(1.65rem,4vw,2.5rem); margin-bottom: 6px; }
.world-cover p { max-width: 26ch; margin-bottom: 12px; }
.world .stage-list { margin-top: 14px; }
.stage { border-left: 4px solid var(--action); }
.world.lesson { max-width: 920px; }
.lesson-head { position: relative; isolation: isolate; border-radius: 22px; background: var(--world-canvas); color: white; padding: 17px 22px; overflow: hidden; }
.lesson-head::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg,#160f2afa,#180d35aa 64%,#170d3250),var(--art) center 53% / cover; }
.lesson-head .tag { color: var(--world-accent); margin: 0 0 5px; }
.lesson-head h1 { margin: 0; }
.game-layout { display: grid; gap: 16px; grid-template-columns: minmax(0,1.5fr) minmax(250px,1fr); align-items: start; }
.task-panel { min-width: 0; }
.guide { border: 1px solid var(--border); border-radius: 24px; overflow: clip; margin-top: 14px; background: var(--buddy-bg); color: var(--buddy-text); padding-bottom: 12px; }
.guide-scene { position: relative; isolation: isolate; display: grid; place-items: center; height: clamp(172px,24vw,238px); overflow: hidden; background: var(--art) center / cover; }
.guide-scene::before { content:""; position:absolute; inset:0; z-index:-1; background:linear-gradient(0deg,#170d34bb,transparent 80%); }
.guide-pose { width: 148px; aspect-ratio: .86; display: grid; place-items: center; position: relative; animation: buddy-arrive .48s cubic-bezier(.18,.86,.35,1.24) both; }
.guide-pose img { display:block; width:100%; height:100%; object-fit:cover; border-radius:50% 50% 42% 42%; border:3px solid #ffffffb8; box-shadow:0 9px 24px #15112675; }
.guide-pose.retry { animation: buddy-peek .63s cubic-bezier(.18,.8,.26,1.04) both; }
.guide-pose.hint { animation: buddy-arrive .48s cubic-bezier(.18,.86,.35,1.24) both; }
.guide-pose.correct,.guide-pose.finish { animation: buddy-celebrate .64s ease-out both; }
.guide-spark { display:none; position:absolute; color:#fffad6; font-weight:900; font-size:2rem; line-height:1; text-shadow:0 0 13px #fbbd56; }
.guide-pose.correct .guide-spark,.guide-pose.finish .guide-spark { display:block; animation:spark .7s ease-out both; }
.guide-spark.left { left:-25px; top:30%; }.guide-spark.right { right:-23px; top:17%; animation-delay:.10s; }
.guide-talk { min-height: 104px; padding: 12px 13px; margin: -8px 12px 0; background:white; border-radius:14px; position:relative; }
.guide-name { display:block; margin-bottom:3px; font-weight:900; }
.guide-line { margin:0; }
.guide-foot { padding: 9px 12px 0; }
.speech-note { margin:6px 0 0; font-size:.9rem; }.speech-note:empty { display:none; }
.route { position:relative; display:flex; align-items:center; gap:8px; min-height:84px; overflow:hidden; padding:13px; margin:6px 0 16px; border-radius:14px; background: linear-gradient(90deg,#190f31c9,#190f314d),var(--art) center 52% / cover; }
.route-node { position:relative; display:grid; place-items:center; width:42px; height:38px; border-radius:8px; background:#150f2ce0; border:1px solid #fff8; color:white; font-weight:900; }
.route-node.now { border:2px solid var(--world-accent); }
.route-node.clear { background:var(--world-accent); color:#241638; border-color:transparent; }
.route-node.just-cleared { animation: checkpoint-pop .40s ease-out both; }
.kitty { width:34px; height:34px; border:2px solid #b54e73; border-radius:9px; overflow:hidden; background:#df8ca7; }
.kitty img { display:block;width:100%;height:100%;object-fit:cover; }
.kitty.green { border-color:#28774c;background:#d9f5e8; }
.kitty.green img { filter:hue-rotate(18deg) saturate(.76); }
.kitty.new { animation:checkpoint-pop .38s ease-out; }
.success-equation { display:inline-flex; flex-wrap:wrap; align-items:center; gap:6px; }
@keyframes buddy-arrive { from { opacity:0; transform:translateY(24px) scale(.91); } to { opacity:1; transform:none; } }
@keyframes buddy-peek { 0% { transform:translateY(95%) rotate(-9deg); } 54% { transform:translateY(-13%) rotate(6deg); } 78% { transform:translateY(4%) rotate(-2deg); } 100% { transform:none; } }
@keyframes buddy-celebrate { 0%,100% { transform:none; } 34% { transform:translateY(-20%) rotate(-9deg); } 65% { transform:translateY(-7%) rotate(5deg); } }
@keyframes checkpoint-pop { 0% { transform:scale(.77); } 55% { transform:scale(1.16); } 100% { transform:scale(1); } }
@keyframes spark { from { opacity:0; transform:translateY(13px) scale(.4); } 46% { opacity:1; transform:translateY(-5px) scale(1.17); } to { opacity:1; transform:none; } }
@media (max-width:640px) {
  .world-cover { min-height:230px; padding:20px 16px; }
  .world-cover h2 { font-size:1.8rem; }
  .lesson-head { border-radius:17px; padding:13px 16px; }
  .game-layout { grid-template-columns:1fr; gap:0; }
  .guide { display:grid; grid-template-columns:88px minmax(0,1fr); border-radius:17px; padding:8px; overflow:hidden; }
  .guide-scene { height:91px; border-radius:12px; grid-row:span 2; align-self:start; }
  .guide-pose { width:68px; }
  .guide-pose img { border-width:2px; }
  .guide-talk { min-height:0; margin:0 0 0 8px; padding:7px 9px; }
  .guide-name { font-size:.94rem; }
  .guide-foot { padding:5px 0 0 8px; }
  .guide-foot .btn { min-height:36px; padding:5px 9px; }
  .guide-spark { font-size:1rem; }.guide-spark.left { left:0; }.guide-spark.right { right:0; }
  .route { min-height:63px; padding:8px; }
  .route-node { width:36px;height:32px; }
  .kitty { width:28px;height:28px; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; scroll-behavior:auto!important; } }
.world.first .reward { background:#ffe2ec; color:#55243c; }
.world-toolbar { display:flex; align-items:center; gap:10px 16px; flex-wrap:wrap; margin-top:12px; padding:10px 14px; background:white; border:1px solid var(--border); border-radius:14px; }
.world-toolbar .btn { margin-left:auto; }
.profile-name { min-width:0; overflow-wrap:anywhere; }
.wallet { display:inline-flex; flex-wrap:wrap; gap:7px; font-weight:850; color:var(--buddy-text); }
.wallet span { padding:2px 7px; background:var(--buddy-bg); border-radius:7px; }
.wallet span span { padding:0; }
.wallet-rules { font-size:.94rem; margin:10px 0 0; color:var(--muted); }
.task-wallet { background:transparent; border:0; padding:0; margin-top:8px; }
.coin-pop { font-weight:900; margin:0 0 7px; color:#503c12; background:#fff1b6; border-radius:8px; padding:5px 9px; animation:checkpoint-pop .34s ease-out both; }
.studio-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.15fr); gap:16px; }
.avatar-stage { margin-top:14px; padding:10px 12px; border-radius:22px; background:radial-gradient(ellipse at 50% 43%,#e7d9fd,transparent 74%),linear-gradient(155deg,#d4c7ff,#a692e6); border:1px solid var(--border); align-self:start; }
.first .avatar-stage { background:radial-gradient(ellipse at 50% 41%,#fff2da,transparent 76%),linear-gradient(155deg,#ffe7e8,#dda6c4); }
.avatar-stage canvas { width:100%; height:auto; max-height:380px; display:block; object-fit:contain; cursor:grab; touch-action:pan-y; }
.avatar-stage canvas:active { cursor:grabbing; }
.avatar-rotate { display:flex; gap:6px; justify-content:center; flex-wrap:wrap; }
.profile-form > label { font-weight:800; }
.profile-form > input { width:100%; display:block; border:1px solid #8874b4; border-radius:10px; min-height:46px; margin:5px 0 15px; padding:7px 10px; }
.profile-form fieldset { border:0; margin:0 0 12px; padding:0; }
.profile-form legend { padding:0; margin-bottom:5px; font-weight:800; }
.avatar-types { display:flex; flex-wrap:wrap; gap:8px; }
.avatar-types label { background:var(--buddy-bg); border-radius:9px; padding:8px; }
.wardrobe-tabs { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:15px; }
.wardrobe-tabs [aria-pressed="true"], .wardrobe-item[aria-pressed="true"] { background:var(--buddy-bg); border-color:var(--action); }
.wardrobe-items { display:grid; gap:7px; }
.wardrobe-item { display:grid; grid-template-columns:22px 1fr auto; gap:8px; align-items:center; text-align:left; min-height:45px; width:100%; color:inherit; background:white; border:1px solid var(--border); padding:5px 8px; border-radius:10px; }
.wardrobe-item > span:last-child { font-weight:900; }
.swatch { display:inline-block; width:18px; height:18px; border-radius:50%; border:1px solid #382b6140; background:var(--swatch); }
.wardrobe .btn:disabled { opacity:.6; }
@media(max-width:640px){.studio-grid{grid-template-columns:1fr;gap:0}.avatar-stage canvas{max-height:260px}.world-toolbar{gap:7px}.world-toolbar .btn{margin-left:0}}
.player-medallion { display:inline-block; flex:none; width:46px; height:46px; border:1px solid var(--border); border-radius:12px; background:var(--buddy-bg); }
.task-wallet .player-medallion { width:39px;height:39px; }
.world.preschool { --world-canvas:#261850; --world-faint:#4e297b; --world-accent:#ffe295; --action:#693bb3; --buddy-bg:#f2e7ff; --buddy-text:#402764; --art:url("art/mira-world.webp"); color:#271d42; }
.world.preschool .world-cover::before { background:linear-gradient(90deg,#181035eb,transparent 90%),linear-gradient(0deg,#211249e0,transparent 77%),var(--art) right center / cover; }
.world.preschool .reward { background:var(--buddy-bg); color:var(--buddy-text); }
.world.preschool .guide-pose img { background:linear-gradient(150deg,#fdaecf,#a97cf3); }
.world-cards { grid-template-columns:repeat(3,minmax(0,1fr)); }
.preschool-task .choices { gap:12px; }
.preschool-task .choice { min-width:64px; min-height:63px; font-size:1.75rem; }
.count-stars { padding:14px; margin:0 0 15px; border-radius:14px; background:#fff4ce; }
.star-group { color:#996100; display:inline-block; font-size:clamp(1.35rem,5vw,2.1rem); line-height:1.38; letter-spacing:.12em; }
.preschool-shape { display:block; width:42px; height:42px; background:#7443c9; }
.shape-0 { border-radius:50%; background:#1b9b84; }
.shape-1 { clip-path:polygon(50% 1%,99% 99%,1% 99%); background:#d35482; }
@media(max-width:820px) { .world-cards { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) { .world-cards { grid-template-columns:1fr; } }
.unit-task .choices { gap:11px; }
.unit-task .choice { min-width:62px; min-height:61px; font-size:clamp(1.13rem,4vw,1.58rem); }
.preschool .unit-task .choice { min-width:64px; min-height:63px; font-size:1.55rem; }
.unit-visual { display:flex; flex-wrap:wrap; align-items:center; gap:9px; font-size:clamp(1.45rem,6vw,2rem); font-weight:900; margin:9px 0 15px; }
.unit-visual .frac { color:var(--buddy-text); }
.unit-stars { background:#fff2c6; border-radius:14px; padding:10px 12px; margin:0 0 14px; font-size:clamp(1.38rem,4vw,2rem); letter-spacing:.13em; color:#996100; }
.shape-series { display:inline-flex; gap:6px; flex-wrap:wrap; align-items:center; vertical-align:middle; }
.shape-series > span { width:27px; height:27px; }
.unit-task > .shape-series { margin:0 8px 14px 0; }
.series-number { display:inline-grid; place-items:center; border-radius:9px; min-width:39px; padding:4px; background:var(--buddy-bg); color:var(--buddy-text); font-weight:850; }
.minus-kittens { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 14px; }
.minus-kittens span { position:relative; width:34px; height:34px; border:2px solid #944768; border-radius:8px; overflow:hidden; }
.minus-kittens img { width:100%;height:100%;object-fit:cover; }
.minus-kittens .crossed { opacity:.62; }
.minus-kittens .crossed::after { content:""; position:absolute; top:48%; left:-18%; width:140%; height:3px; border-radius:3px; transform:rotate(-40deg); background:#582235; }
.length-board { width:min(100%,390px); padding:12px 0 15px; }
.length-strip { width:calc(var(--units) * 9.0909%); height:21px; background:#db6b99; border-radius:4px; }
.length-scale { border-top:2px solid #40264d; display:grid; grid-template-columns:repeat(11,1fr); font-size:.8rem; }
.length-scale span { padding-top:5px; background:linear-gradient(#40264d,#40264d) left top/1px 5px no-repeat; }
.length-scale span:last-child { padding-left:1px; }
.hidden-stars { opacity:.62; text-decoration:line-through 3px #973159; }
.position-tile { width:54px;height:53px;display:grid;place-items:center;border:2px solid #a48ac9;border-radius:10px;background:#fff2c6;color:#825808; }
.unit-task .ribbons { display:grid; max-width:282px; }
.unit-task .ribbons .choice { justify-content:flex-start; }
.compare-ribbon { width:calc(var(--size) * 35px); height:18px; border-radius:3px; background:#a35cc5; }
.compare-circle { width:calc(var(--size) * 15px + 12px); height:calc(var(--size) * 15px + 12px); border-radius:50%; background:#20a489; }
.map-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; margin:24px 0 0; }
.map-heading .section-title { margin:0; }
.map-heading [aria-pressed="true"] { border-color:var(--action); background:var(--buddy-bg); }
