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

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  background: #0f1419;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

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

#game-canvas:focus {
  outline: none;
}

#game-canvas:focus-visible {
  outline: 2px solid #2b8ff0;
  outline-offset: -2px;
}

#time-display {
  position: absolute;
  top: 8%;
  left: 6%;
  font-family: Rockwell, "Rockwell Nova", "Roboto Slab", Georgia, serif;
  font-size: clamp(24px, 5vw, 36px);
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  color: #e8eaed;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  min-width: 3ch;
}

#crash-announce {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#restart-button {
  position: absolute;
  top: 62%;
  left: 50%;
  transform: translateX(-50%);
  min-height: 44px;
  padding: 10px 24px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: #2b8ff0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
}

#restart-button:hover {
  background: #1a7ad9;
}

#restart-button:focus {
  outline: none;
}

#restart-button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

#restart-button:active {
  transform: translateX(-50%) scale(0.98);
}

@media (max-width: 480px) {
  #time-display {
    top: 5%;
    left: 5%;
  }

  #restart-button {
    font-size: 14px;
    padding: 8px 20px;
    top: 65%;
  }
}

@media (max-height: 300px) {
  #time-display {
    font-size: 18px;
  }

  #restart-button {
    top: 68%;
    min-height: 36px;
    padding: 6px 16px;
    font-size: 13px;
  }
}
