@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  height: 100vh;
  margin: 0;
  padding: 10px;
  overflow: hidden; /* Prevent global scroll */
}

/* --- Connection Health & Security --- */
.pulse-dot {
  width: 12px;
  height: 12px;
  background-color: #4caf50;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 rgba(76, 175, 80, 0.4);
  animation: pulse-green 2s infinite;
  transition: background-color 0.3s;
}
.pulse-dot.error {
  background-color: #f44336;
  animation: pulse-red 2s infinite;
}
@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}
@keyframes pulse-red {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(244, 67, 54, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(244, 67, 54, 0); }
}
.https-warning-banner {
  background: rgba(255, 152, 0, 0.2);
  border: 1px solid #ff9800;
  color: #e65100;
  padding: 5px 12px;
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 15px;
}

.timer-toggle-btn {
  display: none;
}

/* --- Animated Title (Faire Style) --- */

.animated-title {
  position: relative;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  text-align: center;
  min-width: 300px;
  width: 100%;
  overflow: visible;
  /*background: #e0e0e0;*/
  border-radius: 16px;
  padding: 6px 20px;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.2);
}

.animated-title span {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  width: 100%;
  font-family: 'Fredoka One', 'Arial Black', sans-serif;
  font-size: clamp(18px, 3.5vw, 38px);
  font-weight: 900;
  letter-spacing: 1px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.2;
  padding: 0 10px;

  background: linear-gradient(135deg, #00e5cc 0%, #d7ff6e 40%, #ffffff 70%, #ff6eb4 100%);

  /* Gradient text 
  background: linear-gradient(
    135deg,
    #00e5cc 0%,
    #ff6eb4 40%,
    #a855f7 70%,
    #ff6eb4 100%
  ); */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto; 

  /* 3D layered shadow (using filter since text-shadow conflicts with gradient) */
  filter:
    drop-shadow(3px 3px 0px #7c3aed)
    drop-shadow(5px 5px 0px rgba(124, 58, 237, 0.5))
    drop-shadow(0px 8px 15px rgba(168, 85, 247, 0.4));

  /* Slide + fade in/out */
  opacity: 0;
  display: block;
  animation: titleFaireFade 6s ease-in-out infinite;
}

.animated-title .text-ta {
  animation-delay: 3s;
  font-size: clamp(14px, 2.8vw, 30px);
  letter-spacing: 0.5px;
}

/* Shimmer sweep on the gradient */
@keyframes titleShimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

@keyframes titleFaireFade {
  0% {
    opacity: 0;
    transform: translateY(calc(-50% + 30px)) scale(0.85);
    filter:
      drop-shadow(3px 3px 0px #7c3aed)
      drop-shadow(5px 5px 0px rgba(124, 58, 237, 0.4))
      drop-shadow(0px 8px 15px rgba(168, 85, 247, 0.3))
      blur(4px);
  }
  8% {
    opacity: 1;
    transform: translateY(-50%) scale(1.05);
    filter:
      drop-shadow(3px 3px 0px #7c3aed)
      drop-shadow(6px 6px 0px rgba(124, 58, 237, 0.5))
      drop-shadow(0px 10px 20px rgba(168, 85, 247, 0.5))
      blur(0px);
  }
  15% {
    transform: translateY(-50%) scale(1);
  }
  42% {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    filter:
      drop-shadow(3px 3px 0px #7c3aed)
      drop-shadow(5px 5px 0px rgba(124, 58, 237, 0.5))
      drop-shadow(0px 8px 15px rgba(168, 85, 247, 0.4))
      blur(0px);
  }
  50% {
    opacity: 0;
    transform: translateY(calc(-50% - 30px)) scale(0.85);
    filter:
      drop-shadow(3px 3px 0px #7c3aed)
      drop-shadow(5px 5px 0px rgba(124, 58, 237, 0.3))
      drop-shadow(0px 8px 15px rgba(168, 85, 247, 0.2))
      blur(4px);
  }
  100% {
    opacity: 0;
    transform: translateY(calc(-50% + 30px)) scale(0.85);
  }
}

/* Shimmer animation applied via JS or pseudo-element workaround */
.animated-title span {
  animation:
    titleFaireFade 6s ease-in-out infinite,
    titleShimmer 3s linear infinite;
}

.layout-row {
  display: flex;
  flex-direction: row;
  height: calc(100vh - 20px);
  gap: 15px;
  max-width: 1600px;
  margin: 0 auto;
}

/* ================= ELIGIBLE SECTION ================= */
.eligible-section {
  flex: 1;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  gap: 8px;
  min-height: 0;
  position: relative;
  overflow: hidden;
}



/* --- Points Animation Overlay --- */
.points-animation-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  z-index: 100;
  font-size: 100px;
  font-weight: 900;
  border-radius: 30px;
  transition: opacity 0.3s ease;
}

.points-animation-overlay.hidden {
  display: none;
  opacity: 0;
}

.points-old {
  color: #888;
  text-decoration: line-through;
  transform: scale(0.8);
}

.points-new {
  color: #4caf50;
  animation: pointsPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.points-arrow {
  color: #667eea;
}

@keyframes pointsPop {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* ================= SIDEBAR ================= */
.sidebar {
  width: 280px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  color: white;
}

.sidebar-header {
  margin-bottom: 30px;
  text-align: center;
}

.sidebar-header h1 {
  font-size: 28px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  font-family: 'Fredoka One', cursive;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sidebar-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(5px);
}

.sidebar-item.active {
  background: rgba(255, 255, 255, 0.3);
  border-left: 5px solid #ffeb3b;
}

.sidebar-item .item-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer {
  margin-top: auto;
  background: rgba(244, 67, 54, 0.2);
  align-items: center;
  flex-direction: row;
}

.sidebar-footer:hover {
  background: rgba(244, 67, 54, 0.4);
}

.queue-next-badge {
  font-size: 13px;
  color: #ffeb3b;
  margin-top: 5px;
  margin-left: 30px;
  font-weight: normal;
}

/* ================= MAIN CONTENT ================= */
.main-content {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ================= PANEL OVERLAYS ================= */
.panel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  z-index: 1000;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;

  /* Animations */
  opacity: 0;
  visibility: hidden;
  transform: translateX(30px) scale(0.98);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.panel-overlay.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
}

/* Hamburger Menu Button */
.hamburger-btn {
  display: none;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1100;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 24px;
  cursor: pointer;
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Sidebar Backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #eee;
}

.panel-header h2 {
  margin: 0;
  color: #667eea;
  text-shadow: none;
}

.btn-close-panel {
  background: #f44336;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
  font-size: 16px;
}

.btn-close-panel:hover {
  transform: scale(1.05);
  background: #d32f2f;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
}

.qr-section {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.qr-code {
  text-align: center;
  background: white;
  padding: 15px;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.qr-code canvas {
  width: 150px;
  height: 150px;
}

.current-speaker audio {
  max-width: 100%;
  height: 35px;
  border-radius: 20px;
  border: 2px solid #667eea;
  box-shadow: 0 4px 10px rgba(102, 126, 234, 0.2);
}

.mobile-url-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8f9fa;
  padding: 20px;
  border-radius: 15px;
  border: 1px solid #e9ecef;
}

.mobile-url-label {
  font-weight: 800;
  color: #495057;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-url-input-wrapper {
  position: relative;
}

.mobile-url-input-wrapper input {
  width: 100%;
  min-width: 320px;
  padding: 12px 15px;
  font-family: 'Fredoka One', cursive, monospace;
  font-size: 16px;
  color: #667eea;
  background: white;
  border: 2px solid #667eea;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.mobile-url-input-wrapper input:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

.mobile-url-hint {
  font-size: 13px;
  color: #adb5bd;
  margin: 0;
  font-weight: 500;
}

.admin-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.btn-danger {
  background: linear-gradient(135deg, #ff4444, #cc0000);
  color: white;
  border: none;
  padding: 15px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  font-size: 18px;
  transition: transform 0.2s;
  box-shadow: 0 4px 10px rgba(255, 0, 0, 0.3);
}

.btn-danger:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #ff6666, #ff0000);
}

/* Formulaire d'inscription */
.register-form {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 15px;
  align-items: flex-end;
}

.register-form input {
  padding: 15px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
}

.register-form input:first-child {
  width: 120px;
}

.register-form input:nth-child(2) {
  flex: 1;
}

.avatar-selector,
.groupe-selector {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.avatar-selector label,
.groupe-selector label {
  font-size: 12px;
  color: #666;
  margin-left: 5px;
}

.avatar-selector select,
.groupe-selector select {
  padding: 15px;
  font-size: 20px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  background: white;
  min-width: 80px;
  text-align: center;
}

.groupe-selector select {
  font-size: 18px;
  font-weight: bold;
}

.register-form button#registerBtn {
  padding: 15px 30px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary-outline {
  padding: 15px 20px;
  background: transparent;
  color: #667eea;
  border: 2px solid #667eea;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary-outline:hover {
  background: rgba(102, 126, 234, 0.1);
}

/* Filtres Participants */
.participants-filter .filter-btn {
  padding: 8px 15px;
  border: 2px solid #eee;
  background: white;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  color: #666;
}

.participants-filter .filter-btn:hover {
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-2px);
}

.participants-filter .filter-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
  box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.participants-filter .filter-btn.group-10 { border-color: #ff5252; color: #ff5252; }
.participants-filter .filter-btn.group-10.active { background: #ff5252; color: white; }
.participants-filter .filter-btn.group-20 { border-color: #4caf50; color: #4caf50; }
.participants-filter .filter-btn.group-20.active { background: #4caf50; color: white; }
.participants-filter .filter-btn.group-30 { border-color: #2196f3; color: #2196f3; }
.participants-filter .filter-btn.group-30.active { background: #2196f3; color: white; }
.participants-filter .filter-btn.group-40 { border-color: #ff9800; color: #ff9800; }
.participants-filter .filter-btn.group-40.active { background: #ff9800; color: white; }
.participants-filter .filter-btn.group-50 { border-color: #9c27b0; color: #9c27b0; }
.participants-filter .filter-btn.group-50.active { background: #9c27b0; color: white; }

/* Sélecteur de mode buzzer */
.buzzer-mode-selector {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: 20px;
}

.mode-select {
  padding: 8px 15px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: white;
  font-weight: bold;
  cursor: pointer;
}

.btn-activate-all {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  transition: transform 0.2s;
  white-space: nowrap;
}

.btn-activate-all:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #af64cc, #9b59b6);
}

.btn-activate-all.active {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  animation: pulse 1s infinite;
}

/* Contrôles des buzzers par groupe */
.buzzer-controls {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin: 20px 0;
  flex-wrap: wrap;
}

.buzzer-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.group-label {
  font-size: 18px;
  font-weight: bold;
  padding: 5px 15px;
  border-radius: 20px;
  color: white;
  margin-right: 10px;
  display: inline-block;
  vertical-align: middle;
}

/* Couleurs des groupes 10-50 */
.group-10 {
  background: #e74c3c;
}
.group-20 {
  background: #3498db;
}
.group-30 {
  background: #2ecc71;
}
.group-40 {
  background: #f39c12;
}
.group-50 {
  background: #9b59b6;
}

.btn-buzzer-group {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s;
  color: white;
  min-width: 120px;
}

.btn-buzzer-group.group-10 {
  background: #c0392b;
}
.btn-buzzer-group.group-20 {
  background: #2980b9;
}
.btn-buzzer-group.group-30 {
  background: #27ae60;
}
.btn-buzzer-group.group-40 {
  background: #d68910;
}
.btn-buzzer-group.group-50 {
  background: #7d3c98;
}

.btn-buzzer-group.active {
  animation: pulse 1s infinite;
  box-shadow: 0 0 20px currentColor;
}

.btn-buzzer-group:hover {
  transform: scale(1.05);
}

.btn-stop-all {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: #95a5a6;
  color: white;
}

.btn-stop-all:hover {
  background: #7f8c8d;
}

.timer-display-group {
  font-size: 20px;
  font-weight: bold;
  padding: 3px 8px;
  background: #f5f5f5;
  border-radius: 8px;
  min-width: 50px;
  text-align: center;
}

.eligible-section.blink {
  animation: blinkBackground 1s infinite;
}

@keyframes blinkBackground {
  0%,
  100% {
    background: #419493;
  }
  50% {
    background: #2e6b6a;
    box-shadow: 0 10px 40px rgba(65, 148, 147, 0.5);
  }
}

.eligible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.eligible-title {
  display: flex;
  align-items: center;
  gap: 20px;
}

.eligible-title h2 {
  color: #333;
  font-size: 28px;
}

.tour-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(135deg, #ff9800, #f44336);
  color: white;
  width: 100px;
  height: 100px;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 5px 10px;
  font-size: 30px;
  font-weight: 900;
  border-top-right-radius: 30px;
  z-index: 10;
  box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.broadcast-badge {
  position: absolute;
  top: 0;
  left: 0;
  background: linear-gradient(135deg, #9c27b0, #673ab7);
  color: white;
  width: 100px;
  height: 100px;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 5px 10px;
  font-size: 30px;
  border-top-left-radius: 30px;
  z-index: 11; /* Slightly above other elements */
  border: none;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.broadcast-badge:hover {
  transform: scale(1.1);
}

.broadcast-badge.recording {
  animation: broadcastPulse 1.5s infinite;
  background: linear-gradient(135deg, #f44336, #d32f2f);
}

.broadcast-badge.sending {
  background: linear-gradient(135deg, #9e9e9e, #616161);
}

.broadcast-badge.success {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
}

@keyframes broadcastPulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

.tour-badge.pop {
  animation: badgePop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badgePop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.4);
    filter: brightness(1.2);
  }
  100% {
    transform: scale(1);
  }
}



.speaker-logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.speaker-logo img {
  max-width: 200px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.speaker-avatar {
  font-size: 140px;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.current-speaker-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  min-height: 0;
  padding: 20px;
}

.current-speaker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 250px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border-radius: 50px;
  padding: 40px 60px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.current-speaker::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 100%);
  z-index: -1;
}

.speaker-content {
  flex: 1;
  text-align: center;
}

.current-speaker h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 20px;
}

.current-speaker-name {
  font-size: 80px;
  font-weight: 900;
  font-family: 'Fredoka One', cursive;
  color: #ffffff;
  text-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  margin-bottom: 10px;
}

.current-speaker-detail {
  font-size: 28px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.speaker-groupe {
  display: inline-block;
  padding: 5px 20px;
  border-radius: 20px;
  color: white;
  font-weight: bold;
  margin-top: 10px;
}

.button-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 5px 0;
  flex-wrap: wrap;
}

.main-controls-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: nowrap;
  width: 100%;
  align-items: center;
  margin-top: 10px;
}

.ranking-buttons-container {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.next-btn,
.reset-btn,
.total-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: bold;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.total-btn {
  background-color: #4caf50;
  color: white;
}

.rank-grp-btn {
  padding: 8px 15px;
  font-size: 14px;
  font-weight: bold;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  color: white;
  transition: transform 0.2s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.rank-grp-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.next-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.reset-btn {
  background: #ff9800;
  color: white;
}

.total-btn {
  background: #4caf50;
  color: white;
}

.queue-section {
  margin-top: 20px;
  border-top: 2px solid #e0e0e0;
  padding-top: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.queue-title {
  font-size: 22px;
  font-weight: bold;
  color: #333;
}

.queue-stats {
  background: #f0f0f0;
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 18px;
}

.queue-list {
  flex: 1;
  overflow-y: auto;
}

.queue-item {
  display: flex;
  align-items: center;
  padding: 15px;
  margin: 10px 0;
  background: #f5f5f5;
  border-radius: 15px;
}

.queue-item.current {
  background: linear-gradient(135deg, #ffe6b3, #ffd89b);
  border: 3px solid #ff9800;
  transform: scale(1.02);
}

.queue-position {
  font-size: 28px;
  font-weight: bold;
  width: 70px;
  text-align: center;
  color: #667eea;
}

.queue-avatar {
  font-size: 40px;
  margin-right: 10px;
  width: 60px;
  text-align: center;
}

.queue-info {
  flex: 1;
  padding: 0 15px;
}

.queue-numero {
  font-size: 18px;
  font-weight: bold;
  color: #667eea;
}

.queue-prenom {
  font-size: 16px;
  color: #333;
}

.queue-groupe {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  color: white;
  font-size: 12px;
  font-weight: bold;
  margin-left: 10px;
}

.queue-points {
  font-size: 14px;
  color: #ff9800;
  font-weight: bold;
}

.queue-actions {
  display: flex;
  gap: 8px;
  margin-right: 15px;
}

.point-btn {
  padding: 6px 12px;
  font-size: 18px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.point-btn-active {
  background: #4caf50;
  color: white;
}

.point-btn-inactive {
  background: #cccccc;
  color: #666;
  cursor: not-allowed;
  opacity: 0.5;
}

.queue-status {
  width: 60px;
  text-align: center;
}

.status-icon {
  font-size: 28px;
}

.empty-queue {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 18px;
}

.registration-area,
.participants-section {
  background: white;
  border-radius: 20px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.registration-area.hidden,
.participants-section.hidden,
.queue-section.hidden,
.hidden {
  display: none !important;
}

h2 {
  color: #333;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.participants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.participants-grid.hidden {
  display: none;
}

.participant-card {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  border: 2px solid #e0e0e0;
  position: relative;
  transition: all 0.3s;
}

.participant-card.connected {
  border-color: #4caf50;
  background: #e8f5e9;
}

.participant-card.speaking {
  border-color: #ff9800;
  background: #fff3e0;
  animation: pulse 1s infinite;
}

.participant-groupe {
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 3px 8px;
  border-radius: 10px;
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.participant-avatar {
  font-size: 50px;
  margin-bottom: 10px;
  margin-top: 15px;
}

.participant-numero {
  font-size: 20px;
  font-weight: bold;
  color: #667eea;
}

.participant-prenom {
  font-size: 18px;
  font-weight: bold;
  margin-top: 5px;
}

.participant-points {
  font-size: 24px;
  font-weight: bold;
  color: #ff9800;
  margin-top: 10px;
  padding: 8px;
  background: #fff3e0;
  border-radius: 10px;
  display: block;
}

.delete-participant {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #ff4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  cursor: pointer;
  font-weight: bold;
  z-index: 10;
}

.delete-participant:hover {
  background: #cc0000;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  border-radius: 30px;
  padding: 30px;
  max-width: 900px;
  width: 90%;
  max-height: 85%;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  margin-bottom: 0;
}

.btn-pdf {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
}

.btn-pdf:hover {
  background: #c0392b;
}

.ranking-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  margin-top: 10px;
}

.ranking-table th {
  padding: 15px;
  text-align: left;
  color: #666;
  font-weight: 600;
  border-bottom: 2px solid #f0f0f0;
}

.ranking-table tr {
  background: #fdfdfd;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.ranking-table tr:hover {
  transform: scale(1.01);
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.ranking-table td {
  padding: 15px;
  vertical-align: middle;
}

.ranking-table tr td:first-child { border-radius: 15px 0 0 15px; }
.ranking-table tr td:last-child { border-radius: 0 15px 15px 0; }

.rank-row-top-1 { background: linear-gradient(to right, #fff9c4, white) !important; }
.rank-row-top-2 { background: linear-gradient(to right, #f5f5f5, white) !important; }
.rank-row-top-3 { background: linear-gradient(to right, #efebe9, white) !important; }

.rank-number {
  background: #f8f9fa;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 800;
  color: #333;
}

.rank-avatar {
  font-size: 30px;
}

.rank-groupe {
  padding: 4px 12px;
  border-radius: 10px;
  color: white;
  font-weight: bold;
  font-size: 14px;
}

.rank-points {
  color: #ff9800;
  font-weight: 800;
  font-size: 18px;
}

.rank-grp-btn.active {
  box-shadow: 0 0 0 3px rgba(0,0,0,0.2), inset 0 2px 5px rgba(0,0,0,0.2);
  transform: scale(1.1);
}

.ranking-groupe {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  color: white;
  font-weight: bold;
}

.medal {
  font-size: 24px;
}

.close-modal {
  padding: 10px 30px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 20px;
  width: 100%;
}

.close-modal:hover {
  background: #5a6fd8;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  z-index: 1000;
  animation: slideIn 0.3s;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .layout-row {
    flex-direction: column;
    padding-top: 60px;
    height: auto;
    gap: 10px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1060;
    width: 280px;
    height: 100vh;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .hamburger-btn {
    display: block;
  }

  .main-content {
    padding: 0;
  }

  .eligible-section {
    height: auto;
    min-height: calc(100vh - 80px);
  }

  .current-speaker {
    flex-direction: column;
    padding: 20px;
  }

  .speaker-logo img {
    max-width: 120px;
  }

  .speaker-avatar {
    font-size: 80px;
  }

  .current-speaker-name {
    font-size: 32px;
  }

  .buzzer-controls {
    display: none; /* Caché par défaut sur mobile */
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 15px;
  }

  .buzzer-controls.open {
    display: flex; /* Affiché quand ouvert */
  }

  .timer-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 46px;
    height: 46px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 110px;
    left: 47%;
    z-index: 100;
    font-size: 36px;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  }
  
  .timer-toggle-btn span {
    display: none;
  }

  .buzzer-group {
    width: 100%;
    max-width: 100%;
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
  }

  .btn-buzzer-group {
    min-width: 100px;
  }

  .eligible-header {
    min-height: 80px;
    margin-bottom: 5px;
    flex-direction: column;
    gap: 10px;
  }
  
  .current-speaker {
    flex-direction: row !important;
    gap: 15px;
    justify-content: space-between !important;
  }
  
  .speaker-logo {
    order: unset !important;
    margin-bottom: 0 !important;
    display: flex !important;
  }
  
  .speaker-content {
    order: unset !important;
    width: auto !important;
  }

  #speakerLogoRight {
    display: flex !important;
  }
  
  .speaker-avatar {
    font-size: 100px !important;
  }

  .buzzer-mode-selector {
    margin-left: 0;
    width: 100%;
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .buzzer-mode-selector > * {
    flex: 1;
    min-width: 120px;
  }
}

@media (max-width: 480px) {
  .eligible-section {
    padding: 10px;
    overflow-y: auto;
  }
  
  .eligible-header {
    min-height: 80px;
    margin-bottom: 5px;
  }
  
  .animated-title {
    font-size: 1.1rem;
    padding: 35px 0 10px 0 !important;
    width: 100%;
    line-height: 1.4;
  }
  
  .tour-badge {
    top: 0;
    right: 0;
    padding: 8px 15px;
    font-size: 16px;
    border-bottom-left-radius: 15px;
  }

  .current-speaker {
    flex-direction: column !important;
    gap: 15px !important;
    justify-content: center !important;
  }
  
  .speaker-logo {
    order: 1 !important;
  }
  
  .speaker-content {
    order: 2 !important;
    width: 100% !important;
  }
  
  #speakerLogoRight {
    display: none !important;
  }

  .speaker-avatar {
    font-size: 70px !important;
    margin-top: 0;
  }
  
  .current-speaker-name {
    font-size: 22px !important;
  }
  
  .current-speaker-detail {
    font-size: 15px !important;
    width: 100%;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .speaker-audio-player {
    width: 95%;
    height: 32px;
    margin: 5px 0;
  }

  .button-group {
    gap: 6px;
  }
  
  .next-btn, .reset-btn, .total-btn {
    padding: 10px;
    font-size: 13px;
  }

  .main-controls-row {
    flex-direction: column !important;
    gap: 12px !important;
  }
  
  .next-btn {
    order: 1;
    width: 100% !important;
  }
  
  .reset-btn {
    order: 2;
    width: 100% !important;
  }
  
  .ranking-buttons-container {
    order: 3;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    padding: 15px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 20px !important;
  }
  
  .rank-grp-btn, .total-btn {
    padding: 10px 5px !important;
    font-size: 11px !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 20px !important;
    font-weight: bold !important;
    border: none !important;
    white-space: nowrap !important;
  }
  
  .total-btn {
    background: #4caf50 !important;
    color: white !important;
    grid-column: auto !important;
    font-size: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  .total-btn::before {
    content: "🏆 TOTAL";
    font-size: 10px !important;
  }
}

/* ===== AUDIO SOUS LE NOM DU PARTICIPANT COURANT ===== */
.queue-audio {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
  margin: 6px 0 4px;
  transition: all 0.3s ease;
}

.queue-audio:empty {
  margin: 0;
}

.speaker-audio-player {
  width: clamp(200px, 60%, 380px);
  height: 44px;
  border-radius: 30px;
  outline: none;
  box-shadow:
    0 0 0 3px rgba(168, 85, 247, 0.25),
    0 4px 15px rgba(124, 58, 237, 0.3);
  animation: audioFadeIn 0.4s ease;
  background: transparent;
}

@keyframes audioFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.participant-audio-mini {
  margin: 5px 0;
  width: 100%;
}

.participant-audio-mini audio {
  filter: sepia(20%) saturate(70%) hue-rotate(180deg);
  border-radius: 10px;
}

.participant-card .current-speaker {
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
    min-height: 0;
}

/* ===== RESPONSIVE MODAL CLASSEMENT ===== */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    padding: 20px 15px;
    border-radius: 20px;
    max-height: 90%;
  }

  .modal-header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    align-items: center;
  }

  .modal-header h2 {
    font-size: 1.2rem;
    line-height: 1.3;
  }

  .btn-pdf {
    width: 100%;
    max-width: 250px;
    padding: 12px;
    font-size: 14px;
    justify-content: center;
  }

  #rankingContainer {
    overflow-x: auto;
    margin-top: 10px;
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
  }

  /* Pour s'assurer que le tableau ne soit pas écrasé */
  #rankingContainer table {
    min-width: 500px;
  }

  .modal-group-selector {
    gap: 5px !important;
  }

  .modal-group-selector button {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }
  
  .close-modal {
    width: 100%;
    margin-top: 20px;
  }
}

/* ===== TABLET RESPONSIVE (769px - 1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
  .layout-row {
    flex-direction: column;
    padding-top: 70px;
    height: auto;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    transform: translateX(-100%);
    z-index: 2000;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    padding: 15px;
  }
  
  .current-speaker {
    flex-direction: row !important; /* Horizontale sur tablette */
    padding: 30px;
    gap: 20px;
    justify-content: space-between !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7)) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 40px !important;
  }
  
  #speakerLogoRight {
    display: flex !important;
  }
  
  .speaker-avatar {
    font-size: 110px !important;
    margin: 0 !important;
  }
  
  .current-speaker-name {
    font-size: 40px !important;
  }
  
  .participants-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  
  .ranking-buttons-container {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    padding: 10px !important;
    border-radius: 30px !important;
    gap: 8px !important;
  }
  
  .rank-grp-btn, .total-btn {
    padding: 8px 12px !important;
    font-size: 12px !important;
    width: auto !important;
  }
}
