[hidden]{display:none!important}
*{box-sizing:border-box}
html,body{margin:0;height:100%;overflow:hidden;background:#1d1747;color:#fff;font-family:"Trebuchet MS","Segoe UI",system-ui,-apple-system,sans-serif;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;touch-action:none;overscroll-behavior:none}
canvas#game{position:fixed;inset:0;width:100vw;height:100vh;height:100dvh;display:block}
button{font-family:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.hud{position:fixed;top:0;left:64px;right:8px;height:48px;display:flex;align-items:center;justify-content:space-between;gap:6px;z-index:3;pointer-events:none;padding-top:env(safe-area-inset-top)}
.hud-stats{display:flex;align-items:center;gap:10px;min-width:0}
.stat{display:flex;flex-direction:column;line-height:1.05;min-width:0}
.stat .lbl{font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:#cfc6ff;opacity:.9}
.stat b{font-size:17px;font-variant-numeric:tabular-nums;color:#ffd34d;text-shadow:0 2px 0 #3b2f94}
.lives{display:flex;gap:2px;align-items:center}
.lives canvas{width:24px;height:24px}
.hud-btns{display:flex;gap:6px;pointer-events:auto}
.round{width:44px;height:44px;border-radius:50%;border:2px solid #fff;background:#6551d9;color:#fff;font-size:17px;box-shadow:0 3px 0 #3b2f94;display:flex;align-items:center;justify-content:center;padding:0}
.round:active{transform:translateY(2px);box-shadow:0 1px 0 #3b2f94}
.dpad{position:fixed;z-index:3;width:172px;height:172px;touch-action:none}
.dp{position:absolute;width:60px;height:60px;border-radius:18px;border:3px solid rgba(255,255,255,.9);background:rgba(101,81,217,.85);color:#fff;font-size:22px;box-shadow:0 4px 0 #3b2f94;display:flex;align-items:center;justify-content:center;padding:0;touch-action:none}
.dp.on{background:#f0862a;transform:translateY(2px);box-shadow:0 2px 0 #9a4d10}
.dp.up{left:56px;top:0}.dp.down{left:56px;bottom:0}.dp.left{left:0;top:56px}.dp.right{right:0;top:56px}
.side{position:fixed;z-index:2;width:220px;display:flex;flex-direction:column;gap:8px;pointer-events:none}
.side .card{background:rgba(41,35,95,.82);border:2px solid rgba(207,198,255,.35);border-radius:16px;padding:8px 10px;display:flex;align-items:center;gap:10px}
.side .card canvas{width:56px;height:56px;flex:none}
.side .card b{display:block;font-size:15px}
.side .card span{font-size:12.5px;color:#e3ddff;line-height:1.25}
.side h3{margin:2px 4px;font-size:14px;color:#ffd34d;letter-spacing:.04em}
.screen{position:fixed;inset:0;z-index:5;display:flex;align-items:center;justify-content:center;padding:12px 12px 12px 64px;pointer-events:none}
.screen:empty{display:none}
.panel{pointer-events:auto;background:linear-gradient(#3b2f94,#29235f);border:3px solid #cfc6ff;border-radius:24px;box-shadow:0 10px 30px rgba(0,0,0,.45),inset 0 2px 0 rgba(255,255,255,.2);padding:16px 18px;max-width:min(520px,100%);max-height:100%;overflow:auto;text-align:center}
.panel h1{margin:0 0 4px;font-size:clamp(24px,6vw,38px);line-height:1.05;color:#ffd34d;text-shadow:0 3px 0 #1d1747}
.panel h2{margin:0 0 6px;font-size:clamp(20px,5vw,28px);color:#ffd34d}
.panel p{margin:6px 0;font-size:15px;line-height:1.35;color:#f1edff}
.panel .small{font-size:13px;color:#cfc6ff}
.hero{display:flex;justify-content:center;align-items:flex-end;gap:2px;margin:2px 0 4px}
.hero canvas{flex:none}
.cast{display:flex;gap:6px;justify-content:center;flex-wrap:wrap;margin:6px 0}
.cast .who{width:104px;background:rgba(255,255,255,.08);border-radius:14px;padding:6px;font-size:12.5px;line-height:1.2;color:#e3ddff}
.cast .who b{display:block;font-size:14px;color:#fff}
.cast canvas{width:52px;height:52px}
.btn{min-height:48px;min-width:120px;padding:10px 20px;border-radius:16px;border:3px solid #fff;background:#f0862a;color:#fff;font-size:19px;font-weight:bold;box-shadow:0 5px 0 #9a4d10;margin:6px 4px;text-shadow:0 2px 0 rgba(0,0,0,.25)}
.btn.alt{background:#6551d9;box-shadow:0 5px 0 #2a2170;font-size:16px}
.btn:active{transform:translateY(3px);box-shadow:0 2px 0 #9a4d10}
.btn:focus-visible,.round:focus-visible,.choice:focus-visible,.seg button:focus-visible{outline:3px solid #ffd34d;outline-offset:2px}
.seg{display:inline-flex;border-radius:14px;overflow:hidden;border:2px solid #cfc6ff;margin:4px}
.seg button{min-height:44px;min-width:96px;padding:6px 10px;border:0;background:transparent;color:#e3ddff;font-size:15px;font-weight:bold}
.seg button[aria-pressed="true"]{background:#2e9b5f;color:#fff}
.row{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:4px}
.choices{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin:10px 0 4px}
.choice{min-width:84px;min-height:60px;border-radius:16px;border:3px solid #fff;background:#2e9b5f;color:#fff;font-size:26px;font-weight:bold;box-shadow:0 5px 0 #17603a}
.choice.right{background:#2fbf71}.choice.wrong{background:#c0504a;box-shadow:0 5px 0 #7a2a26}
.q{font-size:clamp(26px,7vw,40px);font-weight:bold;margin:6px 0;color:#fff}
.fact{background:rgba(255,255,255,.1);border-radius:14px;padding:8px 10px}
.keys{font-size:12.5px;color:#cfc6ff;margin-top:6px}
@media (max-height:520px){.panel{padding:10px 14px}.panel p{font-size:13.5px;margin:4px 0}.cast .who{width:118px}.btn{min-height:46px;margin:4px}}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
@media (max-width:400px){.hud-stats{gap:7px}.stat b{font-size:15px}.stat.best{display:none}.lives canvas{width:20px;height:20px}}
.hud.col{top:176px;height:auto;flex-direction:column;align-items:flex-start;padding-top:0}
.hud.col .hud-stats{flex-direction:column;align-items:flex-start;gap:5px}
.hud.col .stat.best{display:none}
.hud.col .lives{flex-wrap:wrap;max-width:56px}
.hud.col .hud-btns{position:fixed;top:6px;right:10px}
.howrow{display:flex;align-items:center;gap:10px;text-align:left;margin:6px 0}.howrow canvas{flex:none}.howrow p{margin:0;font-size:14.5px}
.badges{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:6px;margin:6px 0;text-align:left}
.badge{background:rgba(255,255,255,.06);border:2px solid rgba(207,198,255,.25);border-radius:12px;padding:6px 8px;opacity:.65}
.badge.on{opacity:1;border-color:#ffd34d;background:rgba(255,211,77,.12)}.badge.new{box-shadow:0 0 0 3px #7dff9a}
.badge b{display:block;font-size:14px;color:#ffd34d}.badge span{font-size:12px;color:#e3ddff}
.panel .sticky{position:sticky;bottom:-16px;padding-top:4px;background:linear-gradient(rgba(41,35,95,0),#29235f 30%)}
.panel.tight .howrow p{font-size:13px;line-height:1.28}.panel.tight .howrow{margin:4px 0;gap:8px}.panel.tight h2{margin-bottom:2px}
@media (max-height:460px){.q{font-size:26px;margin:2px 0}.choices{margin:6px 0 2px}.choice{min-height:52px}.panel h2{font-size:20px}.panel h2 canvas{vertical-align:middle}}
