.phase-game{max-width:1400px;margin:0 auto;padding:12px;color:#242a42;font-family:system-ui,sans-serif}.phase-game *{box-sizing:border-box}.phase-game h1{font-size:clamp(20px,3vw,28px);margin:8px 0 14px}.phase-world{position:relative;border-radius:16px;overflow:hidden;background:#e8f1ed}.phase-world canvas{display:block;width:100%;height:auto;touch-action:none;outline:none}.phase-world canvas:focus-visible{box-shadow:inset 0 0 0 3px #74528e}.phase-world #phaseStars{position:absolute;top:12px;left:14px;font-weight:800;color:#252d3f;background:#fffaf0;padding:7px 12px;border-radius:12px;pointer-events:none}.phase-controls{display:flex;justify-content:space-between;gap:10px;margin-top:12px;touch-action:none;user-select:none;padding-bottom:env(safe-area-inset-bottom,0)}.phase-controls>div{display:flex;gap:8px}.phase-controls button{background:#e1d7ee;border:2px solid #c4b2d9;border-radius:15px;min-height:62px;min-width:96px;padding:12px 16px;font:800 17px system-ui;color:#27253e;touch-action:none;-webkit-user-select:none;cursor:pointer}.phase-controls button[data-move=jump]{background:#f7dea2;border-color:#e3c77f}.phase-controls button.held{background:#c0dcd6;transform:scale(.97)}.phase-controls button:focus-visible{outline:3px solid #75458e;outline-offset:2px}.phase-game p{font-size:14px;line-height:1.5;margin:10px 0}.phase-game .phase-keys{color:#596573;font-size:12px}.in-platformer header,.in-platformer .welcome,.in-platformer #choices,.in-platformer .privacy,.in-platformer footer,.in-platformer #status{display:none!important}.in-platformer main{max-width:1450px;width:100%;margin:auto;padding:4px}body[data-platform-prototype]{margin:0;background:#fff9ef}#phaseStatus{min-height:21px}@media(max-width:600px){.phase-game{padding:8px}.phase-controls button{min-width:83px;min-height:62px;font-size:15px;padding:10px}.phase-controls{gap:5px}.phase-controls>div{gap:5px}}@media(prefers-reduced-motion:reduce){.phase-controls button{transform:none!important}}@media print{.phase-controls{display:none}}

body.in-platformer{overscroll-behavior:none}.phase-controls button{-webkit-touch-callout:none}.phase-world{touch-action:none}
.phase-world #phaseStars{font-size:14px;padding:6px 9px;max-width:calc(100% - 28px);white-space:nowrap;background:rgba(255,250,240,.94)}#phaseSound{margin:6px 0;min-height:44px;padding:8px 14px;border:1px solid #b9ccd0;border-radius:12px;background:#eff7f4;color:#263849;font:600 14px system-ui;cursor:pointer}#phaseSound:focus-visible{outline:3px solid #75458e;outline-offset:2px}@media print{#phaseSound{display:none}}
.phase-world #phaseStars{display:flex;gap:9px;align-items:center}.phase-world #phaseStars>span{display:inline-flex;align-items:center;gap:3px}.phase-world #phaseStars img{width:22px;height:22px;object-fit:contain}

.phase-world #phaseStars{flex-wrap:wrap;max-width:calc(100% - 28px);font-size:12px;gap:5px}.phase-world #phaseStars img{width:18px;height:18px}
/* HUD lives above the canvas, never on top of a character. */
.phase-world{display:flex;flex-direction:column}.phase-world canvas{order:2}.phase-world #phaseStars{position:static;order:0;max-width:none;border-radius:0;padding:8px 12px;min-height:36px;background:#fffaf0;gap:7px;flex-wrap:wrap}.phase-tools{order:1;display:flex;gap:8px;padding:4px 10px 8px;background:#fffaf0}.phase-tools button{min-height:44px;border:1px solid #c8bbd6;border-radius:12px;padding:8px 14px;font:600 14px system-ui;color:#353550;background:#ece3f4;cursor:pointer}.phase-tools #phasePause{margin-left:auto;background:#e0efea}.phase-tools button:focus-visible,#phaseLegendClose:focus-visible{outline:3px solid #775594;outline-offset:2px}#phaseLegendDialog{width:min(470px,calc(100vw - 28px));max-height:80dvh;border:1px solid #d4c5de;border-radius:20px;padding:20px;color:#30334c;background:#fffaf1;font-family:system-ui;box-shadow:0 14px 50px #26334b33}#phaseLegendDialog::backdrop{background:#25334b66}#phaseLegendDialog h2{font-size:23px;margin:0 0 14px}.phase-legend-item{display:grid;grid-template-columns:44px 1fr 34px;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid #e9e0df}.phase-legend-item img{width:44px;height:44px}.phase-legend-item b{font-size:15px}.phase-legend-item small{display:block;color:#656675;margin-top:3px}.phase-legend-item strong{text-align:right;font-size:18px}#phaseLegendClose{width:100%;min-height:48px;margin-top:16px;padding:10px;border:1px solid #537f79;border-radius:12px;background:#dcece7;color:#293f42;font:700 16px system-ui;cursor:pointer}.phase-message-fade{opacity:0}#phaseStatus{transition:opacity .2s ease;min-height:24px}@media(prefers-reduced-motion:reduce){#phaseStatus{transition:none}}@media print{.phase-tools,#phaseLegendDialog{display:none!important}}
#phaseLegendClose{position:sticky;bottom:0}

.phase-audio{display:flex;flex-wrap:wrap;gap:10px}.phase-audio button{min-height:48px;padding:10px 16px} @media print{.phase-audio{display:none}}

.phase-finish-actions{padding:20px;margin-top:16px;border-radius:20px;background:#f4ede1}.phase-finish-actions p{line-height:1.6}.phase-finish-actions button,.phase-finish-actions a{display:inline-flex;min-height:48px;align-items:center;padding:12px 18px;margin:8px 10px 0 0;border-radius:14px}.phase-finish-actions button{background:#d5ece4}.phase-finish-actions a{background:#e5dcf0;color:#37334f}@media print{.phase-finish-actions{display:none}}
/* Boss status stays outside the play canvas and never covers a character. */
.phase-boss-hud{order:1;padding:10px 12px;background:#e9e1f2;color:#34334e;display:flex;align-items:center;gap:12px;flex-wrap:wrap}.phase-boss-hud[hidden]{display:none}.phase-boss-hud p{flex-basis:100%;margin:0;font-size:14px;line-height:1.45}#phaseBossHearts{font-size:24px;letter-spacing:3px;color:#744898}.phase-champion{font-weight:800;color:#3c5f58}@media print{.phase-boss-hud{display:none}}
