/* Rooftop Runner — style rétro arcade (fichier externe, CSP stricte). */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: #05060a;
  color: #e2e8f0;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#game-shell {
  position: fixed;
  inset: 0;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.hidden {
  display: none !important;
}

/* --- HUD (score pendant la partie) --- */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 0;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  pointer-events: none;
}

#hud-score {
  font-size: clamp(20px, 6vw, 34px);
  font-weight: 700;
  color: #22d3ee;
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.8);
}

#hud-best {
  font-size: clamp(12px, 3.5vw, 16px);
  color: #fb923c;
  text-shadow: 0 0 8px rgba(251, 146, 60, 0.6);
}

/* --- Overlays (menu / game over) --- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: radial-gradient(ellipse at center, rgba(5, 6, 10, 0.72), rgba(5, 6, 10, 0.93));
}

.panel {
  text-align: center;
  padding: 24px;
  max-width: 92vw;
}

.title {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  font-size: clamp(28px, 9vw, 56px);
  font-weight: 800;
  letter-spacing: 2px;
  margin: 0;
  color: #fb923c;
  text-shadow: 0 0 18px rgba(251, 146, 60, 0.85), 0 0 44px rgba(251, 146, 60, 0.4);
}

.tagline {
  color: #64748b;
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-size: 12px;
  margin: 6px 0 18px;
}

.instructions {
  color: #cbd5e1;
  max-width: 420px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

.btn {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  font-size: clamp(16px, 5vw, 20px);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #05060a;
  background: #22d3ee;
  border: 2px solid #22d3ee;
  border-radius: 8px;
  padding: 12px 34px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.55);
  pointer-events: none; /* l'écran entier capte l'appui (espace/clic/toucher) */
}

.hint {
  color: #64748b;
  font-family: ui-monospace, Consolas, monospace;
  margin-top: 14px;
  font-size: 13px;
}

.best {
  color: #fb923c;
  font-family: ui-monospace, Consolas, monospace;
  margin-top: 8px;
  font-size: 14px;
}

.gameover-title {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  font-size: clamp(32px, 10vw, 64px);
  font-weight: 800;
  letter-spacing: 2px;
  margin: 0 0 8px;
  color: #e879f9;
  text-shadow: 0 0 18px rgba(232, 121, 249, 0.85), 0 0 44px rgba(232, 121, 249, 0.4);
}

.cause {
  color: #94a3b8;
  font-family: ui-monospace, Consolas, monospace;
  margin: 0 0 12px;
}

.final-score {
  font-size: clamp(20px, 6vw, 32px);
  margin: 6px 0;
  color: #22d3ee;
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.6);
}

.new-record {
  color: #fbbf24;
  font-family: ui-monospace, Consolas, monospace;
  margin: 6px 0;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}
