:root {
  --bg: #050816;
  --panel: #0d1324;
  --text: #f8f9ff;
  --accent: #66fcf1;
  --danger: #ff5a5f;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  overflow: hidden;
}

.app {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: max(8px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
}

.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(13, 19, 36, 0.86);
  border-radius: 10px;
  padding: 8px 12px;
}

.stat {
  font-size: 16px;
  font-weight: 700;
}

.game-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #03050f;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 8px;
  background: rgba(1, 4, 12, 0.72);
  padding: 18px;
}

.overlay.hidden {
  display: none;
}

.overlay h1 {
  margin: 0 0 6px 0;
  font-size: 30px;
}

.overlay p {
  margin: 0;
  opacity: 0.92;
}

.btn {
  margin-top: 8px;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 700;
  background: var(--accent);
  color: #03222a;
}

.btn.secondary {
  margin-top: 0;
  background: #1f2942;
  color: var(--text);
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.ctrl {
  border: 0;
  border-radius: 12px;
  padding: 14px 8px;
  font-size: 22px;
  font-weight: 700;
  background: var(--panel);
  color: var(--text);
  touch-action: manipulation;
}

.ctrl.fire {
  color: #1e1100;
  background: #ffe66d;
}
