*{box-sizing:border-box}body{margin:0;background:#080b0b;color:#eee;font:15px/1.5 system-ui}main{min-height:100dvh;width:100%;display:flex;flex-direction:column;padding:10px 16px;background:#080b0b}header{display:flex;flex-wrap:wrap;align-items:center;gap:8px;flex-shrink:0;padding-bottom:8px}header .brand{color:#ff6464;margin-right:12px;line-height:1.15}header .brand span{display:block;color:#c4cdd1;font-size:11px;letter-spacing:.04em}header a{font-size:12px;margin-left:auto}a{color:#8edbea;text-underline-offset:3px}button{min-height:42px;border:1px solid #778087;border-radius:9px;background:#293036;color:white;padding:8px 12px;font:inherit;touch-action:manipulation}button:disabled{opacity:.45}button:focus-visible,a:focus-visible{outline:2px solid #0bf;outline-offset:3px}header button{font-size:12px;min-height:36px}header button[aria-pressed=true]{background:#0bf;color:#000}#touch-toggle{line-height:13px}#stage{flex:1;min-height:280px;height:calc(100dvh - 285px);display:grid;grid-template-columns:minmax(95px,16%) minmax(0,1fr) minmax(95px,16%);gap:14px;align-items:center}iframe{grid-column:2;grid-row:1;display:block;width:100%;height:100%;border:0;min-height:260px}#pad{grid-column:1;grid-row:1;width:100%;max-width:240px;aspect-ratio:1;justify-self:center;position:relative;border-radius:50%;border:3px solid #555;background:repeating-conic-gradient(from 22.5deg,#333 0deg 43deg,#555 43deg 45deg);box-shadow:inset 0 3px 10px #000,0 2px 0 #666;touch-action:none;user-select:none;-webkit-user-select:none}#pad::before{content:"";position:absolute;inset:27.5%;border:2px solid #aaa8;border-radius:50%;background:#2228;pointer-events:none}#knob{position:absolute;inset:26%;border-radius:50%;background:radial-gradient(circle at 35% 25%,#999,#444 65%,#222);box-shadow:0 4px 8px #000;pointer-events:none}#actions{grid-column:3;grid-row:1;display:flex;flex-direction:column;align-items:center;gap:12px}#fire{width:clamp(75px,10vw,120px);height:clamp(75px,10vw,120px);border-radius:50%;border:6px solid #580909;background:radial-gradient(circle at 35% 25%,#f77,#e21b1b 55%,#970000);box-shadow:inset 0 2px 2px #faa,0 5px 0 #310000,0 7px 8px #000;font-weight:bold;touch-action:none;user-select:none}#bomb{background:#67410f;border-color:#ecb456;font-size:12px;font-weight:700;touch-action:none;user-select:none}#below-fire{display:flex;flex-wrap:wrap;gap:6px;justify-content:center}#below-fire button{font-size:12px;padding:7px 8px}#controls-help{flex-shrink:0;max-width:1250px;width:100%;align-self:center;border-top:1px solid #334044;padding:12px 0 4px;font-size:12px;color:#c4cdd1}#controls-help h1{font-size:14px;margin:0 0 6px;color:#fff}#controls-help p{margin:3px 0}#controls-help strong{color:#fff}kbd{display:inline-block;padding:0 4px;border:1px solid #64747a;border-radius:3px;color:#fff;background:#202b30;font:600 12px/1.5 ui-monospace,monospace}.links{padding-top:5px}#status{font-size:12px;color:#8edbea;margin:4px 0 0;min-height:18px}.touch-off #pad,.touch-off #fire,.touch-off #bomb{display:none}main:fullscreen{height:100dvh;overflow:auto}
@media(max-width:640px){main{padding:8px 12px}header a{margin-left:0}#stage{flex:none;height:auto;min-height:0;grid-template-columns:1fr 1fr;grid-template-rows:clamp(200px,65vw,350px) 185px;gap:8px}iframe{grid-column:1/3;grid-row:1;min-height:0}#pad{grid-column:1;grid-row:2;width:min(100%,165px)}#actions{grid-column:2;grid-row:2;gap:8px}#fire{height:75px;width:75px}#below-fire button{min-height:34px}#bomb{min-height:36px}#controls-help{font-size:12px}header .brand{flex:1}header button{padding:6px 9px}.touch-off #stage{grid-template-rows:clamp(200px,65vw,350px) auto}.touch-off #actions{grid-column:1/3;min-height:40px}}
/* Session actions are deliberately separate from the active thumb controls. */
main{position:relative}header{padding-right:180px;min-height:54px}#session-actions{position:absolute;top:10px;right:16px;display:flex;gap:8px;z-index:2}#session-actions button{font-size:12px;min-height:40px;padding:8px 12px}
@media(max-width:640px){header{padding-right:150px;min-height:100px;align-content:flex-start}header .brand{flex-basis:100%}header a{font-size:11px}#session-actions{top:8px;right:12px;gap:6px}#session-actions button{padding:7px 9px;font-size:11px}#actions{justify-content:center}.touch-off #actions{min-height:0}.touch-off #stage{grid-template-rows:clamp(200px,65vw,350px) 0;row-gap:0}}
/* Fullscreen gives the instruction area back to the game. */
main:fullscreen{overflow:hidden}
main:fullscreen #controls-help,main:fullscreen #status,main:fullscreen header a{display:none}
main:fullscreen #stage{flex:1;min-height:0;height:0}
main:fullscreen iframe{min-height:0}
@media(max-width:640px){main:fullscreen #stage{grid-template-rows:minmax(0,1fr) min(185px,30dvh)}main:fullscreen.touch-off #stage{grid-template-rows:minmax(0,1fr) 0}}

/* Two rows keep options in the top-right, separate from Fire and Sinibomb. */
#session-actions{width:180px;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px}
#session-actions button{flex:1 0 42%;min-height:34px;padding:6px 8px}
#session-actions #pause{flex-basis:100%}
#session-actions button[aria-pressed=true]{background:#0bf;color:#000}
header{min-height:126px;padding-right:196px}
.paused #emulator{opacity:.7}
@media(max-width:640px){#session-actions{width:150px}header{padding-right:162px;min-height:134px}}
