/* EnigmaTeams — Player App Premium v4.0 */
/* ============================================================
   DESIGN SYSTEM
   ============================================================ */
:root {
  --bg:        #07060f;
  --bg2:       #0d0b1a;
  --surface:   #131125;
  --surface2:  #1c1935;
  --surface3:  #252244;
  --primary:   #6C63FF;
  --primary-g: linear-gradient(135deg, #6C63FF 0%, #9b5cff 100%);
  --accent:    #FF6584;
  --accent2:   #43E8B7;
  --success:   #43E8B7;
  --warning:   #FFD166;
  --danger:    #FF6584;
  --joker:     #FFD166;
  --text:      #F0EEFF;
  --text-muted:#8B88AB;
  --text-dim:  #5a5878;
  --border:    rgba(108,99,255,0.12);
  --border2:   rgba(255,255,255,0.06);
  --glow:      0 0 40px rgba(108,99,255,0.25);
  --glow-sm:   0 0 20px rgba(108,99,255,0.15);
  --radius:    22px;
  --radius-sm: 14px;
  --font:      'Inter', system-ui, -apple-system, sans-serif;
  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
#app { min-height: 100vh; position: relative; }

/* Ambient background glow */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(108,99,255,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   SCREENS
   ============================================================ */
.screen {
  display: none;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}
.screen.active { display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ============================================================
   LOADING SCREEN
   ============================================================ */
#screen-loading {
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: var(--bg);
}
.loading-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: fadeInUp 0.6s ease both;
}
.logo-icon-big {
  font-size: 4rem;
  filter: drop-shadow(0 0 20px rgba(108,99,255,0.5));
  animation: logoPulse 2s ease-in-out infinite;
}
.loading-brand {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--primary-g);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(108,99,255,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes logoPulse {
  0%,100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(108,99,255,0.5)); }
  50% { transform: scale(1.06); filter: drop-shadow(0 0 30px rgba(108,99,255,0.7)); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   CODE ENTRY SCREEN — Grande entrée
   ============================================================ */
#screen-code {
  background: var(--bg);
  align-items: center;
  justify-content: center;
}
.code-screen-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  gap: 40px;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
  animation: fadeInUp 0.5s ease both;
}
.code-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.code-logo .logo-icon-big { font-size: 3.5rem; }
.code-logo h1 {
  font-family: var(--font-head);
  font-size: clamp(1.7rem, 6vw, 2.2rem);
  font-weight: 800;
  line-height: 1.1;
}
.code-logo h1 span {
  background: var(--primary-g);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.code-logo p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 280px;
  line-height: 1.5;
}

.code-input-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.code-input-giant {
  width: 100%;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 20px 24px;
  color: var(--text);
  font-family: var(--font-head);
  font-size: clamp(2rem, 8vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-align: center;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.code-input-giant::placeholder {
  color: var(--text-dim);
  letter-spacing: 0.2em;
}
.code-input-giant:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--glow-sm);
}

.code-hint-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.code-hint-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--text-dim);
}

.code-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 0.82rem;
}
.code-divider::before, .code-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border2);
}

/* ============================================================
   IDENTIFY SCREEN
   ============================================================ */
#screen-identify { background: var(--bg); }

.screen-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border2);
  background: rgba(13,11,26,0.9);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.btn-back {
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text-muted);
  width: 38px; height: 38px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-back:hover { background: var(--surface2); color: var(--text); border-color: var(--border); }

.screen-topbar h2 {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  flex: 1;
}
.topbar-event-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(108,99,255,0.15);
  color: var(--primary);
  border: 1px solid rgba(108,99,255,0.25);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.screen-body {
  padding: 24px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  animation: fadeInUp 0.4s ease both;
}
.screen-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Registered participants list */
.identify-registered { width: 100%; }
.idr-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.idr-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border2);
}

.registered-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.registered-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  gap: 10px;
}
.registered-btn:hover {
  border-color: var(--primary);
  background: rgba(108,99,255,0.08);
  transform: translateX(2px);
}
.registered-btn.selected {
  border-color: var(--primary);
  background: rgba(108,99,255,0.15);
  box-shadow: var(--glow-sm);
}
.rb-name { font-weight: 600; flex: 1; }
.rb-team { font-size: 0.78rem; color: var(--text-muted); }
.rb-status {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(67,232,183,0.12);
  color: var(--success);
  font-weight: 700;
  border: 1px solid rgba(67,232,183,0.2);
  white-space: nowrap;
  flex-shrink: 0;
}

.identify-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 0.82rem;
}
.identify-or::before, .identify-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border2);
}
.identify-hint { font-size: 0.8rem; color: var(--text-muted); text-align: center; }
.register-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  padding: 10px;
  border-radius: 10px;
  transition: background var(--transition);
}
.register-link:hover { background: rgba(108,99,255,0.1); }

/* ============================================================
   FORMS
   ============================================================ */
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.12);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group select option { background: var(--surface2); }

.form-msg {
  font-size: 0.85rem;
  min-height: 1.4em;
  text-align: center;
  transition: all var(--transition);
}
.form-msg.success { color: var(--success); }
.form-msg.error   { color: var(--danger); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary-g);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 15px 30px;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(108,99,255,0.35);
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(108,99,255,0.45); }
.btn-primary:hover::before { background: rgba(255,255,255,0.08); }
.btn-primary:active { transform: scale(0.97) translateY(0); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border2);
  border-radius: 999px;
  padding: 13px 26px;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(108,99,255,0.06); }

.btn-outline-dark {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border2);
  border-radius: 999px;
  padding: 12px 24px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-outline-dark:hover { border-color: var(--primary); color: var(--primary); }

.btn-full { width: 100%; }
.btn-sm { padding: 10px 20px; font-size: 0.85rem; }

/* ============================================================
   SESSION HEADER — Barre sticky premium
   ============================================================ */
.session-header {
  padding: 14px 20px 12px;
  background: rgba(13,11,26,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border2);
  position: sticky;
  top: 0;
  z-index: 20;
}
.session-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}
.session-name-wrap { display: flex; flex-direction: column; gap: 2px; }
.session-name {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}
.session-team {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.team-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,101,132,0.12);
  color: var(--accent);
  border: 1px solid rgba(255,101,132,0.2);
  font-size: 0.7rem;
  font-weight: 700;
}

.session-right { display: flex; align-items: center; gap: 10px; }

.joker-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,209,102,0.1);
  color: var(--joker);
  border: 1px solid rgba(255,209,102,0.25);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all var(--transition);
}
.joker-badge.active { box-shadow: 0 0 12px rgba(255,209,102,0.3); }

.btn-refresh-mini {
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text-muted);
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-refresh-mini:hover { border-color: var(--primary); color: var(--primary); transform: rotate(45deg); }

/* Progress bar */
.session-progress { display: flex; flex-direction: column; gap: 5px; }
.session-progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.progress-stage-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}
.progress-stage-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulseDot 1.5s ease-in-out infinite;
}
@keyframes pulseDot {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}
.progress-track {
  height: 5px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 8px rgba(108,99,255,0.6);
  opacity: 0;
  transition: opacity 0.3s;
}
.progress-fill.has-progress::after { opacity: 1; }

/* ============================================================
   SESSION CARDS
   ============================================================ */
.session-cards-wrap {
  flex: 1;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.session-card {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border2);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: cardIn 0.35s cubic-bezier(0.4,0,0.2,1) both;
  position: relative;
  overflow: hidden;
}
.session-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0.6;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes cardInReverse {
  from { opacity: 0; transform: translateY(-16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── WAITING CARD ─────────────────────────────────────── */
.card-waiting-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  text-align: center;
}
.waiting-animation {
  position: relative;
  width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
}
.waiting-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--primary);
  animation: spin 1.5s linear infinite;
}
.waiting-ring:nth-child(2) {
  inset: 10px;
  border-top-color: var(--accent);
  animation-duration: 2s;
  animation-direction: reverse;
}
.waiting-emoji { font-size: 2rem; }
.waiting-title {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
}
.waiting-sub { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; }
.waiting-dots { display: flex; gap: 6px; justify-content: center; }
.waiting-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: bounceDot 1.4s ease-in-out infinite;
}
.waiting-dot:nth-child(2) { animation-delay: 0.2s; background: var(--accent); }
.waiting-dot:nth-child(3) { animation-delay: 0.4s; background: var(--accent2); }
@keyframes bounceDot {
  0%,80%,100% { transform: scale(0.7); opacity: 0.5; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* ── QUESTION CARD ─────────────────────────────────────── */
.card-question { border-color: rgba(108,99,255,0.2); }
.card-question::before { opacity: 1; }

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.question-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
}
.question-num-badge {
  background: rgba(108,99,255,0.15);
  color: var(--primary);
  border: 1px solid rgba(108,99,255,0.25);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.question-text {
  font-size: clamp(1rem, 4vw, 1.15rem);
  line-height: 1.55;
  font-weight: 600;
  color: var(--text);
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 15px 18px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.option-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(108,99,255,0);
  transition: background var(--transition);
}
.option-letter {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
  transition: all var(--transition);
  letter-spacing: 0;
  color: var(--text-muted);
}
.option-text { flex: 1; }

.option-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(108,99,255,0.08);
  transform: translateX(3px);
}
.option-btn:hover:not(:disabled) .option-letter {
  background: rgba(108,99,255,0.2);
  color: var(--primary);
  border-color: var(--primary);
}

.option-btn.correct {
  border-color: var(--success);
  background: rgba(67,232,183,0.1);
  color: var(--success);
  animation: correctPop 0.4s cubic-bezier(0.4,0,0.2,1);
}
.option-btn.correct .option-letter {
  background: rgba(67,232,183,0.2);
  color: var(--success);
  border-color: var(--success);
}
.option-btn.wrong {
  border-color: var(--danger);
  background: rgba(255,101,132,0.08);
  color: var(--danger);
  animation: wrongShake 0.4s ease;
}
.option-btn.wrong .option-letter {
  background: rgba(255,101,132,0.15);
  color: var(--danger);
  border-color: var(--danger);
}

@keyframes correctPop {
  0% { transform: scale(1); }
  30% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
@keyframes wrongShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.answer-feedback {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: feedbackIn 0.3s cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes feedbackIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.answer-feedback.correct {
  background: rgba(67,232,183,0.12);
  color: var(--success);
  border: 1px solid rgba(67,232,183,0.25);
}
.answer-feedback.wrong {
  background: rgba(255,101,132,0.1);
  color: var(--danger);
  border: 1px solid rgba(255,101,132,0.2);
}
.answer-feedback.joker {
  background: rgba(255,209,102,0.1);
  color: var(--joker);
  border: 1px solid rgba(255,209,102,0.2);
}

.question-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.btn-joker {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px dashed rgba(255,209,102,0.35);
  color: var(--joker);
  border-radius: 999px;
  padding: 9px 18px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-joker:hover:not(:disabled) {
  background: rgba(255,209,102,0.1);
  border-color: var(--joker);
  border-style: solid;
  box-shadow: 0 0 16px rgba(255,209,102,0.2);
}
.btn-joker:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── CLUE CARD — moment spectaculaire ─────────────────── */
.card-clue { border-color: rgba(108,99,255,0.3); }
.card-clue::before {
  background: linear-gradient(90deg, var(--primary), #a855f7, var(--accent));
  opacity: 1;
  height: 3px;
}

.clue-unlock-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding-top: 8px;
}
.clue-unlock-icon {
  font-size: 3rem;
  animation: unlockBounce 0.6s cubic-bezier(0.4,0,0.2,1) both;
  filter: drop-shadow(0 0 20px rgba(108,99,255,0.5));
}
@keyframes unlockBounce {
  0% { transform: scale(0) rotate(-15deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.clue-unlock-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 800;
  background: var(--primary-g);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.clue-unlock-sub { font-size: 0.82rem; color: var(--text-muted); }

.clue-box {
  background: linear-gradient(135deg,
    rgba(108,99,255,0.08) 0%,
    rgba(168,85,247,0.06) 50%,
    rgba(255,101,132,0.06) 100%
  );
  border: 1px solid rgba(108,99,255,0.25);
  border-radius: 18px;
  padding: 24px 22px;
  font-size: 1.05rem;
  line-height: 1.7;
  font-style: italic;
  color: var(--text);
  position: relative;
  text-align: center;
}
/* Bouton copier fragment */
.btn-copy-clue {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 10px auto 0; padding: 7px 16px;
  border-radius: 20px; border: 1px solid rgba(108,99,255,0.3);
  background: rgba(108,99,255,0.08); color: rgba(200,200,240,0.8);
  font-size: 0.8rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
}
.btn-copy-clue:hover { background: rgba(108,99,255,0.18); color: var(--primary); border-color: var(--primary); }
.btn-copy-clue.copied { background: rgba(67,232,183,0.12); border-color: var(--accent); color: var(--accent); }
.clue-box::before {
  content: '"';
  position: absolute;
  top: -8px; left: 16px;
  font-size: 4rem;
  color: var(--primary);
  opacity: 0.3;
  font-family: Georgia, serif;
  line-height: 1;
}
.clue-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 18px;
}

.reveal-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.location-wait {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}
.lw-icon { font-size: 2rem; animation: wiggle 2s ease-in-out infinite; }
@keyframes wiggle {
  0%,100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}
.location-wait p { font-size: 0.88rem; color: var(--text-muted); }
.location-wait strong { color: var(--text); }

.location-validated {
  background: rgba(67,232,183,0.07);
  border: 1px solid rgba(67,232,183,0.2);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
  animation: validatedIn 0.5s cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes validatedIn {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.lv-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(67,232,183,0.15);
  color: var(--success);
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  border: 1px solid rgba(67,232,183,0.25);
}
.location-validated p { font-size: 0.88rem; color: var(--text-muted); }

/* ── FINISHED CARD ─────────────────────────────────────── */
.card-finished { border-color: rgba(255,209,102,0.3); }
.card-finished::before {
  background: linear-gradient(90deg, var(--joker), var(--success), var(--accent));
  height: 3px;
}
.finished-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
  text-align: center;
}
.finished-trophy {
  font-size: 4rem;
  animation: trophyPop 0.7s cubic-bezier(0.4,0,0.2,1) both;
  filter: drop-shadow(0 0 24px rgba(255,209,102,0.5));
}
@keyframes trophyPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.finished-title {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--joker), var(--success));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.finished-sub { color: var(--text-muted); font-size: 0.92rem; line-height: 1.6; }
.finished-footer-text {
  padding: 20px 24px;
  text-align: center;
  border-top: 1px solid var(--border2);
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ============================================================
   WELCOME / EVENT HEADER SCREEN
   ============================================================ */
#screen-welcome { background: var(--bg); }
.welcome-header {
  padding: 60px 24px 44px;
  background: linear-gradient(160deg, var(--surface) 0%, var(--bg) 100%);
  text-align: center;
  border-bottom: 1px solid var(--border2);
  position: relative;
  overflow: hidden;
}
.welcome-header::before {
  content: '';
  position: absolute;
  top: -40px; left: 50%;
  transform: translateX(-50%);
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(108,99,255,0.12) 0%, transparent 70%);
}
.welcome-logo {
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 24px;
  font-weight: 700;
  opacity: 0.8;
  position: relative;
}
.welcome-header h1 {
  font-family: var(--font-head);
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 10px;
  line-height: 1.15;
  position: relative;
}
.welcome-header p { color: var(--text-muted); font-size: 0.95rem; position: relative; }

.welcome-body {
  padding: 32px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}
.welcome-intro-text {
  color: var(--text-muted);
  font-size: 0.92rem;
  text-align: center;
  line-height: 1.6;
}
.welcome-actions { display: flex; flex-direction: column; gap: 12px; }
.welcome-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
}

/* ============================================================
   REGISTER PAGE (/register inline)
   ============================================================ */
#register-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: var(--bg);
  position: relative;
}
#register-app::before {
  content: '';
  position: fixed;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(108,99,255,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.reg-card {
  width: 100%;
  max-width: 500px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  animation: fadeInUp 0.5s ease both;
}
.reg-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--primary-g);
  border-radius: var(--radius) var(--radius) 0 0;
}
.reg-logo {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  opacity: 0.8;
}
.reg-event-name {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
}
.reg-event-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  margin-top: -8px;
}

/* Register progress steps */
.reg-steps {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 8px;
}
.reg-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  position: relative;
}
.reg-step::after {
  content: '';
  position: absolute;
  top: 15px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border2);
  z-index: 0;
}
.reg-step:last-child::after { display: none; }
.reg-step-num {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  z-index: 1;
  transition: all var(--transition);
}
.reg-step.active .reg-step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 16px rgba(108,99,255,0.4);
}
.reg-step.done .reg-step-num {
  background: var(--success);
  border-color: var(--success);
  color: var(--bg);
}
.reg-step-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.reg-step.active .reg-step-label { color: var(--primary); }
.reg-step.done .reg-step-label { color: var(--success); }

.reg-success {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
}
.reg-success .success-icon {
  font-size: 3.5rem;
  animation: trophyPop 0.6s cubic-bezier(0.4,0,0.2,1) both;
  filter: drop-shadow(0 0 20px rgba(67,232,183,0.4));
}
.reg-success h2 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
}
.reg-success p { color: var(--text-muted); font-size: 0.92rem; line-height: 1.6; }

.reg-code-display {
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 0.25em;
  color: var(--primary);
  background: rgba(108,99,255,0.1);
  border: 1px solid rgba(108,99,255,0.25);
  padding: 12px 28px;
  border-radius: 14px;
  box-shadow: 0 0 20px rgba(108,99,255,0.15);
}
.reg-play-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  background: var(--primary-g);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(108,99,255,0.35);
}
.reg-play-link:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(108,99,255,0.45); }

/* ============================================================
   LOADING TEXT & MISC
   ============================================================ */
.loading-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  text-align: center;
}
.card-emoji { font-size: 3rem; text-align: center; }
.session-card h3 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
}
.session-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.6;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 500px) {
  .screen-body, .welcome-body { padding: 32px; }
  .session-card { padding: 32px 28px; }
  .code-screen-body { padding: 48px 32px; }
}
@media (min-width: 700px) {
  .session-cards-wrap { padding: 28px 20px; }
  .session-card { max-width: 560px; margin: 0 auto; }
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 40px);
}
.toast {
  background: var(--surface3);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.3s cubic-bezier(0.4,0,0.2,1) both;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toast.success { border-color: rgba(67,232,183,0.3); color: var(--success); }
.toast.error   { border-color: rgba(255,101,132,0.3); color: var(--danger); }
.toast.info    { border-color: rgba(108,99,255,0.3); color: var(--primary); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   SCORE BADGE (session header)
   ============================================================ */
.session-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}
.score-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(67,232,183,0.12);
  color: var(--success);
  border: 1px solid rgba(67,232,183,0.25);
  letter-spacing: 0.02em;
  transition: all 0.3s ease;
}
.score-badge.pulse {
  animation: scorePulse 0.4s cubic-bezier(0.4,0,0.2,1);
}
@keyframes scorePulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); background: rgba(67,232,183,0.25); }
  100% { transform: scale(1); }
}

/* ============================================================
   FINISHED CARD — ENRICHIE
   ============================================================ */
.finished-score-block {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fsb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}
.fsb-label { color: var(--text-muted); }
.fsb-value {
  font-weight: 800;
  color: var(--success);
  font-size: 1rem;
}
.fsb-rank-badge {
  text-align: center;
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 800;
  padding: 12px;
  background: linear-gradient(135deg, rgba(108,99,255,0.12), rgba(255,209,102,0.08));
  border: 1px solid rgba(255,209,102,0.2);
  border-radius: var(--radius-sm);
  color: var(--joker);
  animation: rankReveal 0.6s cubic-bezier(0.4,0,0.2,1) 0.3s both;
}
.fsb-rank-badge.rank-top3 {
  border-color: rgba(255,209,102,0.4);
  background: linear-gradient(135deg, rgba(255,209,102,0.1), rgba(255,101,132,0.08));
  box-shadow: 0 0 24px rgba(255,209,102,0.15);
}
@keyframes rankReveal {
  0% { transform: scale(0.5) rotate(-5deg); opacity: 0; }
  60% { transform: scale(1.1) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* ============================================================
   CONFETTI
   ============================================================ */
.confetti-container {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  pointer-events: none;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  animation: confettiFall linear both;
  opacity: 0.9;
  user-select: none;
}
@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
    opacity: 1;
  }
  80% { opacity: 0.8; }
  100% {
    transform: translateY(220px) rotate(720deg) scale(0.5);
    opacity: 0;
  }
}

/* ============================================================
   LEADERBOARD
   ============================================================ */
.leaderboard-panel {
  width: 100%;
  background: var(--surface);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  animation: fadeInUp 0.3s ease both;
}
.lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border2);
}
.lb-title {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}
.lb-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color var(--transition);
}
.lb-close:hover { color: var(--text); }
.lb-loading, .lb-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 20px;
}
.leaderboard-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lb-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface2);
  font-size: 0.85rem;
  transition: background var(--transition);
}
.lb-entry.lb-me {
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.25);
}
.lb-entry.lb-top { background: rgba(255,209,102,0.06); }
.lb-rank {
  font-size: 1rem;
  min-width: 28px;
  text-align: center;
  font-weight: 800;
}
.lb-name {
  flex: 1;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-you {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(108,99,255,0.2);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: 4px;
}
.lb-team {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-score {
  font-weight: 800;
  color: var(--success);
  min-width: 50px;
  text-align: right;
  font-size: 0.9rem;
}
.lb-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 30px;
  text-align: right;
}
.finished-footer-text {
  padding: 16px 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ===== TEAM LEADERBOARD TABS ===== */
.lb-tabs {
  display: flex;
  gap: 6px;
  margin: 10px 0 14px;
  background: var(--surface2);
  border-radius: 12px;
  padding: 4px;
}
.lb-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  letter-spacing: 0.01em;
}
.lb-tab:hover {
  background: rgba(108,99,255,0.08);
  color: var(--text);
}
.lb-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(108,99,255,0.35);
}

/* ===== TEAM LEADERBOARD ENTRIES ===== */
.lb-team-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface2);
  border-radius: 12px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  transition: background 0.15s;
}
.lb-team-entry:first-child {
  background: rgba(255,209,102,0.08);
  border-color: rgba(255,209,102,0.25);
}
.lb-team-entry .lb-rank {
  font-size: 1.1rem;
  min-width: 30px;
}
.lb-team-name {
  flex: 1;
  font-weight: 800;
  color: var(--text);
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-team-members-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(108,99,255,0.1);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.lb-team-score {
  font-weight: 800;
  color: var(--success);
  font-size: 0.95rem;
  min-width: 55px;
  text-align: right;
}

/* ===== FINISHED CARD — TEAM BLOCK ===== */
.finished-team-block {
  background: linear-gradient(135deg, rgba(108,99,255,0.08) 0%, rgba(255,101,132,0.06) 100%);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: 16px;
  padding: 18px 20px;
  margin: 16px 0;
}
.ftb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.ftb-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ftb-team-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ftb-team-name::before {
  content: '👥';
  font-size: 1.2rem;
}
.ftb-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.ftb-stat {
  text-align: center;
  background: var(--surface2);
  border-radius: 10px;
  padding: 10px 6px;
  border: 1px solid var(--border);
}
.ftb-stat-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
}
.ftb-stat-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-top: 2px;
}
.ftb-rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface2);
  border-radius: 999px;
  padding: 4px 12px;
  border: 1px solid var(--border);
}
.ftb-lb-btn {
  width: 100%;
  padding: 10px;
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.25);
  color: var(--primary);
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.ftb-lb-btn:hover {
  background: rgba(108,99,255,0.2);
}

/* ===== LANG SELECTOR (play) ===== */
.lang-selector-floating {
  position: fixed;
  bottom: 20px;
  right: 16px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.lang-selector-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.lang-selector-btn:hover,
.lang-selector-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.lang-selector-toggle {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s;
}
.lang-selector-toggle:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.lang-selector-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  min-width: 130px;
}

/* ===== QUESTION HEADER + TIMER RING ===== */
.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.q-timer-ring {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}
.q-timer-ring svg { transform: none; }
.timer-circle {
  transition: stroke-dashoffset 0.9s linear, stroke 0.3s ease;
}
.q-timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.q-timer-ring.timer-urgent .q-timer-text {
  color: #FF3B30;
  animation: timerPulse 0.5s ease infinite alternate;
}
@keyframes timerPulse {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to   { opacity: 0.6; transform: translate(-50%, -50%) scale(1.15); }
}

/* ===== STREAK BADGE ===== */
.streak-badge {
  display: inline-block;
  background: linear-gradient(135deg, #FF6B35, #FF3B30);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  animation: streakPop 0.4s ease;
}
@keyframes streakPop {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== SCORE PULSE ===== */
.score-pulse {
  animation: scorePulse 0.6s ease;
}
@keyframes scorePulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.3); color: var(--success); }
  100% { transform: scale(1); }
}

/* ===== LIVE MESSAGE BANNER ===== */
.live-message-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  animation: slideDown 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes slideOut {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(-100%); opacity: 0; }
}
.lmb-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #6C63FF, #FF6584);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
}
.lmb-icon { font-size: 1.1rem; flex-shrink: 0; }
.lmb-text { flex: 1; line-height: 1.4; }
.lmb-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.lmb-close:hover { background: rgba(255,255,255,0.35); }

/* ===== SKELETON LOADER ===== */
.skeleton-loader {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sk-line {
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface2) 25%, rgba(255,255,255,0.06) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.sk-block {
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--surface2) 25%, rgba(255,255,255,0.06) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.sk-short { height: 38px; }
.sk-w80 { width: 80%; }
.sk-w60 { width: 60%; }
.sk-w40 { width: 40%; }
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== TOAST CONTAINER (update) ===== */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(380px, 90vw);
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: auto;
}
@keyframes toastIn {
  from { transform: translateY(20px) scale(0.9); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.toast.success { border-color: rgba(74,222,128,0.4); background: rgba(74,222,128,0.08); color: #4ade80; }
.toast.error   { border-color: rgba(248,113,113,0.4); background: rgba(248,113,113,0.08); color: #f87171; }
.toast.info    { border-color: rgba(108,99,255,0.4);  background: rgba(108,99,255,0.08);  color: var(--primary); }

/* ===== OPTION BUTTON — enhanced ===== */
.option-btn {
  position: relative;
  overflow: hidden;
}
.option-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.15) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.2s;
}
.option-btn:active::after { opacity: 1; }

/* ===== DEBRIEFING ===== */
.finished-debrief {
  width: 100%;
  background: rgba(108,99,255,0.06);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: 16px;
  overflow: hidden;
  margin: 12px 0;
}
.debrief-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}
.debrief-icon { font-size: 1.1rem; }
.debrief-title { flex: 1; font-weight: 700; font-size: 0.92rem; color: var(--text); }
.debrief-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}
.debrief-toggle:hover { background: rgba(255,255,255,0.06); }
.debrief-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.debrief-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid transparent;
}
.debrief-item.correct { border-left-color: #4ade80; }
.debrief-item.wrong   { border-left-color: #f87171; }
.debrief-item.joker   { border-left-color: #FFD166; }
.debrief-q-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700;
  flex-shrink: 0; margin-top: 1px;
}
.debrief-q-body { flex: 1; min-width: 0; }
.debrief-prompt { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 6px; line-height: 1.4; }
.debrief-answers { display: flex; flex-wrap: wrap; gap: 6px; }
.debrief-your-ans, .debrief-correct-ans { display: flex; align-items: center; gap: 6px; }
.debrief-label { font-size: 0.72rem; color: var(--text-muted); }
.debrief-val { font-size: 0.82rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.debrief-val.correct { color: #4ade80; background: rgba(74,222,128,0.1); }
.debrief-val.wrong   { color: #f87171; background: rgba(248,113,113,0.1); }
.debrief-val.joker   { color: #FFD166; background: rgba(255,209,102,0.1); }
.debrief-result-icon { font-size: 1rem; flex-shrink: 0; margin-top: 2px; }
.debrief-item.correct .debrief-result-icon { color: #4ade80; }
.debrief-item.wrong   .debrief-result-icon { color: #f87171; }
.debrief-item.joker   .debrief-result-icon { color: #FFD166; }
.debrief-empty { font-size: 0.82rem; color: var(--text-muted); text-align: center; padding: 12px 0; }

/* ===== WEB SHARE BUTTON ===== */
.btn-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(108,99,255,0.15), rgba(67,232,183,0.1));
  border: 1px solid rgba(108,99,255,0.3);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 8px 0;
}
.btn-share:hover {
  background: linear-gradient(135deg, rgba(108,99,255,0.25), rgba(67,232,183,0.15));
  transform: translateY(-1px);
}
.btn-share-icon { font-size: 1.1rem; }

/* ===== WAITING ENRICHED ===== */
.card-waiting-enriched { padding: 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.waiting-top { text-align: center; }
.waiting-animation { position: relative; width: 72px; height: 72px; margin: 0 auto 12px; }
.waiting-pulse-ring {
  position: absolute; inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(108,99,255,0.3);
  animation: wp-pulse 2s infinite;
}
@keyframes wp-pulse {
  0%,100% { transform: scale(0.9); opacity: 0.4; }
  50% { transform: scale(1.1); opacity: 0.8; }
}
.waiting-emoji { font-size: 2.5rem; line-height: 1; display: flex; align-items: center; justify-content: center; height: 100%; }
.waiting-presence {
  width: 100%;
  background: rgba(108,99,255,0.06);
  border: 1px solid rgba(108,99,255,0.15);
  border-radius: 14px;
  padding: 14px 16px;
}
.wp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.wp-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.wp-count { font-family: var(--font-head); font-size: 1.1rem; font-weight: 800; color: var(--primary); }
.wp-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.wp-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 0.8rem; font-weight: 800;
  position: relative;
  transition: transform 0.2s;
}
.wp-avatar.present { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; }
.wp-avatar.absent  { background: rgba(255,255,255,0.06); color: var(--text-muted); border: 1px dashed rgba(255,255,255,0.15); }
.wp-avatar.me { box-shadow: 0 0 0 2px var(--primary); }
.wp-dot {
  position: absolute; bottom: 0; right: 0;
  width: 10px; height: 10px;
  border-radius: 50%; background: #22c55e;
  border: 2px solid var(--bg);
}
.waiting-dots { display: flex; gap: 6px; }
.wd {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); opacity: 0.3;
  animation: wd-bounce 1.4s infinite;
}
.wd:nth-child(2) { animation-delay: 0.2s; }
.wd:nth-child(3) { animation-delay: 0.4s; }
@keyframes wd-bounce { 0%,80%,100%{transform:scale(0.6);opacity:0.3} 40%{transform:scale(1);opacity:1} }

/* ===== LEADERBOARD SPARK BARS ===== */
.lb-entry-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lb-entry-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lb-spark-wrap {
  height: 4px;
  background: rgba(108,99,255,0.15);
  border-radius: 2px;
  overflow: hidden;
  width: 100%;
}
.lb-spark-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  animation: spark-grow 0.8s ease forwards;
}
@keyframes spark-grow { from { width: 0 !important; } }
.lb-entry { display: flex; align-items: center; gap: 10px; }
.lb-entry .lb-score { margin-left: auto; flex-shrink: 0; }

/* ===== CLUE 3D FLIP ===== */
.clue-box { perspective: 800px; }
@keyframes clue-flip-out {
  0% { transform: rotateY(0deg); opacity: 1; }
  100% { transform: rotateY(-90deg); opacity: 0; }
}
@keyframes clue-flip-in-anim {
  0% { transform: rotateY(90deg); opacity: 0; }
  100% { transform: rotateY(0deg); opacity: 1; }
}
@keyframes clue-reveal-anim {
  0% { opacity: 0; transform: translateY(8px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.clue-flip { animation: clue-flip-out 0.25s ease forwards; }
.clue-flip-in { animation: clue-flip-in-anim 0.4s ease forwards; }
.clue-reveal { animation: clue-reveal-anim 0.5s ease forwards; }

/* ===== ORGANIZER SPINNER ===== */
.btn-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ============================================================
   OFFLINE BANNER (Bug 1.2)
   ============================================================ */
#offline-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background: #FF3B30;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
#offline-banner.visible { transform: translateY(0); }
.ob-icon { font-size: 1rem; }

/* ============================================================
   STAGE TRANSITION OVERLAY (Bug 1.9)
   ============================================================ */
.stage-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(10, 9, 20, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.stage-overlay.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.stage-overlay.leaving {
  opacity: 0;
  transform: scale(1.04);
}
.stage-overlay-inner {
  text-align: center;
  padding: 40px 32px;
  max-width: 320px;
}
.stage-overlay-badge {
  display: inline-block;
  background: var(--primary, #6C63FF);
  color: #fff;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.stage-overlay-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.2;
}
.stage-overlay-sub {
  color: rgba(255,255,255,0.55);
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.stage-overlay-bar {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.stage-overlay-progress {
  height: 100%;
  background: var(--primary, #6C63FF);
  border-radius: 2px;
  animation: overlay-progress 2.8s linear forwards;
}
@keyframes overlay-progress { from { width: 0%; } to { width: 100%; } }

/* ============================================================
   JOKER PULSE animation (Bug 1.10)
   ============================================================ */
@keyframes joker-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 101, 132, 0.6); transform: scale(1); }
  50%       { box-shadow: 0 0 0 10px rgba(255, 101, 132, 0);  transform: scale(1.06); }
}
.btn-joker.joker-pulse {
  animation: joker-pulse 1.4s ease-in-out infinite;
}

/* ============================================================
   TYPEWRITER cursor (Bug 1.8)
   ============================================================ */
.typewriter-active::after {
  content: '|';
  display: inline-block;
  color: var(--primary, #6C63FF);
  animation: tw-blink 0.7s step-end infinite;
  margin-left: 1px;
}
@keyframes tw-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ============================================================
   WAITING empty state (Bug 1.6)
   ============================================================ */
.wp-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 0;
  color: rgba(255,255,255,0.4);
}
.wp-empty-icon { font-size: 2rem; }
.wp-empty-text { font-size: 0.85rem; }

/* ============================================================
   Score bonus badge (Bug 1.11)
   ============================================================ */
.fsb-bonus {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #43E8B7;
  background: rgba(67, 232, 183, 0.15);
  border: 1px solid rgba(67, 232, 183, 0.3);
  border-radius: 10px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ============================================================
   Organizer refresh indicator (Bug 2.1)
   ============================================================ */
#org-refresh-indicator {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  padding: 3px 8px;
  border-radius: 6px;
  transition: color 0.3s;
}
#org-refresh-indicator:not(:empty) { color: #43E8B7; }

/* ============================================================
   Session expirée — message contextuel (Bug 1.3 / 7.2)
   ============================================================ */
.form-msg.info {
  color: var(--primary);
  background: rgba(108, 99, 255, 0.08);
  border: 1px solid rgba(108, 99, 255, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  line-height: 1.5;
}
.form-msg.info strong { font-weight: 700; letter-spacing: 0.05em; }

.session-expired-msg {
  animation: fadeInDown 0.4s ease;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── D9 My Answers panel ─────────────────────────────────── */
.my-answers-panel { margin-top: 16px; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,0.08); }
.mar-toggle {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: rgba(255,255,255,0.04);
  border: none; cursor: pointer; color: var(--text, #e2e8f0);
  font-size: 0.88rem; font-weight: 600; text-align: left;
}
.mar-toggle:hover { background: rgba(255,255,255,0.07); }
.mar-score { margin-left: auto; font-size: 0.8rem; padding: 2px 8px; border-radius: 20px; background: rgba(108,99,255,0.2); color: #a78bfa; font-weight: 700; }
.mar-chevron { font-size: 0.7rem; color: rgba(255,255,255,0.4); }
.mar-list { list-style: none; margin: 0; padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 4px; background: rgba(0,0,0,0.12); }
.mar-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; font-size: 0.8rem; }
.mar-ok { background: rgba(74,222,128,0.06); }
.mar-ko { background: rgba(248,113,113,0.07); }
.mar-joker { background: rgba(250,204,21,0.06); }
.mar-icon { font-size: 0.9rem; flex-shrink: 0; }
.mar-prompt { flex: 1; color: rgba(255,255,255,0.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mar-chosen { font-weight: 600; color: rgba(255,255,255,0.9); flex-shrink: 0; }
.mar-badge { font-size: 0.72rem; padding: 1px 7px; border-radius: 12px; }
.mar-skip { background: rgba(250,204,21,0.15); color: #facc15; }

/* ── D5 Stage Map (Leaflet) ──────────────────────────────── */
.stage-map-container { margin: 12px 0; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); }
.map-label { padding: 6px 12px; background: rgba(255,255,255,0.04); font-size: 0.8rem; color: rgba(255,255,255,0.7); font-weight: 600; }
.stage-map { height: 180px; width: 100%; }
