* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  overflow: hidden;
  background: #07040a;
  color: #ffe7c2;
  font-family: 'VT323', monospace;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#c {
  display: block;
  width: 100%;
  height: 100%;
  position: fixed;
  inset: 0;
  z-index: 0;
}

.arcade-back {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #ffb060;
  text-decoration: none;
  padding: 10px 12px;
  border: 2px solid #4a2418;
  background: rgba(10, 4, 12, 0.75);
  text-shadow: 0 0 8px rgba(255, 122, 26, 0.5);
}
.arcade-back:hover { background: rgba(40, 16, 20, 0.9); color: #ffe08a; }

#fps {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 10;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #6a8a7a;
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 8px;
  border: 1px solid #2a3a30;
}

#hud {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 10;
  width: min(520px, calc(100% - 24px));
  text-align: center;
  pointer-events: none;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
#title-bar {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(8px, 2.2vw, 11px);
  letter-spacing: 0.08em;
  color: #ff8a1a;
  text-shadow: 0 0 10px rgba(255, 122, 26, 0.55);
  margin-bottom: 8px;
}
#prompt {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(10px, 2.8vw, 14px);
  line-height: 1.45;
  padding: 12px 14px;
  border: 3px solid #4a2418;
  background: rgba(8, 4, 12, 0.82);
  color: #c9a27a;
  box-shadow: 0 0 24px rgba(255, 80, 160, 0.12);
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#prompt.hot {
  color: #7dff9a;
  border-color: #3a8848;
  box-shadow: 0 0 28px rgba(80, 255, 140, 0.22);
  animation: pulse-hot 0.9s steps(2, end) infinite;
}
#prompt.idle { color: #9a7a5a; }
@keyframes pulse-hot {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}
#hint {
  margin-top: 8px;
  font-size: 18px;
  color: #6a5040;
  letter-spacing: 0.04em;
}

#pads {
  display: none;
  position: fixed;
  left: 12px;
  bottom: 110px;
  z-index: 10;
}
#pads .dpad {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 4px;
  justify-items: center;
}
#pads .mid {
  display: flex;
  gap: 4px;
}
#pads button {
  width: 52px;
  height: 52px;
  font-size: 18px;
  color: #ffe7c2;
  background: rgba(20, 10, 18, 0.7);
  border: 2px solid #4a2418;
  border-radius: 8px;
  touch-action: none;
}
#pads button:active { background: rgba(255, 122, 26, 0.35); }

@media (max-width: 820px), (pointer: coarse) {
  #pads { display: block; }
  #hint { font-size: 15px; }
  #fps { font-size: 7px; }
}
