/**
 * ==========================================================================
 *    CAAT SPRINT QUIZ — FEUILLE DE STYLE ÉPREUVE (quiz.css)
 *    Charte graphique CAAT :
 *    - Calama Purple : #A8188D / #7B0F66
 *    - Vert Grass / Success : #0E8437
 *    - Vert Mint : #74E0C1
 *    - Or / Bronze : #947946
 *    - Dark / Background : #101325 (Anthracite profond)
 *    - Card BG : rgba(255, 255, 255, 0.07)
 *    - Red / Error : #D93838
 * ==========================================================================
 *
 * @format
 */

:root {
   --color-purple: #a8188d;
   --color-purple-dark: #7b0f66;
   --color-green: #0e8437;
   --color-green-light: #74e0c1;
   --color-gold: #947946;
   --color-bg: #101325;
   --color-card-bg: rgba(255, 255, 255, 0.07);
   --color-text: #ffffff;
   --color-text-muted: #b3b9c1;
   --color-error: #d93838;
   --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
   --radius-lg: 20px;
   --radius-md: 12px;
}

/* ==================== RESET & BASE ==================== */
* {
   box-sizing: border-box;
   margin: 0;
   padding: 0;
   user-select: none;
   -webkit-user-select: none;
}

body,
html {
   width: 100%;
   height: 100%;
   overflow: hidden;
   background-color: var(--color-bg);
   color: var(--color-text);
   font-family: var(--font-main);
   background: radial-gradient(circle at 50% 20%, #1a1f3b 0%, #101325 100%);
}

.app-container {
   width: 100vw;
   height: 100vh;
   position: relative;
   display: flex;
   justify-content: center;
   align-items: center;
}

/* ==================== STRUCTURATION DES ÉCRANS ==================== */
.screen {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   display: flex;
   flex-direction: column;
   justify-content: center;
   align-items: center;
   padding: 2rem;
   opacity: 0;
   pointer-events: none;
   transition:
      opacity 0.4s ease,
      transform 0.4s ease;
   transform: scale(0.98);
}

.screen.active {
   opacity: 1;
   pointer-events: auto;
   transform: scale(1);
}

.hidden {
   display: none !important;
}

/* ==================== SECTION QUIZ / GAMEPLAY ==================== */
.quiz-header {
   width: 100%;
   max-width: 700px;
   margin-bottom: 2rem;
}

.quiz-step-badge {
   font-size: 1.1rem;
   font-weight: 700;
   color: var(--color-gold);
   margin-bottom: 0.5rem;
   text-align: center;
}

/* Compte à rebours circulaire SVG */
.timer-circle-container {
   position: relative;
   width: 90px;
   height: 90px;
   display: flex;
   align-items: center;
   justify-content: center;
   margin: 15px auto 0;
}

.timer-svg {
   width: 100%;
   height: 100%;
   transform: rotate(-90deg); /* Démarrage de l'animation en haut */
}

.timer-circle-bg {
   fill: none;
   stroke: rgba(255, 255, 255, 0.1);
   stroke-width: 8;
}

.timer-circle-progress {
   fill: none;
   stroke: var(--color-purple);
   stroke-width: 8;
   stroke-linecap: round;
   stroke-dasharray: 263.89; /* Circonférence r=42 : 2 * PI * 42 */
   stroke-dashoffset: 0;
   transition:
      stroke-dashoffset 0.1s linear,
      stroke 0.3s ease;
}

.timer-circle-progress.warning {
   stroke: var(--color-error);
}

.timer-circle-text {
   position: absolute;
   font-size: 1.2rem;
   font-weight: 700;
   color: #ffffff;
}

/* Question & Réponses */
.quiz-body {
   width: 100%;
   max-width: 700px;
}

.question-text {
   font-size: 1.8rem;
   font-weight: 700;
   text-align: center;
   margin-bottom: 2.5rem;
   min-height: 80px;
   display: flex;
   align-items: center;
   justify-content: center;
}

.answers-grid {
   display: flex;
   flex-direction: column;
   gap: 1.2rem;
   width: 100%;
   max-width: 650px;
   margin: 0 auto;
}

.answer-btn {
   width: 100%;
   display: flex;
   align-items: center;
   justify-content: flex-start;
   padding: 1.1rem 1.6rem;

   /* Style Glassmorphism Dark */
   background: rgba(255, 255, 255, 0.05);
   border: 1px solid rgba(255, 255, 255, 0.15);
   border-radius: var(--radius-md);
   backdrop-filter: blur(10px);
   -webkit-backdrop-filter: blur(10px);

   /* Typographie */
   color: var(--color-text);
   font-size: 1.05rem;
   font-weight: 500;
   text-align: left;
   line-height: 1.4;

   /* Interactions & Effets */
   cursor: pointer;
   transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
   box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
   outline: none;
}

/* Effet Survol (Hover) */
.answer-btn:hover {
   background: rgba(255, 255, 255, 0.12);
   border-color: var(--color-purple);
   transform: translateY(-2px);
   box-shadow: 0 8px 20px rgba(168, 24, 141, 0.25);
}

/* Effet Clic (Active) */
.answer-btn:active {
   transform: translateY(0) scale(0.98);
}

/* Réponse Correcte */
.answer-btn.correct {
   background: linear-gradient(135deg, rgba(14, 132, 55, 0.85) 0%, rgba(116, 224, 193, 0.3) 100%) !important;
   border-color: var(--color-green-light) !important;
   color: #ffffff !important;
   box-shadow: 0 0 25px rgba(14, 132, 55, 0.6) !important;
}

/* Réponse Incorrecte */
.answer-btn.incorrect {
   background: linear-gradient(135deg, rgba(217, 56, 56, 0.85) 0%, rgba(255, 107, 107, 0.3) 100%) !important;
   border-color: #ff6b6b !important;
   color: #ffffff !important;
   box-shadow: 0 0 25px rgba(217, 56, 56, 0.6) !important;
}

/* ==================== SECTION RÉSULTATS ==================== */
.card-panel {
   background: rgba(255, 255, 255, 0.05);
   border: 1px solid rgba(255, 255, 255, 0.12);
   border-radius: var(--radius-lg);
   padding: 2.5rem;
   width: 100%;
   max-width: 500px;
   backdrop-filter: blur(15px);
   box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
   text-align: center;
}

.card-panel h2 {
   font-size: 2rem;
   margin-bottom: 0.5rem;
}

.panel-subtitle {
   color: var(--color-text-muted);
   font-size: 0.95rem;
   margin-bottom: 1.5rem;
}

.result-icon {
   font-size: 4rem;
   margin-bottom: 0.5rem;
}

.score-display {
   font-size: 3.5rem;
   font-weight: 900;
   color: var(--color-green-light);
   margin-bottom: 1.5rem;
}

.reward-box {
   background: rgba(14, 132, 55, 0.15);
   border: 1px solid var(--color-green);
   border-radius: var(--radius-md);
   padding: 1.5rem;
   margin-bottom: 1.5rem;
}

.reward-box.loss-box {
   background: rgba(255, 255, 255, 0.05);
   border-color: rgba(255, 255, 255, 0.2);
}

.reward-msg {
   font-weight: 700;
   font-size: 1.1rem;
   margin-bottom: 0.5rem;
}

.reward-label {
   font-size: 0.85rem;
   color: var(--color-text-muted);
   margin-bottom: 0.5rem;
}

.code-badge {
   display: inline-block;
   background: var(--color-purple);
   color: #ffffff;
   font-size: 2rem;
   font-weight: 900;
   letter-spacing: 3px;
   padding: 0.5rem 1.5rem;
   border-radius: var(--radius-md);
   margin-top: 0.5rem;
   box-shadow: 0 0 15px rgba(168, 24, 141, 0.5);
}

/* ==================== BOUTONS ==================== */
.btn {
   border: none;
   outline: none;
   cursor: pointer;
   border-radius: 50px;
   font-weight: 700;
   font-size: 1.1rem;
   padding: 1rem 2rem;
   transition:
      transform 0.15s ease,
      background-color 0.2s ease,
      box-shadow 0.2s ease;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   text-decoration: none;
}

.btn-primary {
   background: linear-gradient(135deg, var(--color-purple) 0%, var(--color-purple-dark) 100%);
   color: #ffffff;
   box-shadow: 0 8px 25px rgba(168, 24, 141, 0.4);
}

.btn-primary:active {
   transform: scale(0.96);
   box-shadow: 0 4px 15px rgba(168, 24, 141, 0.3);
}

.btn-giant {
   width: 100%;
   padding: 1.4rem;
   font-size: 1.2rem;
   letter-spacing: 1px;
}

.margin-top {
   margin-top: 1.5rem;
}

/* ==================== RESPONSIVE ADAPTATIONS ==================== */
@media (max-width: 600px) {
   .screen {
      padding: 1rem;
   }

   .question-text {
      font-size: 1.3rem;
      margin-bottom: 1.5rem;
      min-height: 60px;
   }

   .answer-btn {
      padding: 1rem 1.2rem;
      font-size: 1rem;
   }

   .card-panel {
      padding: 1.5rem;
   }

   .score-display {
      font-size: 2.8rem;
   }

   .code-badge {
      font-size: 1.5rem;
   }
}

/* ==================== FORMULAIRE PARTICIPANT ==================== */
.player-form {
   display: flex;
   flex-direction: column;
   gap: 0.8rem;
   margin-top: 1.2rem;
}

.input-group input {
   width: 100%;
   padding: 0.9rem 1.2rem;
   background: rgba(255, 255, 255, 0.08);
   border: 1px solid rgba(255, 255, 255, 0.2);
   border-radius: var(--radius-md);
   color: #ffffff;
   font-size: 1rem;
   outline: none;
   transition:
      border-color 0.2s ease,
      background 0.2s ease;
}

.input-group input:focus {
   border-color: var(--color-purple);
   background: rgba(255, 255, 255, 0.12);
}

.input-group input::placeholder {
   color: var(--color-text-muted);
}

.btn-secondary {
   background: rgba(255, 255, 255, 0.1);
   color: #ffffff;
   border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:active {
   transform: scale(0.97);
}

.hidden {
   display: none !important;
}
