:root{color-scheme:dark;background:#100e14;color:#f7eef0;font:16px/1.5 system-ui,sans-serif}
*{box-sizing:border-box}
body{margin:0}
header,main{width:min(100% - 2rem,68rem);margin-inline:auto}
header{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:.75rem 0;border-bottom:1px solid #4d3036}
header span{color:#e8c6bf;font-size:.85rem}
a{color:#ffc28f}
h1{font-size:clamp(1.8rem,5vw,3rem);line-height:1.05;margin:1rem 0 .3rem}
h1 span{color:#ffad83;font-size:.62em}
.intro,.help,footer{color:#e7d2d2}
.intro{margin:0 0 .7rem}
.console{overflow:hidden;border:1px solid #78414b;border-radius:.65rem;background:#1b131a}
#game-stage{position:relative;height:clamp(210px,58svh,560px);overflow:hidden;isolation:isolate;background:#08070a;touch-action:none}
#container,#overlay,#start-panel{position:absolute;inset:0}
#container canvas,#overlay{display:block}
#overlay{pointer-events:none}
#start-panel{display:grid;place-content:center;text-align:center;gap:.4rem;background:#130b12;padding:1rem}
#start-panel p{max-width:36ch;margin:.3rem auto;color:#e9d4d2}
button{font:inherit;cursor:pointer;color:#fff5ec;background:#44222c;border:1px solid #a66166;border-radius:.45rem;padding:.45rem .75rem}
button:focus-visible,a:focus-visible,#game-stage:focus-visible{outline:3px solid #ffd29f;outline-offset:-3px}
#start{background:#9b322a;font-weight:800}
#controls{display:flex;justify-content:space-between;gap:.5rem;padding:.5rem;touch-action:none;user-select:none}
#controls[hidden],#start-panel[hidden],#toggle-controls[hidden]{display:none}
.pad,.actions{display:grid;gap:.25rem}
.pad{grid-template-columns:repeat(3,minmax(2.75rem,1fr))}
.pad button:first-child{grid-column:2}
.pad button:nth-child(2){grid-column:1}
.actions{grid-template-columns:repeat(2,minmax(3.1rem,1fr))}
#controls button{min-height:44px;padding:.15rem .3rem;font-size:.9rem;touch-action:none}
#controls button[data-held]{background:#eac1a7;color:#23121a}
#controls .fire{background:#8d3129}
#controls .fire[data-held]{background:#ffd2a9;color:#291613}
.help,footer{font-size:.86rem}
footer{border-top:1px solid #4d3036;margin:1.4rem 0;padding:.75rem 0}
.gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,18rem),1fr));gap:1rem}
.gallery figure{margin:0}
.gallery img{width:100%;height:auto;border-radius:.45rem}
.gallery figcaption{color:#e7d2d2;font-size:.9rem}
@media(max-width:600px){header,main{width:calc(100% - 1rem)}#game-stage{height:clamp(190px,38svh,340px)}}
@media(max-height:500px) and (orientation:landscape){
  header{padding:.3rem 0}
  h1{font-size:1.65rem;margin:.45rem 0 .2rem}
  .intro{font-size:.82rem;margin-bottom:.4rem}
  .console:has(#controls:not([hidden])){display:grid;grid-template-columns:minmax(0,1fr) 11rem}
  #game-stage{height:max(175px,calc(100svh - 104px))}
  #controls{display:grid;align-content:center;justify-content:center;gap:.4rem}
}
