* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background: #0C0D14;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  font-family: 'Courier New', monospace;
  overflow-x: hidden;
  overflow-y: auto;
  color: #fff;
}

#game-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 100vh;
}

#hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 8px 16px;
  background: #13141D;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 5;
}

#hud-left {
  display: flex;
  gap: 20px;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #aaa;
}

#hud-left span span {
  color: #00ff88;
}

#hud-right {
  display: flex;
  gap: 8px;
}

#hud-right button {
  background: rgba(255, 255, 255, 0.06);
  color: #aaa;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 6px 14px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.15s;
}

#hud-right button:hover {
  background: #00ff88;
  color: #0C0D14;
  border-color: #00ff88;
}

#hud-right button:active {
  transform: scale(0.95);
}

canvas {
  display: block;
  cursor: pointer;
  touch-action: none;
}

/* ── Overlay ──────────────────────────────────────────────── */

#overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(12, 13, 20, 0.92);
  z-index: 10;
  transition: opacity 0.3s ease;
}

#overlay.hidden {
  display: none;
}

#overlay-box {
  text-align: center;
  padding: 40px 60px;
  background: #161822;
  border: 2px solid #2a2d3a;
  border-radius: 12px;
}

#overlay-box h1 {
  font-family: 'Courier New', monospace;
  font-size: 42px;
  margin-bottom: 8px;
  font-weight: 700;
  color: #00ff88;
}

.subtitle {
  font-size: 16px !important;
  color: #ffcc00 !important;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 20px !important;
}

#overlay-box p {
  font-size: 18px;
  margin-bottom: 10px;
  color: #ccc;
}

#screen-win h1 {
  color: #ffcc00;
}

.action-btn {
  background: #00ff88;
  color: #0C0D14;
  border: none;
  border-radius: 6px;
  padding: 12px 32px;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 3px;
  cursor: pointer;
  margin-top: 16px;
  transition: all 0.15s;
}

.action-btn:hover {
  background: #33ffaa;
  transform: scale(1.05);
}

.action-btn:active {
  transform: scale(0.95);
}

.controls-hint {
  font-size: 14px !important;
  color: #777 !important;
  margin-bottom: 8px !important;
}

.hidden {
  display: none !important;
}

@media (max-width: 600px) {
  #hud {
    padding: 6px 10px;
  }

  #hud-left {
    gap: 12px;
    font-size: 12px;
  }

  #hud-right button {
    padding: 5px 10px;
    font-size: 10px;
    letter-spacing: 1px;
  }

  #overlay-box {
    padding: 24px 32px;
  }

  #overlay-box h1 {
    font-size: 30px;
  }

  #overlay-box p {
    font-size: 16px;
  }
}
