:root { --ink:#27364c; --soft-ink:#68778b; --blue:#4366d6; --cream:#fff7ed; --paper:#fffefd; --line:#e9e7e2; --lavender:#d6c5ff; --rose:#ff967c; --mint:#c8efda; }
  * { box-sizing:border-box; }
  html,body {margin:0; min-height:100%;}
  body {font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", system-ui, -apple-system, sans-serif; color:var(--ink); background:radial-gradient(circle at 7% 3%,#e7f4ff 0,transparent 28%),radial-gradient(circle at 94% 13%,#ffe4d7 0,transparent 27%),linear-gradient(180deg,#fcf5ed 0%,#fbf8f3 100%); -webkit-tap-highlight-color:transparent; }
  button {font:inherit; cursor:pointer; touch-action:manipulation;}
  button:focus-visible {outline:4px solid #527ff1;outline-offset:3px}
  .app {max-width:790px;padding:18px 18px 34px;margin:0 auto;}
  .top {display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:16px;}
  .brand {display:flex;align-items:center;gap:11px}
  .brand-logo {display:grid;place-items:center;background:#fff;border:1px solid #f0e5d7;border-radius:17px;width:49px;height:49px;font-size:25px;box-shadow:0 5px 16px #805d4020;}
  h1 {margin:0;font-size:clamp(20px,3.4vw,27px);letter-spacing:-.05em;line-height:1.12}
  .eyebrow {text-transform:uppercase;letter-spacing:.12em;font-weight:900;color:#c47957;font-size:10px;margin-bottom:4px;}
  .sound-button {border:1px solid #e6e5df;background:#fff;border-radius:14px;width:46px;height:46px;display:grid;place-items:center;font-size:22px;box-shadow:0 3px 10px #77664b17;}
  .subtitle {margin:0 0 17px;color:var(--soft-ink);font-size:14px;line-height:1.4;}
  .difficulty {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 15px;}
  .level {border:2px solid transparent;background:#fff;padding:12px 8px;border-radius:17px;text-align:left;box-shadow:0 5px 15px #77664b10;transition:transform .15s,border .15s;min-width:0;}
  .level:active {transform:scale(.97)}
  .level[aria-pressed="true"] {border-color:#617be2;background:#f5f6ff;box-shadow:0 4px 15px #617be224;}
  .level .emoji {font-size:21px;vertical-align:middle;margin-right:5px}
  .level .name {font-weight:900;font-size:14px;vertical-align:middle}
  .level .desc {color:var(--soft-ink);font-size:11px;margin-top:5px;display:block;font-weight:600;line-height:1.3;}
  .game-frame {overflow:hidden;border:1px solid #f0e3d0;background:var(--paper);border-radius:25px;box-shadow:0 13px 34px #a1855b22;}
  .game-top {display:flex;align-items:center;justify-content:space-between;padding:15px 17px 11px;gap:10px;}
  .pill {background:#f3f0ff;color:#6753b9;padding:8px 12px;border-radius:24px;font-size:12px;font-weight:900;white-space:nowrap;}
  .round-status {display:flex;align-items:center;gap:9px;color:#67768b;font-size:13px;font-weight:800;white-space:nowrap;}
  .dots {display:flex;gap:5px;}
  .dot {width:9px;height:9px;background:#ece9e2;border-radius:50%;}
  .dot.done {background:#f6b84d;}
  .dot.current {background:#6f8aec;box-shadow:0 0 0 3px #6f8aec22}
  .prompt-area {min-height:74px;display:flex;gap:12px;align-items:center;padding:3px 18px 15px;}
  .timer-ring {position:relative;width:53px;height:53px;flex:none;display:none;}
  .timer-ring.active {display:block;}
  .timer-ring svg {display:block;transform:rotate(-90deg)}
  .timer-track {fill:none;stroke:#eeeaf0;stroke-width:7}
  .timer-progress {fill:none;stroke:#6f8ae9;stroke-width:7;stroke-linecap:round;stroke-dasharray:125.66;stroke-dashoffset:0}
  .timer-count {position:absolute;inset:0;display:grid;place-items:center;font-size:18px;font-weight:900;color:#576ad0;}
  .prompt-text {flex:1;min-width:0}
  #prompt {font-size:clamp(19px,4.3vw,25px);font-weight:950;letter-spacing:-.035em;line-height:1.12;margin:0 0 5px;}
  #hint {margin:0;font-size:12px;font-weight:650;color:var(--soft-ink);line-height:1.45;}
  .world {position:relative;margin:0 14px;border-radius:19px;min-height:292px;overflow:hidden;background:linear-gradient(180deg,#ddf2ff 0%,#ecf8ff 70%,#fff3df 70%,#fff3df 100%);border:2px solid #d6eaf5;isolation:isolate;}
  .cloud {position:absolute;top:19px;left:13%;font-size:37px;opacity:.72;filter:drop-shadow(0 6px 6px #ffffffbb);pointer-events:none;}
  .cloud.two {left:auto;right:11%;top:45px;font-size:25px;}
  .scene-title {position:absolute;top:11px;left:0;right:0;text-align:center;color:#7994ae;font-weight:900;font-size:12px;letter-spacing:.04em;}
  .scene {position:relative;z-index:1;width:min(99%,520px);min-height:276px;margin:10px auto 0;display:flex;align-items:flex-end;padding:24px 12px 33px;}
  .shelf-grid {width:100%;min-height:218px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,95px);align-content:end;column-gap:8px;row-gap:9px;position:relative;}
  .shelf-grid::before,.shelf-grid::after {content:"";position:absolute;left:0;right:0;height:11px;z-index:-1;background:linear-gradient(#ddb384,#c99662);border:1px solid #bd8b64;border-radius:5px;box-shadow:0 7px 0 #a77e56;bottom:93px}
  .shelf-grid::after {bottom:-7px;}
  .shelf-grid.three {grid-template-rows:95px;min-height:120px;margin:auto 0 35px}
  .shelf-grid.three::before {display:none}
  .shelf-grid.three::after {bottom:-3px}
  .slot {display:grid;place-items:center;min-width:0;min-height:84px;position:relative;}
  .asset {width:81px;height:81px;max-width:100%;display:grid;place-items:center;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;font-size:51px;line-height:1;background:linear-gradient(145deg,#fffefb,#fff9ee);border-radius:22px;border:2px solid #fff;box-shadow:0 7px 12px #836e5140,0 0 0 1px #e7dfd2;animation:pop .25s ease both;user-select:none;}
  .shelf-grid.three .asset {width:95px;height:95px;font-size:63px;border-radius:26px;}
  @keyframes pop {from {transform:translateY(5px) scale(.87);opacity:.1}to{transform:translateY(0) scale(1);opacity:1}}
  .curtain {position:absolute;inset:0;z-index:4;transform:translateX(-102%);transition:transform .24s ease-in-out;background:repeating-linear-gradient(90deg,#e57877 0px,#e57877 30px,#d86d76 31px,#d86d76 56px,#bb5268 57px,#bb5268 61px);box-shadow:inset 0 -14px 0 #ba596a;display:grid;place-items:center;}
  .curtain::before {content:"";position:absolute;top:0;left:0;right:0;height:20px;background:linear-gradient(#fbd3a2,#eab47c);border-bottom:4px solid #e8a875;}
  .curtain.show {transform:translateX(0)}
  .curtain.hide {transform:translateX(105%)}
  .curtain-message {font-size:27px;font-weight:950;color:#fff;letter-spacing:-.04em;text-shadow:0 3px 3px #ad526a;transform:rotate(-3deg);text-align:center;padding:10px;}
  .curtain-star {display:block;font-size:40px;filter:drop-shadow(0 5px 2px #a14a6333)}
  .ready-overlay,.finish-overlay {position:absolute;z-index:3;inset:0;display:grid;place-items:center;padding:15px;background:#f0f9ffbd;backdrop-filter:blur(4px)}
  .ready-card {background:#fff;box-shadow:0 10px 25px #64839b29;border:1px solid #e8e7ed;border-radius:23px;padding:19px 20px;text-align:center;max-width:330px;width:100%}
  .ready-icon {font-size:46px;margin-bottom:6px}
  .ready-heading {margin:0;font-weight:950;font-size:23px;letter-spacing:-.04em}
  .ready-desc {color:#65758a;font-size:13px;line-height:1.45;margin:8px 0 16px}
  .primary {border:0;border-radius:17px;color:#fff;background:linear-gradient(135deg,#6685ea,#4b66d8);font-weight:900;font-size:15px;padding:13px 23px;min-height:48px;box-shadow:0 7px 0 #3b50af;}
  .primary:active {transform:translateY(3px);box-shadow:0 4px 0 #3b50af;}
  .drawer {padding:16px 15px 18px;min-height:150px;transition:opacity .28s,transform .28s;}
  .drawer.closed {opacity:.35;pointer-events:none;transform:translateY(12px);}
  .drawer-title {display:flex;align-items:center;justify-content:space-between;color:#607084;font-weight:900;font-size:12px;margin-bottom:11px;letter-spacing:.03em}
  .choice-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
  .choice {position:relative;border:2px solid #e6e9ed;background:linear-gradient(#fff,#fffaf2);border-radius:16px;min-height:94px;padding:8px 5px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px;box-shadow:0 5px 0 #e7e5e0;transition:border .15s,transform .15s,box-shadow .15s;}
  .choice:not(:disabled):active {transform:translateY(4px);box-shadow:0 1px 0 #ddd}
  .choice .symbol {font-size:40px;line-height:1.2;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;}
  .choice .label {font-size:12px;font-weight:800;color:#5e6b78;}
  .choice.correct {border-color:#6abf83;background:#eaffed;box-shadow:0 4px 0 #9bd3a9;}
  .choice.correct::after {content:"✓";position:absolute;top:3px;right:9px;color:#28834b;font-size:20px;font-weight:900}
  .choice.wrong {animation:shake .35s ease;}
  @keyframes shake {0%,100%{transform:translateX(0)}25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}
  .feedback {min-height:27px;padding:1px 0 5px;text-align:center;font-weight:900;color:#408c57;font-size:14px;}
  .feedback.nudge {color:#b4782e;}
  .bottomline {display:flex;justify-content:space-between;align-items:center;gap:10px;padding:0 16px 15px;font-size:12px;font-weight:800;color:#8996a5;}
  .tiny {border:0;background:transparent;text-decoration:underline;font-size:12px;color:#7182ab;padding:9px 4px;font-weight:800;}
  .tip {display:flex;gap:9px;align-items:flex-start;padding:13px 2px 0;color:#8590a1;font-size:12px;line-height:1.45;}
  .tip-icon {font-size:17px}
  .confetti {pointer-events:none;position:absolute;z-index:6;width:8px;height:13px;top:40%;left:50%;border-radius:3px;animation:confetti .9s ease-out forwards;}
  @keyframes confetti {to{transform:translate(var(--dx),var(--dy)) rotate(var(--rot));opacity:0}}
  [hidden] {display:none!important}
  @media(min-width:650px) {.app{padding-top:26px}.world{min-height:323px}.scene{min-height:307px;padding-bottom:40px}.shelf-grid{grid-template-rows:repeat(2,105px);row-gap:12px;}.shelf-grid::before{bottom:103px}.shelf-grid.three{margin-bottom:42px}.asset{width:91px;height:91px;font-size:58px}.shelf-grid.three .asset{width:106px;height:106px;font-size:68px}}
  @media(max-width:385px){.app{padding:12px 10px 25px}.brand-logo{width:43px;height:43px}.level .name{font-size:12px}.level .desc{font-size:10px}.level .emoji{font-size:17px}.scene{padding-left:6px;padding-right:6px}.asset{width:73px;height:73px;font-size:46px}.game-top{padding-left:12px;padding-right:12px}.prompt-area{padding-left:12px;padding-right:12px}}
  @media(prefers-reduced-motion:reduce){*,*::after,*::before{animation-duration:.01ms!important;transition-duration:.01ms!important}}
.back-hub {display:inline-block;margin:0 0 12px;color:#5369b4;font-size:13px;font-weight:800;text-decoration:underline;text-underline-offset:3px}

/* Longer native level lists stay usable on touch screens. */
.level-grid,[aria-label="Choose a level"]{flex-wrap:wrap}.level-card[data-level]{min-height:90px}.level-card[data-level="4"]{clear:both}.many-choices{grid-template-columns:repeat(3,minmax(0,1fr))!important}.shelf{flex-wrap:wrap}.dots,.round-progress{flex-wrap:wrap;gap:5px}
