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

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

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

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

.hidden {
  display: none !important;
}

#menu {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.92), rgba(12, 74, 110, 0.94));
  z-index: 20;
}

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

#result.lose {
  background: rgba(127, 29, 29, 0.92);
}

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

.hud-box {
  margin: 18px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(8, 47, 73, 0.78);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  font-weight: 700;
  text-shadow: 0 2px 0 #0008;
}

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

#time-label {
  color: #86efac;
  font-size: 17px;
}

#rings-label {
  color: #7dd3fc;
  font-size: 16px;
}

#score-label,
#speed-label {
  font-size: 15px;
}

#speed-label {
  color: #86efac;
}

#shield-label {
  color: #f9a8d4;
  font-size: 15px;
}

.banner {
  margin-top: 8px;
  color: #fde047;
  font-size: 26px;
  font-weight: 900;
  min-height: 32px;
}

.kicker {
  margin: 0 0 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 700;
  color: #bae6fd;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(42px, 9vw, 72px);
  line-height: 0.95;
  text-shadow: 0 6px 0 #075985;
}

.hint {
  margin: 0 0 22px;
  max-width: 34ch;
  font-size: 16px;
  line-height: 1.45;
  color: #e0f2fe;
}

.footer {
  margin: 16px 0 0;
  font-size: 13px;
  opacity: 0.85;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 14px 34px;
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  background: #facc15;
  color: #0c4a6e;
  box-shadow: 0 8px 0 #a16207;
}

button:hover,
button:focus-visible {
  transform: translateY(-2px);
}

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

button.ghost {
  margin-top: 12px;
  background: transparent;
  color: #fff;
  box-shadow: inset 0 0 0 3px #fff8;
}

#result-title {
  font-size: clamp(36px, 8vw, 64px);
  text-shadow: 0 5px 0 #0006;
}

#result-score {
  font-size: 22px;
  font-weight: 700;
}
