:root { color-scheme: dark; }
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; overflow: hidden; background: #2a1622;
  font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif; color: #f6e9d8; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; }
#hud { position: fixed; top: 8px; left: 8px; right: 8px; pointer-events: none;
  display: flex; flex-direction: column; gap: 4px; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: rgba(24,15,18,.86); border: 1px solid #5b3f3a; border-radius: 10px;
  padding: 6px 12px; font-size: 13px; }
.bar b { color: #ffd23f; font-variant-numeric: tabular-nums; }
.bar.small { font-size: 11px; padding: 4px 12px; gap: 14px; }
.team.p b { color: #9ff5e6; }
.flux { color: #d8c7b0; }
.hbar { width: 90px; height: 9px; border-radius: 5px; background: #1b1013; overflow: hidden; }
.hbar i { display: block; height: 100%; background: linear-gradient(90deg,#35d0ba,#9ff5e6); }
.hbar.e i { background: linear-gradient(90deg,#ff5a3c,#ffb08a); }
#msg { position: fixed; top: 86px; left: 50%; transform: translateX(-50%);
  background: rgba(255,122,26,.92); color: #241007; padding: 6px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 700; opacity: 0; transition: opacity .25s; pointer-events: none; }
#msg.show { opacity: 1; }
#touch { position: fixed; bottom: 10px; left: 8px; right: 8px; display: flex;
  justify-content: space-between; align-items: flex-end; pointer-events: none; }
#touch button { pointer-events: auto; touch-action: none; }
.pad { position: relative; width: 132px; height: 132px; opacity: .85; }
.dpad { position: absolute; width: 44px; height: 44px; border-radius: 10px;
  background: rgba(24,15,18,.85); border: 1px solid #5b3f3a; color: #f6e9d8; font-size: 16px; }
.dpad.up { left: 44px; top: 0; } .dpad.down { left: 44px; top: 88px; }
.dpad.left { left: 0; top: 44px; } .dpad.right { left: 88px; top: 44px; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; max-width: 60vw; }
.acts button { border-radius: 10px; border: 1px solid #5b3f3a; background: rgba(24,15,18,.88);
  color: #f6e9d8; padding: 8px 9px; font-size: 12px; line-height: 1.25; min-width: 46px; }
.acts button small { color: #ffd23f; }
.acts button.cost { border-color: #8a6a35; }
.acts button.hot { background: rgba(120,30,12,.9); border-color: #ff5a3c; font-weight: 800; }
#touch button:active { filter: brightness(1.5); }
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(18,9,12,.82); backdrop-filter: blur(3px); z-index: 10; }
.overlay.hidden { display: none; }
.panel { max-width: 640px; margin: 16px; padding: 26px 28px; text-align: center;
  background: rgba(28,16,20,.94); border: 1px solid #6d4a3e; border-radius: 16px;
  box-shadow: 0 0 60px rgba(255,122,26,.25); }
.panel h1 { font-size: clamp(28px, 6vw, 44px); letter-spacing: .12em;
  background: linear-gradient(90deg,#ffb347,#ff5a3c,#ff7a1a);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.panel .tag { margin: 10px 0 16px; color: #d8c7b0; }
#controls { text-align: left; font-size: 13.5px; line-height: 1.7; color: #cdb9a4;
  background: rgba(0,0,0,.28); border-radius: 10px; padding: 12px 14px; }
#controls b { color: #9ff5e6; }
.big { margin-top: 18px; font-size: 18px; font-weight: 800; padding: 12px 26px;
  border-radius: 12px; border: 0; color: #241007; cursor: pointer;
  background: linear-gradient(90deg,#ffd23f,#ff7a1a); box-shadow: 0 4px 22px rgba(255,140,40,.45); }
@media (max-width: 640px) {
  .bar { font-size: 11px; gap: 6px; padding: 4px 8px; }
  .hbar { width: 56px; }
  .bar.small { display: none; }
  .pad { width: 112px; height: 112px; }
  .dpad { width: 38px; height: 38px; }
  .dpad.up, .dpad.down { left: 37px; } .dpad.up { top: 0; } .dpad.down { top: 74px; }
  .dpad.left { left: 0; top: 37px; } .dpad.right { left: 74px; top: 37px; }
  .acts button { min-width: 40px; font-size: 11px; padding: 7px 6px; }
}
