:root{color-scheme:light;--paper:#fff5df;--purple:#48295f;--pink:#ed93b8;--yellow:#ffdc79;--ink:#35233f;--muted:#674f70;--line:#926696;--pad:clamp(12px,2vw,24px)}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;color:var(--ink);background:#f0d9eb;font-family:ui-rounded,"Trebuchet MS",system-ui,sans-serif;line-height:1.5}.top{max-width:1200px;margin:auto;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:var(--pad)}h1{font-size:clamp(22px,4vw,36px);line-height:1.15;margin:5px 0}small{letter-spacing:.09em;font-size:11px;color:var(--muted)}nav,.homeTools,.dialogActions,.controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap}button,select,summary{font:inherit;min-height:46px}button,select{border:2px solid var(--line);border-radius:13px;background:var(--paper);color:var(--ink);padding:9px 15px;max-width:100%;overflow-wrap:anywhere}button{cursor:pointer;font-weight:700}button:disabled{opacity:.5;cursor:default}button:focus-visible,select:focus-visible,summary:focus-visible,#stage:focus-visible{outline:3px solid #7841b1;outline-offset:3px}.primary{background:var(--yellow)}main{max-width:1200px;margin:auto;padding:0 var(--pad) var(--pad)}.hero{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(260px,1fr);gap:var(--pad);align-items:center;background:var(--paper);border:2px solid #b78bb4;border-radius:22px;overflow:hidden;padding:14px}.hero>img{width:100%;border-radius:13px;aspect-ratio:16/9;object-fit:cover}.hero p:first-child{margin-top:0}.hero button{margin:4px 4px 4px 0}.hero #career{font-weight:700}.hero #saved,.hero #boot{font-size:14px;color:var(--muted)}.homeTools{margin:18px 0;align-items:flex-start}.homeTools details{max-width:100%}summary{cursor:pointer;padding:9px 0;font-weight:700}details p{max-width:80ch}.levelGrid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.levelGrid button{min-height:60px;font-size:14px}.runTop{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}.hud{display:flex;justify-content:space-between;gap:6px 12px;flex-wrap:wrap;font-size:14px;font-weight:700;margin:8px 0}#stage{height:clamp(280px,48vh,440px);border:3px solid var(--purple);border-radius:20px;overflow:hidden;position:relative;touch-action:none;background:var(--purple)}canvas{display:block;width:100%;height:100%}.controls{margin-top:10px}.controls #flip{min-width:150px;font-size:20px}.controls span{font-size:14px;color:var(--muted)}#lesson{margin:10px 0 3px}#live{font-size:14px;color:var(--muted);min-height:22px;margin:4px 0}dialog{width:min(560px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow:auto;background:var(--paper);color:var(--ink);border:3px solid var(--purple);border-radius:22px;padding:22px}dialog::backdrop{background:#25143199}dialog h2{margin-top:0;line-height:1.3}dialog label{display:flex;align-items:center;gap:12px;margin:12px 0;min-height:44px}dialog input[type=checkbox]{width:24px;height:24px;accent-color:var(--purple)}dialog button{margin:5px 5px 5px 0}.skins{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.skins button{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:5px;font-size:13px}.skins img{width:38px;height:110px;object-fit:contain}.skins small{font-size:12px;letter-spacing:0}.props{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.props p{display:flex;align-items:center;gap:8px;font-size:13px}.props img{width:42px;height:42px;object-fit:contain}#notice:empty,#boot:empty,#saved:empty{display:none}@media(max-width:700px){.top{align-items:flex-start;flex-direction:column}.top nav{width:100%}.top nav button{padding:8px 11px;font-size:14px;flex:1}.hero{grid-template-columns:minmax(0,1fr);padding:10px}.hero>div{padding:0 5px}.hero p:first-child{font-size:15px}.hero button{font-size:14px}.levelGrid{grid-template-columns:repeat(4,minmax(0,1fr))}.levelGrid button{padding:7px;font-size:13px}.hud{font-size:12px}#stage{height:clamp(280px,41vh,350px)}.controls #flip{flex:1}.controls span{font-size:12px}#lesson{font-size:14px}dialog{padding:17px}.homeTools>button{flex:1;font-size:14px}}@media(max-height:480px) and (min-width:600px){.top{padding-top:6px;padding-bottom:6px}.top small{display:none}h1{font-size:20px}.top nav button{font-size:12px;min-height:40px}.runTop{position:absolute;top:10px;left:40%;font-size:12px}.runTop button{min-height:36px;font-size:12px}.hud{margin:3px 0;font-size:12px}#stage{height:210px;min-height:210px}.controls{margin-top:5px}.controls #flip{font-size:15px;min-height:42px}#lesson,#live{font-size:12px;margin:3px 0}body:has(#game:not([hidden])) .top nav{visibility:hidden}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
/* Long localized words and large DOM fonts must remain inside the readable modal. */
dialog h2,.props p span{overflow-wrap:anywhere}.props p,.props p span{min-width:0}.props img{flex-shrink:0}dialog label:has(select){flex-direction:column;align-items:stretch;gap:6px}dialog label select{min-width:0;width:100%}@media(max-height:480px) and (min-width:600px){.top nav button,.runTop button,.controls #flip{min-height:44px}}
