/* Bunker Brigade shell: the frame around the canvas, drawn with the game's own palette and pixel faces.
   Hard edges only. Buttons are stamped plates with a solid drop shadow that presses down when held. */
:root { --ink: #0b0a0a; --panel: #1a1210; --plate: #34383b; --tan: #c9b585; --sun: #f7d038; --bone: #f4efe4; --rust: #d8301a; --cyan: #5fe8ff; --dim: #7a7a6a; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { overscroll-behavior: none; }
#game-shell { position: relative; width: 100%; height: 100%; height: 100dvh; background: var(--ink); display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); color: var(--bone); font: 15px/1.4 Silkscreen, monospace; }
#game-toolbar { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 8px; min-height: 48px; padding: 6px 12px; z-index: 5; background: var(--panel); border-bottom: 2px solid var(--tan); }
.shell-brand { margin-right: auto; display: flex; align-items: center; gap: 10px; font: 11px "Press Start 2P", monospace; color: var(--sun); letter-spacing: 1px; text-decoration: none; }
.shell-brand img { width: 31px; height: 34px; image-rendering: pixelated; image-rendering: crisp-edges; }
#game-shell button { cursor: pointer; border: 2px solid var(--tan); border-radius: 0; color: var(--bone); background: var(--panel); padding: 9px 12px 8px; font: 9px "Press Start 2P", monospace; text-transform: uppercase; letter-spacing: 0; box-shadow: 3px 3px 0 #000; touch-action: manipulation; }
#game-shell button:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
#game-shell button:hover { border-color: var(--sun); }
#game-shell button:active, #game-shell button.held { background: var(--sun); color: var(--ink); border-color: var(--sun); box-shadow: 1px 1px 0 #000; transform: translate(2px, 2px); }
#game-shell button:disabled { opacity: .5; cursor: default; }
#game-shell button[aria-pressed="true"] { color: var(--sun); }
#game-stage { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#game { flex: none; max-width: 100%; max-height: 100%; touch-action: none; }
#touch-menu { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; background: #0b0a0af5; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: safe center; padding: 16px; gap: 12px; }
#touch-menu h1 { font: clamp(14px,3.6vw,24px)/1.3 "Press Start 2P", monospace; color: var(--sun); margin: 0 0 4px; text-align: center; text-shadow: 3px 3px 0 #000; }
#touch-menu p { max-width: 440px; text-align: center; color: var(--bone); line-height: 1.45; margin: 0; }
#touch-menu .menu-buttons { display: grid; gap: 10px; width: min(100%,400px); }
#touch-menu button { min-height: 46px; font-size: 11px; }
#touch-menu .primary { color: var(--ink); background: var(--sun); border-color: var(--sun); }
#touch-menu .room-code { font: 32px "Press Start 2P", monospace; color: var(--sun); user-select: all; letter-spacing: .2em; }
#touch-menu form { width: min(100%,360px); display: grid; gap: 12px; }
#touch-menu input { width: 100%; min-height: 56px; padding: 10px; background: var(--ink); color: var(--bone); border: 2px solid var(--tan); border-radius: 0; text-align: center; font: 22px "Press Start 2P", monospace; text-transform: uppercase; letter-spacing: .3em; }
#touch-menu input:focus { outline: none; border-color: var(--sun); }
#touch-menu small { color: var(--tan); text-align: center; line-height: 1.4; font-size: 13px; }
#touch-controls { pointer-events: none; position: absolute; z-index: 4; left: max(12px,env(safe-area-inset-left)); right: max(12px,env(safe-area-inset-right)); bottom: max(12px,env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: flex-end; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#move-pad { width: 136px; height: 136px; flex: none; position: relative; border: 2px solid #c9b58599; background: #1a121099; pointer-events: auto; touch-action: none; }
.pad-arrows { position: absolute; inset: 12px; font-size: 23px; line-height: 34px; text-align: center; color: #f4efe480; }
#move-stick { position: absolute; left: calc(50% - 23px); top: calc(50% - 23px); width: 46px; height: 46px; background: #c9b585b0; border: 2px solid var(--bone); pointer-events: none; }
.pad-label { position: absolute; width: 100%; top: -22px; text-align: center; font: 8px "Press Start 2P", monospace; color: var(--bone); text-shadow: 2px 2px 0 #000; }
.touch-actions { display: grid; gap: 10px; }
.utility-actions, .combat-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
#touch-controls button { pointer-events: auto; touch-action: none; padding: 0; width: 56px; height: 56px; background: #1a1210e0; border: 2px solid var(--tan); font-size: 8px; box-shadow: 3px 3px 0 #000; }
#touch-controls .utility-actions button { width: 56px; height: 42px; }
#touch-controls .fire-button { width: 78px; height: 78px; font-size: 11px; color: var(--ink); background: #f7d038f0; border-color: #fff19a; }
#touch-controls .held { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
#shell-notice { position: absolute; top: 56px; left: 5%; right: 5%; z-index: 10; margin: 0; padding: 12px; background: var(--panel); border: 2px solid var(--sun); box-shadow: 4px 4px 0 #000; text-align: center; pointer-events: none; }
.touch-mode #game-toolbar button { min-height: 40px; }
#game-credit { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 16px; padding: 8px 12px; background: var(--panel); border-top: 2px solid var(--tan); font: 9px "Press Start 2P", monospace; color: var(--tan); letter-spacing: 1px; }
#game-credit .credit-link { display: inline-block; padding: 8px 12px 7px; border: 2px solid var(--tan); background: var(--ink); color: var(--bone); text-decoration: none; box-shadow: 3px 3px 0 #000; transition: transform .08s, box-shadow .08s; }
#game-credit .credit-link:hover, #game-credit .credit-link:focus-visible { color: var(--ink); background: var(--sun); border-color: var(--sun); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 #000; outline: none; }
#game-credit .credit-link:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
.touch-mode.playing #game-credit { display: none; }
#rotate-hint { display: none; color: var(--tan); text-align: center; font-size: 13px; margin: 24px 12px; }
@media (max-width: 380px) {
  #move-pad { width: 112px; height: 112px; }
  .pad-arrows { inset: 3px; }
  #touch-controls button { width: 48px; height: 48px; }
  #touch-controls .fire-button { width: 64px; height: 64px; font-size: 10px; }
}
@media (max-width: 650px) { .shell-brand span { display: none; } #game-toolbar { gap: 6px; } #game-toolbar button { padding: 8px 8px 7px; font-size: 8px; } }
@media (orientation: portrait) {
  .touch-mode.playing #game-stage { flex: none; width: 100%; height: min(56.25vw,55dvh); margin-top: 12px; }
  .touch-mode #touch-controls { bottom: max(38px,env(safe-area-inset-bottom)); }
  .touch-mode #game-stage { align-items: flex-start; }
  .touch-mode.playing #rotate-hint { display: block; }
}
@media (orientation: landscape) and (max-height: 500px) {
  #touch-menu { padding: 10px 18px; gap: 6px; }
  #touch-menu h1 { font-size: 14px; }
  #touch-menu .menu-buttons { grid-template-columns: 1fr 1fr; width: min(100%,620px); }
  #touch-menu button { min-height: 42px; }
  #touch-menu p, #touch-menu small { font-size: 12px; }
  #move-pad { width: 116px; height: 116px; }
  .pad-arrows { inset: 5px; }
  #touch-controls { bottom: max(8px,env(safe-area-inset-bottom)); }
}
