/* ============================================================
   EGGPLORER — Styles principaux
   Mobile-first PWA · Pâques 2026
   ============================================================ */

/* ─── Reset & Variables ─────────────────────────────────── */
:root {
  --cream: #fdf6ec;
  --white: #ffffff;
  --green: #4a7c59;
  --green-dark: #2d5a3d;
  --green-light: #e8f0eb;
  --orange: #e07b39;
  --orange-light: #fdf0e8;
  --gold: #c9a84c;
  --brown: #6b4c2a;
  --red: #c0392b;
  --purple: #7c5cbf;
  --purple-light: #f3f0fc;
  --pink: #c2547a;
  --blue: #4a90d9;
  --text: #1e1e1e;
  --text-soft: #666;
  --text-muted: #aaa;
  --border: #e8e0d5;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html {
  height: 100%;
}
body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--cream);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* ─── Screens ───────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  background: var(--cream);
  overflow: hidden;
  z-index: 1;
  /* Safe area pour les téléphones avec encoche */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.screen.active { display: flex; }

.hidden { display: none !important; }

/* ─── Boutons base ──────────────────────────────────────── */
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
button:active { opacity: 0.85; transform: scale(0.98); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  transition: all 0.18s ease;
  border: 2px solid transparent;
  text-align: center;
  white-space: nowrap;
}

.btn-primary {
  background: var(--green-dark);
  color: white;
  box-shadow: 0 4px 14px rgba(45,90,61,0.35);
}
.btn-primary:hover { background: var(--green); }
.btn-primary:disabled { background: #ccc; box-shadow: none; cursor: not-allowed; opacity: 0.6; }

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--border);
}
.btn-ghost:hover { background: rgba(0,0,0,0.04); }

.btn-danger {
  background: var(--red);
  color: white;
}

.btn-xl {
  width: 100%;
  padding: 18px 24px;
  font-size: 18px;
  border-radius: var(--radius);
}

.btn-sm { font-size: 13px; padding: 8px 16px; }

.btn-add {
  width: 48px; height: 48px; padding: 0;
  background: var(--green-dark);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 24px; font-weight: 300;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.btn-oracle {
  background: linear-gradient(135deg, #7c5cbf, #4a1a7a);
  box-shadow: 0 4px 14px rgba(124,92,191,0.4);
}
.btn-scanner {
  background: var(--green-dark);
}

/* ─── Toast ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1e1e1e;
  color: white;
  padding: 12px 20px;
  border-radius: 50px;
  font-size: 14px;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 90vw;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.toast.visible { transform: translateX(-50%) translateY(0); }

/* ─── Modal ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 12px max(24px, env(safe-area-inset-bottom));
}
.modal-box {
  background: white;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 480px;
  text-align: center;
}
.modal-icon { font-size: 40px; margin-bottom: 12px; }
.modal-box h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.modal-box p { font-size: 14px; color: var(--text-soft); margin-bottom: 12px; }
.modal-location {
  background: var(--orange-light);
  border: 1px solid #f5d5bb;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 14px;
  font-style: italic;
  margin-bottom: 20px;
  color: var(--brown);
}
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

/* ══════════════════════════════════════════════════════════
   ÉCRAN 1 — SPLASH
══════════════════════════════════════════════════════════ */
#screen-splash {
  background: linear-gradient(160deg, var(--green-dark) 0%, var(--green) 55%, #6ba37a 100%);
  overflow: hidden;
}

.splash-bg {
  position: absolute; inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.splash-eggs {
  position: absolute; inset: 0;
}

.egg {
  position: absolute;
  font-size: clamp(24px, 8vw, 48px);
  animation: floatEgg 6s ease-in-out infinite;
  opacity: 0.25;
  user-select: none;
}
.egg-1 { top: 8%;  left: 12%;  animation-delay: 0s; }
.egg-2 { top: 15%; right: 10%; animation-delay: 1.2s; }
.egg-3 { top: 70%; left: 5%;   animation-delay: 0.6s; }
.egg-4 { top: 75%; right: 8%;  animation-delay: 2s; font-size: 40px; }
.egg-5 { top: 45%; right: 20%; animation-delay: 0.9s; }

@keyframes floatEgg {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50%       { transform: translateY(-16px) rotate(8deg); }
}

.splash-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  height: 100%;
  padding: 60px 32px 40px;
}

.splash-logo { text-align: center; }
.logo-icon { font-size: 72px; margin-bottom: 12px; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2)); }
.logo-text {
  font-size: 52px; font-weight: 900; color: white;
  letter-spacing: -2px; line-height: 1;
  font-family: Georgia, 'Times New Roman', serif;
}
.logo-text span { color: var(--gold); }
.logo-tagline {
  font-size: 15px; color: rgba(255,255,255,0.75);
  letter-spacing: 3px; text-transform: uppercase;
  margin-top: 10px;
}

.splash-body { width: 100%; }
.splash-features {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.feature-pill {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  font-size: 13px; font-weight: 600;
  padding: 8px 14px;
  border-radius: 50px;
}

.splash-footer { width: 100%; text-align: center; }
.splash-credits { color: rgba(255,255,255,0.4); font-size: 12px; margin-top: 12px; }

/* ══════════════════════════════════════════════════════════
   ÉCRAN 2 — SETUP
══════════════════════════════════════════════════════════ */
#screen-setup {
  overflow: hidden;
}

/* Barre de progression */
.setup-header {
  background: white;
  padding: 16px 24px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.setup-progress-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 0;
}

.setup-step-dot {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 60px;
}
.setup-step-dot span {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s ease;
}
.setup-step-dot label {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.setup-step-dot.active span {
  background: var(--green-dark);
  color: white;
  box-shadow: 0 2px 8px rgba(45,90,61,0.4);
}
.setup-step-dot.active label { color: var(--green-dark); font-weight: 700; }

.setup-step-line {
  flex: 1; height: 2px;
  background: var(--border);
  margin-bottom: 13px;
  max-width: 48px;
}

/* Step content */
.setup-step {
  flex: 1; overflow-y: auto;
  padding: 24px 20px;
  -webkit-overflow-scrolling: touch;
}

.setup-step-header { text-align: center; margin-bottom: 28px; }
.step-emoji { font-size: 44px; margin-bottom: 8px; }
.setup-step-header h2 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.setup-step-header p { font-size: 14px; color: var(--text-soft); }

/* Player input */
.player-add-row {
  display: flex; gap: 10px; margin-bottom: 8px;
}
.player-add-row input {
  flex: 1;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  font-size: 16px;
  font-family: var(--font);
  background: white;
  color: var(--text);
  transition: border-color 0.2s;
}
.player-add-row input:focus {
  outline: none;
  border-color: var(--green);
}

.input-error { color: var(--red); font-size: 13px; margin-bottom: 10px; }

.player-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 24px; }
.player-item {
  display: flex; align-items: center; gap: 12px;
  background: white;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  animation: slideIn 0.25s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.player-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: white; font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.player-name { flex: 1; font-weight: 700; font-size: 16px; }
.btn-remove-player {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #f0f0f0; color: var(--text-soft);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.btn-remove-player:hover { background: #fde8e8; color: var(--red); }

/* Difficulty cards */
.difficulty-options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.difficulty-card {
  display: flex; align-items: center; gap: 16px;
  background: white;
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: all 0.2s ease;
  width: 100%;
}
.difficulty-card.selected {
  border-color: var(--green-dark);
  background: var(--green-light);
  box-shadow: 0 0 0 4px rgba(45,90,61,0.12);
}
.diff-icon { font-size: 36px; flex-shrink: 0; }
.diff-name { font-size: 18px; font-weight: 800; color: var(--text); }
.diff-meta { font-size: 13px; color: var(--text-soft); margin-top: 2px; }

/* Weather cards */
.weather-options { display: flex; gap: 12px; margin-bottom: 28px; }
.weather-card {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 12px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.weather-card.selected {
  border-color: var(--green-dark);
  background: var(--green-light);
  box-shadow: 0 0 0 4px rgba(45,90,61,0.12);
}
.weather-icon { font-size: 42px; }
.weather-label { font-size: 15px; font-weight: 800; }
.weather-sub { font-size: 11px; color: var(--text-soft); text-align: center; }

/* Nav buttons */
.setup-nav { display: flex; justify-content: flex-end; padding-bottom: 8px; }
.setup-nav.two-col { justify-content: space-between; }
.setup-nav .btn { min-width: 130px; }

/* ══════════════════════════════════════════════════════════
   ÉCRAN 3 — COMPTE À REBOURS
══════════════════════════════════════════════════════════ */
#screen-countdown {
  background: linear-gradient(160deg, var(--green-dark), var(--green));
  align-items: center; justify-content: center;
}

.countdown-wrapper { text-align: center; }
.countdown-label { color: rgba(255,255,255,0.75); font-size: 18px; margin-bottom: 16px; letter-spacing: 1px; }

.countdown-number {
  font-size: 120px;
  font-weight: 900;
  color: white;
  line-height: 1;
  font-family: Georgia, serif;
  text-shadow: 0 6px 24px rgba(0,0,0,0.25);
  transition: none;
}
.countdown-number.pop {
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn {
  0%   { transform: scale(0.4); opacity: 0.3; }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1);   opacity: 1; }
}

.countdown-eggs { font-size: 32px; margin-top: 24px; opacity: 0.6; letter-spacing: 8px; }

/* ══════════════════════════════════════════════════════════
   ÉCRAN 4 — ÉNIGME
══════════════════════════════════════════════════════════ */
#screen-enigma { background: var(--cream); }

/* Barre de statut */
.game-statusbar {
  display: flex; align-items: center; gap: 12px;
  background: white;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.status-left {
  display: flex; align-items: center; gap: 5px;
  min-width: 70px;
}
.timer-icon { font-size: 14px; }
.timer-display {
  font-size: 16px; font-weight: 700;
  font-family: 'Courier New', monospace;
  color: var(--text);
  min-width: 45px;
}

.status-center {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.progress-bar-outer {
  width: 100%; height: 6px;
  background: var(--border);
  border-radius: 3px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold));
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.progress-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }

.status-right { min-width: 56px; text-align: right; }
.score-display {
  font-size: 14px; font-weight: 800;
  color: var(--green-dark);
  background: var(--green-light);
  padding: 4px 10px;
  border-radius: 20px;
}

/* Scroll container */
.enigma-scroll {
  flex: 1; overflow-y: auto;
  padding: 16px 16px 24px;
  -webkit-overflow-scrolling: touch;
}

/* Carte énigme */
.enigma-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid rgba(0,0,0,0.04);
}

.enigma-card-header {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 20px 0;
}

.enigma-number-badge {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--green-dark);
  color: white;
  font-size: 22px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-family: Georgia, serif;
}

.enigma-header-text { flex: 1; padding-top: 2px; }

.enigma-type-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 5px;
}
.badge-text    { background: var(--green-light); color: var(--green-dark); }
.badge-vocal   { background: #fce8f3; color: #c2547a; }
.badge-reverse { background: var(--purple-light); color: var(--purple); }

.enigma-title {
  font-size: 17px; font-weight: 800;
  line-height: 1.3;
  font-family: Georgia, 'Times New Roman', serif;
}

.enigma-body { padding: 16px 20px 0; }
.enigma-text {
  font-size: 16px; line-height: 1.8;
  color: var(--text);
  font-style: italic;
  white-space: pre-wrap;
}

/* Lecteur vocal */
.vocal-section {
  margin: 16px 20px 0;
  background: linear-gradient(135deg, #fdf4f9, #f9f0fc);
  border: 1px solid #f0d0e8;
  border-radius: var(--radius-sm);
  padding: 14px;
}
.vocal-header {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 12px;
}
.vocal-icon { font-size: 24px; flex-shrink: 0; }
.vocal-title { font-size: 14px; font-weight: 700; color: var(--purple); }
.listen-counter { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.listen-counter.warning { color: var(--red); font-weight: 700; }

.audio-player {
  display: flex; align-items: center; gap: 10px;
}
.btn-play-audio {
  padding: 10px 16px;
  background: var(--purple);
  color: white;
  border-radius: var(--radius-xs);
  font-size: 13px; font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s;
}
.btn-play-audio:hover { background: #6a4dad; }
.btn-play-audio:disabled { background: #ccc; }

.audio-progress-bar {
  flex: 1; height: 6px;
  background: rgba(124,92,191,0.2);
  border-radius: 3px; overflow: hidden;
}
.audio-progress-fill {
  height: 100%;
  background: var(--purple);
  border-radius: 3px;
  transition: width 0.2s linear;
  width: 0%;
}
.audio-time { font-size: 12px; color: var(--text-muted); font-family: monospace; flex-shrink: 0; }

/* Indices */
.hints-section { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 8px; }

.hint-block { display: flex; flex-direction: column; gap: 6px; }
.btn-hint {
  display: flex; align-items: center; gap: 8px;
  background: var(--orange-light);
  border: 1px dashed #e8b887;
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  font-size: 13px; font-weight: 700; color: var(--brown);
  text-align: left; width: 100%;
  transition: background 0.2s;
}
.btn-hint:hover { background: #fde8d0; }
.btn-hint-2 { background: var(--purple-light); border-color: #d4c8f8; color: var(--purple); }
.btn-hint-2:hover { background: #e8e0fa; }
.hint-icon { font-size: 16px; flex-shrink: 0; }

.hint-text {
  background: rgba(0,0,0,0.03);
  border-left: 3px solid var(--orange);
  padding: 10px 12px;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  font-size: 14px; line-height: 1.6;
  color: var(--text-soft);
  animation: fadeSlide 0.3s ease;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Actions énigme */
.enigma-actions {
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
}
.enigma-actions .btn-primary { width: 100%; }
.enigma-actions .btn-ghost { width: 100%; color: var(--text-muted); border-color: transparent; }

/* ══════════════════════════════════════════════════════════
   ÉCRAN 5 — SCANNER QR
══════════════════════════════════════════════════════════ */
#screen-scanner {
  background: #0a0a0a;
  align-items: center; justify-content: space-between;
  padding-top: calc(env(safe-area-inset-top) + 20px);
  padding-bottom: calc(env(safe-area-inset-bottom) + 24px);
}

.scanner-wrapper {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; width: 100%; padding: 0 24px;
}

.scanner-header { text-align: center; }
.scanner-header h2 { color: white; font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.scanner-header p  { color: rgba(255,255,255,0.6); font-size: 14px; }

.scanner-viewport {
  position: relative;
  width: min(320px, 85vw);
  height: min(320px, 85vw);
  border-radius: var(--radius);
  overflow: hidden;
  background: #111;
}

.scanner-video {
  width: 100%; height: 100%;
  object-fit: cover;
}
.scanner-canvas { position: absolute; inset: 0; display: none; }

/* Cadre de scan avec coins */
.scanner-frame {
  position: absolute; inset: 0;
  pointer-events: none;
}
.corner {
  position: absolute;
  width: 28px; height: 28px;
  border-color: white;
  border-style: solid;
}
.corner.tl { top: 16px; left: 16px; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.corner.tr { top: 16px; right: 16px; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.corner.bl { bottom: 16px; left: 16px; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.corner.br { bottom: 16px; right: 16px; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }

.scanner-laser {
  position: absolute; left: 16px; right: 16px; height: 2px;
  background: rgba(255,70,70,0.8);
  top: 50%;
  box-shadow: 0 0 8px 2px rgba(255,70,70,0.5);
  animation: scanLaser 2.5s ease-in-out infinite;
}
@keyframes scanLaser {
  0%   { top: 15%; opacity: 1; }
  50%  { top: 85%; opacity: 1; }
  100% { top: 15%; opacity: 1; }
}

.scanner-msg {
  color: rgba(255,255,255,0.8);
  font-size: 14px; text-align: center;
  padding: 8px 16px;
  background: rgba(255,255,255,0.1);
  border-radius: 50px;
}
.scanner-msg.error {
  color: #ff8080;
  background: rgba(255,80,80,0.12);
}

#screen-scanner .btn-ghost {
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.2);
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════
   ÉCRAN 6 — QUI A TROUVÉ ?
══════════════════════════════════════════════════════════ */
#screen-who-found {
  background: linear-gradient(160deg, var(--green-dark), #4a9060);
  align-items: center; justify-content: center;
}

.who-found-wrapper {
  width: 100%; max-width: 420px;
  padding: 24px 20px;
  display: flex; flex-direction: column; align-items: center;
  gap: 0;
}

.who-found-header { text-align: center; margin-bottom: 20px; }
.who-found-anim {
  font-size: 56px;
  animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
  margin-bottom: 8px;
}
@keyframes bounceIn {
  from { transform: scale(0.2); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.who-found-header h2 { color: white; font-size: 26px; font-weight: 900; }
.who-found-enigma-label {
  color: rgba(255,255,255,0.65);
  font-size: 13px; margin-top: 4px;
}

.who-found-question {
  color: rgba(255,255,255,0.9);
  font-size: 16px; font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

.who-found-players {
  display: flex; flex-direction: column; gap: 10px;
  width: 100%;
}

.player-found-btn {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: white; font-size: 17px; font-weight: 700;
  text-align: left; width: 100%;
  backdrop-filter: blur(4px);
  transition: background 0.2s;
}
.player-found-btn:hover { background: rgba(255,255,255,0.25); }

.player-avatar-lg {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  font-size: 20px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.pts-badge {
  margin-left: auto;
  background: var(--gold);
  color: white;
  font-size: 13px; font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
}

.btn-found-all {
  width: 100%; padding: 14px;
  background: transparent;
  border: 1.5px dashed rgba(255,255,255,0.4);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  font-size: 15px; font-weight: 600;
  margin-top: 4px;
  transition: all 0.2s;
}
.btn-found-all:hover { background: rgba(255,255,255,0.1); color: white; }

/* ══════════════════════════════════════════════════════════
   ÉCRAN 7 — FINALE
══════════════════════════════════════════════════════════ */
#screen-finale { overflow: hidden; }

.confetti-container {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.confetti-piece {
  position: absolute; top: -20px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { top: -20px; opacity: 1; }
  80%  { opacity: 1; }
  100% { top: 100vh; opacity: 0; }
}

.finale-scroll {
  position: relative; z-index: 1;
  flex: 1; overflow-y: auto;
  padding: 0 16px 32px;
  -webkit-overflow-scrolling: touch;
}

.finale-hero {
  background: linear-gradient(160deg, var(--green-dark), var(--green));
  color: white;
  text-align: center;
  padding: 48px 20px 32px;
  margin: 0 -16px 24px;
}
.finale-trophy { font-size: 72px; margin-bottom: 12px; }
.finale-title { font-size: 28px; font-weight: 900; font-family: Georgia, serif; }
.finale-subtitle { font-size: 14px; color: rgba(255,255,255,0.7); margin-top: 8px; letter-spacing: 1px; }

.finale-stats {
  display: flex; gap: 12px; margin-bottom: 24px;
}
.finale-stat {
  flex: 1; background: white;
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.finale-stat.highlight {
  background: var(--green-dark);
  border-color: var(--green-dark);
}
.fstat-val {
  font-size: 26px; font-weight: 900;
  color: var(--text);
  font-family: Georgia, serif;
}
.finale-stat.highlight .fstat-val { color: var(--gold); }
.fstat-lbl {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px; margin-top: 3px;
}
.finale-stat.highlight .fstat-lbl { color: rgba(255,255,255,0.6); }

.finale-section { margin-bottom: 20px; }
.section-title {
  font-size: 16px; font-weight: 800;
  margin-bottom: 10px; color: var(--text);
}

.scoreboard { display: flex; flex-direction: column; gap: 8px; }
.score-row {
  display: flex; align-items: center; gap: 12px;
  background: white;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.score-row.first {
  border-color: var(--gold);
  background: linear-gradient(135deg, #fffbee, #fff8e0);
  box-shadow: 0 2px 10px rgba(201,168,76,0.25);
}
.score-rank { font-size: 20px; width: 28px; text-align: center; }
.score-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: white; font-size: 16px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.score-name { flex: 1; font-weight: 700; font-size: 16px; }
.score-pts { font-weight: 900; font-size: 18px; color: var(--green-dark); }

.recap-table { display: flex; flex-direction: column; gap: 6px; }
.recap-row {
  display: grid;
  grid-template-columns: 32px 1fr 60px 44px;
  align-items: center; gap: 8px;
  background: white;
  border-radius: var(--radius-xs);
  padding: 9px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
}
.recap-num  { font-weight: 800; color: var(--text-muted); font-size: 12px; }
.recap-title { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-found { font-size: 12px; color: var(--green-dark); font-weight: 700; text-align: center; }
.recap-time  { font-size: 12px; color: var(--text-muted); font-family: monospace; text-align: right; }

.treasure-card {
  background: linear-gradient(135deg, #fdf8e0, #fdf0d0);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
}
.treasure-icon { font-size: 44px; margin-bottom: 8px; }
.treasure-card h3 { font-size: 17px; font-weight: 800; color: var(--brown); margin-bottom: 8px; }
.treasure-card p { font-size: 14px; line-height: 1.7; color: var(--brown); }

.finale-actions { padding-bottom: 8px; }
.finale-actions .btn-primary { width: 100%; }


/* ══════════════════════════════════════════════════════════
   BLOC-NOTES FLOTTANT
══════════════════════════════════════════════════════════ */

/* Bouton FAB */
.notepad-fab {
  position: fixed;
  bottom: 28px;
  right: 20px;
  z-index: 9999;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9813e, #7b4f1e);
  box-shadow: 0 4px 16px rgba(123,79,30,0.45);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
  border: none;
}
.notepad-fab:hover { transform: scale(1.08); box-shadow: 0 6px 22px rgba(123,79,30,0.55); }
.notepad-fab.open  { transform: rotate(45deg) scale(1.05); }
.fab-icon { font-size: 24px; pointer-events: none; transition: inherit; }
.notepad-fab.open .fab-icon { filter: brightness(0) invert(1); }

/* Popup */
.notepad-popup {
  position: fixed;
  bottom: 92px;
  right: 16px;
  z-index: 9998;
  width: min(340px, calc(100vw - 32px));
  background: white;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  border: 1px solid rgba(0,0,0,0.07);
  overflow: hidden;
  display: flex; flex-direction: column;
  transform-origin: bottom right;
  transition: opacity 0.22s ease, transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
  max-height: min(460px, 62vh);
}
.notepad-popup.hidden {
  opacity: 0;
  transform: scale(0.7) translateY(16px);
  pointer-events: none;
}
.notepad-popup:not(.hidden) {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Handle */
.notepad-handle {
  width: 36px; height: 4px;
  background: #ddd; border-radius: 2px;
  margin: 8px auto 0;
  flex-shrink: 0;
}

/* Header */
.notepad-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px 0;
  flex-shrink: 0;
}
.notepad-tabs { display: flex; gap: 6px; }
.np-tab {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px; font-weight: 700;
  color: var(--text-soft);
  background: #f2f2f2;
  border: none;
  transition: all 0.18s ease;
}
.np-tab.active {
  background: var(--green-dark);
  color: white;
  box-shadow: 0 2px 8px rgba(45,90,61,0.3);
}
.np-clear {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #fff0f0;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  border: none;
  transition: background 0.15s;
  cursor: pointer;
}
.np-clear:hover { background: #ffd5d5; }

/* Panneaux */
.np-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.np-panel.hidden { display: none; }

/* Textarea */
#notepad-textarea {
  flex: 1;
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 15px; line-height: 1.65;
  color: var(--text);
  border: none; outline: none;
  resize: none;
  background: white;
  min-height: 220px;
  max-height: 340px;
}
#notepad-textarea::placeholder { color: #ccc; font-style: italic; }

/* Toolbar dessin */
.draw-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
  gap: 10px;
  flex-shrink: 0;
}
.draw-colors { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.color-swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #999;
}
.color-swatch:hover { transform: scale(1.2); }
.color-swatch.active { border-color: #333; transform: scale(1.15); box-shadow: 0 0 0 2px rgba(0,0,0,0.1); }
.color-swatch.eraser.active { border-color: #e63946; }

.draw-sizes { display: flex; gap: 5px; align-items: center; }
.size-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #f2f2f2;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.size-btn span {
  border-radius: 50%;
  background: #555;
  display: block;
  flex-shrink: 0;
}
.size-btn.active { background: #e8f0eb; border-color: var(--green-dark); }
.size-btn:hover  { background: #e0e0e0; }

/* Canvas */
.draw-canvas {
  flex: 1;
  display: block;
  width: 100%;
  touch-action: none;
  cursor: crosshair;
  background: #fdfcfa;
  min-height: 200px;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
