* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #080b10; color: #e6b677; font-family: system-ui, sans-serif; }
body { display: flex; flex-direction: column; height: 100svh; }
header { min-height: 44px; padding: 5px max(10px, env(safe-area-inset-right)) 5px max(10px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }
header strong { letter-spacing: 2px; }
button { min-height: 36px; border: 1px solid #b87832; border-radius: 6px; background: #18232d; color: #ffe2b3; padding: 6px 12px; cursor: pointer; font: inherit; touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
button:disabled { opacity: .7; cursor: wait; }
main { position: relative; display: flex; flex: 1; min-height: 0; align-items: center; justify-content: center; overflow: hidden; }
#stage { position: relative; width: min(100vw, calc((100svh - 82px) * 16 / 9)); aspect-ratio: 16 / 9; background: #000; }
#c { display: block; width: 100%; height: 100%; image-rendering: pixelated; touch-action: none; cursor: crosshair; }
#a { position: absolute; top: 7%; left: 2%; width: 96%; height: 90%; overflow: hidden; white-space: nowrap; pointer-events: none; font-weight: bold; color: #c80; font-size: clamp(7px, 1.6vw, 19px); text-shadow: 0 0 7px #f70; transition: opacity 1s; }
#a div:last-child { color: #e90; }
#a b { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }
#start { position: absolute; bottom: 9%; left: 50%; transform: translateX(-50%); min-height: 44px; white-space: nowrap; background: #18232de8; }
[hidden] { display: none !important; }
footer { flex-shrink: 0; min-height: 34px; padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)); text-align: center; font-size: 11px; }
a { color: #a9d4ec; }
.mobile-help, #touch-controls { display: none; }
@media (pointer: coarse), (max-width: 700px) {
  .desktop-help { display: none; }
  .mobile-help { display: inline; }
  header { font-size: 10px; gap: 6px; }
  header strong { letter-spacing: 1px; }
  #mute { min-height: 38px; padding: 4px 8px; }
  .playing #touch-controls { display: flex; position: absolute; inset: auto 14px max(10px, env(safe-area-inset-bottom)); justify-content: space-between; pointer-events: none; }
  #move-pad, #aim-pad { width: 112px; height: 112px; border: 2px solid #b9a77c9e; border-radius: 50%; display: grid; place-items: center; background: #0b182e99; color: #f9e8c3; text-align: center; font-size: 15px; line-height: 1.5; user-select: none; touch-action: none; pointer-events: auto; }
  #aim-pad { border-color: #dc8c6aac; background: #471a2590; }
  #move-pad.active, #aim-pad.active { background: #65512bd9; }
  footer { font-size: 9px; }
}
@media (pointer: coarse) and (orientation: landscape) {
  #move-pad, #aim-pad { width: 92px; height: 92px; font-size: 13px; }
}
@media (max-width: 700px) and (orientation: portrait) {
  #stage { margin-bottom: 110px; }
}
