/* ========== Design tokens ========== */
:root{
  --bg-1: #f8f4ff;                /* fond clair doux */
  --bg-2: #e8f4fd;
  --glass: rgba(255,255,255,0.7);
  --stroke: rgba(255,255,255,0.3);
  --txt: #2d3748;
  --muted: #718096;
  --brand: #7c3aed;               /* violet principal */
  --brand-2: #a855f7;             /* violet plus clair */
  --accent: #10b981;              /* vert menthe pour CTA */
  --accent-light: #34d399;        /* vert plus clair */
  --danger: #ef4444;

  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-1: 0 10px 30px rgba(0,0,0,0.15);
  --shadow-2: 0 6px 18px rgba(0,0,0,0.1);

  --container-w: min(1200px, 92vw);
  --gap: 20px;
  --blur: 14px;
  --speed: .25s;
}

/* ========== Reset court ========== */
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
img,video,canvas{max-width:100%;display:block}

/* ========== Fond global avec vagues SVG Aurora ========== */
body {
  font-family: "Inter", "Poppins", sans-serif;
  color: #1e1e2f;
  background: radial-gradient(circle at 28% 18%, #ffdee9 0%, #b5fffc 70%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden; /* Empêche le défilement horizontal seulement */
  overflow-y: auto;   /* Permet le défilement vertical */
}

/* ========== Header hero minimal ========== */
header{
  width:var(--container-w);
  margin: clamp(28px,5vh,48px) auto 0;
  text-align:left;
}
header h1{
  font-size:clamp(28px,3.6vw,44px);
  line-height:1.08;
  letter-spacing:.2px;
  font-weight:800;
  background: linear-gradient(90deg, #fff, #cfd6ff 60%, #b9ffe3);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
header h2{
  color:var(--muted);
  margin-top:10px;
  font-size:clamp(15px,1.4vw,18px);
}

/* ========== Layout principal ========== */
#mainContainer{
  width:var(--container-w);
  margin: 28px auto 60px;
  display:grid;
  grid-template-columns: 1.6fr .7fr;
  gap: clamp(16px,2.5vw,28px);
}
@media (max-width: 980px){
  #mainContainer{ grid-template-columns: 1fr; }
}

/* ========== Panneau gauche (zone vidéo + chat) ========== */
#leftPanel{display:flex;flex-direction:column;gap:var(--gap)}

/* Vidéos en grille souple */
#videos{
  display:grid;
  grid-template-columns: repeat(2, minmax(260px,1fr));
  gap: var(--gap);
}
@media (max-width: 720px){ #videos{ grid-template-columns: 1fr; } }

/* Card vidéo (wrappe <video>) */
.video-wrapper, #videos video{
  border-radius: var(--radius-lg) !important;
}
.video-wrapper{
  position:relative;
  overflow:hidden;
  background: linear-gradient(135deg, rgba(124,140,251,.18), rgba(154,139,255,.12));
  box-shadow: var(--shadow-1);
}
#videos video{
  width:100% !important; height:100% !important; object-fit:cover !important;
  background:#000;
}
.video-wrapper::after{
  content:"";
  position:absolute; inset:auto 0 0 0; height:34%;
  background: linear-gradient(to top, rgba(0,0,0,.45), transparent);
  pointer-events:none;
}

/* Badge pseudo/état */
.video-badge{
  position:absolute; left:12px; bottom:12px;
  padding:8px 12px; border-radius:12px;
  background: rgba(0,0,0,.5);
  border:1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
  color:#fff; font-weight:600; font-size:14px;
}

/* Chat & cartes utilitaires */
#chatBox, .panel-card{
  background: color-mix(in oklab, white 8%, transparent);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow-2);
  padding: 14px;
}
#chatMessages{
  height: 220px; overflow:auto; border-radius:12px;
  background: rgba(255,255,255,0.03);
  border:1px dashed rgba(255,255,255,0.08);
  padding:12px; color:var(--txt);
}

/* Inputs + boutons unifiés */
input[type="text"], select{
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  color:var(--txt);
  outline:none;
  transition:border var(--speed), transform var(--speed);
}
input[type="text"]:focus, select:focus{
  border-color: color-mix(in oklab, var(--brand) 60%, white 0%);
  transform: translateY(-1px);
}

/* Bouton principal */
.btn, button, #startGameBtn, #sendBtn, #nextBtn, #stopBtn, #searchBtn{
  --bg: linear-gradient(90deg, var(--brand), var(--brand-2));
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px; padding:12px 16px; border-radius:14px;
  background: var(--bg); color:#0e1025; border:none; cursor:pointer;
  font-weight:700; letter-spacing:.2px;
  box-shadow: 0 8px 22px rgba(124,140,251,.25);
  transition: transform var(--speed), filter var(--speed);
}
.btn:hover, button:hover{ transform: translateY(-2px); filter: brightness(1.05) }
.btn:active, button:active{ transform: translateY(0) }

/* Bouton "accent" (CTA) */
.btn-accent{ --bg: linear-gradient(90deg, var(--accent), #8ff7d3) }

/* Bouton ghost */
.btn-ghost{
  background: transparent;
  color: var(--txt);
  border:1px solid var(--stroke);
  box-shadow:none;
}

/* Groupe de contrôles */
#controls{ display:flex; flex-wrap:wrap; gap:10px; }

/* ========== Panneau droit (sidebar) ========== */
#rightPanel{
  position: sticky; top: 20px;
  background: color-mix(in oklab, white 6%, transparent);
  border:1px solid var(--stroke);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow-1);
  padding:18px;
  display:flex; flex-direction:column; gap:14px;
}
.panel-section{
  background: rgba(255,255,255,0.05);
  border:1px solid var(--stroke);
  border-radius: 16px;
  padding:14px;
}
.panel-section h3{
  font-size:13px; text-transform:uppercase; letter-spacing:.12em;
  color:var(--muted); margin-bottom:8px;
}

/* ========== Petites touches de motion ========== */
a, button{ will-change: transform; }
.video-wrapper{ transform: translateZ(0); }
.video-wrapper:hover{ transform: translateY(-2px); }

/* ========== États & utilitaires ========== */
.hidden{ display:none !important }
.muted{ color:var(--muted) }

/* ========== Responsive raffinements ========== */
@media (max-width: 1280px){ :root{ --container-w: min(1080px, 92vw) } }
@media (max-width: 980px){
  header{ text-align:center }
  #controls{ justify-content:center }
}
@media (max-width: 520px){
  :root{ --gap:14px }
  .btn, button{ width:100% }
  header h1{ font-size: clamp(24px,7vw,36px) }
}

/* ========== Thème clair optionnel ========== */
/* Ajoute .light sur <body> si tu veux un look clair */
body.light{
  --bg-1:#f7f8fb; --bg-2:#eef1f7; --txt:#0f1220; --muted:#5c6470;
  --glass:rgba(0,0,0,0.04); --stroke:rgba(0,0,0,0.08);
  background:
    radial-gradient(1000px 700px at 10% 0%, rgba(124,140,251,.08), transparent 60%),
    radial-gradient(900px 600px at 90% 100%, rgba(84,230,182,.05), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
}

/* ========== Éléments spécifiques existants ========== */

/* Welcome Screen */
#welcomeScreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 90vh;
}

#welcomeScreen input {
  padding: 16px;
  font-size: 18px;
  border-radius: 8px;
  border: none;
  margin-bottom: 20px;
  width: 250px;
  text-align: center;
}

#welcomeScreen button {
  padding: 14px 30px;
  font-size: 18px;
  background: #00c6ff;
  border: none;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

#welcomeScreen button:hover {
  background: #0072ff;
}

/* Center Card */
.center-card {
  background: color-mix(in oklab, white 8%, transparent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  max-width: 350px;
  margin: 60px auto 0 auto;
  padding: 40px 32px 32px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--stroke);
  backdrop-filter: blur(var(--blur));
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 18px;
  box-shadow: var(--shadow-2);
}

.center-card h1 {
  font-size: 2.2em;
  font-weight: bold;
  margin: 0 0 8px 0;
  color: var(--txt);
}

.subtitle {
  color: var(--muted);
    margin-bottom: 18px;
  font-size: 1.1em;
}

.online-indicator {
    display: flex;
    align-items: center;
  margin-bottom: 22px;
  font-size: 1em;
  color: var(--accent);
}

.online-indicator .dot {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 8px;
  display: inline-block;
}

.center-card input[type="text"] {
  padding: 14px;
  font-size: 1.1em;
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  margin-bottom: 18px;
    width: 100%;
  text-align: center;
  outline: none;
  background: rgba(255,255,255,0.06);
  color: var(--txt);
  transition: border var(--speed), transform var(--speed);
}

.center-card input[type="text"]:focus {
  border-color: var(--brand);
    transform: translateY(-1px);
  }

.center-card button {
  padding: 14px 0;
  font-size: 1.1em;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border: none;
  color: #0e1025;
  border-radius: var(--radius-md);
  cursor: pointer;
  width: 100%;
  font-weight: bold;
  box-shadow: 0 8px 22px rgba(124,140,251,.25);
  transition: transform var(--speed), filter var(--speed);
}

.center-card button:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

/* Status Message */
.status-message {
  text-align: left;
  color: var(--accent);
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 0.9em;
  font-weight: 500;
  min-height: 1.5em;
  transition: color 0.2s;
  padding-left: 0;
  max-width: 100%;
  word-wrap: break-word;
  position: relative;
  z-index: 15;
}

/* Game Area */
#gameArea {
  margin: 20px auto;
  padding: 20px;
  background: color-mix(in oklab, white 8%, transparent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  max-width: 400px;
  border: 1px solid var(--stroke);
  backdrop-filter: blur(var(--blur));
}

#choices button {
  margin: 10px;
  padding: 10px 20px;
  font-size: 18px;
}

#gameStatus {
  margin-top: 15px;
  font-weight: bold;
  transition: all 0.3s ease;
  font-size: 1.2em;
  color: var(--txt);
}

/* Progress Bar */
.progress-bar-top {
  margin: 16px 0;
  background: color-mix(in oklab, white 8%, transparent);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-2);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(var(--blur));
}

.progress-bar-top-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.progress-bar-top-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-bar-top-title {
  font-size: 1.1em;
  font-weight: 600;
  color: var(--txt);
  letter-spacing: 0.5px;
}

.progress-bar-top-level {
  background: rgba(255,255,255,0.06);
  color: var(--txt);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 600;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-2);
}

.progress-bar-container {
  position: relative;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #8ff7d3);
  border-radius: 4px;
  transition: width 0.3s ease;
  box-shadow: 0 1px 3px rgba(84,230,182,0.3);
}

/* Stats Container */
.stats-container {
  margin: 16px 0;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
}

.stat-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.9em;
}

.stat-item:last-child {
  margin-bottom: 0;
}

.stat-icon {
  margin-right: 8px;
  font-size: 1.1em;
}

.stat-label {
  color: var(--muted);
  font-weight: 500;
  margin-right: 8px;
}

.stat-value {
  color: var(--brand);
  font-weight: 600;
}



/* Quest System */
.quests-title {
  font-size: 1em;
  font-weight: 600;
  color: var(--brand);
  margin: 12px 0 8px 0;
  padding: 8px 10px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  border-left: 2px solid var(--brand);
  box-shadow: var(--shadow-2);
  letter-spacing: 0.3px;
  line-height: 1.3;
}

#rightPanel .quest-item {
  margin-bottom: 4px;
  padding: 4px 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  border-left: 2px solid var(--brand);
  box-shadow: var(--shadow-2);
  font-size: 0.85em;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 6px;
}

#rightPanel .quest-icon {
  font-size: 1em;
  flex-shrink: 0;
}

#rightPanel .quest-title {
  flex: 1;
  font-weight: 500;
  font-size: 0.85em;
}

#rightPanel .quest-xp {
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
  font-size: 0.8em;
}

/* Topic Indicator */
.topic-indicator {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  margin: 3px 0 10px 0;
  text-align: center;
  font-weight: 500;
  font-size: 11px;
  box-shadow: var(--shadow-2);
  position: relative;
  z-index: 15;
  max-width: 250px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid rgba(255,255,255,0.1);
}

.topic-indicator.hidden {
  display: none;
}

#currentTopicText {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.5px;
}

/* Modal Styles */
#pfcModal, .popup, .quiz-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#pfcModal.hidden, .popup.hidden, .quiz-popup.hidden {
  display: none;
}

#pfcModalContent, .popup-content, .quiz-popup-content {
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--shadow-1);
  min-width: 320px;
  text-align: center;
  font-size: 1.15rem;
  border: 1px solid var(--stroke);
  backdrop-filter: blur(var(--blur));
  color: var(--txt);
}

#pfcModal button, .popup button, .quiz-popup button {
  margin: 0 10px;
  padding: 8px 20px;
  font-size: 1rem;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #0e1025;
  cursor: pointer;
  transition: transform var(--speed);
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(124,140,251,.25);
}

#pfcModal button:hover, .popup button:hover, .quiz-popup button:hover {
  transform: translateY(-2px);
}

/* Toast */
#toast {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-2);
  color: var(--txt);
  padding: 24px 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  font-size: 1.3em;
  font-weight: bold;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  border: 1px solid var(--stroke);
  backdrop-filter: blur(var(--blur));
}

#toast.show {
  opacity: 1;
  pointer-events: auto;
}

/* Puzzle Container */
#puzzleContainer {
  position: relative;
  margin: 20px auto;
}

#puzzleCanvas {
  border: 2px solid var(--stroke);
  cursor: grab;
  background: var(--bg-1);
  border-radius: var(--radius-md);
}

#puzzleCanvas:active {
  cursor: grabbing;
}

/* Quiz Styles */
#quizArea {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#quizArea.hidden {
  display: none;
}

.quiz-container {
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: quizSlideIn 0.3s ease-out;
  border: 1px solid var(--stroke);
  backdrop-filter: blur(var(--blur));
  color: var(--txt);
}

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

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--stroke);
}

.quiz-header h4 {
  margin: 0;
  color: var(--txt);
}

.quiz-scores {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
  padding: 10px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
}

.quiz-scores .score {
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: bold;
  color: white;
}

.quiz-scores .score.player1 {
  background: var(--brand);
}

.quiz-scores .score.player2 {
  background: var(--danger);
}

.quiz-progress {
  text-align: center;
}

.quiz-progress span {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.progress-bar {
  background: rgba(255,255,255,0.1);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  background: var(--accent);
  height: 100%;
  transition: width 0.3s ease;
}

.quiz-content {
  padding: 30px;
  text-align: center;
}

.quiz-welcome h4 {
  color: var(--txt);
  margin-bottom: 15px;
  font-size: 1.3em;
}

.quiz-welcome p {
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

.quiz-btn {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #0e1025;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 5px;
  font-size: 0.95em;
  box-shadow: 0 8px 22px rgba(124,140,251,.25);
}

.quiz-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.quiz-btn.accept {
  background: linear-gradient(135deg, var(--accent), #8ff7d3);
}

.quiz-btn.decline {
  background: linear-gradient(135deg, var(--danger), #ff9a9a);
}

.quiz-waiting {
  padding: 40px 20px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,0.1);
  border-top: 4px solid var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.quiz-invitation {
  padding: 30px 20px;
}

.invitation-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.quiz-question h4 {
  color: var(--txt);
  margin-bottom: 25px;
  font-size: 1.2em;
  line-height: 1.4;
}

.quiz-options {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.quiz-option {
  display: block;
  width: 100%;
  padding: 15px 20px;
  margin: 8px 0;
  background: rgba(255,255,255,0.05);
  border: 2px solid var(--stroke);
  border-radius: var(--radius-md);
  color: var(--txt);
  font-size: 1.1em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.quiz-option:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--brand);
  transform: translateY(-2px);
}

.quiz-option:active {
  transform: translateY(0);
}

.quiz-option:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124,140,251,0.3);
}

.quiz-timer {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
}

.timer-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: conic-gradient(var(--danger) 0%, rgba(255,255,255,0.1) 0% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-2);
}

#timerText {
  font-size: 1.2em;
  font-weight: 700;
  color: var(--txt);
}

.quiz-result-display {
  text-align: center;
  padding: 20px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  margin: 10px 0;
}

.quiz-result-display h4 {
  margin: 10px 0;
  font-size: 1.5em;
}

.quiz-result-display p {
  margin: 8px 0;
  font-size: 1.1em;
}

.quiz-result-display button {
  margin-top: 15px;
  padding: 12px 24px;
  font-size: 1.1em;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #0e1025;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(124,140,251,.25);
}

.quiz-result-display button:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.score-update {
  color: var(--accent) !important;
  font-weight: 600;
}

.quiz-final {
  padding: 30px;
  text-align: center;
}

.quiz-final h4 {
  color: var(--txt);
  margin-bottom: 20px;
  font-size: 1.4em;
}

.final-score {
  background: rgba(255,255,255,0.05);
  padding: 20px;
  border-radius: var(--radius-md);
  margin: 20px 0;
}

.final-score p {
  margin: 8px 0;
  font-weight: 600;
  color: var(--txt);
}

#winnerAnnouncement h3 {
  color: var(--accent);
  font-size: 1.6em;
  margin: 20px 0;
}

.quiz-error {
  padding: 30px 20px;
  text-align: center;
}

.quiz-error h4 {
  color: var(--danger);
  margin-bottom: 15px;
}

.quiz-error p {
  color: var(--muted);
  margin-bottom: 20px;
}

/* Ludo Styles */
#ludoArea {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#ludoArea.hidden {
  display: none;
}

#ludoInviteModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

#ludoInviteModal.hidden {
  display: none;
}

#ludoInviteModalContent {
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  padding: 30px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-1);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(var(--blur));
  color: var(--txt);
}

#ludoInviteModalContent h3 {
  margin: 0 0 20px 0;
  color: var(--txt);
  font-size: 24px;
}

#ludoInviteModalContent p {
  margin: 0 0 20px 0;
  color: var(--muted);
  font-size: 16px;
}

#ludoInviteModalContent .btn {
  margin: 0 10px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(124,140,251,.25);
}

#ludoInviteModalContent .btn-primary {
  background: linear-gradient(90deg, var(--accent), #8ff7d3);
  color: #0e1025;
}

#ludoInviteModalContent .btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

#ludoInviteModalContent .btn-secondary {
  background: linear-gradient(90deg, var(--danger), #ff9a9a);
  color: white;
}

#ludoInviteModalContent .btn-secondary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

/* Overlay Root */
#overlay-root {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

#overlay-root .game-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 1001;
}

#overlay-root .game-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 1002;
}

/* Game Active States */
body.game-active #mainContainer {
  filter: blur(2px);
  transition: filter 0.3s ease;
}

body.game-active #videos {
  transform: scale(0.7);
  transition: transform 0.3s ease;
}

body.game-active #videos .video-container {
  max-width: 120px;
  max-height: 90px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .quiz-container {
    width: 95%;
    max-height: 90vh;
  }
  
  .quiz-header {
    padding: 15px;
  }
  
  .quiz-header h3 {
    font-size: 1.3em;
  }
  
  .quiz-scores {
    flex-direction: column;
    gap: 8px;
  }
  
  .player-score {
    font-size: 0.8em;
  }
  
  .quiz-content {
    padding: 20px;
  }
  
  .quiz-option {
    padding: 12px 16px;
    font-size: 0.9em;
  }
  
  .timer-circle {
    width: 50px;
    height: 50px;
  }
  
  #timerText {
    font-size: 1em;
  }
  
  .invitation-buttons {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .quiz-container {
    width: 98%;
    border-radius: var(--radius-md);
  }
  
  .quiz-header {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }
  
  .quiz-content {
    padding: 15px;
  }
  
  .quiz-question h4 {
    font-size: 1.1em;
  }
  
  .quiz-option {
    padding: 10px 14px;
    font-size: 0.85em;
  }
}

/* Action Buttons */
.action-btn {
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #0e1025;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 8px;
  box-shadow: 0 8px 22px rgba(124,140,251,.25);
}

.action-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.action-btn.highlight {
  background: linear-gradient(135deg, var(--accent), #8ff7d3);
}

.action-btn.highlight:hover {
  box-shadow: 0 6px 20px rgba(84,230,182,0.4);
}

/* Highlight Sections */
.highlight-section {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-radius: var(--radius-md);
  padding: 15px;
  margin: 15px 0;
  color: #0e1025;
}

.highlight-section h3 {
  color: #0e1025;
  margin-bottom: 8px;
}

.moment-topic {
  font-size: 14px;
  font-style: italic;
  margin: 0;
  opacity: 0.9;
}

.new-feature {
  background: linear-gradient(135deg, var(--accent), #8ff7d3);
  border-radius: var(--radius-md);
  padding: 15px;
  margin: 15px 0;
  color: #0e1025;
}

.new-feature h3 {
  color: #0e1025;
  margin-bottom: 8px;
}

.new-feature-text {
  font-size: 14px;
  font-style: italic;
  margin: 0 0 10px 0;
  opacity: 0.9;
}

/* Debug Button */
.debug-btn {
  width: 100%;
  padding: 8px 12px;
  background: var(--muted);
  color: var(--txt);
  border: none;
  border-radius: var(--radius-md);
  font-size: 12px;
  cursor: pointer;
  margin-top: 15px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.debug-btn:hover {
    opacity: 1;
}

/* Theme Content */
#themeContent {
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  padding: 15px;
  margin: 10px 0;
  border-left: 4px solid var(--accent);
}

#themeTitle {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

#themeChallenges {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.challenge-item {
  background: rgba(255,255,255,0.05);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--txt);
}

.challenge-item:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--accent);
  transform: translateX(2px);
}

.challenge-item.selected {
  background: var(--accent);
  color: #0e1025;
  border-color: var(--accent);
}

/* Row */
.row {
  margin-top: 10px;
  position: relative;
  z-index: 15;
  margin-bottom: 5px;
}

/* Special Button Styles */
#startGameBtn {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #0e1025;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 8px 22px rgba(124,140,251,.25);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 14px;
  position: relative;
  overflow: hidden;
}

#startGameBtn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

#startGameBtn:hover::before {
  left: 100%;
}

#startGameBtn:hover {
  transform: translateY(-3px);
  filter: brightness(1.05);
}

#startGameBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Right Panel Lists */
#rightPanel ul {
  list-style: none;
    padding: 0;
  margin: 10px 0;
}

#rightPanel ul li {
  padding: 8px 0;
  border-bottom: 1px solid var(--stroke);
  color: var(--txt);
}

/* ========== Styles pour l'interface des jeux ========== */
.games-section {
  margin-bottom: 12px;
}

.game-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.nav-tab {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--txt);
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--brand);
}

.nav-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.nav-tab.surprise-btn {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  border-color: #ff6b6b;
  color: white;
  font-weight: 600;
}

.nav-tab.surprise-btn:hover {
  background: linear-gradient(135deg, #ff5252, #d63031);
}

.games-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}

.game-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
}

.game-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--brand);
}

.game-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.game-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.game-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--txt);
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.game-badges {
  display: flex;
  gap: 2px;
  margin-left: 4px;
}

.game-badge {
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 500;
}

.badge-new {
  background: #ff6b6b;
  color: white;
}

.badge-vocal {
  background: #4ecdc4;
  color: white;
}

.badge-mode {
  background: rgba(255, 255, 255, 0.2);
  color: var(--txt);
}

.game-description {
  display: none; /* Masqué pour économiser l'espace */
}

.game-meta {
  display: none; /* Masqué pour économiser l'espace */
}

.game-play-btn {
  background: var(--brand);
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  min-width: 50px;
}

.game-play-btn:hover {
  background: var(--brand-2);
}

.popular-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--stroke);
}

.popular-section h4 {
  font-size: 10px;
  font-weight: 600;
  color: var(--txt);
  margin: 0 0 6px 0;
}

.popular-carousel {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.popular-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  border-radius: 4px;
  padding: 4px;
  min-width: 45px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.popular-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--brand);
}

.popular-rank {
  font-size: 7px;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 1px;
}

.popular-icon {
  font-size: 12px;
  margin-bottom: 1px;
}

.popular-name {
  font-size: 8px;
  font-weight: 500;
  color: var(--txt);
  line-height: 1.1;
  margin-bottom: 1px;
}

.popular-count {
  font-size: 7px;
  color: var(--txt);
  opacity: 0.6;
}

/* Scrollbar personnalisée pour la grille de jeux */
.games-grid::-webkit-scrollbar {
  width: 4px;
}

.games-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.games-grid::-webkit-scrollbar-thumb {
  background: var(--brand);
  border-radius: 2px;
}

.popular-carousel::-webkit-scrollbar {
  height: 4px;
}

.popular-carousel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.popular-carousel::-webkit-scrollbar-thumb {
  background: var(--brand);
  border-radius: 2px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
#mainContainer {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    padding: 5px;
    position: relative;
    gap: 10px;
}

#leftPanel, #rightPanel {
    width: 100%;
    max-width: 100%;
}

#leftPanel {
    height: auto;
    min-height: 60vh;
    padding: 5px;
    flex: 1;
}

#rightPanel {
    margin-top: 10px;
    padding: 12px;
    max-height: 300px !important;
    height: auto !important;
    overflow-y: auto !important;
    min-height: auto !important;
    position: relative !important;
    flex-shrink: 1 !important;
    margin-left: 0 !important;
    min-width: auto !important;
    max-width: 100% !important;
  }

#chatBox {
    margin: 5px 0;
    padding: 10px;
    min-height: 120px;
    margin-bottom: 60px;
    }
    
    #videos {
    min-height: 200px;
    max-height: 40vh;
  }
}

/* Mobile Specific Rules */
@media screen and (max-width: 768px) {
  body #mainContainer {
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    height: 100vh !important;
  }
  
  body #mainContainer #rightPanel {
    max-height: 30vh !important;
    height: 30vh !important;
    overflow-y: auto !important;
    flex-shrink: 0 !important;
    position: relative !important;
    margin: 0 auto !important;
    min-width: 90% !important;
    max-width: 90% !important;
    padding: 8px !important;
    order: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
  }
  
  body #mainContainer #leftPanel {
    order: 1 !important;
    flex: 1 !important;
    min-height: 60vh !important;
    width: 100% !important;
  }

  body #mainContainer #leftPanel {
    flex: 1 !important;
    min-height: 60vh !important;
  }

  body #mainContainer #rightPanel .panel-section {
    margin-bottom: 6px !important;
    padding: 6px !important;
  }

  body #mainContainer #rightPanel h3 {
    font-size: 14px !important;
    margin-bottom: 8px !important;
  }

  body #mainContainer #rightPanel h4 {
    font-size: 12px !important;
    margin-bottom: 6px !important;
  }

  body #mainContainer #rightPanel button {
    padding: 6px 10px !important;
    font-size: 10px !important;
    margin-top: 6px !important;
  }

  body #mainContainer #rightPanel ul li {
    font-size: 11px !important;
    padding: 4px 0 !important;
  }
  
  body #mainContainer #rightPanel select {
    margin-top: 15px !important;
    margin-bottom: 15px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    width: 100% !important;
    max-width: 250px !important;
  }
}

/* Very Small Phones */
@media screen and (max-width: 480px) {
  body #mainContainer #rightPanel {
    max-height: 25vh !important;
    height: 25vh !important;
    min-width: 95% !important;
    max-width: 95% !important;
  }
  
  body #mainContainer #rightPanel select {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    padding: 6px 10px !important;
    font-size: 11px !important;
    width: 100% !important;
    max-width: 200px !important;
  }
}

/* Medium Phones */
@media screen and (min-width: 481px) and (max-width: 768px) {
  body #mainContainer #rightPanel {
    max-height: 35vh !important;
    height: 35vh !important;
    min-width: 85% !important;
    max-width: 85% !important;
  }
  
  body #mainContainer #rightPanel select {
    margin-top: 20px !important;
    margin-bottom: 20px !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
    width: 100% !important;
    max-width: 280px !important;
  }
}

/* Tablets */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  body #mainContainer #rightPanel {
    max-height: 40vh !important;
    height: 40vh !important;
  }
}

/* Welcome Section */
#welcomeSection {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 100vh; /* min-height au lieu de height pour permettre le défilement */
  padding: 20px 40px;
  background: transparent;
  color: var(--txt);
  box-sizing: border-box;
}

#welcomeSection .left-content {
  flex: 1;
  max-width: 55%;
  margin-top: -20px;
}

#welcomeSection .left-content h1 {
  font-size: clamp(2em, 4vw, 2.5em);
  margin-bottom: 15px;
  line-height: 1.2;
  color: var(--txt);
}

#welcomeSection .left-content p {
  font-size: clamp(1em, 2vw, 1.1em);
  margin-bottom: 15px;
  line-height: 1.4;
  color: var(--muted);
}

#welcomeSection .badges span {
  display: inline-block;
  background: rgba(255,255,255,0.05);
  padding: 6px 12px;
  border-radius: 20px;
  margin-right: 8px;
  margin-bottom: 8px;
  font-size: 0.85em;
  color: var(--txt);
  border: 1px solid var(--stroke);
}

#welcomeSection .discover-btn {
  margin-top: 15px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #0e1025;
  font-weight: bold;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.2s;
  font-size: 0.9em;
  box-shadow: 0 8px 22px rgba(124,140,251,.25);
}

#welcomeSection .discover-btn:hover {
  transform: scale(1.05);
}

/* Right Content */
#welcomeSection .right-content {
  flex: 0.4;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(12px);
  padding: 20px;
  border-radius: var(--radius-lg);
  text-align: center;
  border: 1px solid var(--stroke);
}

#welcomeSection .right-content h2 {
  margin-bottom: 15px;
  font-size: clamp(1.2em, 2.5vw, 1.4em);
  color: var(--txt);
}

#welcomeSection .right-content input {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  font-size: 0.95em;
  box-sizing: border-box;
  background: rgba(255,255,255,0.06);
  color: var(--txt);
}

#welcomeSection .right-content button {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: none;
  border-radius: var(--radius-md);
  color: #0e1025;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 8px 22px rgba(124,140,251,.25);
}

#welcomeSection .right-content button:hover {
  transform: scale(1.05);
}

#welcomeSection .rules-text {
  margin-top: 10px;
  font-size: 0.75em;
  opacity: 0.9;
  line-height: 1.3;
  color: var(--muted);
}

#welcomeSection .rules-text a {
  color: var(--brand);
  text-decoration: underline;
}

/* Responsive Welcome Section */
@media (max-width: 900px) {
  #welcomeSection {
    flex-direction: column;
    text-align: center;
    padding: 15px 20px;
    min-height: 100vh; /* min-height au lieu de height */
  }

  #welcomeSection .left-content,
  #welcomeSection .right-content {
    max-width: 100%;
    flex: none;
  }

  #welcomeSection .left-content {
    margin-bottom: 20px;
  }
  
  #welcomeSection .left-content h1 {
    font-size: clamp(1.8em, 6vw, 2.2em);
  }
  
  #welcomeSection .left-content p {
    font-size: clamp(0.9em, 3vw, 1em);
  }
}

/* Hide videos during Ludo */
#videos.rv-videos-hidden { visibility: hidden !important; }

/* Z-Index Management */
#overlay-root {
  z-index: 1000;
}

.game-overlay, .game-modal {
  z-index: 1001;
}

#quizArea {
  z-index: 2000;
}

#toast {
  z-index: 3000;
}

/* Additional utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow { box-shadow: var(--shadow-2); }
.shadow-lg { box-shadow: var(--shadow-1); }

/* === Responsive pour l'écran d'accueil (welcomeSection) === */
#welcomeSection{
  width: var(--container-w);
  margin: clamp(28px,5vh,48px) auto 40px;
  display: grid;
  grid-template-columns: 1.8fr 0.6fr; /* Encore plus large à gauche pour le titre */
  gap: clamp(16px, 3vw, 40px);
  align-items: center;
}

/* H1 smaller & tighter - exactly like mockup */
#welcomeSection .left-content h1 {
  font-weight: 800;
  font-size: clamp(36px, 5.2vw, 54px); /* smaller than before */
  line-height: 1.06;                   /* tight like the mockup */
  letter-spacing: -0.5px;
  color: #0f1736;
  margin-bottom: 12px;
}

/* Force two lines exactly (keep your <br>) */
#welcomeSection .left-content h1 br{ 
  display:block; 
}

#welcomeSection .left-content p{ 
  color: var(--muted); 
  font-size: clamp(14px, 1.6vw, 18px);
  margin-bottom: 24px;
  line-height: 1.5;
}

#welcomeSection .badges{
  display: flex; flex-wrap: wrap; gap: 8px 12px;
  margin: 10px 0 24px;
}
#welcomeSection .badges span{
  padding: 8px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.5);
  font-size: 13px;
  color: var(--txt);
  backdrop-filter: blur(10px);
}

.hero-buttons{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#welcomeSection .discover-btn {
  background: linear-gradient(90deg, #34d399, #6ee7b7);
  color: white;
  font-weight: 700;
  padding: 14px 22px;
  border-radius: 14px;
  border: none;
  box-shadow: 0 8px 25px rgba(52, 211, 153, 0.3);
  transition: transform 0.2s ease;
  cursor: pointer;
  font-size: 14px;
}
#welcomeSection .discover-btn:hover {
  transform: translateY(-2px);
}

#welcomeSection .free-btn{
  padding: 12px 20px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.8);
  font-weight: 700; cursor: pointer;
  color: var(--txt);
  font-size: 14px;
  backdrop-filter: blur(10px);
  transition: transform var(--speed), background var(--speed);
}

#welcomeSection .free-btn:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,0.9);
}

#welcomeSection .right-content {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
  text-align: center;
  position: relative;
}

#welcomeSection .right-content h2{ 
  margin-bottom: 16px; 
  color: var(--txt);
  font-size: 18px;
  font-weight: 600;
}

#welcomeSection .right-content input{
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.5);
  background: white;
  color: var(--txt);
  margin: 10px 0 16px;
  font-size: 14px;
  transition: border-color var(--speed), box-shadow var(--speed);
}

#welcomeSection .right-content input:focus{
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

#welcomeSection .right-content button {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(90deg, #6a11cb, #2575fc);
  color: white;
  font-weight: 700;
  font-size: 1em;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(80, 110, 255, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#welcomeSection .right-content button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(80, 110, 255, 0.4);
}

#welcomeSection .rules-text{
  color: var(--muted);
  margin-top: 12px; font-size: 12px;
  text-align: center;
}

#welcomeSection .rules-text a{
  color: var(--brand);
  text-decoration: underline;
}

/* Breakpoints */
@media (max-width: 980px){
  #welcomeSection{ grid-template-columns: 1fr; text-align: center; }
  #welcomeSection .right-content{ order: -1; }
  #rightPanel{ position: static; } /* évite des chevauchements sur mobile */
  .hero-buttons{ justify-content: center; }
}

@media (max-width: 520px){
  #welcomeSection .badges span, 
  #welcomeSection .discover-btn,
  #welcomeSection .free-btn,
  #welcomeSection .right-content button{ width: 100%; }
  .hero-buttons{ flex-direction: column; }
}

/* Anciennes formes de fond supprimées - remplacées par SVG waves */

/* ==========================================================================
   RANDOMVIBE — AURORA SUPREME (overrides & additions)
   Anciennes vagues supprimées - remplacées par SVG waves plus légers
   ========================================================================== */

/* 3) Titres premium (dégradé pastel lisible) */
#welcomeSection .left-content h1,
header h1{
  background: linear-gradient(90deg, #4f46e5 0%, #06b6d4 45%, #f472b6 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

/* 4) Glassmorphism global doux (sans casser ton layout) */
.panel-card,
#chatBox,
#rightPanel,
.progress-bar-top,
.stats-container,
.games-dropdown-content,
.center-card,
#gameArea,
.quiz-container,
.popup-content,
.quiz-popup-content,
#pfcModalContent,
#ludoInviteModalContent{
  background: rgba(255,255,255,0.42) !important;
  border: 1px solid rgba(255,255,255,0.38) !important;
  backdrop-filter: blur(16px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(160%) !important;
  box-shadow: 0 10px 30px rgba(10, 15, 35, 0.10) !important;
}

/* Sidebar sticky un peu plus premium */
#rightPanel{
  box-shadow: 0 12px 38px rgba(10, 15, 35, 0.12) !important;
}

/* 5) Vidéos : wrapper en verre (la vidéo reste nette) */
.video-wrapper{
  background: rgba(255,255,255,0.25) !important;
  border: 1px solid rgba(255,255,255,0.35) !important;
  backdrop-filter: blur(10px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(140%) !important;
  box-shadow: 0 10px 26px rgba(10, 15, 35, 0.14) !important;
}

/* 6) Boutons & CTA pastel premium (garde tes classes existantes) */
.btn, button, #startGameBtn, #sendBtn, #nextBtn, #stopBtn, #searchBtn,
#welcomeSection .discover-btn, #welcomeSection .free-btn,
.quiz-btn, .action-btn, #enterBtn{
  color: #ffffff !important;
  background-image: linear-gradient(90deg, #7c3aed 0%, #a855f7 33%, #06b6d4 66%, #34d399 100%) !important;
  background-size: 200% 100% !important;
  transition: transform .25s, filter .25s, background-position .5s ease !important;
  border: none !important;
}

.btn:hover, button:hover,
#welcomeSection .discover-btn:hover, #welcomeSection .free-btn:hover,
.quiz-btn:hover, .action-btn:hover, #enterBtn:hover{
  transform: translateY(-2px);
  background-position: 100% 0;
  filter: brightness(1.05);
}

/* Variante CTA menthe (si tu utilises .btn-accent) */
.btn-accent{
  background-image: linear-gradient(90deg, #10b981, #6ee7b7) !important;
}

/* 7) Champs & inputs premium */
input[type="text"], select,
#welcomeSection .right-content input{
  background: rgba(255,255,255,0.65) !important;
  border: 1px solid rgba(255,255,255,0.55) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  box-shadow: 0 6px 18px rgba(10,15,35,.08) !important;
}

input[type="text"]:focus, select:focus,
#welcomeSection .right-content input:focus{
  border-color: rgba(124,58,237,.45) !important;
  box-shadow: 0 0 0 3px rgba(124,58,237,.16) !important;
}

/* 8) Carte droite (login) plus élégante – teinte verre identique au mockup */
#welcomeSection .right-content{
  background: rgba(255,255,255,.55) !important;
  border: 1px solid rgba(255,255,255,.45) !important;
  backdrop-filter: blur(18px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(160%) !important;
  box-shadow: 0 18px 48px rgba(10,15,35,.18) !important;
  border-radius: 20px !important;
}

/* 9) Badges d'intro — plus visibles mais doux */
#welcomeSection .badges span{
  background: rgba(255,255,255,0.68) !important;
  border: 1px solid rgba(255,255,255,0.55) !important;
  backdrop-filter: blur(8px) !important;
}

/* 10) Bandeau "topic" plus premium */
.topic-indicator{
  background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
  border: 1px solid rgba(255,255,255,0.35) !important;
  box-shadow: 0 12px 28px rgba(124,58,237,.24) !important;
}

/* 11) Petits raffinements de lisibilité */
#chatMessages, .quiz-result-display, .final-score, .stats-container,
.games-dropdown-content, .panel-section, .highlight-section, .new-feature{
  color: var(--txt);
}

/* 12) Accessibilité motion — réduit l'animation si demandé */
@media (prefers-reduced-motion: reduce){
  .aurora-waves{
    animation: none !important;
    transform: none !important;
  }
}

/* 13) Z-index propre (fond derrière TOUT) */
.aurora-waves{ z-index: -2; }

/* 14) Option: léger fade-in des gros blocs au chargement */
#welcomeSection, #mainContainer, #rightPanel, #videos, #chatBox{
  animation: subtleAppear .6s ease-out both;
}
@keyframes subtleAppear{
  from{ opacity: 0; transform: translateY(6px); }
  to  { opacity: 1; transform: translateY(0); }
}

/* 15) Bouton "Entrer" (dégradé exact violet → bleu) */
#enterBtn{
  background: linear-gradient(90deg, #6a11cb, #2575fc) !important;
  color:#fff !important;
  font-weight:800 !important;
  box-shadow: inset 0 -2px 0 rgba(255,255,255,.25), 0 10px 26px rgba(80,110,255,.35) !important;
  border-radius:14px !important;
}

/* === CHESS overlay (copie du pattern Ludo) === */
#chessArea{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000; /* comme Ludo */
}
#chessArea.hidden{ display:none; }

#chessContent{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 10px;
}

#chessBoardContainer{
  width: 80vmin;   /* carré réactif */
  height: 80vmin;
  max-width: 720px;
  max-height: 720px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-2);
  border: 1px solid var(--stroke);
}

#chessBoard{ width:100%; height:100%; }

.chess-top-bar{
  display:flex;
  align-items:center;
  gap:10px;
  justify-content:center;
}







/* ==========================================================================
   VAGUES SVG AURORA — Système final
   ========================================================================== */

/* Vagues SVG plein écran */
.aurora-waves{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;                 /* derrière le contenu, devant la page blanche */
  pointer-events: none;
  filter: blur(12px) saturate(115%) contrast(103%);
  opacity: 0.95;
}

/* Mouvement très doux (comme la maquette animée) */
@media (prefers-reduced-motion: no-preference){
  .aurora-waves{
    animation: auroraDrift 26s ease-in-out infinite alternate;
  }
  @keyframes auroraDrift{
    0%   { transform: translateY(0) scale(1); }
    100% { transform: translateY(-10px) scale(1.02); }
  }
}
