/* K-MathsOC — style K-pop néon, mobile-first */
:root {
  --ink: #f7f2ff;
  --muted: #cdbde6;
  --bg: #0d0519;
  --surface: rgba(28, 14, 51, 0.9);
  --surface-solid: #1c0e33;
  --violet: #9b5cff;
  --violet-dark: #c9a4ff;
  --pink: #ff4fa3;
  --pink-strong: #d81e74;
  --cyan: #5ff7ff;
  --yellow: #ffd166;
  --border: #41276b;
  --focus: #5ff7ff;
  --radius: 20px;
  --glow-pink: 0 0 18px rgba(255, 79, 163, 0.45);
  --glow-cyan: 0 0 18px rgba(95, 247, 255, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 79, 163, 0.22), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(95, 247, 255, 0.18), transparent 30%),
    radial-gradient(circle at 50% 95%, rgba(155, 92, 255, 0.2), transparent 38%),
    var(--bg);
  background-attachment: fixed;
  animation: neonSky 22s ease-in-out infinite alternate;
}

h1, h2 { line-height: 1.2; }
h1 { font-size: clamp(1.9rem, 6.5vw, 3rem); margin: 0.2em 0 0.5em; color: var(--ink); }
h2 { font-size: clamp(1.3rem, 4.5vw, 1.75rem); margin: 1.6em 0 0.6em; color: var(--violet-dark); }
p { margin: 0.6em 0; }

a { color: var(--violet-dark); }
a:hover { color: var(--pink); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 50;
  padding: 12px 16px;
  background: var(--surface-solid);
  border: 2px solid var(--cyan);
  border-radius: 10px;
}
.skip-link:focus { left: 8px; top: 8px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(13, 5, 25, 0.85);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.45);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
}

.brand {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 0 12px rgba(255, 79, 163, 0.8), 0 0 24px rgba(155, 92, 255, 0.6);
}
.brand:hover { color: var(--cyan); }

.header-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.motion-toggle,
.sound-toggle,
.settings-toggle {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  border: 1px solid var(--violet);
  border-radius: 999px;
  background: rgba(28, 14, 51, 0.9);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: inset 0 0 12px rgba(155, 92, 255, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.motion-toggle:hover, .sound-toggle:hover, .settings-toggle:hover { transform: translateY(-2px); box-shadow: var(--glow-cyan); }
.motion-toggle[aria-pressed="true"], .sound-toggle[aria-pressed="true"] {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: var(--glow-cyan);
}
.settings-toggle { padding: 8px 12px; font-size: 1.1rem; }

.settings-panel {
  position: absolute;
  top: 100%;
  right: 16px;
  z-index: 30;
  width: min(320px, calc(100vw - 32px));
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--violet);
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6), var(--glow-cyan);
}
.settings-title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--violet-dark);
}
.settings-panel .motion-toggle,
.settings-panel .sound-toggle,
.settings-panel .text-link { width: 100%; }
.settings-panel .sound-toggle { justify-content: center; }
.install-button { width: 100%; }
.setting-group {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.setting-group legend { padding: 0 6px; color: var(--cyan); font-weight: 700; font-size: 0.9rem; }
.setting-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 0;
  cursor: pointer;
  color: var(--ink);
}
.setting-choice input { width: 20px; height: 20px; accent-color: var(--pink); }

.main-nav {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}
.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}
.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.main-nav a:hover {
  transform: translateY(-2px);
  border-color: var(--pink);
  box-shadow: var(--glow-pink);
}
.main-nav a[aria-current="page"] {
  background: linear-gradient(90deg, var(--pink-strong), var(--violet));
  color: #ffffff;
  box-shadow: var(--glow-pink);
  border-color: var(--pink);
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 16px 52px;
}
main:focus { outline: none; }

.eyebrow {
  margin: 0;
  color: var(--cyan);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.82rem;
  text-shadow: 0 0 12px rgba(95, 247, 255, 0.6);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 28px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--violet);
  background: linear-gradient(135deg, rgba(155, 92, 255, 0.26), rgba(255, 79, 163, 0.2));
  box-shadow: var(--glow-pink), inset 0 0 50px rgba(155, 92, 255, 0.18);
  animation: heroIn 0.7s ease-out both;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -70% -20%;
  background: conic-gradient(from 0deg, transparent, rgba(95, 247, 255, 0.16), transparent 28%, rgba(255, 79, 163, 0.16), transparent 60%);
  animation: spin 20s linear infinite;
  pointer-events: none;
}
.hero::after {
  content: "✦ ✧ ✦";
  position: absolute;
  top: 12px;
  right: 16px;
  color: var(--yellow);
  letter-spacing: 0.35em;
  font-size: 1.1rem;
  animation: twinkle 2.6s ease-in-out infinite;
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-text { font-size: 1.05rem; max-width: 62ch; color: var(--muted); }

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  h1 {
    background: linear-gradient(90deg, #ff6fbf, #b18aff, #5ff7ff, #ff6fbf);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: neonText 8s linear infinite;
  }
}

.badge-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 10px; }
.badge {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--cyan);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: var(--glow-cyan);
  animation: badgePulse 3s ease-in-out infinite;
}
.badge:nth-child(2) { animation-delay: 1.1s; }

.math-demo { font-size: 1.05rem; }
.math-demo .katex { font-size: 1.08em; color: #ffffff; }
.math-line { margin: 6px 0; }
.math-line .katex { font-size: 1.06em; }

.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 44px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(43, 21, 76, 0.95), rgba(20, 8, 40, 0.95));
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  text-decoration: none;
  color: var(--ink);
  animation: cardIn 0.6s ease-out both;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card-grid li:nth-child(1) .card { animation-delay: 0.06s; }
.card-grid li:nth-child(2) .card { animation-delay: 0.14s; }
.card-grid li:nth-child(3) .card { animation-delay: 0.22s; }
.card-grid li:nth-child(4) .card { animation-delay: 0.3s; }

.card:hover, .card:focus-visible {
  transform: translateY(-6px) scale(1.01);
  border-color: var(--pink);
  box-shadow: 0 0 0 2px rgba(255, 79, 163, 0.35), 0 16px 42px rgba(255, 79, 163, 0.28);
}
.card-icon {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(255, 79, 163, 0.65));
  animation: bob 3s ease-in-out infinite;
}
.card:hover .card-icon, .card:focus-visible .card-icon { animation-duration: 1s; }
.card strong { color: var(--violet-dark); font-size: 1.15rem; }
.card-text { color: var(--muted); }
.card-cta {
  margin-top: auto;
  color: var(--cyan);
  font-weight: 800;
  text-shadow: 0 0 10px rgba(95, 247, 255, 0.65);
}

.info-panel {
  margin-top: 26px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--cyan);
  box-shadow: 0 0 22px rgba(95, 247, 255, 0.14);
  animation: cardIn 0.7s ease-out 0.35s both;
}
.info-panel h2 { margin-top: 0; }
.info-panel p { color: var(--muted); }

.text-link { font-weight: 700; color: var(--cyan); }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 16px 30px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

@keyframes neonSky {
  from { background-position: 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 6% 4%, -5% 6%, 0 -4%, 0 0; }
}
@keyframes neonText {
  from { background-position: 0% 50%; }
  to { background-position: 300% 50%; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle {
  0%, 100% { opacity: 0.55; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.08); }
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 10px rgba(95, 247, 255, 0.3); }
  50% { box-shadow: 0 0 22px rgba(95, 247, 255, 0.75); }
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-5px) rotate(3deg); }
}

/* Exercices et moteur de correction */
.exercise-card {
  margin-top: 26px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--violet);
  background: linear-gradient(160deg, rgba(35, 17, 64, 0.96), rgba(16, 6, 32, 0.96));
  box-shadow: var(--glow-cyan), inset 0 0 40px rgba(155, 92, 255, 0.12);
}
.exercise-head h2 { margin-top: 8px; color: #ffffff; }
.answer-area {
  margin: 20px 0;
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}
.field-label { display: block; margin-bottom: 8px; font-weight: 700; color: var(--violet-dark); }
.text-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: #120721;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
}
.text-input:focus { border-color: var(--cyan); }
.fraction-fields { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.fraction-field { flex: 1 1 130px; }
.fraction-preview-wrap { flex: 1 1 120px; }
.fraction-preview {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px dashed var(--cyan);
  background: rgba(95, 247, 255, 0.07);
}
.qcm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.qcm-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(28, 14, 51, 0.85);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.qcm-option:has(input:checked) { border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.qcm-label { font-size: 1.1rem; font-weight: 700; }
.qcm-option-content { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qcm-option-content .katex { font-size: 1.06em; }
.level-grid {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.level-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 74px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(140deg, rgba(43, 21, 76, 0.92), rgba(20, 8, 40, 0.95));
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.level-card:hover, .level-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}
.level-card.bonus { border-color: var(--yellow); }
.level-card.current { border-color: var(--pink); box-shadow: var(--glow-pink); }
.level-card.locked {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.35);
}
.level-card.locked:hover, .level-card.locked:focus-visible {
  transform: none;
  border-color: var(--border);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}
.progress-summary, .session-fans {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(43, 21, 76, 0.75);
  color: var(--ink);
  font-weight: 700;
}
.session-fans { margin: 8px 0 0; font-size: 0.95rem; }
.level-icon { font-size: 1.9rem; line-height: 1; }
.level-copy { display: flex; flex-direction: column; gap: 3px; }
.level-copy strong { color: var(--violet-dark); font-size: 1.08rem; }
.level-copy span { color: var(--muted); font-size: 0.92rem; }
.session-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.level-recall {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border-left: 4px solid var(--violet);
  background: rgba(155, 92, 255, 0.1);
  color: var(--muted);
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--pink);
  background: linear-gradient(90deg, var(--pink-strong), var(--violet));
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--glow-pink);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn-secondary {
  background: rgba(28, 14, 51, 0.9);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: var(--glow-cyan);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
[hidden] { display: none !important; }
.feedback { min-height: 1.5em; margin-top: 14px; font-weight: 700; }
.feedback.good { color: var(--cyan); text-shadow: 0 0 10px rgba(95, 247, 255, 0.5); }
.feedback.try { color: var(--yellow); }
.hint, .solution {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border-left: 4px solid var(--yellow);
  background: rgba(255, 209, 102, 0.09);
}
.solution { border-left-color: var(--cyan); background: rgba(95, 247, 255, 0.09); }
.recall {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}
.recall summary {
  min-height: 44px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 800;
  color: var(--violet-dark);
}
.recall p { padding: 0 16px 14px; color: var(--muted); }

/* Mes données : export, import, remise à zéro. */
.backup-section {
  margin: 18px 0;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(43, 21, 76, 0.7);
}
.backup-section h2 { margin-top: 0; }
.backup-section.danger { border-color: rgba(255, 79, 163, 0.55); }
.backup-status { min-height: 1.4em; margin: 12px 0 0; color: var(--muted); font-weight: 700; }
.backup-status.error { color: var(--pink); }
.backup-preview, .backup-confirm {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed var(--cyan);
  background: rgba(10, 6, 24, 0.6);
}
.backup-confirm p { margin-top: 0; }
.reset-option { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-weight: 700; }
.btn-danger {
  border-color: #ff86bd;
  background: linear-gradient(90deg, #e01a6e, #8d0b45);
}
.export-reminder {
  margin: 0 0 18px;
  padding: 11px 15px;
  border-radius: 12px;
  border: 1px solid var(--yellow);
  background: rgba(255, 209, 102, 0.09);
  color: var(--ink);
}

/* Étape 6 : profil K-pop (titre, avatar, série quotidienne). */
.profile-section { margin-top: 18px; }
.profile-inline { margin-top: 14px; }
.profile-card {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--violet);
  background: rgba(43, 21, 76, 0.75);
  box-shadow: var(--glow-cyan);
}
.profile-main { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.avatar-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 76px;
  min-height: 76px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid var(--pink);
  background: rgba(255, 79, 163, 0.12);
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}
.avatar-button:hover { border-color: var(--cyan); }
.avatar-emoji { font-size: 2rem; line-height: 1; }
.avatar-hint { font-size: 0.75rem; font-weight: 800; color: var(--cyan); }
.profile-info { flex: 1 1 180px; }
.profile-title { margin: 0; color: var(--yellow); font-size: 1.2rem; font-weight: 900; }
.profile-title-button {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.profile-title-button:hover { color: var(--pink); }
.profile-idol-hint { color: var(--muted); font-size: 0.8rem; font-weight: 500; }
.profile-next { margin: 4px 0; color: var(--muted); font-size: 0.9rem; }
.profile-streak { margin: 4px 0 0; color: var(--cyan); font-weight: 800; }
.avatar-picker {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.avatar-picker-title { margin: 0 0 10px; font-weight: 800; color: var(--violet-dark); }
.avatar-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.avatar-choice {
  min-width: 56px;
  min-height: 56px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(10, 6, 24, 0.6);
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}
.avatar-choice:hover:not(:disabled) { border-color: var(--cyan); }
.avatar-choice.selected { border-color: var(--pink); box-shadow: var(--glow-pink); }
.avatar-choice.locked { opacity: 0.55; cursor: not-allowed; }
.avatar-choice-emoji { display: block; font-size: 1.5rem; line-height: 1.1; }
.avatar-lock { display: block; font-size: 0.72rem; font-weight: 800; color: var(--muted); }

/* Étape 9 : animaux Manga (images locales, deux styles) et mascotte sur le côté. */
.pet-thumb { display: block; width: 54px; height: 54px; margin: 0 auto; }
.pet-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.pet-fallback { display: block; font-size: 2rem; line-height: 54px; text-align: center; }
.avatar-button .pet-thumb { width: 58px; height: 58px; }
.avatar-list { gap: 10px; }
.avatar-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 96px;
  min-height: 104px;
  padding: 8px 6px;
}
.avatar-choice-label { font-size: 0.78rem; font-weight: 800; line-height: 1.15; }
.avatar-price { font-size: 0.72rem; font-weight: 800; color: var(--yellow); }
.avatar-choice.locked:not(:disabled) { cursor: pointer; opacity: 0.82; }
.style-picker { margin: 2px 0 12px; }
.style-picker-title { margin: 0 0 6px; font-size: 0.85rem; font-weight: 800; color: var(--muted); }
.style-list { display: flex; flex-wrap: wrap; gap: 8px; }
.style-choice {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(10, 6, 24, 0.6);
  color: #ffffff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}
.style-choice:hover { border-color: var(--cyan); }
.style-choice.selected { border-color: var(--pink); background: rgba(255, 79, 163, 0.18); box-shadow: var(--glow-pink); }
.avatar-message { margin: 10px 0 0; color: var(--cyan); font-size: 0.85rem; font-weight: 800; }

.mascot {
  position: fixed;
  right: clamp(6px, 2vw, 22px);
  bottom: 14px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  width: min(190px, 38vw);
  pointer-events: none;
}
.mascot-bubble {
  display: block;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--pink);
  border-radius: 14px 14px 4px 14px;
  background: rgba(20, 9, 40, 0.94);
  color: #ffffff;
  font-size: clamp(0.72rem, 2.6vw, 0.86rem);
  font-weight: 800;
  line-height: 1.3;
  box-shadow: var(--glow-pink);
  text-align: left;
}
.mascot-face { display: block; width: clamp(74px, 18vw, 116px); align-self: flex-end; }
.mascot-image { display: block; width: 100%; height: auto; }
.mascot-fallback { display: block; font-size: clamp(2.4rem, 8vw, 4rem); line-height: 1; text-align: center; }
.mascot-hop .mascot-face { animation: mascotHop 0.45s ease 2; }
.mascot-wave .mascot-face { animation: mascotWave 0.6s ease 2; }
.mascot-cheer .mascot-face { animation: mascotCheer 0.7s ease 2; }
@keyframes mascotHop {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-9px); }
}
@keyframes mascotWave {
  0%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(-9deg); }
  70% { transform: rotate(9deg); }
}
@keyframes mascotCheer {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-12px) scale(1.08); }
}
@media (max-width: 480px) {
  .mascot { width: min(158px, 44vw); bottom: 8px; }
  .mascot-face { width: 78px; }
}

/* Étape 7 : confettis de réussite et écran d'accueil optionnel. */
.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  pointer-events: none;
}
.confetti-bit {
  position: absolute;
  top: -24px;
  width: 9px;
  height: 15px;
  border-radius: 2px;
  opacity: 0.95;
  animation-name: confettiFall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes confettiFall {
  from { transform: translateY(-10vh) rotate(0deg); }
  to { transform: translateY(110vh) rotate(720deg); }
}
.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: rgba(13, 5, 25, 0.88);
  cursor: pointer;
  animation: splashIn 0.25s ease-out both;
}
.splash-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 26px 34px;
  border-radius: 24px;
  border: 1px solid var(--pink);
  background: linear-gradient(135deg, rgba(155, 92, 255, 0.25), rgba(255, 79, 163, 0.22));
  box-shadow: var(--glow-pink);
  animation: splashPop 0.5s ease-out both;
}
.splash-emoji { font-size: 4.5rem; line-height: 1; animation: twinkle 1.4s ease-in-out infinite; }
.splash-text { color: #ffffff; font-weight: 900; font-size: 1.15rem; }
@keyframes splashIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes splashPop {
  from { transform: scale(0.75); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Étape 10 : image de démarrage et petite animation sur les moments choisis. */
.start-splash-overlay {
  padding: 0;
  overflow: hidden;
  background: #0d0519;
}
.start-splash-card {
  width: 100%;
  max-width: none;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  animation: splashIn 0.2s ease-out both;
}
.start-splash-image {
  display: block;
  width: 100vw;
  height: 100vh;
  object-fit: contain;
}
.start-splash-fallback { font-size: clamp(4rem, 20vw, 8rem); }
.start-splash-skip {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1;
  background: rgba(13, 5, 25, 0.92);
}
.moment-splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 3, 18, 0.9);
}
.moment-splash-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(360px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 16px 18px 20px;
  border: 1px solid var(--pink);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(155, 92, 255, 0.3), rgba(255, 79, 163, 0.22)), var(--surface-solid);
  box-shadow: 0 0 36px rgba(255, 79, 163, 0.45);
  text-align: center;
  animation: splashPop 0.35s ease-out both;
}
.moment-splash-image {
  display: block;
  width: min(280px, 70vw);
  max-height: 52vh;
  object-fit: contain;
  border-radius: 16px;
}
.moment-splash-fallback { font-size: 3.4rem; line-height: 1; }
.moment-splash-title { margin: 0; color: var(--yellow); font-size: clamp(1.35rem, 5vw, 1.9rem); }
.moment-splash-text { margin: 0; color: var(--ink); font-size: 0.95rem; font-weight: 800; }
.moment-splash-close { width: 100%; max-width: 240px; }

.idol-splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  background: rgba(8, 3, 18, 0.94);
}
.idol-splash-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 22px 20px 26px;
  border: 1px solid var(--pink);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(155, 92, 255, 0.28), rgba(255, 79, 163, 0.2)), var(--surface-solid);
  box-shadow: 0 0 40px rgba(255, 79, 163, 0.5);
  text-align: center;
  animation: splashPop 0.45s ease-out both;
}
.idol-splash-emoji { margin: 0; font-size: 3.4rem; line-height: 1; }
.idol-splash-title { margin: 4px 0 0; font-size: clamp(1.8rem, 6vw, 2.6rem); color: var(--yellow); }
.idol-splash-subtitle { margin: 2px 0 14px; color: var(--cyan); font-weight: 800; letter-spacing: 0.06em; }
.idol-splash-lyrics {
  margin: 0 0 18px;
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(13, 5, 25, 0.6);
  text-align: left;
}
.idol-line { margin: 0.35em 0; color: var(--ink); font-size: clamp(0.85rem, 3.2vw, 1rem); }
.idol-line-break { height: 0.7em; margin: 0; }
.idol-splash-close { width: 100%; max-width: 260px; }

@media (min-width: 700px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .level-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-inner, .main-nav, main { padding-left: 24px; padding-right: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.reduce-motion { scroll-behavior: auto; }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
