/* In-game chrome only — scoped so the site layout can scroll. */

#game-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  background: #13261c;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
}

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: max(12px, env(safe-area-inset-top)) 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 2;
}

#hud-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#brand {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(180, 255, 200, 0.55);
}

#timer {
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: rgba(232, 255, 232, 0.75);
}

#score {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #e8ffe8;
}

#touch-controls {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 12px max(16px, env(safe-area-inset-bottom));
  gap: 12px;
  z-index: 3;
}

#touch-controls button {
  flex: 1;
  height: 72px;
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.6rem;
  cursor: pointer;
}

#touch-controls button:active,
#touch-controls button.active {
  background: rgba(255, 255, 255, 0.22);
}

@media (hover: none), (pointer: coarse) {
  #touch-controls {
    display: flex;
  }
}

#overlay,
#ready,
#countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 16, 12, 0.72);
  z-index: 5;
}

#overlay.hidden,
#ready.hidden,
#countdown.hidden {
  display: none;
}

#countdown {
  background: rgba(8, 16, 12, 0.55);
  pointer-events: none;
}

#countdown-num {
  font-size: clamp(4rem, 18vw, 6.5rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: #e8ffe8;
  text-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  animation: countdown-pop 0.45s ease-out;
}

@keyframes countdown-pop {
  from {
    opacity: 0.35;
    transform: scale(0.72);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.panel {
  text-align: center;
  padding: 28px 36px;
  border-radius: 16px;
  background: #1a3326;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.panel .label {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(180, 255, 200, 0.55);
  margin-bottom: 8px;
}

#final-score {
  font-size: 2.75rem;
  font-weight: 700;
  color: #e8ffe8;
  font-variant-numeric: tabular-nums;
  margin-bottom: 22px;
}

#play-again,
#start-run {
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  color: #0e1a14;
  background: #7dff9a;
  cursor: pointer;
}

#play-again:active,
#start-run:active {
  transform: scale(0.97);
}
