@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --bg-0: #0a0a0a;
  --bg-1: #111111;
  --bg-2: #1a1a1a;
  --bg-3: #242424;
  --bg-4: #2e2e2e;
  --gold: #c9a84c;
  --gold-light: #e8c97a;
  --gold-dim: #8a6e2e;
  --gold-bg: rgba(201,168,76,0.08);
  --gold-border: rgba(201,168,76,0.25);
  --text-1: #f0ece0;
  --text-2: #a89f8c;
  --text-3: #6b6459;
  --success: #4caf78;
  --success-bg: rgba(76,175,120,0.1);
  --danger: #e05555;
  --danger-bg: rgba(224,85,85,0.1);
  --warning: #e8a530;
  --warning-bg: rgba(232,165,48,0.1);
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg-0);
  color: var(--text-1);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3 { font-family: 'Playfair Display', serif; font-weight: 600; letter-spacing: 0.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

.gold { color: var(--gold); }
.muted { color: var(--text-2); }
.small { font-size: 0.82rem; }

/* ── LAYOUT ── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-1);
  border-right: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 0 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 1rem;
}
.sidebar-logo .logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--gold);
  letter-spacing: 0.05em;
}
.sidebar-logo .logo-sub { font-size: 0.72rem; color: var(--text-3); letter-spacing: 0.1em; text-transform: uppercase; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.6rem 1.25rem;
  color: var(--text-2);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  border-left: 2px solid transparent;
  text-decoration: none;
}
.nav-item:hover { color: var(--text-1); background: rgba(255,255,255,0.03); }
.nav-item.active { color: var(--gold); border-left-color: var(--gold); background: var(--gold-bg); }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--gold); color: var(--bg-0); font-size: 0.7rem; font-weight: 600; padding: 1px 6px; border-radius: 10px; min-width: 20px; text-align: center; }

.sidebar-user {
  margin-top: auto;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold-bg); border: 1px solid var(--gold-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600; color: var(--gold); flex-shrink: 0;
}
.user-name { font-size: 0.85rem; color: var(--text-1); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-logout { background: none; border: none; color: var(--text-3); cursor: pointer; padding: 4px; font-size: 14px; }
.btn-logout:hover { color: var(--danger); }

.main-content {
  margin-left: 220px;
  flex: 1;
  min-height: 100vh;
  padding: 2rem 2.5rem;
  max-width: calc(100vw - 220px);
}

/* ── AUTH SCREENS ── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-0);
  position: relative;
  overflow: hidden;
}
.auth-screen::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,0.06) 0%, transparent 70%);
  top: -100px; right: -100px;
  pointer-events: none;
}

.auth-card {
  background: var(--bg-1);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}
.auth-card .logo-text { font-family: 'Playfair Display', serif; font-size: 1.8rem; color: var(--gold); display: block; margin-bottom: 0.25rem; }
.auth-card .logo-sub { font-size: 0.78rem; color: var(--text-3); letter-spacing: 0.12em; text-transform: uppercase; }
.auth-card h2 { margin: 1.75rem 0 1.25rem; font-size: 1.1rem; color: var(--text-2); font-family: 'DM Sans', sans-serif; font-weight: 400; }
.auth-switch { text-align: center; margin-top: 1.25rem; font-size: 0.85rem; color: var(--text-3); }
.auth-switch a { color: var(--gold); cursor: pointer; text-decoration: none; }
.auth-switch a:hover { color: var(--gold-light); }

/* ── FORMS ── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.82rem; color: var(--text-2); margin-bottom: 0.4rem; letter-spacing: 0.04em; }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-1);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.15s;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold-dim); }
input::placeholder { color: var(--text-3); }
input[type="range"] { -webkit-appearance: none; width: 100%; height: 3px; background: var(--bg-4); border-radius: 2px; outline: none; border: none; padding: 0; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--gold); cursor: pointer; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--gold); color: var(--bg-0); }
.btn-primary:hover { background: var(--gold-light); }
.btn-primary:disabled { background: var(--gold-dim); color: var(--bg-2); cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid rgba(255,255,255,0.1); }
.btn-ghost:hover { background: rgba(255,255,255,0.04); color: var(--text-1); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(224,85,85,0.2); }
.btn-danger:hover { background: rgba(224,85,85,0.2); }
.btn-full { width: 100%; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }

/* ── CARDS ── */
.card {
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.card-title { font-size: 0.75rem; color: var(--text-3); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.5rem; }

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 2rem; }
.stat-card { background: var(--bg-1); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius-lg); padding: 1.25rem 1rem; text-align: center; }
.stat-val { font-family: 'Playfair Display', serif; font-size: 2rem; color: var(--gold); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-3); margin-top: 0.3rem; letter-spacing: 0.05em; }

/* ── QUIZ FLASHCARD ── */
.quiz-wrap { max-width: 520px; margin: 0 auto; }
.quiz-meta { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.quiz-meta .progress-wrap { flex: 1; }
.quiz-meta .prog-label { font-size: 0.78rem; color: var(--text-3); margin-bottom: 4px; display: flex; justify-content: space-between; }
.progress-bar { height: 3px; background: var(--bg-4); border-radius: 2px; }
.progress-fill { height: 100%; background: var(--gold); border-radius: 2px; transition: width 0.4s cubic-bezier(.4,0,.2,1); }
.score-chip { font-size: 0.82rem; background: var(--gold-bg); color: var(--gold); border: 1px solid var(--gold-border); padding: 4px 12px; border-radius: 20px; white-space: nowrap; }

.flashcard {
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card-context {
  padding: 10px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.82rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-context strong { color: var(--text-1); font-weight: 500; }
.type-pill {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-3);
  color: var(--text-3);
  letter-spacing: 0.06em;
}

.card-photo {
  width: 100%; height: 340px;
  background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.card-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.card-photo .no-photo { text-align: center; color: var(--text-3); }
.card-photo .no-photo svg { width: 48px; height: 48px; opacity: 0.3; }

.card-body { padding: 1.25rem; }
.card-question { font-size: 0.8rem; color: var(--text-3); margin-bottom: 0.75rem; letter-spacing: 0.04em; }

.answer-input-row { display: flex; gap: 8px; }
.answer-input-row input { font-size: 1rem; }
.answer-input-row input.correct { border-color: var(--success) !important; background: var(--success-bg); color: var(--success); }
.answer-input-row input.wrong { border-color: var(--danger) !important; background: var(--danger-bg); color: var(--danger); }

.reveal-box { margin-top: 1rem; padding: 1rem; background: var(--bg-2); border-radius: var(--radius); border-left: 3px solid transparent; }
.reveal-box.correct { border-left-color: var(--success); }
.reveal-box.wrong { border-left-color: var(--danger); }
.reveal-name { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--text-1); }
.reveal-character { font-size: 0.82rem; color: var(--text-3); margin-top: 2px; }
.reveal-status { font-size: 0.82rem; font-weight: 500; margin-bottom: 4px; }
.reveal-status.ok { color: var(--success); }
.reveal-status.ko { color: var(--danger); }

.rating-row { display: flex; gap: 8px; margin-top: 1rem; flex-wrap: wrap; }
.rating-btn {
  flex: 1; min-width: 60px;
  padding: 0.5rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--bg-3);
  color: var(--text-2);
  text-align: center;
  transition: all 0.15s;
}
.rating-btn:hover { background: var(--bg-4); color: var(--text-1); }
.rating-btn.r0 { border-color: rgba(224,85,85,0.3); }
.rating-btn.r0:hover { background: var(--danger-bg); color: var(--danger); }
.rating-btn.r1 { border-color: rgba(224,85,85,0.2); }
.rating-btn.r3 { border-color: rgba(201,168,76,0.2); }
.rating-btn.r3:hover { background: var(--gold-bg); color: var(--gold); }
.rating-btn.r4, .rating-btn.r5 { border-color: rgba(76,175,120,0.2); }
.rating-btn.r4:hover, .rating-btn.r5:hover { background: var(--success-bg); color: var(--success); }
.rating-label { font-size: 0.68rem; color: var(--text-3); margin-top: 2px; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-state svg { width: 56px; height: 56px; color: var(--text-3); margin-bottom: 1rem; opacity: 0.4; }
.empty-state h2 { font-size: 1.1rem; color: var(--text-2); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.88rem; color: var(--text-3); }

/* ── MEDIA GRID ── */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.media-thumb {
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.media-thumb:hover { border-color: var(--gold-border); transform: translateY(-2px); }
.media-thumb img { width: 100%; height: 200px; object-fit: cover; display: block; background: var(--bg-2); }
.media-thumb-body { padding: 0.75rem; }
.media-thumb-title { font-size: 0.85rem; font-weight: 500; color: var(--text-1); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-thumb-meta { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; }

/* ── IMPORT DROP ZONE ── */
.drop-zone {
  border: 1.5px dashed var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--gold-bg);
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--gold); background: rgba(201,168,76,0.12); }
.drop-zone svg { width: 40px; height: 40px; color: var(--gold-dim); margin-bottom: 1rem; }
.drop-zone p { color: var(--text-2); font-size: 0.9rem; line-height: 1.7; }
.drop-zone strong { color: var(--text-1); }
.drop-zone .hint { font-size: 0.78rem; color: var(--text-3); margin-top: 0.5rem; }

/* ── ALERTS ── */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); font-size: 0.85rem; margin-bottom: 1rem; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(76,175,120,0.2); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(224,85,85,0.2); }
.alert-info { background: var(--gold-bg); color: var(--gold); border: 1px solid var(--gold-border); }

/* ── LOADING ── */
.spinner { width: 20px; height: 20px; border: 2px solid rgba(201,168,76,0.2); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 999; }

/* ── TOAST ── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 0.75rem 1.25rem; border-radius: var(--radius); font-size: 0.85rem; box-shadow: var(--shadow); animation: slideUp 0.2s ease; max-width: 320px; }
.toast-success { background: #1a2e22; color: var(--success); border: 1px solid rgba(76,175,120,0.3); }
.toast-error { background: #2e1a1a; color: var(--danger); border: 1px solid rgba(224,85,85,0.3); }
.toast-info { background: #22200f; color: var(--gold); border: 1px solid var(--gold-border); }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── PAGE HEADER ── */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.6rem; color: var(--text-1); }
.page-header p { color: var(--text-2); font-size: 0.88rem; margin-top: 0.25rem; }

/* ── DIVIDER ── */
.divider { height: 1px; background: rgba(255,255,255,0.06); margin: 1.5rem 0; }

/* ── IMPORT PROGRESS ── */
.import-log { margin-top: 1rem; max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.import-log-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--bg-2); border-radius: 6px; font-size: 0.8rem; color: var(--text-2); }
.import-log-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-ok { background: var(--success); }
.dot-err { background: var(--danger); }
.dot-pending { background: var(--text-3); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.3; } }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; padding: 1.25rem; }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── SCREEN VISIBILITY ── */
.screen { display: none; }
.screen.active { display: block; }
#auth-root { display: none; }
#auth-root.active { display: flex; }

/* ── QUIZ FEED (style réseau social) ── */
.quiz-feed {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 4rem;
}

.feed-card {
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color 0.2s;
}
.feed-card:has(.verdict-perfect) { border-color: rgba(76,175,120,0.3); }
.feed-card:has(.verdict-wrong),
.feed-card:has(.verdict-blank) { border-color: rgba(224,85,85,0.2); }

.feed-card-inner { display: flex; flex-direction: column; }

.feed-card-header {
  padding: 10px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.feed-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.feed-media-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-1);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-type-pill {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--bg-3);
  color: var(--text-3);
  white-space: nowrap;
}
.feed-new-badge {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}
.streak-badge {
  font-size: 0.75rem;
  font-weight: 500;
}

.feed-photo-wrap {
  position: relative;
  background: var(--bg-2);
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.feed-photo {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.feed-no-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-3);
  padding: 4rem;
}
.feed-no-photo svg { width: 52px; height: 52px; opacity: 0.25; }
.feed-photo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1rem 0.75rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: none;
}

.feed-card-body { padding: 1rem; }

.feed-answer-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.feed-answer-row input {
  font-size: 1rem;
  flex: 1;
}
.feed-answer-row .btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.1rem;
}

/* Reveal après réponse */
.feed-reveal {
  padding: 1rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--bg-4);
}
.feed-reveal.verdict-perfect { background: var(--success-bg); border-left-color: var(--success); }
.feed-reveal.verdict-good    { background: rgba(76,175,120,0.06); border-left-color: var(--success); }
.feed-reveal.verdict-close   { background: var(--warning-bg); border-left-color: var(--warning); }
.feed-reveal.verdict-wrong   { background: var(--danger-bg); border-left-color: var(--danger); }
.feed-reveal.verdict-blank   { background: var(--bg-2); border-left-color: var(--text-3); }

.feed-reveal-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--text-1);
  margin-bottom: 4px;
}
.feed-reveal-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.feed-verdict-label {
  font-size: 0.82rem;
  font-weight: 500;
}
.verdict-perfect .feed-verdict-label { color: var(--success); }
.verdict-good    .feed-verdict-label { color: var(--success); }
.verdict-close   .feed-verdict-label { color: var(--warning); }
.verdict-wrong   .feed-verdict-label { color: var(--danger); }
.verdict-blank   .feed-verdict-label { color: var(--text-3); }

.feed-your-answer {
  font-size: 0.78rem;
  color: var(--text-3);
  font-style: italic;
}
.feed-next-info {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-3);
}

/* ════════════════════════════════════════════════════════════
   QUIZ ONE-CARD
   ════════════════════════════════════════════════════════════ */

#quiz-container {
  height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
}

/* ── Sélecteur de modes ── */
.mode-selector {
  max-width: 560px;
}

.mode-global {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  margin-bottom: 1.25rem;
  text-align: left;
}
.mode-global:hover { background: rgba(201,168,76,0.06); border-color: var(--gold); transform: translateY(-1px); }

.mode-card-icon {
  width: 40px; height: 40px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
}
.mode-card-icon svg { width: 18px; height: 18px; }

.mode-card-info { flex: 1; }
.mode-card-title { font-size: 0.95rem; font-weight: 500; color: var(--text-1); }
.mode-card-sub   { font-size: 0.78rem; color: var(--text-3); margin-top: 2px; }

.mode-card-count {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--gold);
  min-width: 2rem;
  text-align: right;
}

.mode-section-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.mode-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.mode-media-card {
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  text-align: left;
  padding: 0;
}
.mode-media-card:hover { border-color: var(--gold-border); transform: translateY(-2px); }

.mode-media-poster {
  position: relative;
  height: 140px;
  background: var(--bg-2);
  overflow: hidden;
}
.mode-media-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mode-media-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
}
.mode-media-badge {
  position: absolute;
  top: 6px; right: 6px;
  background: var(--gold);
  color: var(--bg-0);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.mode-media-title {
  padding: 7px 8px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── One-card layout ── */
.quiz-one {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 4rem);
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.quiz-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 1rem 0;
  flex-shrink: 0;
}

.quiz-back-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  color: var(--text-2);
  cursor: pointer;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.quiz-back-btn:hover { color: var(--text-1); background: rgba(255,255,255,0.05); }

.quiz-prog-wrap { flex: 1; }
.quiz-prog-bar  { height: 3px; background: var(--bg-4); border-radius: 2px; overflow: hidden; }
.quiz-prog-fill { height: 100%; background: var(--gold); border-radius: 2px; transition: width 0.4s ease; }
.quiz-prog-label { font-size: 0.72rem; color: var(--text-3); margin-top: 4px; text-align: right; }

.quiz-score-chip {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  white-space: nowrap;
  flex-shrink: 0;
}

.quiz-context {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 0 0.75rem 0;
  flex-shrink: 0;
}
.quiz-media-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-1);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.quiz-media-pill {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--bg-3);
  color: var(--text-3);
  flex-shrink: 0;
}
.quiz-new-badge {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid var(--gold-border);
  flex-shrink: 0;
}
.quiz-streak { font-size: 0.78rem; flex-shrink: 0; }

/* ── Photo ── */
.quiz-photo-area {
  flex: 1;
  background: var(--bg-2);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  position: relative;
  min-height: 0;
}
.quiz-photo-area.no-photo-bg { display: flex; align-items: center; justify-content: center; }
.quiz-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Centre sur le visage : 30% depuis le haut = on voit front/yeux/nez/bouche */
  object-position: center 25%;
  display: block;
}
.quiz-no-photo {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; min-height: 260px;
  color: var(--text-3);
}
.quiz-no-photo svg { width: 60px; height: 60px; opacity: 0.2; }

/* ── Zone réponse ── */
.quiz-answer-area {
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,0.07);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 1rem;
  flex-shrink: 0;
}

.quiz-hint {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-bottom: 0.6rem;
  letter-spacing: 0.03em;
}
.quiz-hint strong { color: var(--text-2); }

.quiz-input-row {
  display: flex;
  gap: 8px;
}
.quiz-main-input {
  flex: 1;
  font-size: 1.05rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-1);
  outline: none;
  transition: border-color 0.15s;
}
.quiz-main-input:focus { border-color: var(--gold-dim); }
.quiz-main-input.input-correct { border-color: var(--success); background: var(--success-bg); color: var(--success); }
.quiz-main-input.input-close   { border-color: var(--warning); background: var(--warning-bg); color: var(--warning); }
.quiz-main-input.input-wrong   { border-color: var(--danger);  background: var(--danger-bg);  color: var(--danger);  }

.quiz-submit-btn {
  width: 44px; height: 44px;
  padding: 0;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
}

/* ── Reveal ── */
.quiz-reveal {
  border-left: 3px solid var(--bg-4);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  background: var(--bg-2);
}

.quiz-reveal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.quiz-reveal-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--text-1);
  line-height: 1.2;
}
.quiz-your-answer {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 3px;
}
.quiz-your-answer em { font-style: normal; color: var(--danger); }

.quiz-verdict-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.quiz-verdict-perfect, .quiz-verdict-good { background: var(--success-bg); color: var(--success); }
.quiz-verdict-close   { background: var(--warning-bg); color: var(--warning); }
.quiz-verdict-wrong   { background: var(--danger-bg);  color: var(--danger); }
.quiz-verdict-blank   { background: var(--bg-3); color: var(--text-3); }

.quiz-reveal-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.quiz-next-review { font-size: 0.78rem; color: var(--text-3); flex: 1; }
.quiz-next-btn {
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.quiz-next-btn:focus { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── Empty state dans quiz ── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}
.empty-state h2 { font-size: 1.1rem; color: var(--text-2); margin-bottom: 0.5rem; }
.empty-state p  { font-size: 0.88rem; color: var(--text-3); }
