/* ============================================================
   TOKENS — thème "rythme circadien" (facteurs humains, aviation)
   jour/nuit, ressources attentionnelles, vigilance
   ============================================================ */
:root {
  --bg-deep: #0A0C13;
  --ink: #0E1119;
  --panel: rgba(22, 26, 36, 0.62);
  --panel-raised: rgba(255, 255, 255, 0.045);
  --panel-raised-solid: #1A1E2A;
  --panel-line: rgba(255, 255, 255, 0.09);
  --panel-line-strong: rgba(255, 255, 255, 0.18);
  --steel: #B7BECE;
  --steel-dim: #7B8398;
  --paper: #F4F1E8;

  /* Aube / alerte — chaleur du jour */
  --coral: #FF7A59;
  --coral-deep: #D6552F;
  --coral-glow: rgba(255, 122, 89, 0.38);
  /* Vigilance / or — repères, rang 1 */
  --amber: #F2B84C;
  --amber-glow: rgba(242, 184, 76, 0.35);
  /* Nuit / cognition — fatigue, mémoire */
  --indigo: #6C8EEF;
  --indigo-deep: #3F5FC4;
  --indigo-glow: rgba(108, 142, 239, 0.34);
  /* Sécurité / validé */
  --teal: #36C9A6;
  --teal-deep: #1F8F76;
  --teal-glow: rgba(54, 201, 166, 0.30);
  /* Alerte / erreur / stress */
  --red: #F0556B;
  --red-deep: #A82F44;
  --red-glow: rgba(240, 85, 107, 0.32);

  --font-display: "Oswald", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --blur: 20px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --shadow-deep: 0 28px 70px -24px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  --shadow-soft: 0 14px 36px -16px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--paper);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Fond d'ambiance : halo double-ton (corail d'aube / indigo nocturne)
   + une fine courbe sinusoïdale rappelant le rythme circadien. */
.ambience-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 18px 18px, rgba(255, 255, 255, 0.022) 1.4px, transparent 1.4px),
    radial-gradient(900px 600px at 90% -8%, var(--coral-glow), transparent 60%),
    radial-gradient(820px 580px at -6% 106%, var(--indigo-glow), transparent 60%);
  background-size: 36px 36px, auto, auto;
  opacity: 0.9;
}
.ambience-bg::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 38%;
  height: 220px;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='160' viewBox='0 0 600 160'%3E%3Cpath d='M0 120 C 75 10, 150 10, 225 80 S 375 150, 450 80 S 575 10, 600 60' fill='none' stroke='%23FF7A59' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 600px 160px;
}

@media (prefers-reduced-motion: no-preference) {
  .pulse-on-enter { animation: fadeUp 0.5s var(--ease) both; }
  .brand-mark svg { animation: breathe 5s ease-in-out infinite; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes breathe {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255,122,89,0)); }
  50% { filter: drop-shadow(0 0 9px rgba(255,122,89,0.55)); }
}

a { color: var(--coral); }

.modal-card::-webkit-scrollbar { width: 8px; }
.modal-card::-webkit-scrollbar-track { background: transparent; }
.modal-card::-webkit-scrollbar-thumb {
  background: var(--panel-line-strong);
  border-radius: var(--radius-pill);
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--panel-line);
  background: rgba(10, 12, 19, 0.66);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: 0 1px 0 rgba(108,142,239,0.45), 0 12px 30px -18px rgba(0,0,0,0.6);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { color: var(--coral); flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-line1 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--steel-dim);
  font-weight: 700;
}
.brand-text h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 23px;
  letter-spacing: 0.01em;
  color: var(--paper);
  text-transform: uppercase;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.signature {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--steel);
  background: var(--panel-raised);
  border: 1px solid var(--panel-line);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
}
.signature strong { color: var(--amber); }

/* ============================================================
   GENERIC BUTTONS
   ============================================================ */
.ghost-btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--paper);
  background: var(--panel-raised);
  border: 1.5px solid var(--panel-line);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.ghost-btn:hover {
  border-color: var(--indigo);
  color: var(--indigo);
  box-shadow: 0 8px 22px -12px var(--indigo-glow);
  transform: translateY(-1px);
}
.ghost-btn.small { padding: 6px 12px; font-size: 12.5px; }
.ghost-btn.danger:hover { border-color: var(--red); color: var(--red); box-shadow: 0 8px 22px -12px var(--red-glow); }

.primary-btn {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 15px;
  color: #1F1004;
  background: linear-gradient(160deg, var(--amber) 0%, var(--coral) 100%);
  border: none;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 30px -12px var(--coral-glow), inset 0 1px 0 rgba(255,255,255,0.35);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s var(--ease);
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -12px var(--coral-glow), inset 0 1px 0 rgba(255,255,255,0.4); filter: brightness(1.05); }
.primary-btn:active { transform: translateY(0); box-shadow: 0 8px 18px -10px var(--coral-glow), inset 0 1px 0 rgba(255,255,255,0.3); }
.primary-btn:disabled {
  background: var(--panel-raised-solid);
  box-shadow: none;
  cursor: not-allowed;
  color: var(--steel-dim);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--steel);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.icon-btn:hover { color: var(--paper); transform: rotate(90deg); }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
main#app {
  position: relative;
  z-index: 1;
  flex: 1;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.app-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--steel-dim);
  letter-spacing: 0.06em;
  border-top: 1px solid var(--panel-line);
}

/* ============================================================
   HOME / SETUP SCREEN
   ============================================================ */
.hero-panel {
  background: var(--panel);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow-deep);
  position: relative;
  overflow: hidden;
}
.hero-panel::before {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, var(--indigo-glow), transparent 70%);
  pointer-events: none;
}
.hero-panel::after {
  /* Bord gauche évoquant l'axe d'un diagramme de ressources attentionnelles */
  content: "";
  position: absolute;
  top: 18px; bottom: 18px; left: 0;
  width: 6px;
  border-radius: 0 4px 4px 0;
  background: repeating-linear-gradient(
    to bottom,
    var(--coral-deep) 0px, var(--coral-deep) 22px,
    transparent 22px, transparent 34px
  );
  opacity: 0.55;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--indigo);
  text-transform: uppercase;
  margin: 0 0 10px;
}
.hero-panel h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.hero-sub {
  color: var(--steel);
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 28px;
  max-width: 560px;
}

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--steel-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.name-input {
  width: 100%;
  max-width: 360px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--paper);
  background: var(--panel-raised-solid);
  border: 1.5px solid var(--panel-line-strong);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  margin-bottom: 26px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.name-input::placeholder { color: var(--steel-dim); }
.name-input:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-glow);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 10px;
}
@media (max-width: 560px) {
  .mode-grid { grid-template-columns: 1fr; }
}
.mode-card {
  text-align: left;
  background: var(--panel-raised);
  border: 1.5px solid var(--panel-line);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  color: var(--paper);
  font-family: var(--font-body);
  position: relative;
}
.mode-card:hover {
  border-color: var(--amber);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -16px var(--amber-glow);
}
.mode-card.selected {
  border-color: var(--amber);
  background: linear-gradient(160deg, rgba(242,184,76,0.12), rgba(242,184,76,0.03));
  box-shadow: 0 0 0 1px var(--amber) inset;
}
.mode-card-icon {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--amber);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}
.mode-card-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 4px;
  text-transform: uppercase;
}
.mode-card-desc {
  font-size: 12.5px;
  color: var(--steel-dim);
  line-height: 1.4;
  margin: 0;
}
.mode-card:disabled, .mode-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.cat-select-wrap { display: none; margin-top: 16px; }
.cat-select-wrap.visible { display: block; }
.cat-select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--paper);
  background: var(--panel-raised-solid);
  border: 1.5px solid var(--panel-line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  cursor: pointer;
}

.hero-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  flex-wrap: wrap;
  gap: 14px;
}
.bank-stat {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--steel-dim);
}
.bank-stat strong { color: var(--steel); }

/* ============================================================
   QUIZ SCREEN
   ============================================================ */
.quiz-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.progress-track {
  flex: 1;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--panel-raised-solid);
  border: 1px solid var(--panel-line);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--indigo-deep), var(--indigo));
  border-radius: var(--radius-pill);
  transition: width 0.35s var(--ease);
}
.progress-text {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--steel);
  white-space: nowrap;
}
.quiz-timer {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--steel-dim);
  white-space: nowrap;
}

.question-panel {
  background: var(--panel);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-deep);
}
.question-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  background: rgba(242, 184, 76, 0.1);
  border: 1px solid rgba(242, 184, 76, 0.3);
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}
.question-cat.multi-tag {
  color: var(--indigo);
  background: rgba(108,142,239,0.1);
  border-color: rgba(108,142,239,0.35);
  margin-left: 8px;
}
.question-text {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.35;
  margin: 0 0 20px;
  color: var(--paper);
}
.multi-hint {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--steel-dim);
  margin: -10px 0 18px;
}

.question-img-wrap {
  margin-bottom: 20px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--panel-line);
  background: #fff;
  text-align: center;
}
.question-img-wrap img {
  max-width: 100%;
  max-height: 360px;
  display: block;
  margin: 0 auto;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--paper);
  background: var(--panel-raised);
  border: 1.5px solid var(--panel-line-strong);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.15s var(--ease);
}
.option-btn:hover:not(:disabled) {
  border-color: var(--indigo);
  background: rgba(108,142,239,0.08);
  transform: translateX(2px);
}
.option-letter {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--panel-raised-solid);
  border: 1px solid var(--panel-line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--steel);
}
.option-btn.checkbox-mode .option-letter {
  border-radius: 6px;
}
.option-btn.checkbox-mode.checked .option-letter {
  background: var(--indigo);
  border-color: var(--indigo);
  color: #06141F;
}
.option-btn.checkbox-mode.checked {
  border-color: var(--indigo);
  background: rgba(108,142,239,0.1);
}

.option-btn:disabled.checkbox-mode.checked.correct,
.option-btn.checkbox-mode.correct {
  border-color: var(--teal) !important;
  background: rgba(54, 201, 166, 0.14) !important;
}
.option-btn.checkbox-mode.correct .option-letter,
.option-btn:disabled.checkbox-mode.checked.correct .option-letter {
  background: var(--teal) !important;
  border-color: var(--teal) !important;
  color: #06241B !important;
}
.option-btn:disabled.checkbox-mode.checked.incorrect,
.option-btn.checkbox-mode.incorrect {
  border-color: var(--red) !important;
  background: rgba(240, 85, 107, 0.14) !important;
}
.option-btn.checkbox-mode.incorrect .option-letter,
.option-btn:disabled.checkbox-mode.checked.incorrect .option-letter {
  background: var(--red) !important;
  border-color: var(--red) !important;
  color: #260910 !important;
}

.option-btn:disabled { cursor: default; }
.option-btn.correct {
  border-color: var(--teal);
  background: rgba(54, 201, 166, 0.14);
}
.option-btn.correct .option-letter { background: var(--teal); border-color: var(--teal); color: #06241B; }
.option-btn.incorrect {
  border-color: var(--red);
  background: rgba(240, 85, 107, 0.14);
}
.option-btn.incorrect .option-letter { background: var(--red); border-color: var(--red); color: #260910; }
.option-btn.faded { opacity: 0.55; }

.validate-row { margin-top: 16px; }

.explain-box {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-line);
  background: var(--panel-raised-solid);
  animation: fadeUp 0.35s var(--ease) both;
}
.explain-box.is-correct { border-color: rgba(54,201,166,0.4); }
.explain-box.is-incorrect { border-color: rgba(240,85,107,0.4); }
.explain-verdict {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.explain-verdict.ok { color: var(--teal); }
.explain-verdict.ko { color: var(--red); }
.explain-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--steel);
  margin: 0;
}

.next-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}

/* ============================================================
   RESULTS SCREEN
   ============================================================ */
.results-panel {
  background: var(--panel);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow-deep);
  text-align: center;
}
.score-ring-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}
.score-big {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 700;
  margin: 6px 0 0;
  letter-spacing: 0.01em;
}
.score-sub {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--steel-dim);
  margin: 0 0 4px;
}
.results-stats-row {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 22px 0 28px;
  flex-wrap: wrap;
}
.results-stat {
  text-align: center;
}
.results-stat-val {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--paper);
}
.results-stat-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--steel-dim);
  text-transform: uppercase;
}

.name-save-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.results-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.review-section {
  margin-top: 28px;
  text-align: left;
}
.review-section h3 {
  font-family: var(--font-display);
  font-size: 16px;
  text-transform: uppercase;
  color: var(--steel);
  margin: 0 0 14px;
  border-bottom: 1px solid var(--panel-line);
  padding-bottom: 10px;
}
.review-item {
  background: var(--panel-raised-solid);
  border: 1px solid var(--panel-line);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.review-q {
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 8px;
  color: var(--paper);
}
.review-your {
  font-size: 13px;
  color: var(--red);
  margin: 0 0 4px;
}
.review-correct {
  font-size: 13px;
  color: var(--teal);
  margin: 0 0 8px;
}
.review-explain {
  font-size: 12.5px;
  color: var(--steel-dim);
  line-height: 1.5;
  margin: 0;
}
.review-empty {
  text-align: center;
  color: var(--steel-dim);
  font-size: 14px;
  padding: 20px;
}

/* ============================================================
   LEADERBOARD MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5, 6, 10, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  width: 100%;
  max-width: 540px;
  max-height: 84vh;
  overflow-y: auto;
  background: var(--panel-raised-solid);
  border: 1px solid var(--panel-line-strong);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow-deep);
  animation: fadeUp 0.3s var(--ease) both;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.modal-head h2 {
  font-family: var(--font-display);
  font-size: 19px;
  text-transform: uppercase;
  margin: 0;
}
.modal-sub {
  font-size: 12.5px;
  color: var(--steel-dim);
  margin: 0 0 18px;
}
.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.lb-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel-dim);
  padding: 8px 6px;
  border-bottom: 1px solid var(--panel-line);
}
.lb-table td {
  padding: 9px 6px;
  border-bottom: 1px solid var(--panel-line);
  color: var(--paper);
}
.lb-table tr:last-child td { border-bottom: none; }
.lb-rank {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--amber);
  width: 28px;
}
.lb-rank.top1 { color: #FFD86B; }
.lb-rank.top2 { color: #D7DCE3; }
.lb-rank.top3 { color: #E0A578; }
.lb-pct { font-weight: 700; }
.lb-empty, .lb-loading {
  text-align: center;
  color: var(--steel-dim);
  padding: 30px 10px;
  font-size: 13.5px;
}
.modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--panel-raised-solid);
  border: 1px solid var(--panel-line-strong);
  color: var(--paper);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-deep);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .hero-panel, .question-panel, .results-panel { padding: 24px 18px; }
  .brand-text h1 { font-size: 18px; }
  .question-text { font-size: 18px; }
  .score-big { font-size: 44px; }
}
