/* ============================================================
   BASSAM, MÉMOIRES D'UNE CAPITALE — Styles
   Aesthetic: Colonial journal revisited · Ivorian soul
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400;1,700&family=Lora:ital,wght@0,400;0,500;1,400&family=Special+Elite&display=swap');

/* ── VARIABLES ────────────────────────────────────────────── */
:root {
  /* Ivorian palette — orange, green, white + colonial sepia */
  --orange:       #E8640A;
  --orange-light: #F5904A;
  --orange-pale:  #FDE8D4;
  --green:        #1A6B3A;
  --green-light:  #2A9B56;
  --green-pale:   #D4F0E0;
  --ivory:        #F5EDD8;
  --parchment:    #EDE0C4;
  --sepia:        #8B6914;
  --sepia-dark:   #4A3208;
  --sepia-mid:    #6B4E1A;
  --ink:          #1C1208;
  --ink-light:    #3D2A0A;
  --red-life:     #C0392B;
  --gold:         #C9A227;
  --gold-light:   #F0D060;

  /* Act colors */
  --act1: #8B5E3C;
  --act2: #C4992A;
  --act3: #1A6B3A;

  /* Functional */
  --correct:  #1A6B3A;
  --wrong:    #C0392B;
  --neutral:  #8B6914;

  /* Shadows */
  --shadow-paper: 2px 4px 12px rgba(74,50,8,0.25);
  --shadow-deep:  4px 8px 24px rgba(28,18,8,0.4);
}

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  overflow: hidden;
}

body {
  height: 100%;
  font-family: 'Lora', Georgia, serif;
  background: var(--ink);
  color: var(--ink);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ── PAPER TEXTURE ────────────────────────────────────────── */
.paper {
  background: var(--parchment);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* ── AR SCENE ─────────────────────────────────────────────── */
#ar-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#ar-scene canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ── SCREEN MANAGER ───────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  z-index: 10;  /* au-dessus de ar-container (z:5) sauf screen-game */
  display: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex-direction: column;
}

/* screen-game est transparent — la caméra AR apparaît en fond */
#screen-game {
  background: transparent !important;
  z-index: 6; /* juste au-dessus de la scène AR (z:5) */
  display: none;
  flex-direction: column;
  pointer-events: none; /* le HUD capte les events, pas le fond transparent */
}

/* Les éléments du HUD restent cliquables */
#screen-game .hud-top,
#screen-game .hud-timer,
#screen-game .bottom-panel,
#screen-game #compass-wrap,
#screen-game #nearby-alert,
#screen-game #koko-container {
  pointer-events: auto;
}

/* Conteneur AR */
#ar-container {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: none;
  background: #000;
}

.screen.active { display: flex; }

/* Animation entrée/sortie */
.screen.slide-in {
  animation: screenIn 0.35s cubic-bezier(0.22,1,0.36,1) forwards;
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── ══════════════════════════════════════════════════════ */
/*    ÉCRAN 0 — LOGO SPLASH (illumination bas → haut)        */
/* ══════════════════════════════════════════════════════════ */
#screen-logo {
  background: #040302;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.logo-reveal-wrap {
  width: 100%;
  max-width: 420px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ── ══════════════════════════════════════════════════════ */
/*    ÉCRAN 1 — SPLASH / PRÉSENTATION DU JEU                 */
/* ══════════════════════════════════════════════════════════ */
#screen-splash {
  align-items: center;
  justify-content: flex-start;
  background: #080604;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(232,100,10,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(26,107,58,0.08) 0%, transparent 45%);
  padding-bottom: 32px;
  overflow-y: auto;
}

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

.splash-logo-img {
  width: 220px;
  max-width: 80%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.splash-logo-mini {
  display: flex;
  align-items: baseline;
  gap: 0;
  margin: 48px 0 16px;
}

.splash-h {
  font-family: 'Playfair Display', serif;
  font-size: 3.2rem;
  font-weight: 900;
  font-style: italic;
  color: var(--gold);
  line-height: 1;
}

.splash-brand {
  font-family: 'Special Elite', cursive;
  font-size: 1.8rem;
  color: var(--ivory);
  letter-spacing: 0.08em;
}

.splash-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  margin: 16px auto;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(245,237,216,0.04);
  border: 1px solid rgba(245,237,216,0.08);
  border-radius: 4px;
  font-family: 'Special Elite', cursive;
  font-size: 0.65rem;
  color: var(--sepia);
  letter-spacing: 0.06em;
}

.feature-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.splash-content {
  position: relative;
  text-align: center;
  padding: 0 28px;
  z-index: 2;
  width: 100%;
  max-width: 400px;
}

.splash-flag {
  display: flex;
  gap: 0;
  width: 60px;
  height: 6px;
  margin: 0 auto 24px;
  border-radius: 3px;
  overflow: hidden;
}
.splash-flag span:nth-child(1) { flex: 1; background: var(--orange); }
.splash-flag span:nth-child(2) { flex: 1; background: white; }
.splash-flag span:nth-child(3) { flex: 1; background: var(--green); }

.splash-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 900;
  font-style: italic;
  color: var(--ivory);
  line-height: 1.1;
  margin-bottom: 8px;
  text-shadow: 0 2px 20px rgba(232,100,10,0.4);
}

.splash-subtitle {
  font-family: 'Special Elite', cursive;
  font-size: 0.75rem;
  color: var(--sepia);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.splash-location {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--orange-light);
  margin-bottom: 32px;
}

.splash-desc {
  font-size: 0.9rem;
  color: rgba(245,237,216,0.65);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.btn-primary {
  display: inline-block;
  padding: 14px 40px;
  font-family: 'Special Elite', cursive;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: linear-gradient(135deg, var(--orange-light), var(--orange));
  border: none;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(232,100,10,0.5), var(--shadow-deep);
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
  max-width: 280px;
}

.btn-primary:active { transform: scale(0.97); }

.splash-version {
  margin-top: 16px;
  font-size: 0.65rem;
  color: rgba(139,105,20,0.5);
  font-family: 'Special Elite', cursive;
  letter-spacing: 0.1em;
}

/* ── ══════════════════════════════════════════════════════ */
/*    MAIN GAME UI                                           */
/* ══════════════════════════════════════════════════════════ */
#screen-game {
  flex-direction: column;
  pointer-events: none;
  overflow: hidden;
}

/* ── TOP HUD ─────────────────────────────────────────────── */
#hud-top {
  pointer-events: all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  background: linear-gradient(to bottom, rgba(6,4,1,0.98) 0%, rgba(6,4,1,0.7) 60%, rgba(6,4,1,0) 100%);
  gap: 10px;
  flex-shrink: 0;
}

/* Vies — côté gauche */
#hud-lives {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.heart {
  font-size: 1rem;
  transition: transform 0.3s, opacity 0.3s;
}

.heart.lost {
  opacity: 0.2;
  transform: scale(0.75);
  filter: grayscale(1);
}

/* Barre de progression — centre */
#hud-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

#progress-track {
  flex: 1;
  height: 4px;
  background: rgba(245,237,216,0.1);
  border-radius: 2px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--orange), var(--gold-light));
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
}

#progress-label {
  font-family: 'Special Elite', cursive;
  font-size: 0.6rem;
  color: rgba(245,237,216,0.9);
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Score + Journal — côté droit */
#hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#hud-score {
  font-family: 'Special Elite', cursive;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: #f5c842;
  text-shadow: 0 0 8px rgba(0,0,0,0.9), 0 1px 3px rgba(0,0,0,1);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap;
  font-weight: 700;
}

#hud-score.pop { transform: scale(1.35); }

/* ── TIMER — discret, juste l'heure ─────────────────────── */
#timer-bar {
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 0 4px;
  flex-shrink: 0;
}

#timer-display {
  font-family: 'Special Elite', cursive;
  font-size: 0.65rem;
  color: rgba(245,237,216,0.3);
  letter-spacing: 0.15em;
}

/* Radar et crosshair supprimés — Kôkô sert de boussole */

/* ── NEARBY ALERT — centre écran, visible ────────────────── */
#nearby-alert {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  pointer-events: none;
  background: rgba(10,6,2,0.94);
  border: 1.5px solid var(--orange);
  border-radius: 8px;
  padding: 12px 22px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 280px;
  box-shadow: 0 0 20px rgba(232,100,10,0.25), 0 4px 16px rgba(0,0,0,0.5);
  white-space: nowrap;
}

#nearby-alert.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#nearby-name {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  margin-bottom: 3px;
}

#nearby-dist {
  font-family: 'Special Elite', cursive;
  font-size: 0.68rem;
  color: var(--orange-light);
  letter-spacing: 0.12em;
}

/* ── BOTTOM SITES LIST ───────────────────────────────────── */
#bottom-panel {
  pointer-events: all;
  margin-top: auto;
  background: rgba(8,5,2,0.95);
  border-top: 1px solid rgba(245,237,216,0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1);
  max-height: 52px;   /* FERMÉ par défaut — juste la barre des onglets */
  overflow: hidden;
  padding: 0;
}

/* État ouvert — toggled via JS */
#bottom-panel.panel-open {
  max-height: 42vh;
}

/* Poignée de drag — indique que c'est cliquable */
#panel-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px 4px;
  cursor: pointer;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
}

#panel-handle-bar {
  width: 36px;
  height: 3px;
  background: rgba(245,237,216,0.25);
  border-radius: 2px;
}

#panel-handle-label {
  font-family: 'Special Elite', cursive;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: rgba(245,237,216,0.35);
}

#panel-handle-arrow {
  font-size: 0.65rem;
  color: rgba(245,237,216,0.3);
  transition: transform 0.3s;
}

#bottom-panel.panel-open #panel-handle-arrow {
  transform: rotate(180deg);
}

/* Contenu du panneau — caché quand fermé */
#panel-content {
  padding: 0 12px 16px;
  overflow: hidden;
}

#act-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 8px;
  padding-top: 2px;
}

.act-tab {
  flex: 1;
  padding: 8px 4px;
  font-family: 'Special Elite', cursive;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  border: 1px solid rgba(245,237,216,0.18);
  border-radius: 4px;
  color: rgba(245,237,216,0.65);
  background: rgba(245,237,216,0.06);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.act-tab.active {
  color: #fff;
  border-color: var(--orange);
  background: rgba(232,100,10,0.22);
  font-weight: 700;
}

.act-tab.locked {
  color: rgba(245,237,216,0.25);
  background: rgba(245,237,216,0.02);
  cursor: not-allowed;
}

#sites-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(139,105,20,0.6) transparent;
}

.site-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: rgba(30,20,8,0.92);
  border: 1px solid rgba(245,237,216,0.16);
  border-radius: 6px;
  transition: border-color 0.3s, background 0.3s;
  cursor: default;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.site-card.nearby {
  border-color: var(--orange);
  background: rgba(232,100,10,0.18);
  animation: nearby-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(232,100,10,0.3), 0 2px 8px rgba(0,0,0,0.5);
}

.site-card.done {
  opacity: 0.4;
}

.site-card.done .site-name::after {
  content: ' ✓';
  color: var(--green-light);
}

@keyframes nearby-pulse {
  0%, 100% { border-color: rgba(232,100,10,0.4); }
  50%       { border-color: rgba(232,100,10,0.9); }
}

.site-emoji { font-size: 1.4rem; flex-shrink: 0; }

.site-info { flex: 1; min-width: 0; }

.site-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #f8f0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.site-period {
  font-family: 'Special Elite', cursive;
  font-size: 0.62rem;
  color: #c4992a;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.site-dist {
  font-family: 'Special Elite', cursive;
  font-size: 0.72rem;
  color: #a08040;
  flex-shrink: 0;
  text-align: right;
  min-width: 44px;
}

.site-dist.close {
  color: #ffaa44;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(255,170,68,0.5);
}

/* ── GPS STATUS — minimaliste ────────────────────────────── */
#gps-status {
  position: absolute;
  bottom: calc(var(--bottom-panel-height, 220px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Special Elite', cursive;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: rgba(139,105,20,0.7);
  background: rgba(10,6,2,0.7);
  border: 1px solid rgba(139,105,20,0.2);
  border-radius: 20px;
  padding: 3px 10px;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 1s ease;
}

#gps-status.locked {
  opacity: 0; /* Disparaît silencieusement une fois GPS acquis */
}

/* ── ══════════════════════════════════════════════════════ */
/*    QUIZ MODAL                                             */
/* ══════════════════════════════════════════════════════════ */
#screen-quiz {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: rgba(28,18,8,0.96);
  padding: 0;
  overflow-y: auto;
}

.quiz-header {
  width: 100%;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(245,237,216,0.08);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(28,18,8,0.8);
  flex-shrink: 0;
}

.quiz-site-emoji { font-size: 2.2rem; flex-shrink: 0; margin-top: 2px; }

.quiz-site-info { flex: 1; }

.quiz-act-label {
  font-family: 'Special Elite', cursive;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.quiz-site-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--ivory);
  line-height: 1.2;
}

.quiz-site-period {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.75rem;
  color: var(--sepia);
  margin-top: 2px;
}

/* ── QUIZ TIMER BAR ──────────────────────────────────────── */
#quiz-timer-wrap {
  width: 100%;
  padding: 8px 20px 0;
  flex-shrink: 0;
}

#quiz-timer-bar {
  width: 100%;
  height: 4px;
  background: rgba(245,237,216,0.1);
  border-radius: 2px;
  overflow: hidden;
}

#quiz-timer-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 2px;
  transition: width 1s linear;
}

#quiz-timer-label {
  font-family: 'Special Elite', cursive;
  font-size: 0.65rem;
  color: var(--sepia);
  letter-spacing: 0.08em;
  margin-top: 4px;
  text-align: right;
}

/* ── QUIZ BODY ───────────────────────────────────────────── */
#quiz-body {
  width: 100%;
  padding: 20px 20px 28px;
  flex: 1;
}

.quiz-question {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ivory);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* MCQ / Photo choices */
.choices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.choices-grid.single-col {
  grid-template-columns: 1fr;
}

.choice-btn {
  padding: 12px 14px;
  background: rgba(245,237,216,0.05);
  border: 1px solid rgba(245,237,216,0.12);
  border-radius: 4px;
  font-family: 'Lora', serif;
  font-size: 0.85rem;
  color: var(--parchment);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.4;
}

.choice-btn:active { transform: scale(0.98); }
.choice-btn:hover  { border-color: rgba(232,100,10,0.4); background: rgba(232,100,10,0.06); }

.choice-btn.selected { border-color: var(--orange); background: rgba(232,100,10,0.12); }
.choice-btn.correct  { border-color: var(--correct); background: rgba(26,107,58,0.15); color: #6EE8A0; }
.choice-btn.wrong    { border-color: var(--wrong);   background: rgba(192,57,43,0.15);  color: #F08080; }

/* True/False */
.tf-question {
  padding: 14px 16px;
  background: rgba(245,237,216,0.04);
  border: 1px solid rgba(245,237,216,0.1);
  border-radius: 4px;
  margin-bottom: 12px;
}

.tf-text {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ivory);
  margin-bottom: 10px;
  line-height: 1.5;
}

.tf-buttons {
  display: flex;
  gap: 8px;
}

.tf-btn {
  flex: 1;
  padding: 10px;
  font-family: 'Special Elite', cursive;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  border: 1px solid rgba(245,237,216,0.15);
  border-radius: 3px;
  background: transparent;
  color: var(--parchment);
  cursor: pointer;
  transition: all 0.2s;
}

.tf-btn.true-btn  { border-color: rgba(26,107,58,0.4); }
.tf-btn.false-btn { border-color: rgba(192,57,43,0.4); }
.tf-btn.correct   { background: rgba(26,107,58,0.2);  color: #6EE8A0; border-color: var(--correct); }
.tf-btn.wrong     { background: rgba(192,57,43,0.2);  color: #F08080; border-color: var(--wrong); }

/* Chronological */
.chron-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.chron-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(245,237,216,0.05);
  border: 1px solid rgba(245,237,216,0.1);
  border-radius: 4px;
  cursor: grab;
  font-family: 'Lora', serif;
  font-size: 0.82rem;
  color: var(--parchment);
  line-height: 1.4;
  touch-action: none;
}

.chron-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.chron-handle {
  font-size: 1rem;
  opacity: 0.4;
  flex-shrink: 0;
}

.chron-num {
  font-family: 'Special Elite', cursive;
  font-size: 0.7rem;
  color: var(--orange);
  flex-shrink: 0;
  width: 18px;
}

/* Word mystery */
.word-hints {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.hint-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(245,237,216,0.04);
  border-left: 2px solid var(--orange);
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.85rem;
  color: rgba(245,237,216,0.7);
  opacity: 0;
  transition: opacity 0.5s;
}

.hint-item.revealed { opacity: 1; }

.hint-num {
  font-family: 'Special Elite', cursive;
  font-size: 0.65rem;
  color: var(--orange);
  font-style: normal;
  flex-shrink: 0;
  margin-top: 2px;
}

.word-input-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.word-input {
  flex: 1;
  padding: 12px 14px;
  background: rgba(245,237,216,0.07);
  border: 1px solid rgba(245,237,216,0.15);
  border-radius: 4px;
  font-family: 'Special Elite', cursive;
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  color: var(--ivory);
  text-transform: uppercase;
  outline: none;
}

.word-input:focus { border-color: var(--orange); }

.next-hint-btn {
  padding: 12px 16px;
  background: rgba(232,100,10,0.15);
  border: 1px solid rgba(232,100,10,0.3);
  border-radius: 4px;
  color: var(--orange-light);
  font-family: 'Special Elite', cursive;
  font-size: 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}

/* Open question */
.open-textarea {
  width: 100%;
  padding: 14px;
  background: rgba(245,237,216,0.06);
  border: 1px solid rgba(245,237,216,0.12);
  border-radius: 4px;
  font-family: 'Lora', serif;
  font-size: 0.88rem;
  color: var(--ivory);
  resize: none;
  min-height: 100px;
  outline: none;
  line-height: 1.6;
  margin-bottom: 12px;
}

.open-textarea:focus { border-color: var(--orange); }

.open-hint {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.75rem;
  color: var(--sepia);
  margin-bottom: 14px;
}

/* Submit button */
.btn-submit {
  width: 100%;
  padding: 14px;
  font-family: 'Special Elite', cursive;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: linear-gradient(135deg, var(--orange-light), var(--orange));
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 4px 16px rgba(232,100,10,0.3);
}

.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* Feedback */
.quiz-feedback {
  display: none;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 4px;
  font-family: 'Lora', serif;
  font-size: 0.85rem;
  line-height: 1.6;
}

.quiz-feedback.show { display: block; }
.quiz-feedback.correct { background: rgba(26,107,58,0.15); border: 1px solid rgba(26,107,58,0.3); color: #9EE8B8; }
.quiz-feedback.wrong   { background: rgba(192,57,43,0.15);  border: 1px solid rgba(192,57,43,0.3);  color: #F0A0A0; }

.feedback-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

/* ── ══════════════════════════════════════════════════════ */
/*    MEMORY CARD MODAL (après quiz réussi)                  */
/* ══════════════════════════════════════════════════════════ */
#screen-memory {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10,6,2,0.97);
  padding: 24px 20px;
}

.memory-card-wrap {
  width: 100%;
  max-width: 360px;
  position: relative;
}

.memory-card {
  background: var(--parchment);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  border-radius: 4px;
  padding: 24px 22px 20px;
  box-shadow: var(--shadow-deep), 4px 4px 0 var(--sepia-dark);
  position: relative;
  overflow: hidden;
}

.memory-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(to right, var(--orange), var(--gold), var(--green));
}

.memory-tag {
  font-family: 'Special Elite', cursive;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sepia-mid);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.memory-site-emoji { font-size: 2rem; margin-bottom: 8px; display: block; }

.memory-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 900;
  font-style: italic;
  color: var(--sepia-dark);
  margin-bottom: 4px;
  line-height: 1.2;
}

.memory-date {
  font-family: 'Special Elite', cursive;
  font-size: 0.7rem;
  color: var(--sepia-mid);
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}

.memory-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--sepia), transparent);
  margin-bottom: 14px;
  opacity: 0.4;
}

.memory-anecdote {
  font-family: 'Lora', serif;
  font-size: 0.85rem;
  color: var(--ink-light);
  line-height: 1.7;
  margin-bottom: 14px;
}

.memory-fragment {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.78rem;
  color: var(--sepia-mid);
  line-height: 1.6;
  border-left: 2px solid var(--orange);
  padding-left: 12px;
  margin-bottom: 16px;
}

.memory-badge-earned {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(201,162,39,0.12);
  border: 1px solid rgba(201,162,39,0.3);
  border-radius: 3px;
  margin-bottom: 12px;
}

.badge-emoji { font-size: 1.5rem; }

.badge-info { flex: 1; }
.badge-label {
  font-family: 'Special Elite', cursive;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sepia-mid);
}
.badge-name {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--sepia-dark);
}

.memory-points {
  font-family: 'Special Elite', cursive;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--sepia-mid);
  text-align: right;
  margin-bottom: 16px;
}

.memory-points span {
  color: var(--orange);
  font-size: 1rem;
}

.btn-continue {
  width: 100%;
  padding: 14px;
  font-family: 'Special Elite', cursive;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--parchment);
  background: var(--sepia-dark);
  border: 1px solid rgba(245,237,216,0.15);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: var(--shadow-paper);
}

.btn-continue:active { background: var(--ink); }

/* ── ══════════════════════════════════════════════════════ */
/*    JOURNAL SCREEN                                          */
/* ══════════════════════════════════════════════════════════ */
#screen-journal {
  flex-direction: column;
  background: var(--ink);
  overflow-y: auto;
}

.journal-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(245,237,216,0.08);
  flex-shrink: 0;
}

.journal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 900;
  font-style: italic;
  color: var(--ivory);
  margin-bottom: 4px;
}

.journal-subtitle {
  font-family: 'Special Elite', cursive;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--sepia);
  text-transform: uppercase;
}

.journal-stats {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.jstat {
  text-align: center;
}

.jstat-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold-light);
}

.jstat-label {
  font-family: 'Special Elite', cursive;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--sepia);
  text-transform: uppercase;
}

.journal-acts {
  padding: 16px 20px 28px;
  flex: 1;
}

.journal-act-section { margin-bottom: 24px; }

.journal-act-title {
  font-family: 'Special Elite', cursive;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.journal-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.journal-card {
  padding: 12px;
  background: rgba(245,237,216,0.04);
  border: 1px solid rgba(245,237,216,0.08);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.journal-card.unlocked {
  background: rgba(232,100,10,0.06);
  border-color: rgba(232,100,10,0.2);
}

.journal-card-emoji { font-size: 1.4rem; display: block; margin-bottom: 6px; }

.journal-card-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--parchment);
  line-height: 1.3;
  margin-bottom: 2px;
}

.journal-card-period {
  font-family: 'Special Elite', cursive;
  font-size: 0.58rem;
  color: var(--sepia);
  letter-spacing: 0.06em;
}

.journal-lock {
  position: absolute;
  top: 8px; right: 8px;
  font-size: 0.7rem;
  opacity: 0.3;
}

/* Badges section */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.badge-cell {
  text-align: center;
  padding: 8px 4px;
  background: rgba(245,237,216,0.03);
  border: 1px solid rgba(245,237,216,0.06);
  border-radius: 4px;
}

.badge-cell.earned {
  background: rgba(201,162,39,0.08);
  border-color: rgba(201,162,39,0.25);
}

.badge-cell-emoji { font-size: 1.5rem; display: block; margin-bottom: 4px; }
.badge-cell-name {
  font-family: 'Special Elite', cursive;
  font-size: 0.52rem;
  color: var(--sepia);
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.badge-cell.earned .badge-cell-name { color: var(--gold); }
.badge-cell.locked-badge { opacity: 0.25; filter: grayscale(1); }

.journal-back {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
  font-family: 'Special Elite', cursive;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--ivory);
  background: rgba(28,18,8,0.98);
  border: none;
  border-bottom: 1px solid rgba(245,237,216,0.1);
  cursor: pointer;
  text-align: left;
  pointer-events: all;
  -webkit-tap-highlight-color: rgba(232,100,10,0.2);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.journal-back::before {
  content: '←';
  font-size: 1.2rem;
  color: var(--orange);
}

.journal-back:active {
  background: rgba(232,100,10,0.15);
}

/* ── ══════════════════════════════════════════════════════ */
/*    ACT TRANSITION                                         */
/* ══════════════════════════════════════════════════════════ */
#screen-act-transition {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  text-align: center;
  padding: 40px 28px;
}

.act-trans-icon { font-size: 4rem; margin-bottom: 16px; animation: float 3s ease-in-out infinite; }

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

.act-trans-label {
  font-family: 'Special Elite', cursive;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sepia);
  margin-bottom: 8px;
}

.act-trans-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 900;
  font-style: italic;
  color: var(--ivory);
  margin-bottom: 8px;
  line-height: 1.2;
}

.act-trans-period {
  font-family: 'Special Elite', cursive;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  margin-bottom: 20px;
}

.act-trans-desc {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: rgba(245,237,216,0.6);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 300px;
}

/* ── ══════════════════════════════════════════════════════ */
/*    WIN / END SCREEN                                       */
/* ══════════════════════════════════════════════════════════ */
#screen-win {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  text-align: center;
  padding: 32px 24px;
  overflow-y: auto;
}

.win-trophee { font-size: 5rem; margin-bottom: 12px; animation: float 3s ease-in-out infinite; }

.win-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 900;
  font-style: italic;
  color: var(--ivory);
  margin-bottom: 8px;
  line-height: 1.2;
}

.win-subtitle {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--sepia);
  margin-bottom: 24px;
}

.win-letter {
  background: var(--parchment);
  border-radius: 4px;
  padding: 20px;
  box-shadow: var(--shadow-deep), 3px 3px 0 var(--sepia-dark);
  text-align: left;
  margin-bottom: 24px;
  max-width: 340px;
  width: 100%;
  position: relative;
}

.win-letter::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--orange), var(--gold), var(--green));
}

.win-letter-title {
  font-family: 'Special Elite', cursive;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sepia-mid);
  margin-bottom: 10px;
}

.win-letter-text {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.82rem;
  color: var(--ink-light);
  line-height: 1.7;
}

.win-stats {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 24px;
}

.wstat { text-align: center; }
.wstat-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--gold-light);
}
.wstat-label {
  font-family: 'Special Elite', cursive;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--sepia);
  text-transform: uppercase;
}

/* ── ANIMATIONS ──────────────────────────────────────────── */
.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.slide-up {
  animation: slideUp 0.35s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── SCROLLBARS ──────────────────────────────────────────── */
::-webkit-scrollbar       { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sepia-dark); border-radius: 2px; }

/* ── JOURNAL BUTTON — dans le HUD top ───────────────────── */
#journal-btn {
  width: 34px;
  height: 34px;
  background: rgba(245,237,216,0.07);
  border: 1px solid rgba(245,237,216,0.14);
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  transition: background 0.2s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

#journal-btn:active {
  background: rgba(245,237,216,0.14);
}

/* ── BADGE TOAST ─────────────────────────────────────────── */
#badge-toast {
  position: fixed;
  bottom: 280px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 999;
  background: rgba(28,18,8,0.95);
  border: 1px solid rgba(201,162,39,0.4);
  border-radius: 6px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(201,162,39,0.2);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  white-space: nowrap;
}

#badge-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#badge-toast #toast-emoji { font-size: 1.4rem; }

.toast-label {
  font-family: 'Special Elite', cursive;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: var(--sepia);
  text-transform: uppercase;
}

.toast-name {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gold-light);
}

/* ── PWA INSTALL PROMPT ──────────────────────────────────── */
#pwa-install-banner {
  position: fixed;
  bottom: 16px;
  left: 16px; right: 16px;
  z-index: 1000;
  background: rgba(28,18,8,0.98);
  border: 1px solid rgba(201,162,39,0.35);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  transform: translateY(120px);
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1);
}

#pwa-install-banner.visible { transform: translateY(0); }

.pwa-icon { font-size: 1.8rem; flex-shrink: 0; }

.pwa-text { flex: 1; }
.pwa-text strong {
  font-family: 'Special Elite', cursive;
  font-size: 0.8rem;
  color: var(--ivory);
  letter-spacing: 0.06em;
  display: block;
}
.pwa-text span {
  font-family: 'Lora', serif;
  font-size: 0.72rem;
  color: var(--sepia);
}

.pwa-btn {
  padding: 8px 16px;
  font-family: 'Special Elite', cursive;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border: none;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.pwa-dismiss {
  background: none;
  border: none;
  color: var(--sepia);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

/* ── SPLASH TITLE adjust ──────────────────────────────────── */
.splash-title {
  font-family: 'Playfair Display', serif !important;
  margin-top: 8px !important;
}

/* ── SCREEN WIN CENTER ────────────────────────────────────── */
#screen-win {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  overflow-y: auto;
  background: var(--ink);
}

/* ── SCREEN QUIZ fix ─────────────────────────────────────── */
#screen-quiz {
  background: rgba(28,18,8,0.97);
  overflow-y: auto;
}

/* ── SCREEN MEMORY fix ───────────────────────────────────── */
#screen-memory {
  align-items: center;
  justify-content: center;
  background: rgba(10,6,2,0.97);
  padding: 24px 20px;
  overflow-y: auto;
}

/* ── ACT TRANSITION CENTER ───────────────────────────────── */
#screen-act-transition {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 28px;
  background: var(--ink);
}

/* ── JOURNAL fix ─────────────────────────────────────────── */
#screen-journal {
  background: var(--ink);
  overflow-y: auto;
  flex-direction: column;
  align-items: stretch;
}


/* ═══════════════════════════════════════════════════════════
   ÉCRAN SÉLECTION THÈME — MODE AGENCE
═══════════════════════════════════════════════════════════ */

#screen-theme-select {
  background: #06040200;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(196,153,42,0.1) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 90%, rgba(26,107,58,0.08) 0%, transparent 45%);
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: 0 0 32px;
}

.theme-select-wrap {
  width: 100%;
  max-width: 480px;
  padding: 0 16px;
}

/* ── Header ── */
.theme-select-header {
  text-align: center;
  padding: 36px 0 24px;
}

.theme-koko-mini {
  font-size: 2.8rem;
  margin-bottom: 12px;
  animation: koko-float 3s ease-in-out infinite;
}

.theme-select-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--ivory);
  margin-bottom: 8px;
  line-height: 1.2;
}

.theme-select-sub {
  font-family: 'Special Elite', cursive;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--sepia);
}

/* ── Cards thématiques ── */
.theme-cards-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.theme-card {
  background: rgba(20,12,4,0.92);
  border: 1.5px solid var(--theme-color, var(--sepia));
  border-radius: 10px;
  padding: 18px 16px 16px;
  box-shadow:
    0 4px 20px rgba(0,0,0,0.4),
    inset 0 0 30px var(--theme-color-light, rgba(139,94,60,0.1));
  transition: transform 0.2s, box-shadow 0.2s;
}

.theme-card:active {
  transform: scale(0.98);
}

.theme-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.theme-card-emoji {
  font-size: 2.2rem;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

.theme-card-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ivory);
  margin-bottom: 4px;
}

.theme-card-meta {
  display: flex;
  gap: 12px;
  font-family: 'Special Elite', cursive;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--theme-color, var(--sepia));
}

.theme-card-desc {
  font-family: 'Lora', serif;
  font-size: 0.8rem;
  color: rgba(245,237,216,0.65);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Pills des sites */
.theme-card-sites {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.theme-site-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(245,237,216,0.06);
  border: 1px solid rgba(245,237,216,0.12);
  border-radius: 20px;
  font-family: 'Special Elite', cursive;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  color: rgba(245,237,216,0.6);
  white-space: nowrap;
}

/* Bouton lancement thème */
.btn-theme-launch {
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg,
    var(--theme-color, var(--sepia)) 0%,
    color-mix(in srgb, var(--theme-color, var(--sepia)) 70%, #f0d060) 100%
  );
  border: none;
  border-radius: 6px;
  font-family: 'Special Elite', cursive;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  color: #fff;
  cursor: pointer;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transition: opacity 0.2s, transform 0.15s;
}

.btn-theme-launch:active {
  opacity: 0.85;
  transform: scale(0.98);
}

/* ── Footer ── */
.theme-select-footer {
  text-align: center;
  padding-top: 4px;
}

.btn-theme-all {
  width: 100%;
  padding: 14px 20px;
  background: rgba(245,237,216,0.05);
  border: 1.5px solid rgba(245,237,216,0.2);
  border-radius: 8px;
  font-family: 'Special Elite', cursive;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: rgba(245,237,216,0.7);
  cursor: pointer;
  margin-bottom: 10px;
  transition: background 0.2s, color 0.2s;
}

.btn-theme-all:active {
  background: rgba(245,237,216,0.1);
  color: var(--ivory);
}

.theme-select-note {
  font-family: 'Special Elite', cursive;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--sepia-dark);
  text-transform: uppercase;
}

/* ── Badge agence dans HUD ── */
#hud-theme-badge {
  position: absolute;
  top: 46px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  background: rgba(196,153,42,0.15);
  border: 1px solid rgba(196,153,42,0.3);
  border-radius: 20px;
  font-family: 'Special Elite', cursive;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  pointer-events: none;
  white-space: nowrap;
}

/* ── Win screen thème — ajustements ── */
.win-title {
  font-size: 1.6rem !important;
}


/* ═══════════════════════════════════════════════════════════
   ÉCRAN ATELIER FINAL — MODE AGENCE
═══════════════════════════════════════════════════════════ */

#screen-atelier {
  --atelier-color: #1A6B3A;
  --atelier-color-light: rgba(26,107,58,0.15);
  background: var(--ink);
  background-image:
    radial-gradient(ellipse at 50% 0%, var(--atelier-color-light) 0%, transparent 60%);
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  text-align: center;
  overflow-y: auto;
  flex-direction: column;
}

.atelier-wrap {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Confetti emoji animé */
.atelier-confetti {
  font-size: 3rem;
  animation: atelier-pop 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes atelier-pop {
  from { transform: scale(0) rotate(-20deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}

/* Badge gagné */
.atelier-badge-earned {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(196,153,42,0.12);
  border: 1.5px solid rgba(196,153,42,0.4);
  border-radius: 50px;
  animation: atelier-pop 0.6s 0.15s cubic-bezier(0.34,1.56,0.64,1) both;
}

.atelier-badge-emoji {
  font-size: 2rem;
}

.atelier-badge-label {
  font-family: 'Special Elite', cursive;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: var(--sepia);
  text-transform: uppercase;
}

.atelier-badge-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold-light);
}

.atelier-divider {
  width: 60px;
  height: 1.5px;
  background: linear-gradient(to right, transparent, var(--atelier-color), transparent);
}

/* Header atelier */
.atelier-header {
  animation: atelier-pop 0.5s 0.25s cubic-bezier(0.34,1.56,0.64,1) both;
}

.atelier-emoji {
  font-size: 3.5rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
  margin-bottom: 8px;
}

.atelier-theme {
  font-family: 'Special Elite', cursive;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--atelier-color);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.atelier-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--ivory);
  line-height: 1.2;
}

/* Card atelier */
.atelier-card {
  width: 100%;
  background: rgba(20,12,4,0.9);
  border: 1.5px solid var(--atelier-color);
  border-radius: 10px;
  padding: 18px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), inset 0 0 30px var(--atelier-color-light);
  animation: atelier-pop 0.5s 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}

.atelier-card-title {
  font-family: 'Special Elite', cursive;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--atelier-color);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.atelier-desc {
  font-family: 'Lora', serif;
  font-size: 0.85rem;
  color: rgba(245,237,216,0.75);
  line-height: 1.6;
  margin-bottom: 16px;
}

/* Étapes */
.atelier-instructions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.atelier-step {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.atelier-step-num {
  width: 26px;
  height: 26px;
  background: var(--atelier-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Special Elite', cursive;
  font-size: 0.75rem;
  color: #fff;
  flex-shrink: 0;
  font-weight: 700;
}

.atelier-step span:last-child {
  font-family: 'Lora', serif;
  font-size: 0.8rem;
  color: rgba(245,237,216,0.7);
}

/* Bouton continuer */
.btn-atelier-continue {
  width: 100%;
  max-width: 320px;
  padding: 15px 24px;
  background: linear-gradient(135deg, var(--atelier-color) 0%, color-mix(in srgb, var(--atelier-color) 60%, #f0d060) 100%);
  border: none;
  border-radius: 8px;
  font-family: 'Special Elite', cursive;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: #fff;
  cursor: pointer;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  animation: atelier-pop 0.5s 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
  transition: opacity 0.2s, transform 0.15s;
}

.btn-atelier-continue:active {
  opacity: 0.85;
  transform: scale(0.98);
}


/* ═══════════════════════════════════════════════════════════
   BOUTON SON
═══════════════════════════════════════════════════════════ */
#sound-btn {
  width: 34px;
  height: 34px;
  background: rgba(245,237,216,0.07);
  border: 1px solid rgba(245,237,216,0.14);
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  transition: background 0.2s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

#sound-btn:active {
  background: rgba(245,237,216,0.14);
}


/* ═══════════════════════════════════════════════════════════
   BOUSSOLE DIRECTIONNELLE
   Flèche pointant vers le site cible
═══════════════════════════════════════════════════════════ */

#compass-wrap {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#compass-wrap.visible {
  opacity: 1;
}

/* Flèche — grande, sans cercle */
#compass-arrow {
  width: 90px;
  height: 135px;
  /* La rotation est appliquée via JS directement sur cette svg */
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* Pulsation quand on est dans le rayon d'approche */
#compass-wrap.nearby #compass-arrow {
  animation: arrow-pulse 1.2s ease-in-out infinite;
}

@keyframes arrow-pulse {
  0%, 100% { filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6)); }
  50%       { filter: drop-shadow(0 0 24px rgba(232,100,10,0.8)) drop-shadow(0 4px 12px rgba(0,0,0,0.6)); }
}

#compass-dist {
  font-family: 'Special Elite', cursive;
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: #ffaa44;
  font-weight: 700;
  text-shadow:
    0 0 12px rgba(232,100,10,0.6),
    0 2px 8px rgba(0,0,0,0.9);
}

#compass-site {
  font-family: 'Special Elite', cursive;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: rgba(245,237,216,0.75);
  text-shadow: 0 1px 6px rgba(0,0,0,0.95);
  max-width: 200px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(10,6,2,0.55);
  padding: 3px 12px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* Masquer la boussole sur les écrans autres que game */
.compass-hidden { display: none !important; }


/* ═══════════════════════════════════════════════════════════
   ÉCRAN LOGO — vrai logo PNG avec animation de révélation
═══════════════════════════════════════════════════════════ */

#screen-logo {
  background: #060402;
  align-items: center;
  justify-content: center;
}

.logo-reveal-wrap {
  width: 100%;
  max-width: 420px;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Conteneur image + overlay */
.logo-img-wrap {
  position: relative;
  width: 100%;
  max-width: 380px;
}

/* Le logo couleur */
.logo-img {
  width: 100%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0;
  /* Fade-in géré par JS */
}

/* Overlay de révélation bas → haut
   On l'anime en height de 100% → 0% */
.logo-reveal-overlay {
  position: absolute;
  inset: 0;
  background: #060402;
  transform-origin: bottom;
  /* animation lancée par JS via classe */
}

.logo-reveal-overlay.reveal {
  animation: logo-reveal-sweep 2.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes logo-reveal-sweep {
  0%   { clip-path: inset(0 0 0% 0); }   /* tout masqué */
  100% { clip-path: inset(0 0 100% 0); } /* tout révélé, bas → haut */
}




/* ═══════════════════════════════════════════════════════════
   ÉCRAN MOMENT HIDANSEY
═══════════════════════════════════════════════════════════ */

#screen-moment {
  background: #060402;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
}

.moment-wrap {
  width: 100%;
  max-width: 420px;
  padding: 32px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Badge row */
.moment-badge-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(26,107,58,0.12);
  border: 1px solid rgba(26,107,58,0.3);
  border-radius: 14px;
}

.moment-badge-circle {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #1a6b3a, #2a9b56);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(26,107,58,0.4);
}

.moment-badge-label {
  font-family: 'Special Elite', cursive;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: rgba(74,219,128,0.7);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.moment-badge-name {
  font-family: 'Lora', serif;
  font-size: 0.95rem;
  color: #f5edd8;
  font-weight: 600;
}

/* Site row */
.moment-site-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 0 4px;
}

.moment-site-emoji {
  font-size: 1.4rem;
}

.moment-site-name {
  font-family: 'Special Elite', cursive;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: rgba(245,237,216,0.5);
}

/* Divider */
.moment-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196,153,42,0.3), transparent);
  margin-bottom: 24px;
}

/* CTA Moment */
.moment-cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 24px 16px;
  background: rgba(196,153,42,0.06);
  border: 1px solid rgba(196,153,42,0.2);
  border-radius: 18px;
  margin-bottom: 16px;
}

.moment-cta-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.moment-cta-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #c4992a;
  letter-spacing: 0.02em;
}

.moment-defi-text {
  font-family: 'Lora', serif;
  font-size: 0.9rem;
  color: rgba(245,237,216,0.8);
  line-height: 1.6;
  font-style: italic;
}

/* Tags */
.moment-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.moment-tag {
  font-family: 'Special Elite', cursive;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: rgba(196,153,42,0.8);
  background: rgba(196,153,42,0.08);
  border: 1px solid rgba(196,153,42,0.2);
  border-radius: 20px;
  padding: 4px 12px;
}

/* Bouton copier tags */
.btn-copy-tags {
  background: none;
  border: 1px solid rgba(245,237,216,0.15);
  border-radius: 8px;
  padding: 8px 20px;
  font-family: 'Special Elite', cursive;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(245,237,216,0.4);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy-tags:active,
.btn-copy-tags.copied {
  color: #4adb80;
  border-color: rgba(74,219,128,0.4);
}

/* Bouton "Fait !" */
.btn-moment-done {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #1a6b3a, #2a9b56);
  border: none;
  border-radius: 12px;
  font-family: 'Special Elite', cursive;
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: #f5edd8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(26,107,58,0.3);
  transition: transform 0.15s;
}

.btn-moment-done:active { transform: scale(0.98); }

.moment-pts {
  font-size: 0.78rem;
  color: rgba(245,237,216,0.6);
}

/* Bouton skip */
.btn-moment-skip {
  background: none;
  border: none;
  font-family: 'Special Elite', cursive;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: rgba(245,237,216,0.25);
  cursor: pointer;
  padding: 8px;
  align-self: center;
  transition: color 0.2s;
}

.btn-moment-skip:active { color: rgba(245,237,216,0.5); }
