/* ============================================================
   NEON SURGE - style.css
   Design : Arcade Néon Moderne
   ============================================================ */

/* -- Google Fonts -- */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;400;600&display=swap');

/* -- Variables CSS -- */
:root {
  --neon-cyan: #00f5ff;
  --neon-pink: #ff006e;
  --neon-yellow: #ffbe00;
  --neon-green: #39ff14;
  --neon-purple: #bf00ff;
  --dark-bg: #060612;
  --darker-bg: #03030a;
  --card-bg: rgba(10, 10, 30, 0.85);
  --text-primary: #e8f4f8;
  --text-dim: rgba(200, 220, 255, 0.6);
  --border-glow: rgba(0, 245, 255, 0.4);
  --font-arcade: 'Orbitron', monospace;
  --font-body: 'Rajdhani', sans-serif;
  --shadow-neon-cyan: 0 0 10px var(--neon-cyan), 0 0 30px rgba(0,245,255,0.3);
  --shadow-neon-pink: 0 0 10px var(--neon-pink), 0 0 30px rgba(255,0,110,0.3);
}

/* -- Reset & Base -- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* Anti double-tap zoom */
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--dark-bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* -- Fond animé étoiles/grille -- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0, 245, 255, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 0, 110, 0.04) 0%, transparent 60%),
    linear-gradient(rgba(0,245,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,245,255,0.03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Particules de fond animées */
body::after {
  content: '';
  position: fixed;
  width: 2px; height: 2px;
  background: var(--neon-cyan);
  border-radius: 50%;
  box-shadow:
    120px 80px 0 var(--neon-pink),
    340px 200px 0 var(--neon-cyan),
    550px 90px 0 var(--neon-yellow),
    750px 300px 0 var(--neon-purple),
    200px 400px 0 var(--neon-green),
    900px 150px 0 var(--neon-pink),
    1100px 350px 0 var(--neon-cyan),
    450px 500px 0 var(--neon-yellow);
  animation: twinkle 4s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes twinkle {
  0% { opacity: 0.3; }
  100% { opacity: 0.9; }
}

/* ============================================================
   BARRE DU HAUT
   ============================================================ */
#top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(6, 6, 18, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glow);
  box-shadow: 0 2px 20px rgba(0, 245, 255, 0.1);
}

#top-bar .game-logo {
  font-family: var(--font-arcade);
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--neon-cyan);
  text-shadow: var(--shadow-neon-cyan);
  text-decoration: none;
}

#top-bar .game-logo span {
  color: var(--neon-pink);
  text-shadow: var(--shadow-neon-pink);
}

/* Bouton Arcade */
#btn-arcade {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-arcade);
  font-size: clamp(0.65rem, 2vw, 0.8rem);
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--dark-bg);
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 0 15px rgba(0, 245, 255, 0.4);
  min-height: 44px;
}

#btn-arcade:hover, #btn-arcade:active {
  transform: scale(1.06);
  box-shadow: 0 0 25px rgba(0, 245, 255, 0.7);
}

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
#main-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 60px;
  min-height: calc(100vh - 60px);
}

/* ============================================================
   PANNEAU DE SCORE
   ============================================================ */
#score-panel {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 600px;
  margin-bottom: 20px;
}

.score-card {
  flex: 1;
  min-width: 120px;
  background: var(--card-bg);
  border: 1px solid var(--border-glow);
  border-radius: 10px;
  padding: 12px 16px;
  text-align: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 20px rgba(0,245,255,0.05);
}

.score-card .label {
  font-family: var(--font-arcade);
  font-size: 0.55rem;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.score-card .value {
  font-family: var(--font-arcade);
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  font-weight: 900;
  color: var(--neon-cyan);
  text-shadow: var(--shadow-neon-cyan);
  transition: color 0.3s;
}

.score-card.danger .value { color: var(--neon-pink); text-shadow: var(--shadow-neon-pink); }
.score-card.combo .value  { color: var(--neon-yellow); text-shadow: 0 0 10px var(--neon-yellow); }

/* ============================================================
   CANVAS DU JEU
   ============================================================ */
#game-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1 / 1.3;
  background: var(--darker-bg);
  border: 2px solid var(--border-glow);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0,245,255,0.1),
    0 0 40px rgba(0,245,255,0.12),
    inset 0 0 60px rgba(0,0,0,0.5);
  touch-action: none;
}

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

/* Overlay "Appuyez pour jouer" */
#start-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: rgba(6,6,18,0.85);
  backdrop-filter: blur(4px);
  z-index: 10;
  transition: opacity 0.4s;
}

#start-overlay.hidden { opacity: 0; pointer-events: none; }

#start-overlay .big-title {
  font-family: var(--font-arcade);
  font-size: clamp(1.8rem, 7vw, 3rem);
  font-weight: 900;
  text-align: center;
  color: var(--neon-cyan);
  text-shadow: var(--shadow-neon-cyan);
  animation: pulse-glow 2s ease-in-out infinite;
  line-height: 1.2;
}

#start-overlay .big-title span { color: var(--neon-pink); text-shadow: var(--shadow-neon-pink); }

@keyframes pulse-glow {
  0%, 100% { text-shadow: 0 0 10px var(--neon-cyan), 0 0 30px rgba(0,245,255,0.3); }
  50%       { text-shadow: 0 0 25px var(--neon-cyan), 0 0 60px rgba(0,245,255,0.6); }
}

#btn-start {
  font-family: var(--font-arcade);
  font-size: clamp(0.8rem, 3vw, 1rem);
  font-weight: 700;
  letter-spacing: 2px;
  padding: 16px 40px;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  animation: btn-bounce 1.5s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(255,0,110,0.5);
  min-height: 54px;
  min-width: 160px;
}

@keyframes btn-bounce {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.06); }
}

/* ============================================================
   CONTRÔLES TACTILES (mobile)
   ============================================================ */
#touch-controls {
  display: none; /* affiché via JS si appareil tactile */
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 18px;
  width: 100%;
  max-width: 500px;
}

#touch-controls button {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid var(--border-glow);
  background: var(--card-bg);
  color: var(--neon-cyan);
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0,245,255,0.2);
  transition: background 0.15s, transform 0.1s;
  user-select: none;
  -webkit-user-select: none;
}

#touch-controls button:active {
  background: rgba(0,245,255,0.2);
  transform: scale(0.92);
}

#touch-controls #btn-fire {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  border-color: var(--neon-pink);
  color: #fff;
  font-size: 1.8rem;
  box-shadow: 0 0 20px rgba(255,0,110,0.4);
}

/* ============================================================
   WIDGET VIGNETTE (Picture-in-Picture style)
   ============================================================ */
#pip-widget {
  position: fixed;
  bottom: 80px;
  left: 16px;
  z-index: 200;
  width: 100px;
  height: 72px;
  background: var(--card-bg);
  border: 1px solid var(--border-glow);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 10px rgba(0,245,255,0.15);
  cursor: grab;
  user-select: none;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
}

#pip-widget .pip-header {
  font-family: var(--font-arcade);
  font-size: 0.45rem;
  letter-spacing: 1px;
  color: var(--neon-cyan);
  padding: 4px 6px;
  background: rgba(0,245,255,0.08);
  border-bottom: 1px solid rgba(0,245,255,0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#pip-widget .pip-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0,245,255,0.06), rgba(255,0,110,0.06));
  font-size: 1.6rem;
  animation: pip-pulse 3s ease-in-out infinite;
}

@keyframes pip-pulse {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1; }
}

#pip-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

#pip-close:hover { color: var(--neon-pink); }

/* ============================================================
   MODALES
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 3, 10, 0.88);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.3s;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-box {
  background: rgba(8, 8, 24, 0.97);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 0 60px rgba(0,245,255,0.15), 0 0 120px rgba(255,0,110,0.08);
  position: relative;
}

.modal-box h2 {
  font-family: var(--font-arcade);
  font-size: clamp(1rem, 4vw, 1.4rem);
  color: var(--neon-cyan);
  text-shadow: var(--shadow-neon-cyan);
  margin-bottom: 18px;
  text-align: center;
  letter-spacing: 2px;
}

.modal-box p, .modal-box li {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 10px;
}

.modal-box ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

.modal-box .rule-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  background: rgba(0,245,255,0.04);
  border-radius: 8px;
  padding: 10px 12px;
  border-left: 3px solid var(--neon-cyan);
}

.modal-box .rule-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.modal-box .neon-txt { color: var(--neon-cyan); font-weight: 700; }
.modal-box .pink-txt  { color: var(--neon-pink); font-weight: 700; }
.modal-box .yellow-txt{ color: var(--neon-yellow); font-weight: 700; }

/* Boutons de modale */
.btn-modal {
  display: block;
  width: 100%;
  padding: 14px 24px;
  font-family: var(--font-arcade);
  font-size: clamp(0.7rem, 2.5vw, 0.85rem);
  font-weight: 700;
  letter-spacing: 1.5px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 12px;
  min-height: 50px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-modal:hover, .btn-modal:active { transform: scale(1.03); }

.btn-primary {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  color: var(--dark-bg);
  box-shadow: 0 0 20px rgba(0,245,255,0.3);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--neon-pink), #cc0055);
  color: #fff;
  box-shadow: 0 0 20px rgba(255,0,110,0.3);
}

.btn-coin {
  background: linear-gradient(135deg, var(--neon-yellow), #ff8c00);
  color: var(--dark-bg);
  font-size: clamp(0.75rem, 2.5vw, 0.9rem);
  box-shadow: 0 0 20px rgba(255,190,0,0.4);
  animation: coin-shine 2s ease-in-out infinite;
  /* Compatible <a href> : pas de soulignement, texte centré */
  text-decoration: none;
  text-align: center;
}

@keyframes coin-shine {
  0%, 100% { box-shadow: 0 0 20px rgba(255,190,0,0.4); }
  50%       { box-shadow: 0 0 40px rgba(255,190,0,0.8), 0 0 80px rgba(255,190,0,0.3); }
}

.btn-share {
  background: linear-gradient(135deg, #1da1f2, #0d7abf);
  color: #fff;
  box-shadow: 0 0 15px rgba(29,161,242,0.3);
}

/* Score final */
#final-score-display {
  font-family: var(--font-arcade);
  font-size: clamp(2.5rem, 10vw, 4rem);
  font-weight: 900;
  color: var(--neon-yellow);
  text-shadow: 0 0 20px var(--neon-yellow), 0 0 60px rgba(255,190,0,0.4);
  text-align: center;
  margin: 16px 0;
  animation: score-pop 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes score-pop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

#final-wave-display {
  text-align: center;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}

/* ============================================================
   RGPD (désactivé par défaut)
   ============================================================ */
/* -- RGPD OFF -- */
#rgpd-section {
  /* display: none; -- Mettre display:block pour activer */
  display: none;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid rgba(0,245,255,0.2);
  border-radius: 10px;
  background: rgba(0,245,255,0.03);
}

#rgpd-section h3 {
  font-family: var(--font-arcade);
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: var(--neon-cyan);
  margin-bottom: 12px;
}

#rgpd-section input[type="text"],
#rgpd-section input[type="email"] {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: rgba(0,245,255,0.05);
  border: 1px solid var(--border-glow);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
}

#rgpd-section input[type="text"]:focus,
#rgpd-section input[type="email"]:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 8px rgba(0,245,255,0.2);
}

#rgpd-section .rgpd-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-dim);
  cursor: pointer;
  margin-bottom: 12px;
}

#rgpd-section .rgpd-check input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--neon-cyan);
  cursor: pointer;
  margin-top: 2px;
}
/* -- END RGPD -- */

/* ============================================================
   COPYRIGHT
   ============================================================ */
#copyright {
  position: fixed;
  bottom: 10px;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  z-index: 50;
  pointer-events: none;
}

/* ============================================================
   NOTIFICATIONS FLOTTANTES (combo, bonus)
   ============================================================ */
.float-notif {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-arcade);
  font-size: clamp(0.9rem, 3vw, 1.2rem);
  font-weight: 700;
  padding: 8px 24px;
  border-radius: 50px;
  pointer-events: none;
  z-index: 999;
  animation: float-up 1.5s ease-out forwards;
}

@keyframes float-up {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-60px); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  #score-panel { gap: 10px; }
  .score-card { min-width: 90px; padding: 10px 10px; }
  #touch-controls { display: flex; }
  #pip-widget { bottom: 20px; }
}

@media (hover: none) and (pointer: coarse) {
  /* Appareils tactiles uniquement */
  #touch-controls { display: flex; }
}

/* Barre de vie */
#life-bar-wrapper {
  width: 100%;
  max-width: 500px;
  margin-bottom: 10px;
}

#life-bar-label {
  font-family: var(--font-arcade);
  font-size: 0.6rem;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

#life-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}

#life-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan));
  transition: width 0.3s, background 0.5s;
  box-shadow: 0 0 8px var(--neon-green);
}

#life-bar-fill.danger {
  background: linear-gradient(90deg, var(--neon-pink), #ff6600);
  box-shadow: 0 0 8px var(--neon-pink);
}
