:root{color-scheme:dark;background:#101512;color:#e8efdf;font:16px system-ui,sans-serif}
body{margin:0}main{width:min(100% - 2rem,1100px);margin:auto}header{display:flex;align-items:center;justify-content:space-between;gap:1rem}
h1{font-size:clamp(1.25rem,4vw,2rem)}a{color:#c0e79c}section{max-width:38rem;margin:10vh auto}p{line-height:1.55}
label,button{display:block;font-weight:650;margin:1rem 0 .5rem}button,input{font:inherit;max-width:100%}button,input::file-selector-button{padding:.65rem 1rem;cursor:pointer}
#screen{width:min(100%,calc((100dvh - 6rem)*1.6));aspect-ratio:8/5;margin:auto;background:black}ruffle-player{width:100%;height:100%}[hidden]{display:none}
.classic-credits{font-size:.8rem;color:#b8c9a8}

/* Optional touch-only layer: the original canvas and desktop UI stay intact. */
#touch-options{margin-left:auto}#touch-options button{font-size:.75rem;min-height:48px;margin:0;padding:.35rem .65rem}
#touch-controls{position:fixed;inset:0;pointer-events:none;z-index:4;user-select:none;-webkit-user-select:none}
.touch-move,.touch-actions{position:absolute;display:grid;grid-template-columns:repeat(2,52px);gap:7px;bottom:max(12px,env(safe-area-inset-bottom));pointer-events:none}
.touch-move{left:max(12px,env(safe-area-inset-left))}.touch-actions{right:max(12px,env(safe-area-inset-right))}
#touch-controls button{box-sizing:border-box;width:52px;min-height:52px;margin:0;padding:5px 2px;border:1px solid #b8c9a8;border-radius:12px;background:#16231ddd;color:#f0f6df;font:700 24px system-ui;line-height:1;touch-action:none;pointer-events:auto;box-shadow:0 2px 5px #0008}
#touch-controls button span{display:block;margin-top:3px;font-size:9px;font-weight:600}
#touch-controls button.held{background:#c4e597;color:#142218;border-color:white}
#touch-controls .touch-adrenaline{grid-column:1/3;width:auto;font-size:22px}
#touch-help{position:fixed;left:170px;right:290px;top:8px;margin:0;text-align:center;font-size:10px;line-height:1.3;color:#d5e5bf;pointer-events:none;z-index:5}
#rotate-help{display:none}.classic-touch-device main{width:calc(100% - 16px)}
.classic-touch-device header{min-height:56px;gap:8px}.classic-touch-device h1{font-size:18px;margin:8px 0}
.classic-touch-device #return{font-size:12px;min-height:48px;padding:.4rem .7rem;margin:0}
.classic-touch-controls #screen{width:min(calc(100% - 262px),calc((100dvh - 64px)*1.6));margin:0 auto}
.classic-touch-device #status:empty{display:none}
@media (orientation:portrait){.classic-touch-device header{flex-wrap:wrap}.classic-touch-device #screen{width:100%}.classic-touch-device #rotate-help:not([hidden]){display:block;text-align:center;color:#dbe9be;font-size:13px}.classic-touch-device #touch-help{display:none}.touch-move,.touch-actions{bottom:max(16px,env(safe-area-inset-bottom))}}
@media (max-width:700px){#touch-help{display:none}}
