/* ═══════════════════════════════════════════════════════════════════════════════
   QUIZZGEN AI - RESPONSIVE & COMPACT STYLES v2
   Consolidates: style.css, new-features.css, animations.css
   Optimized for mobile/tablet/desktop with compact spacing
═══════════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #F7F8FA;
  color: #111318;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #C41C3B; }
::selection { background: rgba(196,28,59,.3); }

/* CSS Variables */
:root {
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --surface2: #F0F2F5;
  --border: rgba(0,0,0,0.07);
  --border-hover: rgba(0,0,0,0.14);
  --accent: #C41C3B;
  --accent-soft: rgba(196,28,59,0.07);
  --accent-glow: rgba(196,28,59,0.18);
  --text-1: #111318;
  --text-2: #5A6070;
  --text-3: #9AA0AE;
  --green: #00A88C;
  --green-glow: rgba(0,168,140,0.18);
  --purple: #6D28D9;
  --font-display: 'Syne', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius: 12px;
  --radius-lg: 18px;
  --transition: 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --padding-sm: 8px;
  --padding-md: 12px;
  --padding-lg: 16px;
  --padding-xl: 20px;
}

/* ════════════════════════════════════════════════════════════════
   LAYOUTS & PAGES
═════════════════════════════════════════════════════════════════ */

.page { display: none; flex: 1; flex-direction: column; overflow: hidden; position: relative; z-index: 1; }
.page.active { display: flex; }

.setup-wrapper {
  display: flex;
  flex: 1;
  overflow: hidden;
  gap: 0;
}

/* ════════════════════════════════════════════════════════════════
   SIDEBAR - RESPONSIVE
═════════════════════════════════════════════════════════════════ */

.sidebar-matieres {
  width: 220px;
  flex-shrink: 0;
  background: #FFFFFF;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 800;
  color: var(--text-3);
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 0 8px 12px;
}

.matiere-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.matiere-card:hover {
  background: var(--surface2);
  border-color: var(--border-hover);
}

.matiere-card.active-preset {
  background: var(--accent-soft);
  border-color: rgba(196,28,59,0.18);
}

.matiere-card.active-preset .matiere-name { color: #C41C3B; }

.matiere-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border-radius: 6px;
}

.matiere-name { font-size: 11px; font-weight: 600; color: var(--text-1); line-height: 1.2; }
.matiere-sub  { font-size: 9px; color: var(--text-3); margin-top: 1px; }
.matiere-hint { font-size: 8px; color: #34D399; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }

/* ════════════════════════════════════════════════════════════════
   MAIN SETUP AREA
═════════════════════════════════════════════════════════════════ */

.setup {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.setup-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.hero-title span {
  background: linear-gradient(135deg, #FF6B6B 0%, #C41C3B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
  line-height: 1.5;
}

.hero-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.hero-feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
}

.hero-note {
  display: inline-block;
  margin-top: 10px;
  color: var(--text-2);
  font-size: 11px;
  background: rgba(196,28,59,0.06);
  border: 1px solid rgba(196,28,59,0.12);
  border-radius: 12px;
  padding: 10px 12px;
}

.hero-note strong { color: var(--accent); }

.stats-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 12px;
  font-size: 10px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-chip strong { color: var(--text-1); font-weight: 600; }

/* ════════════════════════════════════════════════════════════════
   SEARCH BAR
═════════════════════════════════════════════════════════════════ */

.topbar-search { position: relative; margin-left: 8px; }
.search-input {
  background: #13131a; border: 1px solid #2a2a36; color: #ccc;
  border-radius: 6px; padding: 6px 10px; font-size: 12px; width: 160px;
  outline: none; transition: border-color .15s;
}
.search-input:focus { border-color: #C41C3B; box-shadow: 0 0 0 2px rgba(196,28,59,.12); }
.search-results {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #18181f; border: 1px solid #2a2a36; border-radius: 6px;
  max-height: 250px; overflow-y: auto; z-index: 1000; display: none;
  margin-top: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.5);
}
.search-results.show { display: block; }
.search-item {
  padding: 8px 10px; border-bottom: 1px solid #2a2a36; cursor: pointer;
  transition: background .1s; font-size: 11px;
}
.search-item:hover { background: rgba(196,28,59,.08); color: #C41C3B; }
.search-item-title { font-weight: 600; color: #e8e8ea; }
.search-item-meta { font-size: 9px; color: #555; margin-top: 1px; }

/* ════════════════════════════════════════════════════════════════
   NOTIFICATIONS
═════════════════════════════════════════════════════════════════ */

.notif-btn { position: relative; }
.notif-badge { position: absolute; top: -6px; right: -6px; background: #FF6B6B;
  color: #fff; font-size: 10px; font-weight: 700; width: 18px; height: 18px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.notif-dropdown {
  position: absolute; top: 100%; right: 0; width: 300px;
  background: #18181f; border: 1px solid #2a2a36; border-radius: 8px;
  margin-top: 6px; z-index: 1000; display: none; box-shadow: 0 4px 16px rgba(0,0,0,.5);
}
.notif-dropdown.show { display: block; }
.notif-header { padding: 10px 12px; border-bottom: 1px solid #2a2a36; display: flex; justify-content: space-between; align-items: center; }
.notif-header-title { font-size: 11px; font-weight: 700; color: #e8e8ea; }
.notif-header-clear { font-size: 10px; color: #555; cursor: pointer; }
.notif-header-clear:hover { color: #C41C3B; }
.notif-list { max-height: 350px; overflow-y: auto; }
.notif-item {
  padding: 8px 12px; border-bottom: 1px solid #2a2a36; cursor: pointer;
  transition: background .1s; font-size: 11px;
}
.notif-item:hover { background: rgba(196,28,59,.08); }
.notif-item.unread { background: rgba(196,28,59,.04); border-left: 3px solid #C41C3B; padding-left: 9px; }
.notif-icon { font-size: 16px; margin-right: 6px; }
.notif-title { font-weight: 600; color: #e8e8ea; }
.notif-msg { font-size: 10px; color: #555; margin-top: 1px; }
.notif-empty { padding: 16px 12px; text-align: center; color: #444; font-size: 10px; }

/* ════════════════════════════════════════════════════════════════
   AI ASSISTANT
═════════════════════════════════════════════════════════════════ */

.ai-assistant-btn {
  position: fixed; bottom: 20px; right: 20px; z-index: 998;
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #6C5CE7, #5F3DC4);
  color: #fff; border: none; cursor: pointer; font-size: 24px;
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.4);
  transition: transform .2s, box-shadow .2s; display: none;
}
.ai-assistant-btn:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(108, 92, 231, 0.6); }
.ai-assistant-btn.show { display: flex; align-items: center; justify-content: center; }

.ai-chat-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 10000; background: #18181f; border: 1px solid #2a2a36;
  border-radius: 10px; width: 90%; max-width: 450px; max-height: 550px;
  display: none; flex-direction: column; box-shadow: 0 8px 32px rgba(0,0,0,.7);
}
.ai-chat-modal.show { display: flex; }
.ai-chat-header {
  padding: 12px 14px; border-bottom: 1px solid #2a2a36;
  display: flex; justify-content: space-between; align-items: center;
}
.ai-chat-header-title { font-size: 12px; font-weight: 700; color: #e8e8ea; }
.ai-chat-close { background: none; border: none; color: #888; cursor: pointer; font-size: 14px; }
.ai-chat-close:hover { color: #C41C3B; }
.ai-chat-body { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.ai-chat-message { padding: 8px 10px; border-radius: 6px; max-width: 85%; font-size: 11px; line-height: 1.4; }
.ai-chat-message.user { background: rgba(196,28,59,.15); color: #C41C3B; align-self: flex-end; }
.ai-chat-message.assistant { background: #13131a; color: #aaa; align-self: flex-start; }
.ai-chat-message.loading { background: #13131a; color: #555; font-style: italic; }
.ai-chat-input-area { padding: 10px 12px; border-top: 1px solid #2a2a36; display: flex; gap: 6px; }
.ai-chat-input { flex: 1; background: #13131a; border: 1px solid #2a2a36; color: #ccc;
  border-radius: 6px; padding: 6px 8px; font-size: 11px; outline: none;
}
.ai-chat-input:focus { border-color: #C41C3B; }
.ai-chat-send { background: #C41C3B; color: #fff; border: none; border-radius: 6px;
  padding: 6px 12px; cursor: pointer; font-size: 11px; font-weight: 700;
  transition: background .1s;
}
.ai-chat-send:hover { background: #A01530; }

.ai-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5);
  z-index: 9999; display: none;
}
.ai-overlay.show { display: block; }

/* ════════════════════════════════════════════════════════════════
   ANIMATIONS - GAMIFICATION
═════════════════════════════════════════════════════════════════ */

@keyframes pointsFloat { 0% { opacity: 1; transform: translate(0, 0) scale(1); } 50% { opacity: 1; transform: translate(var(--tx, 0), -25px) scale(1.1); } 100% { opacity: 0; transform: translate(var(--tx, 0), -50px) scale(0.8); } }
@keyframes achievementSlideIn { 0% { opacity: 0; transform: translateX(-80px) rotateZ(-45deg); } 50% { opacity: 1; transform: translateX(8px) rotateZ(0deg); } 100% { opacity: 1; transform: translateX(0) rotateZ(0deg); } }
@keyframes heartBeat { 0%, 70%, 100% { transform: scale(1); } 14%, 42% { transform: scale(1.3); } 28% { transform: scale(1); } }
@keyframes shimmer { 0% { background-position: -1000px 0; } 100% { background-position: 1000px 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.7; transform: scale(1.05); } }
@keyframes badgeEarn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes flameFlicker { 0%, 18%, 22%, 25%, 54%, 56%, 100% { opacity: 1; transform: scale(1) rotateZ(0deg); } 20%, 24%, 55% { opacity: 0.8; transform: scale(1.1) rotateZ(2deg); } }
@keyframes confettiPop { 0% { opacity: 1; transform: translate(0, 0) rotate(0deg); } 100% { opacity: 0; transform: translate(var(--tx, 80px), var(--ty, 80px)) rotate(720deg); } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scoreIncrease { 0% { opacity: 0; transform: scale(0.5) rotateY(-90deg); } 50% { opacity: 1; transform: scale(1.1) rotateY(0deg); } 100% { opacity: 1; transform: scale(1) rotateY(0deg); } }
@keyframes streakExtend { 0% { opacity: 0; transform: scaleX(0); } 50% { opacity: 1; transform: scaleX(1.1); } 100% { opacity: 1; transform: scaleX(1); } }
@keyframes wiggle { 0%, 100% { transform: translateX(0); } 10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); } 20%, 40%, 60%, 80% { transform: translateX(4px); } }
@keyframes bounceEnter { 0% { opacity: 0; transform: scale(0.3); } 50% { opacity: 1; transform: scale(1.1); } 100% { opacity: 1; transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes glowPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(196, 28, 59, 0.7); } 50% { box-shadow: 0 0 0 12px rgba(196, 28, 59, 0); } }
@keyframes slideRight { from { opacity: 0; transform: translateX(-100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes rotateIn { from { opacity: 0; transform: rotate(-180deg); } to { opacity: 1; transform: rotate(0deg); } }
@keyframes slideInLeft { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(20px); opacity: 0; } }

.points-earned { animation: pointsFloat 2s ease-out forwards; font-weight: 800; font-size: 20px; color: #FFD700; text-shadow: 0 0 10px rgba(255, 215, 0, 0.8); pointer-events: none; }
.achievement-unlock { animation: achievementSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.heart-beat { animation: heartBeat 1.3s ease-in-out forwards; color: #FF6B6B; }
.shimmer { background: linear-gradient(90deg, #2a2a36 25%, #3a3a46 50%, #2a2a36 75%); background-size: 1000px 100%; animation: shimmer 2s infinite; }
.pulse-effect { animation: pulse 2s ease-in-out infinite; }
.badge-earned { animation: badgeEarn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.flame-flicker { animation: flameFlicker 2s ease-in-out infinite; color: #FF6B6B; display: inline-block; font-size: 20px; }
.confetti { animation: confettiPop 2s ease-out forwards; position: absolute; pointer-events: none; }
.slide-in-up { animation: slideInUp 0.5s ease-out forwards; }
.score-increase { animation: scoreIncrease 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.streak-extend { animation: streakExtend 0.4s ease-out forwards; transform-origin: left center; }
.wiggle { animation: wiggle 0.5s ease-in-out; }
.bounce-enter { animation: bounceEnter 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards; }
.fade-in { animation: fadeIn 0.3s ease-out forwards; }
.glow-pulse { animation: glowPulse 2s ease-out infinite; }
.slide-right { animation: slideRight 0.3s ease-out forwards; }
.rotate-in { animation: rotateIn 0.6s ease-out forwards; }

.player-row { animation: slideInLeft 0.4s ease-out forwards; }
.player-row.removing { animation: slideOutRight 0.4s ease-out forwards; }
.player-row.highlight { animation: pulse 1s ease-in-out infinite; }
.player-score.updated { animation: pulse 0.6s ease-out; }
.player-row-animated { transition: transform 0.3s ease, background-color 0.3s ease; }
.player-row-animated:hover { transform: translateX(6px); background: rgba(196, 28, 59, 0.15) !important; }

/* ════════════════════════════════════════════════════════════════
   PODIUM & LEADERBOARD
═════════════════════════════════════════════════════════════════ */

.podium-screen {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #1a0a2e 0%, #16213e 50%, #0f3460 100%);
  z-index: 5000;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.podium-screen.show { display: flex; }

.podium-container {
  text-align: center;
  max-width: 900px;
  width: 100%;
}

.podium-title {
  font-size: 40px;
  font-weight: 900;
  margin-bottom: 30px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
  animation: fadeInScale 0.8s ease-out;
}

.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 30px;
  min-height: 300px;
}

.podium-rank { display: flex; flex-direction: column; align-items: center; }

.podium-medal {
  font-size: 52px;
  margin-bottom: 12px;
  animation: medal-spin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.podium-medal.gold { animation-delay: 0.2s; }
.podium-medal.silver { animation-delay: 0.4s; }
.podium-medal.bronze { animation-delay: 0.6s; }

.podium-box {
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  animation: podium-rise 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  opacity: 0;
}

.podium-box.first {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05));
  border: 2px solid #FFD700;
  width: 140px;
  height: 170px;
  order: 2;
  animation-delay: 0.2s;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.3), inset 0 0 20px rgba(255, 215, 0, 0.1);
}

.podium-box.second {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.05));
  border: 2px solid #C0C0C0;
  width: 120px;
  height: 140px;
  order: 1;
  animation-delay: 0.4s;
  box-shadow: 0 0 30px rgba(192, 192, 192, 0.2), inset 0 0 15px rgba(192, 192, 192, 0.1);
}

.podium-box.third {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.05));
  border: 2px solid #CD7F32;
  width: 120px;
  height: 120px;
  order: 3;
  animation-delay: 0.6s;
  box-shadow: 0 0 30px rgba(205, 127, 50, 0.2), inset 0 0 15px rgba(205, 127, 50, 0.1);
}

.podium-rank-number {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 28px;
  font-weight: 900;
  opacity: 0.3;
}

.podium-rank-number.first { color: #FFD700; }
.podium-rank-number.second { color: #C0C0C0; }
.podium-rank-number.third { color: #CD7F32; }

.podium-player-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: white;
  margin: 0 auto 10px;
  border: 3px solid;
}

.podium-player-name {
  font-size: 16px;
  font-weight: 800;
  color: #e8e8ea;
  margin-bottom: 6px;
  word-break: break-word;
}

.podium-player-score {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 3px;
}

.podium-player-score.first { color: #FFD700; }
.podium-player-score.second { color: #C0C0C0; }
.podium-player-score.third { color: #CD7F32; }

.podium-player-label {
  font-size: 10px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.leaderboard-live-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #4CAF50;
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse 2s ease-in-out infinite;
}

.podium-close-btn {
  margin-top: 30px;
  padding: 10px 28px;
  background: #C41C3B;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.podium-close-btn:hover {
  background: #A01530;
  transform: scale(1.05);
}

/* ════════════════════════════════════════════════════════════════
   KAHOOT ANIMATIONS
═════════════════════════════════════════════════════════════════ */

@keyframes checkboxPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7); } 50% { box-shadow: 0 0 0 6px rgba(255, 107, 107, 0); } }
@keyframes slideDownFade { from { opacity: 0; transform: translateY(-20px); max-height: 0; } to { opacity: 1; transform: translateY(0); max-height: 500px; } }
@keyframes podium-rise { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes medal-spin { 0% { transform: scale(0) rotateZ(0deg); opacity: 0; } 50% { transform: scale(1.1) rotateZ(10deg); } 100% { transform: scale(1) rotateZ(0deg); opacity: 1; } }
@keyframes fadeInScale { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes confetti-fall { to { transform: translateY(100vh) rotate(360deg); opacity: 0; } }

.kahoot-checkbox:checked { animation: checkboxPulse 0.6s ease-out; }
.kahoot-session-info.show { animation: slideDownFade 0.5s ease-out forwards !important; }
.kahoot-copy-btn { transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.kahoot-copy-btn:active { transform: scale(0.95); }
.kahoot-info-value { animation: slideInLeft 0.4s ease-out; }

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN - TABLET (768px - 1024px)
═════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .sidebar-matieres { width: 180px; padding: 12px 8px; }
  .setup { padding: 18px 22px; }
  .hero-title { font-size: 24px; }
  .podium { gap: 10px; min-height: 250px; }
  .podium-title { font-size: 32px; }
  .podium-box.first { width: 120px; height: 150px; }
  .podium-box.second { width: 110px; height: 130px; }
  .podium-box.third { width: 110px; height: 110px; }
  .search-input { width: 140px; }
  .notif-dropdown { width: 280px; }
  .ai-chat-modal { width: 90%; max-width: 400px; max-height: 500px; }
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN - MOBILE (<768px)
═════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
  body { font-size: 14px; }
  
  .setup-wrapper { flex-direction: column; }
  
  .sidebar-matieres {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 8px 10px;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    height: auto;
    gap: 8px;
  }
  
  .sidebar-title {
    display: none;
  }
  
  .matiere-card {
    flex-shrink: 0;
    gap: 6px;
    padding: 6px 8px;
  }
  
  .matiere-icon {
    font-size: 16px;
    width: 28px;
    height: 28px;
  }
  
  .matiere-name { font-size: 10px; }
  .matiere-sub { font-size: 8px; }
  .matiere-hint { font-size: 7px; }
  
  .setup {
    padding: 16px;
    gap: 12px;
  }
  
  .setup-hero {
    flex-direction: column;
    gap: 8px;
  }
  
  .hero-title { font-size: 22px; }
  .hero-subtitle { font-size: 11px; }
  .hero-feature-list { gap: 6px; margin-top: 8px; }
  .hero-feature-pill { padding: 4px 10px; font-size: 10px; }
  .hero-note { padding: 8px 10px; font-size: 10px; margin-top: 8px; }
  .stats-row { gap: 8px; }
  .stat-chip { padding: 4px 10px; font-size: 9px; }
  
  .topbar-search { margin-left: 4px; }
  .search-input { width: 130px; padding: 5px 8px; font-size: 11px; }
  .search-results { max-height: 200px; }
  .search-item { padding: 6px 8px; font-size: 10px; }
  .search-item-meta { font-size: 8px; }
  
  .notif-dropdown { width: 260px; }
  .notif-header { padding: 8px 10px; }
  .notif-header-title { font-size: 10px; }
  .notif-list { max-height: 300px; }
  .notif-item { padding: 6px 8px; font-size: 10px; }
  .notif-icon { font-size: 14px; margin-right: 4px; }
  .notif-msg { font-size: 9px; }
  
  .ai-assistant-btn { width: 48px; height: 48px; font-size: 20px; bottom: 16px; right: 16px; }
  .ai-chat-modal { width: 95%; max-width: 380px; max-height: 480px; }
  .ai-chat-header { padding: 10px 12px; }
  .ai-chat-body { padding: 10px 12px; gap: 6px; }
  .ai-chat-message { padding: 6px 8px; font-size: 10px; max-width: 90%; }
  .ai-chat-input-area { padding: 8px 10px; gap: 4px; }
  .ai-chat-input { padding: 5px 6px; font-size: 10px; }
  .ai-chat-send { padding: 5px 10px; font-size: 10px; }
  
  .podium { gap: 8px; min-height: 200px; }
  .podium-title { font-size: 26px; margin-bottom: 20px; }
  .podium-medal { font-size: 40px; margin-bottom: 8px; }
  .podium-box { padding: 12px; margin-bottom: 8px; border-radius: 10px; }
  .podium-box.first { width: 100px; height: 130px; }
  .podium-box.second { width: 90px; height: 110px; }
  .podium-box.third { width: 90px; height: 90px; }
  .podium-player-avatar { width: 40px; height: 40px; font-size: 18px; margin-bottom: 6px; }
  .podium-player-name { font-size: 13px; margin-bottom: 4px; }
  .podium-player-score { font-size: 18px; margin-bottom: 2px; }
  .podium-player-label { font-size: 9px; }
  .podium-close-btn { padding: 8px 20px; font-size: 12px; margin-top: 20px; }
  
  /* Navbar compacte pour mobile */
  .navbar, nav {
    padding: 8px 12px !important;
  }
  
  /* Burger menu pour mobile */
  .mobile-menu-toggle {
    display: flex;
    width: 32px;
    height: 32px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    background: none;
    border: none;
  }
  
  .mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--text-1);
    border-radius: 2px;
    transition: all 0.3s ease;
  }
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN - SMALL MOBILE (<480px)
═════════════════════════════════════════════════════════════════ */

@media (max-width: 479px) {
  .hero-title { font-size: 19px; }
  .setup { padding: 12px 12px; }
  .search-input { width: 110px; }
  .podium-title { font-size: 22px; }
  .podium { gap: 6px; }
  .podium-box { padding: 10px; }
  .podium-box.first { width: 85px; height: 110px; }
  .podium-box.second { width: 80px; height: 95px; }
  .podium-box.third { width: 80px; height: 80px; }
  .ai-chat-modal { width: 98%; max-height: 400px; }
}

/* ════════════════════════════════════════════════════════════════
   NAVBAR & LAYOUT OVERRIDES
═════════════════════════════════════════════════════════════════ */

.navbar, nav {
  background: rgba(247,248,250,0.92) !important;
  backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 12px 16px !important;
}

/* Ambient glow background */
body::before {
  content: '';
  position: fixed;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(196,28,59,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
