/* === Vol Panique — page de jeu (solo.php) === */

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

body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: linear-gradient(180deg, #0c4a6e 0%, #1e293b 80%);
  color: #e0e0e0;
  padding: 12px;
}

#app {
  position: relative; z-index: 1;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 22px;
  padding: 24px 22px 20px;
  max-width: 900px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
}
.back-link {
  font-size: 0.85rem;
  color: #7dd3fc;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}
.back-link:hover { color: #bae6fd; }

h1 {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(90deg, #7dd3fc, #0ea5e9, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.info-bar {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 10px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  flex-wrap: wrap;
}
.info-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 700;
}
.info-score { color: #fbbf24; }
.info-best { color: #7dd3fc; }
.info-icon { font-size: 1rem; }

/* Aire de jeu — format portrait 9:16, identique sur mobile et desktop */
.game-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: inset 0 4px 16px rgba(0,0,0,0.35), 0 4px 20px rgba(0,0,0,0.3);
  background: linear-gradient(180deg, #87ceeb 0%, #38bdf8 60%, #0ea5e9 100%);
}
.game-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  touch-action: manipulation;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  user-select: none;
}
.game-wrap, .game-overlay, .game-overlay * {
  -webkit-tap-highlight-color: transparent;
}

/* Overlay départ / fin de partie (HTML par-dessus le canvas) */
.game-overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 22px;
  background: rgba(7, 29, 51, 0.55);
  color: #fff;
  text-align: center;
  animation: fadeOverlay 0.25s ease both;
}
.game-overlay.visible { display: flex; }
@keyframes fadeOverlay { from { opacity: 0; } to { opacity: 1; } }

.overlay-titre {
  font-size: clamp(1.4rem, 3.5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.titre-debut { color: #fbbf24; }
.titre-gameover { color: #fca5a5; }

.overlay-sous {
  font-size: clamp(0.85rem, 2vw, 1rem);
  color: #e0f2fe;
  max-width: 380px;
  line-height: 1.4;
}

.overlay-scores {
  display: flex;
  gap: 18px;
  margin-top: 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.overlay-score-bloc {
  padding: 10px 18px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  min-width: 100px;
}
.overlay-score-bloc .label {
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #cbd5e1;
  display: block;
  margin-bottom: 4px;
}
.overlay-score-bloc .valeur {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fbbf24;
}
.overlay-score-bloc.is-best .valeur { color: #7dd3fc; }

.btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 11px 26px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, #f97316, #fbbf24);
  box-shadow: 0 4px 15px rgba(249,115,22,0.4);
}
.btn-primary:hover { box-shadow: 0 6px 22px rgba(249,115,22,0.5); }
.btn-secondary {
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  box-shadow: 0 4px 15px rgba(14,165,233,0.35);
}
.btn-ghost {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
}
.overlay-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.cta-score-msg {
  color: #fde68a;
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Hint en bas */
.hint {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-top: 12px;
}
.hint kbd {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  font-family: monospace;
  font-size: 0.85em;
}

footer { font-size: 0.78rem; color: #64748b; margin-top: 12px; }
footer a { color: #7dd3fc; text-decoration: none; }
footer a:hover { color: #bae6fd; }

@media (max-width: 480px) {
  #app { padding: 16px 12px 14px; border-radius: 16px; }
  h1 { font-size: 1.2rem; }
  .info-bar { padding: 6px 10px; gap: 12px; }
  .info-item { font-size: 0.85rem; }
}
