/* ==========================================
   QUI VEUT GAGNER DES MILLIONS - QUIZ APP
   Style fidèle à l'émission TF1
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Roboto+Condensed:wght@400;700&display=swap');

:root {
  /* Couleurs principales de l'émission */
  --bg-dark: #0a0a1a;
  --bg-gradient-start: #0d0d2b;
  --bg-gradient-end: #1a0a2e;
  --blue-primary: #1e3a8a;
  --blue-light: #3b82f6;
  --blue-glow: #60a5fa;
  --purple-dark: #2d1b4e;
  --purple-accent: #7c3aed;
  
  /* Couleurs des états */
  --orange-selection: #f97316;
  --orange-glow: #fb923c;
  --green-correct: #22c55e;
  --green-glow: #4ade80;
  --red-wrong: #ef4444;
  --red-glow: #f87171;
  
  /* Couleurs texte */
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-gold: #fbbf24;
  
  /* Bordures hexagonales */
  --border-default: linear-gradient(135deg, #3b82f6, #1e3a8a, #7c3aed);
  --border-hover: linear-gradient(135deg, #60a5fa, #3b82f6, #a78bfa);
}

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

body {
  font-family: 'Roboto Condensed', sans-serif;
  min-height: 100vh;
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* ==========================================
   CONTENEUR PRINCIPAL AVEC FOND
   ========================================== */

.game-container {
  min-height: 100vh;
  background: 
    radial-gradient(ellipse at center top, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at center bottom, rgba(124, 58, 237, 0.2) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-dark) 50%, var(--bg-gradient-end) 100%);
  background-attachment: fixed;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* Image de fond personnalisable */
.game-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--custom-bg-image);
  background-size: cover;
  background-position: center;
  opacity: 0.3;
  z-index: 0;
}

.game-container > * {
  position: relative;
  z-index: 1;
}

/* Effet de particules lumineuses */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--blue-glow);
  border-radius: 50%;
  animation: float 8s infinite ease-in-out;
  opacity: 0.6;
}

@keyframes float {
  0%, 100% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { transform: translateY(-100vh) scale(1); opacity: 0; }
}

/* ==========================================
   EN-TÊTE ET GAINS
   ========================================== */

.header {
  text-align: center;
  margin-bottom: 30px;
}

.logo {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1rem, 5vw, 3rem);
  letter-spacing: 4px;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(251, 191, 36, 0.5);
  margin-bottom: 10px;
}

.gain-display {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.5rem, 6vw, 3.5rem);
  color: var(--text-gold);
  text-shadow: 
    0 0 20px rgba(251, 191, 36, 0.8),
    0 0 40px rgba(251, 191, 36, 0.4);
  animation: pulse-gold 2s ease-in-out infinite;
}

@keyframes pulse-gold {
  0%, 100% { text-shadow: 0 0 20px rgba(251, 191, 36, 0.8), 0 0 40px rgba(251, 191, 36, 0.4); }
  50% { text-shadow: 0 0 30px rgba(251, 191, 36, 1), 0 0 60px rgba(251, 191, 36, 0.6); }
}

.question-counter {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-top: 5px;
  letter-spacing: 2px;
}

/* ==========================================
   ZONE DE QUESTION - STYLE HEXAGONAL
   ========================================== */

.question-container {
  width: 100%;
  max-width: 900px;
  margin-bottom: 40px;
}

.question-box {
  background: linear-gradient(135deg, 
    rgba(30, 58, 138, 0.7) 0%, 
    rgba(45, 27, 78, 0.7) 50%,
    rgba(30, 58, 138, 0.7) 100%);
  border: 3px solid;
  border-left:none;
  border-right:none;
  border-image: var(--border-default) 1;
  padding: 30px 40px;
  position: relative;
  clip-path: polygon(3% 0%, 97% 0%, 100% 50%, 97% 100%, 3% 100%, 0% 50%);
  box-shadow: 
    0 0 30px rgba(59, 130, 246, 0.3),
    inset 0 0 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  opacity:0.8;

}

.question-box::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: linear-gradient(135deg, var(--blue-light), var(--purple-accent), var(--blue-light));
  clip-path: polygon(3% 0%, 97% 0%, 100% 50%, 97% 100%, 3% 100%, 0% 50%);
  z-index: -1;
  animation: border-glow 3s ease-in-out infinite;
}

@keyframes border-glow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.question-text {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  text-align: center;
  line-height: 1.5;
  font-weight: 400;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* ==========================================
   OPTIONS DE RÉPONSE - STYLE LOSANGE
   ========================================== */

.options-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  width: 100%;
  max-width: 900px;
}

.option {
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.option-inner {
  background: linear-gradient(135deg, 
    rgba(30, 58, 138, 0.85) 0%, 
    rgba(45, 27, 78, 0.85) 100%);
  border-top: 2px solid var(--blue-light);
  border-bottom: 2px solid var(--blue-light);
  padding: 18px 25px;
  display: flex;
  align-items: center;
  gap: 15px;
  clip-path: polygon(4% 0%, 96% 0%, 100% 50%, 96% 100%, 4% 100%, 0% 50%);
  transition: all 0.3s ease;
  box-shadow: 
    0 0 15px rgba(59, 130, 246, 0.2),
    inset 0 0 30px rgba(0, 0, 0, 0.4);
}

.option:hover:not(.disabled) .option-inner {
  background: linear-gradient(135deg, 
    rgba(59, 130, 246, 0.5) 0%, 
    rgba(124, 58, 237, 0.5) 100%);
  border-color: var(--blue-glow);
  box-shadow: 
    0 0 25px rgba(59, 130, 246, 0.5),
    inset 0 0 30px rgba(59, 130, 246, 0.2);
  transform: scale(1.02);
}

.option-letter {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  color: var(--text-gold);
  min-width: 30px;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.option-text {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  flex: 1;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

/* État sélectionné (orange) - "C'est votre dernier mot ?" */
.option.selected .option-inner {
  background: linear-gradient(135deg, 
    rgba(249, 115, 22, 0.9) 0%, 
    rgba(234, 88, 12, 0.9) 100%);
  border-color: var(--orange-glow);
  box-shadow: 
    0 0 30px rgba(249, 115, 22, 0.6),
    0 0 60px rgba(249, 115, 22, 0.3),
    inset 0 0 30px rgba(0, 0, 0, 0.3);
  animation: pulse-orange 1s ease-in-out infinite;
}

@keyframes pulse-orange {
  0%, 100% { box-shadow: 0 0 30px rgba(249, 115, 22, 0.6), 0 0 60px rgba(249, 115, 22, 0.3); }
  50% { box-shadow: 0 0 40px rgba(249, 115, 22, 0.8), 0 0 80px rgba(249, 115, 22, 0.5); }
}

/* État bonne réponse (vert) */
.option.correct .option-inner {
  background: linear-gradient(135deg, 
    rgba(34, 197, 94, 0.9) 0%, 
    rgba(22, 163, 74, 0.9) 100%);
  border-color: var(--green-glow);
  box-shadow: 
    0 0 40px rgba(34, 197, 94, 0.7),
    0 0 80px rgba(34, 197, 94, 0.4),
    inset 0 0 30px rgba(0, 0, 0, 0.2);
  animation: correct-flash 0.5s ease-out 3;
}

@keyframes correct-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* État mauvaise réponse (rouge) */
.option.wrong .option-inner {
  background: linear-gradient(135deg, 
    rgba(239, 68, 68, 0.9) 0%, 
    rgba(220, 38, 38, 0.9) 100%);
  border-color: var(--red-glow);
  box-shadow: 
    0 0 40px rgba(239, 68, 68, 0.7),
    0 0 80px rgba(239, 68, 68, 0.4),
    inset 0 0 30px rgba(0, 0, 0, 0.2);
  animation: wrong-shake 0.5s ease-out;
}

@keyframes wrong-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

.option.disabled {
  pointer-events: none;
  opacity: 0.7;
}

/* ==========================================
   BOUTON DE VALIDATION
   ========================================== */

.validate-btn {
  margin-top: 30px;
  padding: 15px 50px;
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 3px;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--orange-selection), #ea580c);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 
    0 0 20px rgba(249, 115, 22, 0.5),
    0 4px 15px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

.validate-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.validate-btn:hover {
  transform: scale(1.05);
  box-shadow: 
    0 0 35px rgba(249, 115, 22, 0.7),
    0 6px 20px rgba(0, 0, 0, 0.4);
}

.validate-btn:active {
  transform: scale(0.98);
}

/* ==========================================
   ÉCRANS DE DÉMARRAGE ET FIN
   ========================================== */

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 70vh;
  margin-top:50px;
}

.screen.active {
  display: flex;
}

.start-screen .logo-big {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(2.5rem, 8vw, 5rem);
  letter-spacing: 6px;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 30%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  animation: title-glow 2s ease-in-out infinite;
}

@keyframes title-glow {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.5)); }
  50% { filter: drop-shadow(0 0 40px rgba(251, 191, 36, 0.8)); }
}

.subtitle {
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  letter-spacing: 2px;
}

.start-btn, .restart-btn {
  padding: 20px 60px;
  font-family: 'Oswald', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 4px;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--blue-primary), var(--purple-dark));
  border: 3px solid var(--blue-light);
  border-radius: 60px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 
    0 0 30px rgba(59, 130, 246, 0.4),
    0 5px 20px rgba(0, 0, 0, 0.4);
}

.start-btn:hover, .restart-btn:hover {
  background: linear-gradient(135deg, var(--blue-light), var(--purple-accent));
  transform: scale(1.05);
  box-shadow: 
    0 0 50px rgba(59, 130, 246, 0.6),
    0 8px 25px rgba(0, 0, 0, 0.5);
}

/* Écran de fin - Victoire */
.end-screen .result-title {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(2rem, 6vw, 4rem);
  margin-bottom: 20px;
}

.end-screen .result-title.winner {
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: winner-glow 1s ease-in-out infinite;
}

@keyframes winner-glow {
  0%, 100% { filter: drop-shadow(0 0 30px rgba(251, 191, 36, 0.8)); }
  50% { filter: drop-shadow(0 0 50px rgba(251, 191, 36, 1)); }
}

.end-screen .result-title.loser {
  color: var(--red-wrong);
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.final-gain {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.5rem, 10vw, 6rem);
  color: var(--text-gold);
  margin: 20px 0 40px;
  text-shadow: 
    0 0 30px rgba(251, 191, 36, 0.8),
    0 0 60px rgba(251, 191, 36, 0.5);
}
.video-hint {
  font-size: 0.95rem;
  color: var(--text-gold);
  margin: 10px 0 20px;
  opacity: 0.9;
  animation: pulse-hint 2s ease-in-out infinite;
}

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

/* Conteneur vidéo */
.video-container {
  width: 100%;
  max-width: 700px;
  margin: 30px 0;
  margin-top:10px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.3);
  display: none;
}

.video-container.visible {
  display: block;
}

.video-container video {
  width: 100%;
  display: block;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
  .options-container {
    grid-template-columns: 1fr;
  }
  
  .question-box {
    padding: 20px 25px;
    clip-path: polygon(2% 0%, 98% 0%, 100% 50%, 98% 100%, 2% 100%, 0% 50%);
  }
  
  .option-inner {
    padding: 15px 20px;
    clip-path: polygon(3% 0%, 97% 0%, 100% 50%, 97% 100%, 3% 100%, 0% 50%);
  }
  
  .game-container {
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .option-letter {
    font-size: 1.2rem;
    min-width: 25px;
  }
  
  .validate-btn {
    padding: 12px 35px;
    font-size: 1.2rem;
  }
}

/* ==========================================
   ANIMATIONS D'ENTRÉE
   ========================================== */

.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.option {
  opacity: 0;
  animation: slideIn 0.5s ease-out forwards;
}

.option:nth-child(1) { animation-delay: 0.1s; }
.option:nth-child(2) { animation-delay: 0.2s; }
.option:nth-child(3) { animation-delay: 0.3s; }
.option:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================
   INDICATEUR AUDIO (pour future implémentation)
   ========================================== */

.audio-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 100;
}

.audio-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(30, 58, 138, 0.8);
  border: 2px solid var(--blue-light);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.audio-btn:hover {
  background: rgba(59, 130, 246, 0.8);
  transform: scale(1.1);
}

.audio-btn.muted {
  opacity: 0.5;
}
