*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a100c;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: #e8f5e9;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 50% -10%, #2a4a3a 0%, transparent 50%),
    linear-gradient(180deg, #0f1a14 0%, #1a2e22 45%, #0c1410 100%);
}

#hud {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 14px 8px;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.92;
  z-index: 2;
}

#hud .stat strong {
  display: inline-block;
  min-width: 1.4ch;
  margin-left: 4px;
  color: #f6c945;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

#hud .lives strong {
  color: #ff7a6e;
}

#game {
  flex: 1 1 auto;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  touch-action: none;
  cursor: pointer;
}

#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 14, 10, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 5;
  padding: 20px;
}

#overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.panel {
  text-align: center;
  max-width: 300px;
}

.brand {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #f6c945;
  margin-bottom: 10px;
}

.panel h1 {
  font-size: clamp(24px, 6vw, 30px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
}

.panel #subtitle {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(232, 245, 233, 0.78);
  margin-bottom: 24px;
}

#startBtn {
  appearance: none;
  border: none;
  background: linear-gradient(180deg, #f6d35a, #e0a820);
  color: #1a1408;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 13px 40px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 0 #b07a10;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

#startBtn:hover {
  filter: brightness(1.04);
}

#startBtn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b07a10;
}

#paused.banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(246, 201, 69, 0.35);
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}

#paused[hidden] {
  display: none !important;
}

@media (min-width: 481px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #app {
    height: min(100vh, 860px);
    border-radius: 18px;
    overflow: hidden;
    box-shadow:
      0 0 0 1px rgba(246, 201, 69, 0.18),
      0 24px 60px rgba(0, 0, 0, 0.5);
  }
}
