/* =========================================================
   PAGE JEUX — styles dédiés (thème noir & or)
   Composants partagés + 12 mini-jeux
   ========================================================= */

/* --- Jetons de design (secours) ---
   Valeurs identiques à celles du style principal : la page jeux
   reste ainsi entièrement stylée même si style.css ne définit pas
   encore les variables CSS. Aucun conflit : les valeurs sont les mêmes. */
:root {
  --bg: #0c0c0d;
  --bg-deep: #08080a;
  --card: #151517;
  --card-2: #1b1b1e;
  --gold: #d4af37;
  --gold-bright: #e8c860;
  --gold-12: rgba(212, 175, 55, 0.12);
  --gold-25: rgba(212, 175, 55, 0.25);
  --gold-45: rgba(212, 175, 55, 0.45);
  --text: #f3f1ec;
  --muted: #a7a29a;
  --line: rgba(255, 255, 255, 0.08);
  --header-h: 96px;
  --radius: 18px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

/* --- Intro & barre d'outils --- */
.games-intro {
  padding-top: 40px;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  padding-inline: 20px;
}

.games-intro p {
  color: var(--muted);
  line-height: 1.7;
  margin-top: 10px;
}

.games {
  padding-top: 24px;
  padding-inline: 16px;
}

.games-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}

.bar-btn:hover {
  color: var(--gold);
  border-color: var(--gold-45);
}

.bar-btn.is-off {
  color: #c84646;
  border-color: rgba(200, 70, 70, 0.45);
}

/* --- Sélecteur d'onglets --- */
.game-selector {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
}

.game-tab {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--gold-25);
  border-radius: 50px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}

.game-tab:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.game-tab.active {
  background: linear-gradient(135deg, var(--gold), #b8912b);
  color: #100d02;
  border-color: var(--gold);
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.28);
}

/* --- Panneaux & coquille de jeu --- */
.game-panel {
  display: none;
  width: 100%;
  flex-direction: column;
  align-items: center;
}

.game-panel.active {
  display: flex;
}

.game-shell {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px 30px;
  box-shadow: var(--shadow);
}

.game-top {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.game-help {
  width: 100%;
  max-width: 560px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.game-stage {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.game-actions .btn {
  padding: 11px 24px;
  font-size: 0.9rem;
}

.btn-ghost {
  background: transparent !important;
  color: var(--gold) !important;
  border: 1.5px solid var(--gold-45) !important;
  box-shadow: none !important;
}

.btn-ghost:hover {
  background: var(--gold-12) !important;
  border-color: var(--gold) !important;
}

/* --- Chips de statistiques --- */
.stat-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.stat-chips-center {
  width: 100%;
  justify-content: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 50px;
  padding: 6px 14px;
  white-space: nowrap;
}

.chip-label {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.chip strong {
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 700;
}

/* --- Overlay (début / pause / fin de partie) --- */
.game-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 22px;
  background: rgba(8, 8, 10, 0.9);
  backdrop-filter: blur(5px);
  border-radius: inherit;
}

.game-overlay h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--gold);
}

.game-overlay p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 360px;
}

.overlay-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.overlay-count {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  color: var(--gold);
  animation: count-pop 0.7s ease;
}

@keyframes count-pop {
  0% { transform: scale(0.4); opacity: 0; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* --- Barres de progression --- */
.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  border-radius: 50px;
  transition: width 0.35s ease;
}

.quiz-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* --- Sélecteur de niveau --- */
.level-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.level-btn {
  background: var(--card-2);
  color: var(--muted);
  border: 1px solid var(--gold-25);
  border-radius: 50px;
  padding: 7px 16px;
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.level-btn:hover {
  border-color: var(--gold);
  color: var(--text);
}

.level-btn.active {
  background: var(--gold);
  color: #100d02;
  border-color: var(--gold);
  font-weight: 600;
}

.timer-display {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.9rem;
}

.timer-display.is-low {
  color: #e08a8a;
  animation: blink 0.8s steps(2) infinite;
}

@keyframes blink {
  50% { opacity: 0.35; }
}

/* --- Enregistrement de score --- */
.score-submit {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.score-submit input {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--gold-45);
  background: var(--card-2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  max-width: 180px;
}

.score-submit input::placeholder {
  color: #777;
}

.score-submit .btn {
  margin: 0;
  padding: 10px 22px;
  font-size: 0.88rem;
}

/* --- Classement --- */
.leaderboard {
  width: 100%;
  max-width: 440px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.leaderboard h4 {
  text-align: center;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.leaderboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leaderboard-item {
  display: grid;
  grid-template-columns: 26px 1fr auto auto;
  align-items: center;
  gap: 10px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.leaderboard-item:nth-child(1) {
  border-color: var(--gold-45);
  background: var(--gold-12);
}

.leaderboard-rank {
  color: var(--gold);
  font-weight: 700;
  text-align: center;
}

.leaderboard-name {
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-score {
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
}

.leaderboard-level {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.leaderboard-empty {
  color: var(--muted);
  text-align: center;
  font-size: 0.85rem;
}

/* ============================
   JEU 1 — Attrape la mèche
   ============================ */
.catch-game {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.catch-area {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: 400px;
  background: var(--card-2);
  border: 1px solid var(--gold-25);
  border-radius: 14px;
  overflow: hidden;
}

.falling-object {
  position: absolute;
  font-size: 2rem;
  cursor: pointer;
  user-select: none;
  line-height: 1;
  transition: transform 0.15s ease, opacity 0.15s ease;
  z-index: 2;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.falling-object:hover {
  transform: scale(1.18);
}

.falling-object.caught {
  transform: scale(1.7);
  opacity: 0;
}

.catch-pop {
  position: absolute;
  z-index: 3;
  color: var(--gold);
  font-weight: 700;
  font-size: 1rem;
  pointer-events: none;
  animation: pop-float 0.7s ease forwards;
}

@keyframes pop-float {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-42px); opacity: 0; }
}

.catch-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--gold-45), transparent);
}

/* ============================
   JEU 2 — 2048
   ============================ */
.g2048-board {
  position: relative;
  width: min(360px, 86vw);
  aspect-ratio: 1 / 1;
  background: #101012;
  border: 1px solid var(--gold-25);
  border-radius: 14px;
  touch-action: none;
}

.g2048-cell {
  position: absolute;
  background: rgba(255, 255, 255, 0.045);
  border-radius: 10px;
}

.g2048-tile {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 700;
  transition: left 0.12s ease, top 0.12s ease;
  will-change: left, top;
}

.g2048-tile.is-new { animation: tile-pop 0.18s ease; }
.g2048-tile.is-merge { animation: tile-merge 0.2s ease; }

@keyframes tile-pop {
  0% { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes tile-merge {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.g2048-tile[data-v="2"] { background: #2c2c31; color: #f3f1ec; }
.g2048-tile[data-v="4"] { background: #3a3a41; color: #f3f1ec; }
.g2048-tile[data-v="8"] { background: #8a6d1f; color: #0c0c0d; }
.g2048-tile[data-v="16"] { background: #a98624; color: #0c0c0d; }
.g2048-tile[data-v="32"] { background: var(--gold); color: #0c0c0d; }
.g2048-tile[data-v="64"] { background: var(--gold-bright); color: #0c0c0d; }
.g2048-tile[data-v="128"] { background: #ecd07a; color: #0c0c0d; box-shadow: 0 0 14px rgba(212, 175, 55, 0.4); }
.g2048-tile[data-v="256"] { background: #f0d88d; color: #0c0c0d; box-shadow: 0 0 16px rgba(212, 175, 55, 0.5); }
.g2048-tile[data-v="512"] { background: #f4e0a2; color: #0c0c0d; box-shadow: 0 0 18px rgba(212, 175, 55, 0.6); }
.g2048-tile[data-v="1024"] { background: #f8e9bb; color: #0c0c0d; box-shadow: 0 0 22px rgba(232, 200, 96, 0.7); }
.g2048-tile[data-v="2048"] { background: #fff4d4; color: #0c0c0d; box-shadow: 0 0 28px rgba(232, 200, 96, 0.9); }
.g2048-tile[data-v="4096"],
.g2048-tile[data-v="8192"] { background: #ffffff; color: #0c0c0d; box-shadow: 0 0 30px rgba(255, 255, 255, 0.75); }

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(2, 44px);
  gap: 8px;
  justify-content: center;
}

.dpad-btn {
  background: var(--card-2);
  border: 1px solid var(--gold-45);
  border-radius: 10px;
  color: var(--gold);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dpad-btn:hover {
  background: var(--gold-12);
}

.dpad-btn:active {
  transform: scale(0.94);
}

.dpad-btn[data-dir="up"] { grid-column: 2; grid-row: 1; }
.dpad-btn[data-dir="left"] { grid-column: 1; grid-row: 2; }
.dpad-btn[data-dir="down"] { grid-column: 2; grid-row: 2; }
.dpad-btn[data-dir="right"] { grid-column: 3; grid-row: 2; }

/* ============================
   JEU 3 — Démineur
   ============================ */
.mine-scroll {
  position: relative;
  width: 100%;
  overflow-x: auto;
  display: flex;
  justify-content: center;
  padding-bottom: 6px;
}

.mine-board {
  display: grid;
  gap: 3px;
  background: #101012;
  border: 1px solid var(--gold-25);
  border-radius: 12px;
  padding: 10px;
  width: max-content;
}

.mine-cell {
  width: var(--cell, 30px);
  height: var(--cell, 30px);
  border-radius: 6px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.12s ease, transform 0.08s ease, border-color 0.12s ease;
}

.mine-cell:hover:not(.is-open) {
  transform: scale(1.08);
  border-color: var(--gold-45);
}

.mine-cell.is-open {
  background: rgba(255, 255, 255, 0.03);
  border-color: transparent;
  cursor: default;
}

.mine-cell.is-flag { color: #e08a8a; }
.mine-cell.is-flag::after {
  content: "";
  width: 15px;
  height: 15px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 3v18' fill='none' stroke='%23d4af37' stroke-width='2.5' stroke-linecap='round'/%3E%3Cpath d='M8.5 4.5H19l-3.2 4.2 3.2 4.2H8.5z' fill='%23e08a8a'/%3E%3C/svg%3E") no-repeat center / contain;
}
.mine-cell.is-flag span { display: none; }
.mine-cell svg { width: 74%; height: 74%; }

.mine-cell.is-mine {
  background: rgba(200, 70, 70, 0.35);
  border-color: #c84646;
}

.mine-cell.is-boom {
  background: #c84646;
  animation: boom 0.3s ease;
}

@keyframes boom {
  0% { transform: scale(0.4); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.mine-cell.n1 { color: #6fa8ff; }
.mine-cell.n2 { color: #6fcf8f; }
.mine-cell.n3 { color: #e08a8a; }
.mine-cell.n4 { color: #b39df5; }
.mine-cell.n5 { color: #f0b36b; }
.mine-cell.n6 { color: #7fd6d2; }
.mine-cell.n7 { color: #f3f1ec; }
.mine-cell.n8 { color: #a7a29a; }

/* ============================
   JEU 4 — Memory
   ============================ */
.memory-game {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
}

.memory-card {
  aspect-ratio: 1 / 1;
  perspective: 700px;
  cursor: pointer;
}

.memory-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.35, 0.1, 0.25, 1);
  transform-style: preserve-3d;
}

.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-card-back,
.memory-card-front {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
}

.memory-card-back {
  background: linear-gradient(160deg, var(--card-2), #121214);
  border: 1px solid var(--gold-45);
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}

.memory-card-front {
  background: linear-gradient(135deg, var(--gold), #b8912b);
  color: #100d02;
  transform: rotateY(180deg);
}

.memory-card.matched .memory-card-front {
  background: var(--card-2);
  color: var(--gold);
  border: 1px solid var(--gold);
}

.memory-card.matched {
  animation: matched-pulse 0.4s ease;
}

@keyframes matched-pulse {
  50% { transform: scale(1.06); }
}

.memory-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 30px;
}

.stars {
  font-size: 1.5rem;
  letter-spacing: 6px;
  color: var(--gold);
  min-height: 1.4em;
}

.stars span {
  display: inline-block;
  animation: star-in 0.4s ease backwards;
}

.stars span:nth-child(2) { animation-delay: 0.15s; }
.stars span:nth-child(3) { animation-delay: 0.3s; }

@keyframes star-in {
  0% { transform: scale(0) rotate(-40deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.memory-win-message {
  color: var(--gold);
  font-weight: 600;
  text-align: center;
  font-size: 0.9rem;
}

/* ============================
   JEU 5 — Puissance 4
   ============================ */
.c4-board {
  display: grid;
  grid-template-columns: repeat(7, var(--c4cell, 44px));
  gap: var(--c4gap, 8px);
  background: #0f0f11;
  border: 1px solid var(--gold-25);
  border-radius: 14px;
  padding: 10px;
  box-shadow: var(--shadow);
}

.c4-col {
  display: grid;
  gap: var(--c4gap, 8px);
  background: transparent;
  border: none;
  padding: 2px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.c4-col:hover:not(:disabled) {
  background: rgba(212, 175, 55, 0.08);
}

.c4-col:disabled {
  cursor: default;
}

.c4-slot {
  width: var(--c4cell, 44px);
  height: var(--c4cell, 44px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
}

.c4-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: c4-drop 0.35s cubic-bezier(0.25, 0.9, 0.4, 1);
}

@keyframes c4-drop {
  0% { transform: translateY(calc(-6 * (var(--c4cell, 44px) + var(--c4gap, 8px)))); }
  75% { transform: translateY(4px); }
  100% { transform: translateY(0); }
}

.c4-disc.p1 {
  background: radial-gradient(circle at 32% 26%, #f5dd8a, var(--gold) 55%, #9c7c25);
}

.c4-disc.p2 {
  background: radial-gradient(circle at 32% 26%, #ef8f8f, #c84646 55%, #7e2a2a);
}

.c4-slot.is-win {
  animation: win-flash 0.7s ease infinite alternate;
}

@keyframes win-flash {
  from { box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.65), 0 0 0 rgba(212, 175, 55, 0); }
  to { box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.65), 0 0 14px rgba(212, 175, 55, 0.85); }
}

/* ============================
   JEU 6 — Suite de rythme (Simon)
   ============================ */
.simon-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.simon-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 240px;
  height: 240px;
}

.simon-pad {
  background: var(--pad-color);
  border-radius: 16px;
  border: 3px solid #0b0b0c;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.simon-pad:disabled {
  cursor: default;
}

.simon-pad.active {
  opacity: 1;
  transform: scale(1.04);
  box-shadow: 0 0 26px var(--pad-color);
}

.simon-message {
  color: var(--muted);
  text-align: center;
  min-height: 1.4em;
  font-size: 0.92rem;
}

/* ============================
   JEU 7 — Pendu barbier
   ============================ */
.hangman-stage {
  display: flex;
  gap: 26px;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex-wrap: wrap;
}

.hangman-figure svg {
  width: 150px;
  height: 170px;
  display: block;
}

.hm-base {
  stroke: var(--muted);
  stroke-width: 4;
  fill: none;
  stroke-linecap: round;
}

.hm-part {
  stroke: var(--gold);
  stroke-width: 4;
  fill: none;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hm-part.on {
  opacity: 1;
}

.hangman-hint {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  max-width: 320px;
}

.hangman-word {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 7px;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 8px;
  min-height: 1.3em;
}

.hangman-word .blank {
  color: rgba(212, 175, 55, 0.25);
}

.hangman-wrong {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
  min-height: 26px;
}

.hangman-wrong span {
  background: rgba(200, 70, 70, 0.16);
  border: 1px solid rgba(200, 70, 70, 0.5);
  color: #e08a8a;
  border-radius: 8px;
  padding: 2px 9px;
  font-size: 0.8rem;
  font-weight: 600;
}

.hangman-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  max-width: 560px;
}

.hangman-key {
  width: 40px;
  height: 44px;
  background: var(--card-2);
  border: 1px solid var(--gold-25);
  border-radius: 9px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hangman-key:hover:not(:disabled) {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.hangman-key:disabled {
  cursor: default;
  opacity: 0.35;
}

.hangman-key.is-good {
  background: rgba(60, 160, 90, 0.22);
  border-color: #3ca05a;
  color: #6fcf8f;
  opacity: 1;
}

.hangman-key.is-bad {
  background: rgba(200, 70, 70, 0.2);
  border-color: #c84646;
  color: #e08a8a;
  opacity: 1;
}

/* ============================
   JEU 8 — Quiz / JEU 10 — Bonne coupe (partagés)
   ============================ */
.quiz-game,
.haircut-game {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.quiz-question-block,
.haircut-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.quiz-progress {
  color: var(--muted);
  font-size: 0.88rem;
}

.quiz-question {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  text-align: center;
  line-height: 1.45;
}

.haircut-request {
  font-style: italic;
  color: var(--text);
  text-align: center;
  line-height: 1.65;
  background: var(--card-2);
  border: 1px solid var(--gold-25);
  border-left: 3px solid var(--gold);
  border-radius: 12px;
  padding: 18px 20px;
  width: 100%;
}

.quiz-options {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--gold-25);
  border-radius: 10px;
  padding: 12px 18px;
  text-align: left;
  font-family: inherit;
  font-size: 0.93rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--gold);
  transform: translateX(4px);
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-option.correct {
  background: rgba(60, 160, 90, 0.22);
  border-color: #3ca05a;
}

.quiz-option.incorrect {
  background: rgba(200, 70, 70, 0.2);
  border-color: #c84646;
}

.quiz-feedback {
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.6;
  min-height: 1.2em;
  color: var(--muted);
}

.quiz-feedback-correct {
  color: #6fcf8f;
}

.quiz-feedback-incorrect {
  color: #e08a8a;
}

.quiz-result {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 100%;
}

.quiz-result p {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--gold);
}

/* ============================
   JEU 9 — Puzzle glissant
   ============================ */
.puzzle-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.puzzle-board {
  position: relative;
  width: 320px;
  height: 320px;
  border: 1px solid var(--gold-45);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-2);
}

.puzzle-tile {
  position: absolute;
  cursor: pointer;
  transition: top 0.18s ease, left 0.18s ease, filter 0.15s ease;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
  background-image: url('image/puzzle-star-barbershop.jpg');
}

.puzzle-tile:hover {
  filter: brightness(1.15);
}

.puzzle-win-message {
  color: var(--gold);
  font-weight: 600;
  text-align: center;
}

/* === RESPONSIVE === */
@media (max-width: 700px) {
  .game-shell {
    padding: 20px 14px 24px;
    gap: 15px;
  }

  .c4-board {
    --c4cell: 40px;
    --c4gap: 6px;
  }
}

@media (max-width: 600px) {
  .games {
    padding-inline: 10px;
  }

  .game-tab {
    padding: 9px 14px;
    font-size: 0.82rem;
  }

  .catch-area {
    height: 340px;
  }

  .memory-grid {
    gap: 7px;
  }

  .memory-card-back,
  .memory-card-front {
    font-size: 1.3rem;
  }

  .puzzle-board {
    width: 260px;
    height: 260px;
  }

  .dpad {
    grid-template-columns: repeat(3, 50px);
    grid-template-rows: repeat(2, 40px);
  }

  .leaderboard-item {
    grid-template-columns: 22px 1fr auto;
  }

  .leaderboard-level {
    display: none;
  }

  .hangman-stage {
    gap: 16px;
  }

  .hangman-figure svg {
    width: 110px;
    height: 130px;
  }

  .hangman-key {
    width: 32px;
    height: 38px;
    font-size: 0.8rem;
  }

  .hangman-word {
    letter-spacing: 4px;
    text-align: center;
  }

  .simon-board {
    width: 210px;
    height: 210px;
  }
}

@media (max-width: 400px) {
  .c4-board {
    --c4cell: 34px;
    --c4gap: 5px;
  }

  .chip {
    padding: 5px 11px;
  }
}

/* ============================
   SUCCÈS, ILLUSTRATIONS & NOUVEAUX COMPOSANTS
   ============================ */

/* --- Bandeau de succès --- */
.achv-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.achv-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.achv-title i { color: var(--gold); }
.achv-title strong { color: var(--gold); }

.achv-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 940px;
}

.achv-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--card);
  border: 1px solid var(--gold-25);
  border-radius: 50px;
  padding: 6px 13px;
  font-size: 0.78rem;
  color: var(--text);
  transition: all 0.25s ease;
}

.achv-chip svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.achv-chip.locked {
  opacity: 0.4;
  filter: grayscale(0.7);
  border-color: var(--line);
}

.achv-chip:not(.locked) {
  box-shadow: 0 5px 16px rgba(212, 175, 55, 0.2);
}

.achv-chip:hover { transform: translateY(-2px); }
.achv-name { white-space: nowrap; }

/* --- Toasts de succès --- */
.toast-root {
  position: fixed;
  right: 18px;
  bottom: 84px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1600;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(18, 18, 20, 0.97);
  border: 1px solid var(--gold-45);
  border-radius: 14px;
  padding: 12px 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  transform: translateX(130%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  max-width: 330px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast svg {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}

.toast span {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.35;
}

.toast strong {
  color: var(--gold);
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* --- Illustration de question (quiz) --- */
.quiz-art {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.quiz-art svg {
  width: 92px;
  height: 92px;
  background: radial-gradient(circle at 50% 35%, rgba(212, 175, 55, 0.15), transparent 72%), var(--card-2);
  border: 1px solid var(--gold-25);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.quiz-art figcaption {
  font-size: 0.78rem;
}

.quiz-art-link {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.quiz-art-link:hover { color: var(--gold-bright); }

/* --- Cartes-illustrations des réponses (Trouve la bonne coupe) --- */
.quiz-options.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 12px;
}

.option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 14px 10px 13px;
  text-align: center;
}

.option-card .option-art {
  display: block;
  width: 74px;
  height: 74px;
}

.option-card .option-art svg {
  width: 100%;
  height: 100%;
}

.option-card .option-name {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
}

.option-card:hover:not(:disabled) {
  transform: translateY(-3px);
}

/* --- Client (avatar + demande) --- */
.haircut-client {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.haircut-avatar {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
}

.haircut-avatar svg {
  width: 100%;
  height: 100%;
  background: var(--card-2);
  border: 1px solid var(--gold-25);
  border-radius: 50%;
  padding: 4px;
}

.haircut-client .haircut-request {
  flex: 1;
  min-width: 0;
  width: auto;
  margin: 0;
}

/* --- Sélecteur de photos du puzzle --- */
.puzzle-picker {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.puzzle-thumb {
  width: 64px;
  height: 64px;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid var(--gold-25);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: var(--card-2);
  transition: all 0.2s ease;
}

.puzzle-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.puzzle-thumb:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.puzzle-thumb.active {
  border-color: var(--gold);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.35);
  transform: translateY(-2px) scale(1.06);
}

/* --- Images vectorielles dans les jeux --- */
.falling-object svg {
  width: 34px;
  height: 34px;
  display: block;
}

.memory-card-front svg {
  width: 58%;
  height: 58%;
}

#catch-lives {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

#catch-lives svg {
  width: 15px;
  height: 15px;
}

/* --- Adaptations mobiles des nouveaux composants --- */
@media (max-width: 600px) {
  .quiz-art svg {
    width: 76px;
    height: 76px;
  }

  .quiz-options.cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .option-card .option-art {
    width: 58px;
    height: 58px;
  }

  .haircut-client {
    flex-direction: column;
    gap: 9px;
  }

  .puzzle-thumb {
    width: 52px;
    height: 52px;
  }

  .toast-root {
    left: 12px;
    right: 12px;
    bottom: 72px;
    align-items: center;
  }

  .toast {
    max-width: min(330px, 92vw);
  }

  .achv-name {
    display: none;
  }

  .achv-chip {
    padding: 7px 9px;
  }
}

/* =========================================================
   RETOUR / FERMETURE, FILTRES SOLO-MULTI & JEUX À PLUSIEURS
   ========================================================= */

/* --- Retour au salon (intro) --- */
.games-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 9px 20px;
  border: 1px solid var(--gold-45);
  border-radius: 50px;
  background: var(--gold-12);
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: all 0.25s ease;
}

.games-back:hover {
  background: var(--gold);
  color: #100d02;
  transform: translateX(-4px);
}

/* --- Bouton « Fermer les jeux » de la barre d'outils --- */
.bar-btn {
  text-decoration: none;
}

.bar-close {
  border-color: var(--gold-45);
  color: var(--gold);
}

.bar-close:hover {
  background: var(--gold);
  color: #100d02;
  border-color: var(--gold);
}

/* --- Filtres solo / à plusieurs --- */
.mode-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.mode-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50px;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}

.mode-btn i {
  margin-right: 6px;
}

.mode-btn:hover {
  color: var(--gold);
  border-color: var(--gold-45);
}

.mode-btn.active {
  background: var(--gold-12);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}

/* --- Mime Express : plateau des équipes --- */
.mime-teams {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.mime-team-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 50px;
  padding: 8px 16px;
  transition: all 0.25s ease;
}

.mime-team-card.active {
  border-color: var(--gold);
  background: var(--gold-12);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.2);
}

.mime-team-name {
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
}

.mime-team-card.active .mime-team-name {
  color: var(--gold);
}

.mime-team-score {
  color: var(--gold);
  font-size: 1.05rem;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
}

.mime-card {
  width: 100%;
  max-width: 520px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 26px 22px;
  background: linear-gradient(160deg, var(--card-2), #121214);
  border: 1px solid var(--gold-25);
  border-radius: var(--radius);
}

.mime-category {
  color: var(--gold);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: var(--gold-12);
  border: 1px solid var(--gold-25);
  border-radius: 50px;
  padding: 5px 14px;
}

.mime-word {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.25rem, 4vw, 1.9rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.mime-word.is-hidden {
  color: var(--muted);
  letter-spacing: 7px;
}

/* --- Blagues & Anecdotes : carte de jeu --- */
.joke-card {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  text-align: center;
  padding: 26px 24px;
  background: linear-gradient(160deg, var(--card-2), #121214);
  border: 1px solid var(--gold-25);
  border-radius: var(--radius);
}

.joke-tag {
  color: #100d02;
  background: linear-gradient(135deg, var(--gold), #b8912b);
  border-radius: 50px;
  padding: 4px 14px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.joke-setup {
  margin: 0;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.65;
}

.joke-punchline {
  margin: 0;
  width: 100%;
  padding: 14px 16px;
  background: var(--gold-12);
  border: 1px dashed var(--gold-45);
  border-radius: 12px;
  color: var(--gold-bright);
  font-size: 0.98rem;
  line-height: 1.6;
  animation: joke-in 0.35s ease;
}

@keyframes joke-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.joke-rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
}

.joke-rating-label {
  width: 100%;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.joke-rate {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--gold-25);
  border-radius: 50px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.joke-rate strong {
  color: var(--gold);
  margin-left: 5px;
}

.joke-rate:hover {
  background: var(--gold-12);
  border-color: var(--gold);
  transform: translateY(-2px);
}

/* --- Adaptations mobiles (retour, filtres, jeux à plusieurs) --- */
@media (max-width: 600px) {
  .games-back {
    margin-bottom: 14px;
    padding: 8px 16px;
    font-size: 0.78rem;
  }

  .mode-btn {
    padding: 7px 14px;
    font-size: 0.75rem;
  }

  .mime-team-card {
    padding: 7px 13px;
  }

  .mime-card,
  .joke-card {
    padding: 22px 16px;
  }

  .joke-rate {
    font-size: 0.8rem;
    padding: 8px 13px;
  }
}
