html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: #0f172a;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#renderCanvas {
  width: 100%;
  height: 100%;
  touch-action: none;
  display: block;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  pointer-events: auto;
  z-index: 10;
}

.overlay.hidden {
  display: none;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

#menu {
  background: linear-gradient(180deg, rgba(29, 78, 216, 0.92), rgba(15, 23, 42, 0.88));
  z-index: 20;
}

#gameover {
  background: rgba(127, 29, 29, 0.88);
  z-index: 30;
}

#win {
  background: rgba(21, 128, 61, 0.9);
  z-index: 30;
}

#save-prompt {
  background: rgba(15, 23, 42, 0.94);
  z-index: 40;
}

#btn-win {
  background: #facc15;
  color: #111827;
  box-shadow: 0 8px 0 #a16207;
}

#btn-win:active {
  box-shadow: 0 4px 0 #a16207;
}

#btn-continue {
  background: #22c55e;
  box-shadow: 0 8px 0 #14532d;
}

#btn-continue:active {
  box-shadow: 0 4px 0 #14532d;
}

.btn-secondary {
  background: #64748b;
  box-shadow: 0 8px 0 #334155;
  font-size: 22px;
  padding: 12px 32px;
}

.btn-secondary:active {
  box-shadow: 0 4px 0 #334155;
}

#btn-save-yes {
  background: #22c55e;
  box-shadow: 0 8px 0 #14532d;
}

#hud {
  z-index: 15;
}

.progress {
  margin-top: 8px;
  width: 180px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

#progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #facc15, #22c55e);
  border-radius: 999px;
  transition: width 0.1s linear;
}

#distance-label {
  color: #bbf7d0;
  font-size: 15px;
  font-weight: 600;
}

#level-label {
  color: #fde68a;
  font-size: 18px;
  font-weight: 800;
}

#over-level {
  margin: 0 0 8px;
  font-size: 22px;
  color: #fecaca;
}

#boost-label {
  color: #facc15;
  font-size: 16px;
  font-weight: 800;
  text-shadow: 0 0 12px #f59e0b;
}

#plane-label {
  color: #7dd3fc;
  font-size: 16px;
  font-weight: 800;
  text-shadow: 0 0 12px #0ea5e9;
}

.kicker {
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  color: #fde68a;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(42px, 8vw, 64px);
  line-height: 1;
  text-shadow: 0 4px 0 #0f172a;
}

.hint,
.footer {
  margin: 12px 0;
  font-size: 18px;
  color: #e2e8f0;
  line-height: 1.5;
}

.footer {
  font-size: 14px;
  opacity: 0.85;
}

button {
  margin-top: 12px;
  padding: 16px 42px;
  border: none;
  border-radius: 16px;
  background: #f97316;
  color: #fff;
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 8px 0 #7c2d12;
}

button:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #7c2d12;
}

#btn-retry {
  background: #22c55e;
  box-shadow: 0 8px 0 #14532d;
}

#btn-retry:active {
  box-shadow: 0 4px 0 #14532d;
}

#hud {
  justify-content: flex-start;
  align-items: flex-start;
  pointer-events: none;
}

.hud-box {
  margin: 20px;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 20px;
  font-weight: 700;
  text-shadow: 0 2px 0 #000;
}

#speed-label {
  color: #fde68a;
  font-size: 16px;
  font-weight: 400;
}

#final-score {
  font-size: 26px;
  margin: 0 0 8px;
}
