:root {
  --bg: #000000;
  --fg: #ffffff;
  --gold: #ffc93c;
  --soul-red: #e6231e;
  --correct-green: #3adf3a;
  --muted: #808080;

  --font-display: 'Press Start 2P', monospace;
  --font-body: 'VT323', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
}

body {
  font-family: var(--font-body);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-bottom: 56px; /* laisse la place au disclaimer fixe en bas */
}

#disclaimer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.92);
  border-top: 1px solid var(--muted);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 15px;
  text-align: center;
  padding: 8px 12px;
}

/* Le lecteur YouTube ne doit JAMAIS être visible : ni titre, ni miniature, ni contrôles. */
#yt-hidden-player {
  position: fixed;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

#app {
  width: 100%;
  max-width: 620px;
}

.screen {
  display: none;
}

.screen.active {
  display: flex;
  justify-content: center;
}

.box {
  width: 100%;
  border: 3px solid var(--fg);
  background: var(--bg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.title {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.6;
  text-align: center;
  margin: 0;
}

.title.small {
  font-size: 20px;
}

.subtitle {
  font-size: 24px;
  color: var(--muted);
  text-align: center;
  margin: 0;
}

/* --- Menu de configuration --- */
.menu-label {
  width: 100%;
  font-size: 18px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  text-align: left;
}

.menu {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.menu-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  border: 2px solid var(--muted);
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 22px;
  text-align: left;
  cursor: pointer;
}

.menu-option .cursor {
  color: var(--soul-red);
  opacity: 0;
  width: 1em;
}

.menu-option.selected {
  border-color: var(--gold);
}

.menu-option.selected .cursor {
  opacity: 1;
}

.menu-option input[type="number"] {
  background: var(--bg);
  color: var(--fg);
  border: none;
  border-bottom: 2px solid var(--fg);
  font-family: var(--font-body);
  font-size: 22px;
  width: 80px;
  margin-left: auto;
}

.menu-option input[type="number"]:focus {
  outline: 2px solid var(--gold);
}

/* --- Boutons génériques style "combat" --- */
.battle-btn {
  font-family: var(--font-display);
  font-size: 16px;
  background: var(--bg);
  color: var(--gold);
  border: 3px solid var(--gold);
  padding: 16px 20px;
  cursor: pointer;
  width: 100%;
}

.battle-btn:hover,
.battle-btn:focus-visible {
  background: var(--gold);
  color: var(--bg);
  outline: none;
}

.error-msg {
  color: var(--soul-red);
  font-size: 20px;
  text-align: center;
  min-height: 1.2em;
  margin: 0;
}

/* --- Ecran de jeu --- */
.hud {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#progress-label {
  font-size: 20px;
  color: var(--muted);
}

.hp-bar {
  width: 100%;
  height: 22px;
  border: 2px solid var(--fg);
  background: var(--bg);
  padding: 2px;
}

.hp-fill {
  height: 100%;
  width: 100%;
  background: var(--fg);
  transition: width 15s linear, background-color 0.3s ease;
}

.hp-fill.warning { background: var(--gold); }
.hp-fill.critical { background: var(--soul-red); }

.listening-indicator {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: 40px;
}

.eq-bar {
  width: 8px;
  background: var(--gold);
  animation: eq 0.9s ease-in-out infinite;
}
.eq-bar:nth-child(1) { animation-delay: 0s; }
.eq-bar:nth-child(2) { animation-delay: 0.15s; }
.eq-bar:nth-child(3) { animation-delay: 0.3s; }
.eq-bar:nth-child(4) { animation-delay: 0.45s; }
.eq-bar:nth-child(5) { animation-delay: 0.6s; }

@keyframes eq {
  0%, 100% { height: 8px; }
  50% { height: 36px; }
}

.listening-text {
  font-size: 20px;
  color: var(--muted);
  text-align: center;
  margin: 0;
}

.answers-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.answer-btn {
  font-family: var(--font-body);
  font-size: 20px;
  background: var(--bg);
  color: var(--gold);
  border: 3px solid var(--gold);
  padding: 16px 10px;
  min-height: 72px;
  cursor: pointer;
  text-transform: none;
}

.answer-btn:hover:not(:disabled),
.answer-btn:focus-visible:not(:disabled) {
  background: var(--gold);
  color: var(--bg);
  outline: none;
}

.answer-btn:disabled {
  cursor: default;
}

.answer-btn.correct {
  border-color: var(--correct-green);
  color: var(--correct-green);
  background: var(--bg);
}

.answer-btn.wrong {
  border-color: var(--soul-red);
  color: var(--soul-red);
  background: var(--bg);
}

/* --- Ecran de résultats --- */
.score-line {
  font-family: var(--font-display);
  font-size: 26px;
  text-align: center;
  line-height: 1.8;
  margin: 0;
}

@media (max-width: 480px) {
  body { font-size: 20px; }
  .title { font-size: 22px; }
  .answers-grid { grid-template-columns: 1fr; }
  #disclaimer { font-size: 13px; padding: 6px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .eq-bar { animation: none; height: 20px; }
  .hp-fill { transition: none; }
}
