/* ============================================================
   Famille en OR — Plateau de jeu (grille de réponses)
   ============================================================ */

/* Conteneur du plateau : bordure or lumineuse */
.board {
  position: relative;
  z-index: 2;
  margin-top: clamp(34px, 5vmin, 60px);
  padding: clamp(14px, 2.4vmin, 26px);
  border-radius: 20px;
  background: linear-gradient(180deg, #12296e 0%, #0a1c58 100%);
  border: 4px solid transparent;
  box-shadow:
    0 0 0 4px var(--gold-2),
    0 0 22px 3px var(--gold-glow),
    0 0 0 8px rgba(0, 0, 0, 0.25),
    inset 0 0 40px rgba(0, 0, 0, 0.45);
}

/* ----------  Compteur central (trapèze)  ---------- */
.counter {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -58%);
  z-index: 5;
  min-width: clamp(120px, 18vmin, 190px);
  padding: clamp(6px, 1.2vmin, 12px) clamp(24px, 4vmin, 46px);
  text-align: center;
  color: #fff;
  font-family: 'Anton', sans-serif;
  font-size: clamp(34px, 6vmin, 68px);
  line-height: 1;
  background: linear-gradient(180deg, #1a3a94 0%, #0a1a55 100%);
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0% 100%);
  box-shadow:
    inset 0 0 0 3px rgba(150, 190, 255, 0.5),
    0 8px 22px rgba(0, 0, 0, 0.55);
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
}

.counter::after {
  content: '';
  position: absolute;
  inset: 4px;
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0% 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

/* ----------  Grille des 8 réponses  ---------- */
.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(4, 1fr);
  grid-auto-flow: column;
  gap: clamp(10px, 1.6vmin, 18px);
  margin-top: clamp(18px, 3vmin, 34px);
}
.answers[data-count="0"] { min-height: clamp(48px, 7.2vmin, 78px); }

/* Une case de réponse */
.answer {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(48px, 7.2vmin, 78px);
  padding: 0 clamp(14px, 2vmin, 22px);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--blue-cell-1) 0%, var(--blue-cell-2) 100%);
  box-shadow:
    inset 0 0 0 2px rgba(120, 160, 255, 0.28),
    inset 0 2px 6px rgba(255, 255, 255, 0.14),
    0 6px 14px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

/* Pastille numérotée (réponse cachée) */
.answer__num {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(30px, 4.4vmin, 46px);
  height: clamp(30px, 4.4vmin, 46px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(16px, 2.4vmin, 26px);
  color: #dfe9ff;
  background: radial-gradient(circle at 40% 35%, #12266e, #060f36);
  box-shadow:
    inset 0 0 0 2px rgba(120, 160, 255, 0.4),
    0 3px 6px rgba(0, 0, 0, 0.5);
}

/* Texte de la réponse + score (cachés par défaut) */
.answer__label,
.answer__score {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.answer__label {
  flex: 1;
  font-weight: 600;
  text-transform: uppercase;
  font-size: clamp(15px, 2.3vmin, 26px);
  letter-spacing: 0.5px;
  color: #fff;
  text-shadow: var(--text-shadow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.answer__score {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 3vmin, 34px);
  color: #fff;
  padding-left: 12px;
  text-shadow: var(--text-shadow);
}

/* État révélé */
.answer.is-revealed {
  background: linear-gradient(180deg, var(--answer-1) 0%, var(--answer-2) 100%);
  box-shadow:
    inset 0 0 0 2px rgba(180, 210, 255, 0.5),
    inset 0 2px 8px rgba(255, 255, 255, 0.25),
    0 6px 16px rgba(0, 0, 0, 0.45);
}

.answer.is-revealed .answer__num {
  opacity: 0;
}

.answer.is-revealed .answer__label,
.answer.is-revealed .answer__score {
  opacity: 1;
}

/* Case vide (ligne non utilisée) : pas de pastille */
.answer.is-empty .answer__num {
  display: none;
}

/* ============================================================
   Bandeau de question
   ============================================================ */
.question-bar {
  position: relative;
  z-index: 2;
  margin: clamp(20px, 3vmin, 34px) auto 0;
  max-width: 92%;
  text-align: center;
  padding: clamp(12px, 2vmin, 20px) clamp(20px, 4vmin, 48px);
  border-radius: 14px;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(16px, 2.6vmin, 30px);
  letter-spacing: 0.5px;
  color: #fff;
  background: linear-gradient(180deg, #1e46b0 0%, #0e2670 100%);
  box-shadow:
    inset 0 0 0 3px rgba(150, 190, 255, 0.55),
    0 10px 26px rgba(0, 0, 0, 0.5);
  text-shadow: var(--text-shadow);
}

/* ============================================================
   Strikes (X rouges des mauvaises réponses)
   ============================================================ */
/* --- Grand X : flash momentané, disparaît tout seul --- */
.strikes {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 3vmin, 40px);
  pointer-events: none;
  opacity: 0; /* invisible au repos : n'encombre pas l'écran */
}

.strike {
  font-family: 'Anton', sans-serif;
  font-size: clamp(90px, 24vmin, 260px);
  line-height: 1;
  color: var(--red-1);
  text-shadow:
    0 0 6px rgba(255, 0, 0, 0.6),
    0 0 26px rgba(255, 40, 40, 0.6),
    0 8px 14px rgba(0, 0, 0, 0.6);
  -webkit-text-stroke: 3px #7a0000;
  transform: rotate(-3deg);
  opacity: 0;
}

/* Le flash affiche autant de X que d'erreurs, puis s'efface */
.strikes.flash {
  animation: strikesFlash 1.8s ease forwards;
}
.strikes.flash[data-count="1"] .strike:nth-child(-n + 1),
.strikes.flash[data-count="2"] .strike:nth-child(-n + 2),
.strikes.flash[data-count="3"] .strike:nth-child(-n + 3) {
  animation: strikePop 1.8s ease forwards;
}

@keyframes strikesFlash {
  0% { opacity: 1; }
  72% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes strikePop {
  0% { opacity: 0; transform: rotate(-3deg) scale(0.2); }
  10% { opacity: 1; transform: rotate(-4deg) scale(1.18); }
  18% { transform: rotate(3deg) scale(0.98); }
  26% { transform: rotate(-3deg) scale(1.05); }
  34% { transform: rotate(-3deg) scale(1); }
  72% { opacity: 1; transform: rotate(-3deg) scale(1); }
  100% { opacity: 0; transform: rotate(-3deg) scale(1.12); }
}

/* --- Petit compteur d'erreurs persistant (coin haut droite) --- */
.strikes-mini {
  position: absolute;
  top: clamp(6px, 1.6vmin, 16px);
  right: clamp(8px, 2vmin, 22px);
  z-index: 9;
  display: flex;
  gap: clamp(4px, 1vmin, 10px);
  pointer-events: none;
}

.strike-mini {
  font-family: 'Anton', sans-serif;
  font-size: clamp(22px, 4.5vmin, 52px);
  line-height: 1;
  color: var(--red-1);
  -webkit-text-stroke: 2px #7a0000;
  text-shadow: 0 0 8px rgba(255, 40, 40, 0.5);
  transform: rotate(-3deg);
  opacity: 0.13; /* éteint */
  transition: opacity 0.2s ease;
}

.strikes-mini[data-count="1"] .strike-mini:nth-child(-n + 1),
.strikes-mini[data-count="2"] .strike-mini:nth-child(-n + 2),
.strikes-mini[data-count="3"] .strike-mini:nth-child(-n + 3) {
  opacity: 1;
}

/* ============================================================
   Barre de scores équipes (haut du plateau)
   ============================================================ */
.teams {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: clamp(8px, 1.6vmin, 20px);
  margin-bottom: clamp(6px, 1vmin, 14px);
}

.team {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 1 1 auto;
  min-width: clamp(120px, 18vmin, 240px);
  max-width: 320px;
  padding: 8px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #1a3a94 0%, #0a1a55 100%);
  box-shadow:
    inset 0 0 0 3px var(--gold-2),
    0 8px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

/* Les autres familles s'effacent un peu pour laisser la place au buzz */
.teams.has-active .team:not(.team--active) {
  opacity: 0.48;
  filter: saturate(0.65);
}

/* Famille au buzz : carte or, plus grande, halo lumineux */
.team--active {
  z-index: 4;
  transform: scale(1.12);
  background: linear-gradient(180deg, #ffe96a 0%, #f0b400 100%);
  box-shadow:
    inset 0 0 0 3px #fff6c4,
    0 0 0 4px var(--gold-1),
    0 0 32px 10px var(--gold-glow),
    0 12px 28px rgba(0, 0, 0, 0.55);
}

.team--active.team--buzz-in {
  animation: buzzPop 0.45s ease-out;
}

.team--active .team__name {
  color: #1a1400;
  text-shadow: none;
}

.team--active .team__score {
  color: #1a1400;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.team--active .team__chief {
  color: #5c3d00;
  text-shadow: none;
}

.team__buzz {
  display: none;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(10px, 1.35vmin, 15px);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #7a1a00;
  line-height: 1.1;
}

.team--active .team__buzz {
  display: block;
}

@keyframes buzzPop {
  0% { transform: scale(0.92); }
  55% { transform: scale(1.2); }
  100% { transform: scale(1.12); }
}

.team__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  gap: 1px;
}

.team__name {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(13px, 1.9vmin, 22px);
  color: #eaf3ff;
  text-shadow: var(--text-shadow);
  line-height: 1.05;
}

.team__chief {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: clamp(10px, 1.3vmin, 14px);
  color: var(--gold-1);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.team__score {
  font-family: 'Anton', sans-serif;
  font-size: clamp(24px, 4vmin, 50px);
  color: var(--gold-1);
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
  min-width: 1.4ch;
  text-align: center;
}

/* Beaucoup de familles : on réduit un peu la taille */
.teams[data-count="5"] .team,
.teams[data-count="6"] .team,
.teams[data-count="7"] .team,
.teams[data-count="8"] .team,
.teams[data-count="9"] .team,
.teams[data-count="10"] .team {
  min-width: clamp(100px, 13vmin, 170px);
  padding: 6px 12px;
}
.teams[data-count="5"] .team__score,
.teams[data-count="6"] .team__score,
.teams[data-count="7"] .team__score,
.teams[data-count="8"] .team__score,
.teams[data-count="9"] .team__score,
.teams[data-count="10"] .team__score {
  font-size: clamp(20px, 3vmin, 38px);
}
