/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #0d0d1a;
  --bg-surface: #13132a;
  --bg-card: #1a1a35;
  --accent: #7c3aed;
  --accent-light: #a855f7;
  --accent-glow: rgba(124, 58, 237, .35);
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, .3);
  --green: #22c55e;
  --green-glow: rgba(34, 197, 94, .35);
  --red: #ef4444;
  --red-glow: rgba(239, 68, 68, .35);
  --yellow: #f59e0b;
  --text: #f0f0ff;
  --text-muted: #8587a8;
  --border: rgba(255, 255, 255, .08);
  --radius: 20px;
  --radius-sm: 12px;
  --font: 'Inter', sans-serif;
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

/* ===== APP SHELL ===== */
.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 500px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-title {
  font-size: 1.15rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-icon {
  background: rgba(255, 255, 255, .08);
  border: none;
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, .15);
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 12px;
  min-width: 52px;
}

.stat-label {
  font-size: .6rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-light);
  line-height: 1.1;
}

.lives {
  font-size: 1.1rem;
  letter-spacing: 2px;
}

/* ===== SCREENS ===== */
.screen {
  flex: 1;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.screen.active {
  display: flex;
}

#screenIdle, #screenOver {
  overflow-y: auto;
  justify-content: flex-start;
  padding: 24px 0;
}

/* ===== INTRO / IDLE ===== */
.intro-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  animation: slideUp .4s ease;
  margin: auto;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.intro-icon {
  font-size: 4rem;
  margin-bottom: 12px;
  display: block;
  filter: drop-shadow(0 0 20px rgba(124, 58, 237, .6));
}

.intro-title {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.intro-desc {
  color: var(--text-muted);
  font-size: .95rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

.intro-desc strong {
  color: var(--text);
}

.intro-tips {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.tip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, .05);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  flex: 1;
  font-size: .78rem;
  color: var(--text-muted);
}

.tip-icon {
  font-size: 1.6rem;
}

/* Difficulty selector */
.difficulty-selector {
  margin-bottom: 24px;
}

.diff-label {
  font-size: .8rem;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.diff-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.btn-diff {
  flex: 1;
  padding: 10px 0;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.btn-diff:hover {
  border-color: var(--accent-light);
  color: var(--text);
}

.btn-diff.active {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent-light);
}

/* ===== BOUTONS ===== */
.btn-primary {
  display: block;
  width: 100%;
  padding: 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  color: #fff;
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--accent-glow);
  transition: transform .15s, box-shadow .15s;
  letter-spacing: .03em;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-secondary {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.btn-secondary:hover {
  border-color: var(--accent-light);
  color: var(--text);
}

/* ===== GAME SCREEN ===== */
.game-top-bar {
  width: 100%;
  padding: 10px 16px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.instruction-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 10px 20px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  transition: all .3s ease;
}

.instruction-banner.observe {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 20px var(--cyan-glow);
}

.instruction-banner.recall {
  border-color: var(--yellow);
  color: var(--yellow);
  box-shadow: 0 0 20px rgba(245, 158, 11, .3);
}

.instruction-banner.correct {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 20px var(--green-glow);
}

.instruction-banner.wrong {
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 0 20px var(--red-glow);
}

.round-counter {
  text-align: center;
  font-size: .8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* GAME AREA */
.game-area-wrapper {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
}

.game-area {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: 100%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  cursor: crosshair;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .3);
}

/* Subtle grid overlay */
.game-area::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* SYMBOLS */
.symbol {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 4.5rem;
  line-height: 1;
  pointer-events: none;
  transition: opacity .12s;
  filter: drop-shadow(0 0 16px currentColor);
  z-index: 2;
}

.symbol.hidden {
  opacity: 0;
}

.symbol.visible {
  opacity: 1;
  animation: symbolPop .18s cubic-bezier(.34, 1.56, .64, 1);
}

.symbol.numbered::after {
  content: attr(data-order);
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--yellow);
  color: #000;
  font-size: .75rem;
  font-weight: 900;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
}

@keyframes symbolPop {
  from {
    transform: translate(-50%, -50%) scale(0.3);
    opacity: 0;
  }

  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* FEEDBACK DOT (where player tapped) */
.marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.marker.correct {
  background: var(--green-glow);
  border: 3px solid var(--green);
  box-shadow: 0 0 20px var(--green-glow);
  animation: markerPop .3s ease;
}

.marker.wrong {
  background: var(--red-glow);
  border: 3px solid var(--red);
  box-shadow: 0 0 20px var(--red-glow);
  animation: markerPop .3s ease;
}

/* TARGET REVEAL (actual position) */
.target-reveal {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px dashed var(--cyan);
  pointer-events: none;
  z-index: 4;
  animation: targetReveal .3s ease;
  box-shadow: 0 0 16px var(--cyan-glow);
}

/* Line from tap to target */
.miss-line {
  position: absolute;
  transform-origin: 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red), var(--cyan));
  pointer-events: none;
  z-index: 3;
  opacity: .6;
}

@keyframes markerPop {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }

  70% {
    transform: translate(-50%, -50%) scale(1.2);
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes targetReveal {
  from {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }

  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* RECALL ORDER INDICATOR (top of next symbol to tap) */
.recall-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--yellow);
  color: #000;
  font-size: .8rem;
  font-weight: 900;
  font-family: var(--font);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 6;
  animation: symbolPop .2s ease;
}

/* PROGRESS BAR */
.progress-bar-wrapper {
  width: 100%;
  padding: 6px 20px 16px;
  flex-shrink: 0;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  border-radius: 99px;
  width: var(--progress, 0%);
  transition: width .4s ease;
}

/* FLASH OVERLAY (entire screen flash) */
.flash-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0;
}

.flash-overlay.green {
  background: var(--green);
  animation: flashAnim .35s ease;
}

.flash-overlay.red {
  background: var(--red);
  animation: flashAnim .35s ease;
}

@keyframes flashAnim {
  0% {
    opacity: .18;
  }

  100% {
    opacity: 0;
  }
}

/* ===== RESULT SCREEN ===== */
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  animation: slideUp .5s ease;
  margin: auto;
}

.result-icon {
  font-size: 3.5rem;
  margin-bottom: 10px;
}

.result-title {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 20px;
}

.result-score-block {
  background: rgba(124, 58, 237, .15);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.result-score-label {
  display: block;
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}

.result-score-value {
  font-size: 3.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.result-details {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.result-detail-item {
  flex: 1;
  background: rgba(255, 255, 255, .04);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
}

.detail-label {
  display: block;
  font-size: .7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.detail-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.result-stars {
  font-size: 2rem;
  letter-spacing: 6px;
  margin-bottom: 24px;
}

/* ===== COUNTDOWN OVERLAY ===== */
.countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: none;
}

.countdown-number {
  font-size: 8rem;
  font-weight: 900;
  color: var(--accent-light);
  text-shadow: 0 0 60px var(--accent-glow);
  animation: countdownPop .9s ease-out;
}

@keyframes countdownPop {
  0% {
    transform: scale(1.6);
    opacity: 1;
  }

  100% {
    transform: scale(0.6);
    opacity: 0;
  }
}

/* ===== RESPONSIVE LARGE SCREEN ===== */
@media (min-width: 500px) {
  .app {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

@media (max-height: 600px) {
  .intro-tips {
    gap: 8px;
  }

  .tip-item {
    padding: 8px 6px;
  }

  .intro-card {
    padding: 24px 20px;
  }
}

/* ===== HUB — MENU D'ACCUEIL ===== */
#screenHub {
  overflow-y: auto;
  justify-content: flex-start;
}

.hub-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 92%;
  max-width: 420px;
  padding: 24px 0;
  margin: auto;
}

.hub-subtitle {
  text-align: center;
  font-size: .85rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px;
}

.game-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  animation: slideUp .4s ease both;
  position: relative;
  overflow: hidden;
}

.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124, 58, 237, .08), transparent 60%);
  opacity: 0;
  transition: opacity .25s;
}

.game-card:nth-child(2) {
  animation-delay: .05s;
}

.game-card:nth-child(3) {
  animation-delay: .12s;
}

.game-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .45);
  border-color: var(--accent);
}

.game-card:hover::before {
  opacity: 1;
}

.game-card:active {
  transform: translateY(0);
}

.game-card-icon {
  font-size: 3rem;
  flex-shrink: 0;
  filter: drop-shadow(0 0 14px rgba(124, 58, 237, .5));
  line-height: 1;
}

.game-card-body {
  flex: 1;
  min-width: 0;
}

.game-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.game-card-desc {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 10px;
}

.game-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-size: .68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  letter-spacing: .03em;
}

.tag-cyan {
  background: rgba(6, 182, 212, .15);
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, .3);
}

.tag-purple {
  background: rgba(124, 58, 237, .15);
  color: var(--accent-light);
  border: 1px solid rgba(124, 58, 237, .3);
}

.tag-green {
  background: rgba(34, 197, 94, .15);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, .3);
}

.game-card-arrow {
  font-size: 1.4rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform .2s, color .2s;
}

.game-card:hover .game-card-arrow {
  transform: translateX(4px);
  color: var(--accent-light);
}

/* ===== SÉQUENCE RAPIDE — GRILLE ===== */
.seq-grid-wrapper {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  position: relative;
}

.seq-grid {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
}

.seq-tile {
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: background .08s, border-color .08s, transform .08s, box-shadow .08s;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.seq-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, .15), transparent 70%);
  opacity: 0;
  transition: opacity .15s;
}

.seq-tile:not(:disabled):hover {
  border-color: rgba(255, 255, 255, .2);
  transform: scale(1.03);
}

.seq-tile:not(:disabled):active {
  transform: scale(0.95);
}

/* Lit — shown during sequence */
.seq-tile--active {
  background: var(--accent-light) !important;
  border-color: var(--accent-light) !important;
  box-shadow: 0 0 28px var(--accent-glow), inset 0 0 20px rgba(255, 255, 255, .2) !important;
  transform: scale(1.06) !important;
}

.seq-tile--active::after {
  opacity: 1;
}

/* Correct tap */
.seq-tile--correct {
  background: var(--green) !important;
  border-color: var(--green) !important;
  box-shadow: 0 0 24px var(--green-glow) !important;
}

/* Wrong tap */
.seq-tile--wrong {
  background: var(--red) !important;
  border-color: var(--red) !important;
  box-shadow: 0 0 24px var(--red-glow) !important;
  animation: shakeX .35s ease;
}

/* Reveal the expected tile after error */
.seq-tile--reveal {
  border-color: var(--cyan) !important;
  box-shadow: 0 0 24px var(--cyan-glow) !important;
  background: rgba(6, 182, 212, .2) !important;
}

@keyframes shakeX {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-6px);
  }

  40% {
    transform: translateX(6px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}

.seq-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.seq-length-badge {
  font-size: .78rem;
  font-weight: 700;
  background: rgba(124, 58, 237, .2);
  border: 1px solid rgba(124, 58, 237, .4);
  color: var(--accent-light);
  border-radius: 99px;
  padding: 3px 12px;
}

/* Countdown overlay for sequence game */
.seq-countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  background: rgba(13, 13, 26, .6);
  border-radius: 20px;
  pointer-events: none;
}

/* ===== MOT FANTÔME — STYLES ===== */
.mf-flash-zone {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 180px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  margin: 15px 0;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.mf-flash-zone--active {
  border-color: var(--accent);
  box-shadow: 0 0 40px var(--accent-glow);
}

.mf-word {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  transition: opacity 0.1s, transform 0.2s;
  padding: 0 15px;
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
}

.mf-word span {
  display: inline-block;
  transition: transform 0.2s;
}

/* Jitter effect for noisy words */
.mf-flash-zone--active .mf-word span {
  animation: jitter 0.15s infinite alternate;
}

.mf-flash-zone--active .mf-word span:nth-child(even) {
  animation-delay: 0.05s;
}

@keyframes jitter {
  0% {
    transform: translateY(-1px) rotate(-2deg);
  }

  100% {
    transform: translateY(1px) rotate(2deg);
  }
}

.mf-word--hidden {
  opacity: 0;
  transform: scale(0.9);
}

.mf-word--visible {
  opacity: 1;
  transform: scale(1);
  animation: wordPop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes wordPop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.mf-timer-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}

.mf-choices {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s, transform 0.4s;
  pointer-events: none;
}

.mf-choices--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mf-choice-btn {
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}

.mf-choice-btn:hover:not(:disabled) {
  border-color: var(--accent-light);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.05);
}

.mf-choice-btn:active:not(:disabled) {
  transform: translateY(0);
}

.mf-choice-btn:disabled {
  cursor: default;
}

.mf-choice-btn--correct {
  background: var(--green) !important;
  border-color: var(--green) !important;
  color: #fff !important;
  box-shadow: 0 0 20px var(--green-glow);
}

.mf-choice-btn--wrong {
  background: var(--red) !important;
  border-color: var(--red) !important;
  color: #fff !important;
  box-shadow: 0 0 20px var(--red-glow);
  animation: shakeX 0.4s;
}

.mf-choice-btn--reveal {
  border-color: var(--green) !important;
  background: rgba(34, 197, 94, 0.15) !important;
  color: var(--green) !important;
  box-shadow: 0 0 15px var(--green-glow);
}

/* ===== INTRUS — GRILLE ===== */
.intrus-container {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  position: relative;
}

.intrus-grid {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1;
}

.intrus-grid--disabled {
  pointer-events: none;
}

.intrus-timer-track {
  width: 100%;
  max-width: 380px;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  margin: 0 auto 10px auto;
  overflow: hidden;
}

.intrus-timer-fill {
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(1);
}

.intrus-tile {
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all .1s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text);
  font-family: var(--font);
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.intrus-tile:hover {
  background: rgba(255, 255, 255, 0.05);
}

.intrus-tile:active {
  transform: scale(0.9);
}

.intrus-tile--correct {
  background: var(--green) !important;
  border-color: var(--green) !important;
  color: #fff !important;
  box-shadow: 0 0 20px var(--green-glow);
  transform: scale(1.1) !important;
}

.intrus-tile--wrong {
  background: var(--red) !important;
  border-color: var(--red) !important;
  color: #fff !important;
  box-shadow: 0 0 20px var(--red-glow);
  animation: shakeX .35s ease;
}

.intrus-tile--reveal {
  border-color: var(--cyan) !important;
  box-shadow: 0 0 15px var(--cyan-glow) !important;
  animation: pulseCyan 1s infinite;
}

@keyframes pulseCyan {
  0% {
    box-shadow: 0 0 10px var(--cyan-glow);
  }

  50% {
    box-shadow: 0 0 25px var(--cyan);
  }

  100% {
    box-shadow: 0 0 10px var(--cyan-glow);
  }
}

/* ===== JEU : REGLE CHANGEANTE ===== */
.regle-container {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 10px 20px 30px;
}

.regle-label {
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 10px;
  text-align: center;
}

.regle-target-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: inset 0 0 30px rgba(0,0,0,.3);
}

.regle-options-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.regle-options-grid {
  display: flex;
  gap: 15px;
  width: 100%;
  justify-content: center;
}

.regle-card {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  transition: transform .2s, box-shadow .2s;
  position: relative;
}

.regle-options-grid .regle-card {
  cursor: pointer;
}

.regle-options-grid .regle-card:hover {
  transform: scale(1.05);
}

.regle-options-grid .regle-card:active {
  transform: scale(0.95);
}

/* Formes */
.shape-circle {
  border-radius: 50%;
}

.shape-square {
  border-radius: 16px;
}

.shape-triangle {
  /* Using clip-path for a triangle */
  clip-path: polygon(50% 10%, 0% 90%, 100% 90%);
  border-radius: 0;
  padding-top: 15px; /* Shift the emoticon down into the wider part of the triangle */
}

/* Couleurs */
.color-red {
  background: var(--red);
  box-shadow: 0 0 20px var(--red-glow);
}
.color-green {
  background: var(--green);
  box-shadow: 0 0 20px var(--green-glow);
}
.color-blue {
  background: var(--cyan);
  box-shadow: 0 0 20px var(--cyan-glow);
}

/* Modifier for correct/wrong animations */
.regle-card.correct {
  animation: markerPop .3s ease;
  box-shadow: 0 0 30px var(--green);
}

.regle-card.wrong {
  animation: shakeX .35s ease;
  box-shadow: 0 0 30px var(--red);
}

/* ===== JEU : LABYRINTHE MENTAL ===== */
.labyrinthe-container {
  width: 100%;
  aspect-ratio: 1;
  max-height: 400px;
  max-width: 400px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 24px;
  box-shadow: inset 0 0 40px rgba(0,0,0,.3);
  padding: 12px;
  position: relative;
  /* For the 3D rotation feel if we want it */
  perspective: 1000px;
}

.labyrinthe-grid {
  width: 100%;
  height: 100%;
  display: grid;
  gap: 8px;
  transition: transform 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.labyrinthe-tile {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.labyrinthe-tile:active {
  transform: scale(0.95);
}

/* Disabled clicks during observe/rotate phases */
.labyrinthe-grid.disabled .labyrinthe-tile {
  pointer-events: none;
}

/* States */
.labyrinthe-tile.path {
  background: var(--cyan);
  box-shadow: 0 0 15px var(--cyan-glow);
  border-color: var(--cyan-glow);
}

.labyrinthe-tile.start {
  background: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
  border-color: var(--accent-glow);
}

.labyrinthe-tile.end {
  background: var(--yellow);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
  border-color: rgba(245, 158, 11, 0.3);
}

.labyrinthe-tile.correct {
  background: var(--green);
  box-shadow: 0 0 15px var(--green-glow);
  border-color: var(--green-glow);
}

.labyrinthe-tile.wrong {
  background: var(--red);
  box-shadow: 0 0 15px var(--red-glow);
  border-color: var(--red-glow);
}

/* ===== JEU : METEORITES ===== */
.meteorite-sky {
  flex: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at top, #111122, var(--bg));
  border-bottom: 2px solid var(--border);
}

.meteorite {
  position: absolute;
  top: -80px; 
  transform: translateX(-50%);
  width: 75px;
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* Asteroid styling */
  background: radial-gradient(circle at 30% 30%, #906b53, #4a3320);
  border-radius: 60% 40% 50% 70% / 60% 50% 70% 40%;
  border: 2px solid #3a2310;
  
  /* Tail / Flame effect pointing UP */
  box-shadow: 
    0 -15px 15px -2px rgba(255, 150, 0, 0.5),
    0 -30px 25px -5px rgba(255, 50, 0, 0.3),
    inset -5px -5px 10px rgba(0,0,0,0.6);
    
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: opacity 0.15s, transform 0.15s;
}

.meteorite.destroyed {
  opacity: 0;
  transform: translateX(-50%) scale(1.5);
}

.meteorite.missed {
  opacity: 0;
  transform: translateX(-50%) scale(0.5);
}

/* Couleurs d'encre (Effet Stroop) */
.ink-red { color: var(--red); text-shadow: 0 0 10px var(--red-glow); }
.ink-green { color: var(--green); text-shadow: 0 0 10px var(--green-glow); }
.ink-blue { color: var(--cyan); text-shadow: 0 0 10px var(--cyan-glow); }

.meteorite-cannons {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 20px;
  background: var(--bg-surface);
}

.cannon-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.cannon-btn:active {
  transform: scale(0.9);
}

.cannon-red { background: var(--red); box-shadow: 0 0 20px var(--red-glow); }
.cannon-green { background: var(--green); box-shadow: 0 0 20px var(--green-glow); }
.cannon-blue { background: var(--cyan); box-shadow: 0 0 20px var(--cyan-glow); }