/* ==========================================
   HEARO - PROFILE CSS
   Optimisé avec navigation identique à Join & Create
   ========================================== */

/* ==========================================
   1. VARIABLES & RESET
   ========================================== */
:root {
  --primary-color: #5e9bff;
  --secondary-color: #1e70ff;
  --tertiary-color: #0044cc;
  --accent-color: #80bfff;
  --text-color: #ffffff;
  --bg-color: #0a0a12;
  --panel-bg: #12121f;
  --home-bg: #a8d0e6;
  --nav-height: 100px;
}

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

html {
  height: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================
   2. BODY - Layout principal
   ========================================== */
body {
  background-color: var(--home-bg);
  color: var(--text-color);
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 15px 15px calc(var(--nav-height) + 15px);
  overflow-x: hidden;
  position: relative;
}

/* ==========================================
   3. PANEL HEADER - Conteneur principal
   ========================================== */
.panel-header {
  background: rgba(23, 25, 35, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 20px 25px;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - var(--nav-height) - 40px);
  max-height: calc(100dvh - var(--nav-height) - 40px);
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 15px;
  animation: panelSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  margin: auto;
}

.panel-header::-webkit-scrollbar {
  width: 6px;
}

.panel-header::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.panel-header::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

.panel-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
  opacity: 0.6;
}

@keyframes panelSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================
   4. HEADER & TITLE
   ========================================== */
.panel-header h1 {
  font-size: clamp(1.4rem, 5vw, 1.8rem);
  font-weight: 600;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--tertiary-color), var(--accent-color));
  background-size: 300%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
  width: 100%;
  animation: gradientShift 6s ease infinite;
  user-select: none;
  margin-bottom: 5px;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ==========================================
   5. SCENE TOGGLE & PROFILE SECTION
   ========================================== */
.scene-toggle {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* ==========================================
   6. PROFILE INFO
   ========================================== */
.profile-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.profile-info h3 {
  font-size: 1rem;
  font-weight: 600;
}

.profile-info span {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-info strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* ==========================================
   7. AVATAR DISPLAY
   ========================================== */
.avatar-container-circular {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 20px auto;
    cursor: pointer;
}

.circular-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#avatarDisplay {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid var(--primary-color);
    cursor: pointer;
    margin: 0 !important;
    transition: none !important;
}

/* Pas d'effet hover qui déplace l'avatar */
#avatarDisplay:hover {
    transform: translate(-50%, -50%) !important;
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(94, 155, 255, 0.6);
}

/* ==========================================
   8. BUTTONS
   ========================================== */
.scene-btn,
#editProfileBtn,
#btn-create-quiz {
  background: linear-gradient(145deg, var(--primary-color), var(--secondary-color));
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  box-shadow: 
    0 6px 0 var(--tertiary-color),
    0 10px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.15s ease;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.scene-btn:hover,
#editProfileBtn:hover,
#btn-create-quiz:hover {
  box-shadow: 
    0 4px 0 var(--tertiary-color),
    0 8px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(2px);
}

.scene-btn:active,
#editProfileBtn:active,
#btn-create-quiz:active {
  box-shadow: 
    0 2px 0 var(--tertiary-color),
    0 4px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(4px);
}

/* ==========================================
   9. QUIZ CARD SECTION
   ========================================== */
.quiz-card {
  background: rgba(30, 40, 70, 0.15);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 10px 0;
  box-shadow: 0 4px 10px rgba(30, 80, 150, 0.25);
  width: 100%;
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  gap: 15px;
  user-select: none;
}

.quiz-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
  text-align: center;
  text-shadow: 0 0 8px var(--primary-color);
  margin: 5px 0;
}

/* ==========================================
   10. FILTER BUTTONS
   ========================================== */
.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px; /* ← AJOUTER pour l'espace en haut */
  margin-bottom: 15px; /* ← AUGMENTER (était 12px) pour l'espace en bas */
  width: 100%;
  overflow-x: hidden;
  padding: 4px 0; /* ← AJOUTER pour encore plus d'espace vertical */
}

.filter-btn {
  flex: 0 0 auto;
  padding: 12px; /* ← Changé de "10px 14px" à "12px" pour un padding égal sur tous les côtés */
  min-width: 48px; /* ← Ajouté pour garantir une largeur minimale */
  min-height: 48px; /* ← Ajouté pour garantir une hauteur minimale */
  border-radius: 50%; /* ← Changé de "20px" à "50%" pour un cercle parfait */
  border: 2px solid var(--primary-color);
  background: rgba(94, 155, 255, 0.15);
  color: var(--primary-color);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 0 rgba(0, 68, 204, 0.3);
  max-width: 100%;
}

.filter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 rgba(0, 68, 204, 0.4);
}

.filter-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(0, 68, 204, 0.3);
}

.filter-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 3px 0 #1e70ff;
}

/* Couleurs spécifiques par type de quiz */
.filter-btn[data-type="musique"].active {
  background: linear-gradient(145deg, #FF0000, #CC0000);
  box-shadow: 0 3px 0 #990000;
  border-color: #FF0000;
}

.filter-btn[data-type="spotify"].active {
  background: linear-gradient(145deg, #1DB954, #1ed760);
  box-shadow: 0 3px 0 #168f3f;
  border-color: #1DB954;
}

.filter-btn[data-type="question"].active {
  background: linear-gradient(145deg, #d69e2e, #b7791f);
  box-shadow: 0 3px 0 #975a16;
  border-color: #d69e2e;
}

.filter-btn[data-type="image"].active {
  background: linear-gradient(145deg, #4A90E2, #2E86DE);
  box-shadow: 0 3px 0 #1a5fa0;
  border-color: #4A90E2;
}

/* ==========================================
   11. QUIZ LIST
   ========================================== */
#quizList {
  list-style: none;
  padding: 8px;
  margin: 0;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden; /* ← AJOUTER CETTE LIGNE */
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) transparent;
  border-radius: 12px;
  background: rgba(10, 20, 40, 0.3);
  width: 100%;
}

#quizList::-webkit-scrollbar {
  width: 6px;
}

#quizList::-webkit-scrollbar-track {
  background: transparent;
}

#quizList::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

.quiz-item {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(94, 155, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  cursor: pointer;
  color: var(--text-color);
  font-weight: 500;
  transition: all 0.3s ease;
  gap: 15px;
  margin-bottom: 8px;
  max-width: 100%; /* ← AJOUTER */
  overflow: hidden; /* ← AJOUTER */
}

.quiz-item:hover {
  background: rgba(94, 155, 255, 0.25);
  box-shadow: 0 4px 12px rgba(94, 155, 255, 0.4);
  transform: translateY(-2px);
}

.quiz-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}

.quiz-text-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.quiz-type-icon {
  font-size: 1.6rem;
  margin-top: 2px;
  filter: drop-shadow(0 0 8px rgba(94, 155, 255, 0.5));
}

/* Couleurs icônes par type */
.quiz-item[data-type*="musique"] .quiz-type-icon { color: #FF0000; }
.quiz-item[data-type*="spotify"] .quiz-type-icon { color: #1DB954; }
.quiz-item[data-type*="question"] .quiz-type-icon { color: #d69e2e; }
.quiz-item[data-type*="image"] .quiz-type-icon { color: #4A90E2; }

.quiz-name {
  font-weight: 600;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quiz-count-below {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 10px;
  border-radius: 10px;
  display: inline-block;
}

/* ==========================================
   12. MODALS (Avatar, Edit Profile, Create Room)
   ========================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.modal-content {
  background: rgba(26, 26, 46, 0.95);
  border-radius: 20px;
  padding: 25px;
  width: 100%;
  max-width: 450px;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  position: relative;
  animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-content h2 {
  font-size: 1.6rem;
  font-weight: 600;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--tertiary-color), var(--accent-color));
  background-size: 300%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
  width: 100%;
  margin-bottom: 20px;
  animation: gradientShift 6s ease infinite;
}

/* Inputs dans les modales */
.modal-content input.input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  font-size: 0.95rem;
  outline: none;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.modal-content input.input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.modal-content input.input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 15px rgba(94, 155, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
}

/* ==========================================
   13. AVATAR MODAL GRID
   ========================================== */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* ← Changé de 6 à 5 colonnes par défaut pour mobile */
  gap: 10px; /* ← Réduit de 12px à 10px */
  width: 100%;
  margin: 15px 0;
  padding: 0 5px; /* ← Ajouté pour éviter le débordement */
}

.avatar-option {
  font-size: 32px; /* ← Réduit de 36px */
  width: 50px; /* ← Réduit de 55px */
  height: 50px; /* ← Réduit de 55px */
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.avatar-option:hover {
  transform: scale(1.15);
  background: rgba(94, 155, 255, 0.2);
  border-color: var(--primary-color);
  box-shadow: 0 0 15px rgba(94, 155, 255, 0.4);
}

.avatar-option.selected {
  background: rgba(94, 155, 255, 0.3);
  border-color: var(--primary-color);
  box-shadow: 0 0 12px rgba(94, 155, 255, 0.5);
}
/* ==========================================
   14. CREATE ROOM MODAL SPECIFICS
   ========================================== */
.room-quiz-info {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  margin-bottom: 15px;
  position: relative;
  overflow: hidden;
}

.room-quiz-info .quiz-type-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

.room-quiz-info .quiz-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  display: block;
  margin-bottom: 5px;
}

.quiz-meta {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.quiz-type,
.quiz-count {
  background: rgba(94, 155, 255, 0.2);
  color: var(--accent-color);
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
}

/* ==========================================
   15. TOGGLE SWITCH (Team Mode)
   ========================================== */
.toggle-setting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.toggle-setting:hover {
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 15px rgba(94, 155, 255, 0.1);
}

.setting-title {
  font-size: 1rem;
  font-weight: 600;
}

.setting-description {
  font-size: 0.85rem;
  opacity: 0.7;
  line-height: 1.3;
}

.toggle-switch {
  position: relative;
  width: 56px;
  height: 28px;
  flex-shrink: 0;
  margin-left: 15px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 28px;
  transition: 0.3s;
  cursor: pointer;
}

.toggle-slider:before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

input:checked + .toggle-slider {
  background: var(--primary-color);
}

input:checked + .toggle-slider:before {
  transform: translateX(28px);
}

/* ==========================================
   16. NUMBER SELECTOR (Questions Count)
   ========================================== */
.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-color);
}

.number-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 8px;
  gap: 20px;
}

.number-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.number-btn:hover {
  border-color: var(--primary-color);
  background: rgba(94, 155, 255, 0.1);
  transform: scale(1.05);
}

.number-display {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  min-width: 50px;
  text-align: center;
}

.max-questions-info {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  margin-top: 8px;
}

/* ==========================================
   17. MODAL BUTTONS
   ========================================== */
.nav-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.nav-buttons .btn {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  color: white;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3), 0 10px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.15s ease;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  user-select: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary,
#createRoomBtn,
#saveProfileBtn {
  background: linear-gradient(145deg, var(--primary-color), var(--secondary-color));
}

.btn-primary:hover,
#createRoomBtn:hover,
#saveProfileBtn:hover {
  box-shadow: 0 4px 0 var(--tertiary-color), 0 8px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(2px);
}

.btn-primary:active,
#createRoomBtn:active,
#saveProfileBtn:active {
  box-shadow: 0 2px 0 var(--tertiary-color), 0 4px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(4px);
}

.btn-secondary,
#cancelRoomBtn,
#cancelProfileBtn {
  background: linear-gradient(145deg, #5a6478, #4a5568);
}

.btn-secondary:hover,
#cancelRoomBtn:hover,
#cancelProfileBtn:hover {
  box-shadow: 0 4px 0 #3a4555, 0 8px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(2px);
}

.btn-secondary:active,
#cancelRoomBtn:active,
#cancelProfileBtn:active {
  box-shadow: 0 2px 0 #3a4555, 0 4px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(4px);
}

/* ==========================================
   18. BOTTOM NAVIGATION (Identique à Join & Create)
   ========================================== */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--nav-height);
  background: #0d0d1c;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 5px);
  z-index: 999;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.nav-group {
  display: flex;
  gap: 40px;
  align-items: center;
}

.nav-item {
  text-decoration: none;
  text-align: center;
  font-size: 13px;
  color: #cdd2ff;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.nav-item:active {
  transform: scale(0.95);
}

.buzzer {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
  box-shadow: 
    0 6px 0 rgba(0, 0, 0, 0.4),
    0 8px 16px rgba(0, 0, 0, 0.6),
    inset 0 3px 8px rgba(255, 255, 255, 0.3);
  transition: all 0.1s ease;
  border: 3px solid rgba(255, 255, 255, 0.5);
}

.buzzer:active {
  transform: translateY(4px);
  box-shadow: 
    0 2px 0 rgba(0, 0, 0, 0.4),
    0 4px 10px rgba(0, 0, 0, 0.6),
    inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.buzzer-logout { background: linear-gradient(145deg, #ff5c8a, #e04670); }
.buzzer-join { background: linear-gradient(145deg, #ffbe4d, #e6a927); }
.buzzer-create { background: linear-gradient(145deg, #45d67f, #3bc06b); }
.buzzer-prof { background: linear-gradient(145deg, #5e9bff, #4a87eb); }

.nav-item.active {
  color: #FFD700;
}

.nav-item.active .buzzer {
  border-color: #FFD700;
  box-shadow: 
    0 6px 0 rgba(0, 0, 0, 0.4),
    0 8px 20px rgba(255, 215, 0, 0.4),
    inset 0 3px 8px rgba(255, 255, 255, 0.4);
}

/* ==========================================
   19. UTILITIES
   ========================================== */
.hidden {
  display: none !important;
}

.mb-4 {
  margin-bottom: 16px;
}

.flex {
  display: flex;
}

.gap-2 {
  gap: 8px;
}

.space-y-2 > * + * {
  margin-top: 8px;
}

/* ==========================================
   20. COULEURS ICÔNES DANS CREATE ROOM MODAL
   ========================================== */

/* Couleurs pour les icônes dans le modal Create Room */
.room-quiz-info[data-type*="musique"] .quiz-type-icon {
    color: #FF0000 !important;
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.6));
}

.room-quiz-info[data-type*="spotify"] .quiz-type-icon {
    color: #1DB954 !important;
    filter: drop-shadow(0 0 8px rgba(29, 185, 84, 0.6));
}

.room-quiz-info[data-type*="question"] .quiz-type-icon {
    color: #d69e2e !important;
    filter: drop-shadow(0 0 8px rgba(214, 158, 46, 0.6));
}

.room-quiz-info[data-type*="image"] .quiz-type-icon {
    color: #4A90E2 !important;
    filter: drop-shadow(0 0 8px rgba(74, 144, 226, 0.6));
}

/* ==========================================
   21. MEDIA QUERIES - RESPONSIVE
   ========================================== */

/* Galaxy S3 360x640 - ULTRA COMPACT */
@media (max-width: 360px) {
  :root {
    --nav-height: 95px;
  }
  
  body {
    padding: 5px 10px calc(var(--nav-height) + 5px);
    justify-content: flex-start;
  }
  
  .panel-header {
    padding: 15px 18px;
    border-radius: 18px;
    gap: 8px;
    max-height: calc(100vh - var(--nav-height) - 15px);
    max-height: calc(100dvh - var(--nav-height) - 15px);
    margin-top: 0;
  }
  
  .panel-header h1 {
    font-size: 1.35rem;
    margin-bottom: 2px;
  }
  
  .scene-toggle {
    gap: 8px;
  }
  
  #avatarDisplay {
    width: 70px;
    height: 70px;
    font-size: 48px;
    margin: 5px auto;
  }
  
  .scene-btn,
  #editProfileBtn,
  #btn-create-quiz {
    padding: 10px 15px;
    font-size: 0.9rem;
    box-shadow: 0 5px 0 var(--tertiary-color), 0 8px 16px rgba(0, 0, 0, 0.3);
  }
  
  .filter-btn {
    padding: 10px; /* ← Changé de "8px 12px" */
    min-width: 42px;
    min-height: 42px;
    font-size: 1rem;
  }
  
  .quiz-item {
    padding: 10px 12px;
  }
  
  .quiz-name {
    font-size: 0.95rem;
  }
  
  #quizList {
    max-height: 280px;
  }
  
  .avatar-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
    padding: 0 4px;
  }
  
  .avatar-option {
    width: 42px;
    height: 42px;
    font-size: 26px;
  }
  
  .nav-group {
    gap: 22px;
  }
  
  .buzzer {
    width: 48px;
    height: 48px;
    font-size: 17px;
  }
  
  .nav-item {
    font-size: 11px;
  }
}

/* iPhone SE 320px */
@media (max-width: 320px) {
  :root {
    --nav-height: 90px;
  }
  
  body {
    padding: 3px 8px calc(var(--nav-height) + 3px);
  }
  
  .panel-header {
    padding: 12px 15px;
    gap: 6px;
  }
  
  .panel-header h1 {
    font-size: 1.25rem;
  }
  
  #avatarDisplay {
    width: 65px;
    height: 65px;
    font-size: 42px;
  }
  
  .scene-btn,
  #editProfileBtn,
  #btn-create-quiz {
    padding: 9px 14px;
    font-size: 0.85rem;
  }
  
  .filter-btn {
    padding: 8px; /* ← Changé de "6px 10px" */
    min-width: 38px;
    min-height: 38px;
    font-size: 0.9rem;
  }
  
  .nav-group {
    gap: 18px;
  }
  
  .buzzer {
    width: 45px;
    height: 45px;
    font-size: 16px;
  }
  
  .nav-item {
    font-size: 10px;
  }
  
    .avatar-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 0 3px;
  }
  
  .avatar-option {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }
}

/* Petits mobiles 361-428px */
@media (min-width: 361px) and (max-width: 428px) {
  .panel-header {
    max-width: 92%;
  }
  
  .avatar-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 0 5px;
  }
  
  .avatar-option {
    width: 48px;
    height: 48px;
    font-size: 30px;
  }
}

/* Écrans bas */
@media (max-height: 700px) {
  body {
    padding-top: 12px;
  }
  
  .panel-header {
    padding: 18px 22px;
    gap: 12px;
  }
  
  .avatar-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    padding: 0;
  }
  
  .avatar-option {
    width: 60px;
    height: 60px;
    font-size: 38px;
  } 
  
  #avatarDisplay {
    margin: 6px auto;
  }
  
  #quizList {
    max-height: 260px;
  }
}

/* Paysage mobile */
@media (max-height: 500px) and (orientation: landscape) {
  :root {
    --nav-height: 85px;
  }
  
  body {
    padding: 8px 15px calc(var(--nav-height) + 8px);
  }
  
  .panel-header {
    padding: 12px 18px;
    gap: 8px;
    max-height: calc(100vh - var(--nav-height) - 20px);
  }
  
  #avatarDisplay {
    width: 65px;
    height: 65px;
    font-size: 40px;
    margin: 4px auto;
  }
  
  .avatar-grid {
    grid-template-columns: repeat(8, 1fr); /* Plus de colonnes en mode paysage */
    gap: 8px;
    padding: 0 5px;
  }
  
  .avatar-option {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }
  
  .nav-group {
    gap: 30px;
  }
  
  .buzzer {
    width: 45px;
    height: 45px;
    font-size: 16px;
  }
  
  .nav-item {
    font-size: 10px;
  }
  
  .scene-btn,
  #editProfileBtn,
  #btn-create-quiz {
    padding: 9px 14px;
    font-size: 0.85rem;
  }
  
  #quizList {
    max-height: 200px;
  }
}

/* Tablettes et grands écrans */
@media (min-width: 768px) {
  body {
    padding: 30px 30px calc(var(--nav-height) + 30px);
  }
  
  .panel-header {
    max-width: 480px;
    padding: 30px 35px;
    gap: 18px;
  }
  
  #avatarDisplay {
    width: 100px;
    height: 100px;
    font-size: 70px;
  }
  
  .scene-btn,
  #editProfileBtn,
  #btn-create-quiz {
    padding: 14px 20px;
    font-size: 1rem;
  }
  
  .filter-btn {
    padding: 14px; /* ← Changé de "12px 16px" */
    min-width: 52px;
    min-height: 52px;
    font-size: 1.3rem;
  }
  
  .quiz-item {
    padding: 16px;
  }
  
  #quizList {
    max-height: 380px;
  }
  
  .avatar-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    padding: 0;
  }
  
  .avatar-option {
    width: 60px;
    height: 60px;
    font-size: 38px;
  }
}

/* Grands écrans Desktop */
@media (min-width: 1024px) {
  .panel-header {
    max-width: 540px;
  }
  
  .modal-content {
    max-width: 600px;
  }
}

/* Fallback pour backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
  .panel-header {
    background: rgba(23, 25, 35, 0.98);
  }
  
  .modal {
    background: rgba(0, 0, 0, 0.9);
  }
}

/* Mode PWA standalone/fullscreen */
@media (display-mode: fullscreen), (display-mode: standalone) {
  body {
    padding-top: max(15px, env(safe-area-inset-top));
  }
  
  .bottom-nav {
    padding-bottom: max(5px, env(safe-area-inset-bottom));
  }
}

