/* =========================================
  PRÉSIDENTIELLE! — Dark UI parodique
   ========================================= */

:root {
  --bg:        #0b1024;
  --bg-soft:   #141a35;
  --bg-card:   #181f3e;
  --bg-elev:   #20284c;
  --line:      rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);

  --text:      #f1f3ff;
  --text-dim:  #8b93b8;
  --text-mute: #5b6391;

  --accent:    #ff6b81;
  --accent-soft: #ff90a3;
  --accent-glow: rgba(255, 107, 129, 0.35);

  --blue:      #6aa8ff;
  --blue-glow: rgba(106, 168, 255, 0.4);
  --green:     #4ade80;
  --red:       #ef4f5e;
  --yellow:    #ffd54f;
  --purple:    #b07bff;
  --purple-soft: #c79bff;
  --purple-glow: rgba(176, 123, 255, 0.4);

  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --pad-screen: 22px;
}

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

/* =========================================
   HOUSE AD — pub fallback (web ou plugin AdMob absent)
   ========================================= */
.house-ad-card {
  text-align: center;
  padding-top: 12px;
}
.house-ad-tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 1.4px;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 18px;
  color: var(--text-dim);
}
.house-ad-content {
  margin: 4px 0 24px;
}
.house-ad-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.house-ad-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}
.house-ad-text {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  padding: 0 8px;
}
.house-ad-skip {
  width: 100%;
  background: var(--accent);
  color: #0b1024;
  border: none;
  padding: 14px;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
}
.house-ad-skip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--bg-elev);
  color: var(--text-dim);
}

/* =========================================
   HONEYPOT ANTI-BOT — invisible aux humains
   ========================================= */
.hp-wrap {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* =========================================
   SPLASH SCREEN (web only)
   ========================================= */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #050818;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}
.splash-screen.splash-out { opacity: 0; pointer-events: none; }
.splash-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #050818;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
}

.phone-frame {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(255, 107, 129, 0.10), transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(106, 168, 255, 0.07), transparent 60%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 480px) {
  .phone-frame {
    height: 100dvh;        /* cadre à la hauteur max de l'écran */
    border-radius: 0;
    border: none;
    box-shadow: 0 0 80px rgba(0,0,0,0.6);
    z-index: 1;            /* au-dessus du fond flouté */
  }

  /* Fond plein écran (background.png) flouté DERRIÈRE le cadre — version
     ordinateur uniquement (sur mobile le cadre remplit déjà tout l'écran).
     Le flou est sur ce pseudo-élément seul : l'UI du cadre reste nette. */
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    background: url("../background.png") center / cover no-repeat;
    filter: blur(5px);
    transform: scale(1.04);  /* évite les bords transparents dus au flou */
    pointer-events: none;
  }
}

/* Wordmark "presidentielle.app" — à gauche, DEVANT le fond flouté, en font
   pixel et tricolore (bleu / blanc / rouge). Affiché seulement sur écrans
   larges (≥1200px) où il y a la place à côté du cadre. */
.brand-side {
  position: fixed;
  left: clamp(20px, 4vw, 80px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  display: none;
  white-space: nowrap;
  font-family: 'Silkscreen', monospace;
  font-weight: 700;
  font-size: clamp(20px, 2.2vw, 38px);
  line-height: 1;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  user-select: none;
}
.brand-c1 { color: #1d4ed8; }       /* "presid" — bleu foncé */
.brand-c2 { color: #ffffff; }       /* "entielle" — blanc */
.brand-c3 { color: var(--red); }    /* ".app" — rouge */

/* même wordmark, miroir à droite */
.brand-side-right {
  left: auto;
  right: clamp(20px, 4vw, 80px);
}

@media (min-width: 1200px) {
  .brand-side { display: block; }
}

/* =========================================
   SCREEN SYSTEM
   ========================================= */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  animation: screenIn 0.35s var(--ease);
  padding-top: max(0px, env(safe-area-inset-top));
  padding-bottom: max(0px, env(safe-area-inset-bottom));
}
.screen.active { display: flex; }

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

/* =========================================
   SHARED HEADER
   ========================================= */
.screen-header {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: calc(18px + env(safe-area-inset-top)) var(--pad-screen) 8px;
  min-height: 64px;
}
.screen[data-screen="briefing"] .screen-header,
.screen[data-screen="dialogue"] .screen-header {
  padding-top: 4px;
  padding-bottom: 4px;
  min-height: 48px;
}
.screen-header-compact {
  padding: 12px var(--pad-screen) 6px;
  min-height: 48px;
}
.screen-title-hidden,
.counter-hidden {
  display: none;
}
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s;
}
.icon-btn:hover { background: var(--bg-elev); }
.icon-btn:active { transform: scale(0.92); }
.screen-title {
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}
.counter {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: 99px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-dim);
  min-width: 48px;
  text-align: center;
}
.counter-accent { color: var(--accent); }

.screen-footer {
  flex: 0 0 auto;
  padding: 14px var(--pad-screen) 22px;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s, box-shadow 0.25s;
  color: var(--text);
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 22px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-soft); }

.btn-ghost {
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-ghost:hover { background: var(--bg-elev); }

.btn-blue {
  background: linear-gradient(135deg, var(--blue), #4a85e8);
  color: #fff;
  box-shadow: 0 6px 22px var(--blue-glow);
}
.btn-blue:hover { background: linear-gradient(135deg, #84b8ff, #6aa8ff); }
.btn-blue .btn-meta { color: rgba(255, 255, 255, 0.7); }

.btn-danger {
  background: var(--red);
  color: #fff;
  box-shadow: 0 6px 22px rgba(239, 79, 94, 0.3);
}
.btn-danger:hover { background: #ff6776; }

.btn-share {
  background: var(--bg-card);
  border: 1px dashed var(--accent);
  color: var(--accent);
}
.btn-share:hover { background: var(--bg-elev); }
.btn-share.is-copied {
  background: rgba(46, 204, 113, 0.12);
  border-color: var(--green);
  color: var(--green);
}
.btn-share-strong {
  background: linear-gradient(135deg, var(--accent), #b94055);
  border: none;
  color: #fff;
  box-shadow: 0 6px 22px var(--accent-glow);
}
.btn-share-strong:hover { filter: brightness(1.08); }
.btn-share-strong.is-copied {
  background: linear-gradient(135deg, var(--green), #1f9d57);
  box-shadow: 0 6px 22px rgba(46, 204, 113, 0.3);
}

.link-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.18s;
}
.link-btn:hover { color: var(--text); }
.link-btn-danger { color: var(--red); opacity: 0.75; }
.link-btn-danger:hover { opacity: 1; }

.btn-label { font-size: 15px; font-weight: 600; }
.btn-arrow {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex: 0 0 28px;
}
.btn-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
}

/* =========================================
   MAIN MENU
   ========================================= */
.menu-cog {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 14px);
  right: 18px;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  z-index: 5;
  transition: background 0.18s, transform 0.18s;
}
.menu-cog:hover  { background: var(--bg-elev); transform: scale(1.08); }
.menu-cog:active { transform: scale(0.95); }

.menu-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(80px, 14dvh, 130px) var(--pad-screen) 14px;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* fond coloré animé spécifique au main menu */
.screen[data-screen="menu"] {
  background-image:
    radial-gradient(ellipse 70% 50% at 18% 12%, rgba(255, 107, 129, 0.28), transparent 60%),
    radial-gradient(ellipse 60% 45% at 82% 18%, rgba(106, 168, 255, 0.26), transparent 60%),
    radial-gradient(ellipse 90% 60% at 50% 92%, rgba(176, 123, 255, 0.30), transparent 65%),
    radial-gradient(ellipse 70% 50% at 12% 78%, rgba(74, 222, 128, 0.18), transparent 60%),
    radial-gradient(ellipse 60% 45% at 90% 60%, rgba(255, 213, 79, 0.18), transparent 60%);
  background-size: 200% 200%;
  animation: menuBgShift 18s ease-in-out infinite alternate;
}
@keyframes menuBgShift {
  0%   { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}
/* particules colorées flottantes */
.screen[data-screen="menu"]::before {
  content: '';
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(circle 6px at 18% 22%, rgba(255, 107, 129, 0.7), transparent 70%),
    radial-gradient(circle 4px at 70% 40%, rgba(106, 168, 255, 0.7), transparent 70%),
    radial-gradient(circle 5px at 30% 70%, rgba(74, 222, 128, 0.6), transparent 70%),
    radial-gradient(circle 4px at 84% 78%, rgba(255, 213, 79, 0.7), transparent 70%),
    radial-gradient(circle 5px at 50% 12%, rgba(176, 123, 255, 0.7), transparent 70%);
  pointer-events: none;
  animation: menuParticles 9s linear infinite;
  opacity: 0.85;
  z-index: 0;
}
@keyframes menuParticles {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0.6; }
  50%  { opacity: 1; }
  100% { transform: translateY(-30px) rotate(8deg); opacity: 0.6; }
}
.menu-eyebrow {
  font-size: 10px;
  letter-spacing: 2.4px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
}
.menu-eyebrow .eyebrow-accent { color: var(--blue); }

.platform-web .screen[data-screen="menu"] .menu-body .menu-eyebrow {
  order: 2;
  margin-top: 10px;
}
.platform-web .screen[data-screen="menu"] .menu-body .title {
  order: 1;
  font-size: clamp(24px, 6vw, 34px);
  line-height: 0.95;
  margin-top: 20px;
}
.platform-web .screen[data-screen="menu"] .menu-body .menu-tagline {
  order: 3;
  margin-top: 10px;
  margin-bottom: 6px;
}
.platform-web .screen[data-screen="menu"] .menu-body .menu-illu {
  order: 4;
  margin-top: 14px;
}
.platform-web .screen[data-screen="menu"] .menu-body .menu-actions {
  order: 5;
}
.platform-web .screen[data-screen="menu"] .menu-body .user-strip {
  order: 6;
}

.menu-tagline .tag-w-red   { color: var(--red);  font-weight: 600; }
.menu-tagline .tag-w-white { color: var(--text); font-weight: 600; }
.menu-tagline .tag-w-blue  { color: var(--blue); font-weight: 600; }
.title {
  font-size: clamp(54px, 14vw, 72px);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  margin-top: 38px;
}
.title .excl { color: var(--accent); }

.menu-tagline {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
  font-style: italic;
}

.menu-illu {
  margin: 24px 0 8px;
}
.hero-orb {
  width: 140px; height: 140px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 25% 25%, rgba(106, 168, 255, 0.45), transparent 55%),
    radial-gradient(circle at 75% 75%, rgba(255, 107, 129, 0.45), transparent 55%),
    linear-gradient(160deg, #1d2a55, #2a1d4a);
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.5),
    0 0 70px var(--c-color, rgba(106, 168, 255, 0.25)),
    0 0 100px var(--c-color, rgba(255, 107, 129, 0.18)),
    inset 0 0 0 2px color-mix(in srgb, var(--c-color, #ffffff) 35%, transparent);
  position: relative;
  transition: box-shadow 0.8s ease;
}
.hero-orb::before,
.hero-orb::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero-orb::before {
  inset: -8px;
  border: 1px dashed rgba(106, 168, 255, 0.3);
  animation: spin 22s linear infinite;
}
.hero-orb::after {
  inset: -16px;
  border: 1px dashed rgba(255, 107, 129, 0.22);
  animation: spin 32s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }
.avatar-face { font-size: 60px; }

.menu-stats {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}
.m-stat {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 8px;
  display: flex; flex-direction: column;
  align-items: center;
}
.m-key {
  font-size: 9px;
  letter-spacing: 1.4px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
}
.m-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 2px;
}
/* tricolore — each stat block in a different accent */
.m-stat:nth-child(1) .m-val { color: var(--red);    }
.m-stat:nth-child(2) .m-val { color: var(--text);   }
.m-stat:nth-child(3) .m-val { color: var(--blue);   }

.settings-reset {
  margin-top: 4px;
  text-align: center;
  width: 100%;
  font-size: 12px;
}

.settings-privacy {
  display: block;
  width: 100%;
  margin-top: 4px;
  text-align: center;
  font-size: 12px;
}

.menu-actions {
  margin-top: max(16px, calc(52dvh - 280px));
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* =========================================
   CANDIDATE CAROUSEL — compact, no longer stretched
   ========================================= */
.carousel {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 12px 12% 8px;
  gap: 14px;
  align-items: center;
}
.carousel::-webkit-scrollbar { display: none; }

.candidate-card {
  flex: 0 0 76%;
  scroll-snap-align: center;
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  padding: 18px 18px 20px;
  display: flex; flex-direction: column;
  transition: transform 0.35s var(--ease), border-color 0.3s, box-shadow 0.3s;
  transform: scale(0.94);
  align-self: center;
}
.candidate-card.active {
  transform: scale(1);
  border-color: rgba(255, 107, 129, 0.4);
  box-shadow: 0 0 0 1px rgba(255, 107, 129, 0.4), 0 14px 30px rgba(0, 0, 0, 0.35);
}

.custom-candidate-card {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}
.custom-card-preview {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  background: var(--bg-elev);
  border: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--text-dim);
  overflow: hidden;
}
.custom-card-preview.has-photo {
  border: none;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--c-color, #9bbcf2) 70%, white) 0%, var(--c-color, #9bbcf2) 60%, color-mix(in srgb, var(--c-color, #9bbcf2) 60%, #1d2a55) 100%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-color, #9bbcf2) 60%, white), 0 8px 22px color-mix(in srgb, var(--c-color, #9bbcf2) 50%, transparent);
}
.custom-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.custom-card-plus {
  font-size: 36px;
  line-height: 1;
}
.custom-card-title {
  font-size: 15px;
  font-weight: 800;
}
.custom-card-desc {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.card-avatar {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: linear-gradient(160deg, #2a1d4a, #4d2566);
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
  flex: 0 0 76px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}
.card-headtext {
  flex: 1; min-width: 0;
}
.card-style {
  font-size: 9px;
  letter-spacing: 1.6px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
}
.card-name {
  font-size: 19px;
  font-weight: 800;
  margin-top: 2px;
  line-height: 1.15;
}
.card-party {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
}
.card-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

.carousel-dots {
  display: flex; gap: 5px;
  justify-content: center;
  padding: 4px 0 4px;
  flex-wrap: wrap;
  max-width: 80%;
  margin: 0 auto;
}
.dot-pip {
  width: 6px; height: 6px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 99px;
  transition: width 0.25s, background 0.25s;
}
.dot-pip.active {
  width: 18px;
  background: var(--accent);
}

/* Flèches de navigation du carrousel candidats — surtout utiles sur PC
   (pas de swipe). Masquées sur mobile où le balayage suffit. */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: background 0.18s, transform 0.18s, opacity 0.18s;
}
.carousel-arrow-prev { left: 12px; }
.carousel-arrow-next { right: 12px; }
.carousel-arrow:hover  { background: var(--bg-elev); }
.carousel-arrow:active { transform: translateY(-50%) scale(0.9); }
.carousel-arrow:disabled { opacity: 0.3; cursor: default; box-shadow: none; }

@media (min-width: 480px) {
  .carousel-arrow { display: flex; }
}

/* =========================================
   TIMELINE HUD (top inline gauges + bottom axis)
   ========================================= */
.hud-top {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 14px);
  left: 0;
  right: 0;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 4;
  pointer-events: none;
}
.hud-top-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: min(320px, calc(100% - 80px));
  margin-left: auto;
}
.hud-top-row .hud-mini-pop { flex: 1 1 auto; min-width: 0; width: auto; }
.hud-energy-chip {
  flex: 0 0 75px;
  width: 75px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 9px;
  box-sizing: border-box;
}
.hud-energy-chip .hud-energy-emoji {
  font-size: 13px;
  line-height: 1;
}
.hud-energy-chip .hud-num {
  font-size: 12px;
  line-height: 1;
}
/* La box "popularité" (poll-text) est SOUS le bouton ⚙ : pas besoin de décaler
   toute la colonne. On garde un padding symétrique (pour centrer la box) et on
   contraint la rangée de jauges à tenir ENTRE le bouton retour ‹ (gauche) et le
   ⚙ (droite) pour qu'elle ne déborde sur aucun des deux. */
.screen[data-screen="timeline"] .hud-top-row {
  width: auto;
  margin-left: 56px;   /* dégage le bouton retour ‹ (se termine à ~62px) */
  margin-right: 46px;  /* dégage le ⚙ (commence à ~frame-50px) */
}
.timeline-cog {
  top: calc(env(safe-area-inset-top) + 14px);
  right: 12px;
  pointer-events: auto;
}
.hud-mini {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 7px 9px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
  min-width: 0;
}
.axis-float {
  position: absolute;
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  z-index: 4;
  pointer-events: none;
  width: min(150px, 30vw);
}
.hud-mini-axis {
  width: 100%;
}
.hud-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.hud-label {
  font-size: 8px;
  letter-spacing: 1.4px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
}
.hud-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 3px;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  width: 17%;
  border-radius: 99px;
  transition: width 0.6s var(--ease);
  box-shadow: 0 0 12px var(--accent-glow);
}
.bar-fill-energy {
  background: var(--yellow);
  box-shadow: 0 0 12px rgba(255, 213, 79, 0.5);
}
.hud-energy { color: var(--yellow); }
.hud-energy.energy-low { color: var(--red); }
.hud-energy.energy-infinite { color: var(--purple-soft); font-size: 14px; }
.energy-hint {
  font-size: 8px;
  color: var(--text-mute);
  margin: -2px 0 4px;
  letter-spacing: 0.3px;
}
.energy-timer-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 10px 0 4px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.energy-timer-block[hidden] { display: none; }
.energy-timer-label {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
}
.energy-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
}
.hud-row-pop { margin-top: 3px; }
.hud-row-axis { margin-top: 2px; }
.axis-label {
  font-size: 8px;
  letter-spacing: 1.2px;
  font-weight: 700;
  text-transform: uppercase;
}
.axis-label-left  { color: var(--red);  }
.axis-label-right { color: var(--blue); }

.axis-rail {
  position: relative;
  height: 4px;
  background: linear-gradient(90deg, var(--red), var(--text-mute) 50%, var(--blue));
  border-radius: 99px;
  opacity: 0.85;
}
.axis-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px; height: 10px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 0 2px var(--bg-card);
  transition: left 0.5s var(--ease);
}
.hud-top .energy-hint,
.axis-float .axis-hint {
  display: none;
}

.screen[data-screen="menu"] .menu-body {
  padding-top: calc(92px + env(safe-area-inset-top));
}

.screen[data-screen="timeline"] .timeline-scroll {
  padding-top: 94px;
}

.hud-top .poll-text {
  margin: 0;
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.35;
  text-align: center;
}

.poll-text {
  flex: 0 0 auto;
  margin: 12px var(--pad-screen) 0;
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.5;
  text-align: center;
}

/* =========================================
   TIMELINE — slalom
   ========================================= */
.timeline-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 0 24px;
  scrollbar-width: none;
}
.timeline-scroll::-webkit-scrollbar { display: none; }
.timeline-list {
  position: relative;
  margin: 0 auto;
  width: 100%;
}

/* SVG path drawn by JS — lies behind all bubbles */
.tl-path {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
.tl-path-stroke {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* nodes (positioned absolutely on the slalom path) */
.tl-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}
.tl-bubble {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.3s, background 0.2s;
  position: relative;
}
.tl-bubble:active { transform: scale(0.92); }
.tl-bubble .tl-icon {
  width: 36px; height: 36px;
  object-fit: contain;
  pointer-events: none;
}
.tl-bubble .tl-portrait {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
}

.tl-day-label {
  margin-top: 6px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* type-color base : applied via data-type attribute */
.tl-bubble[data-type="INTERVIEW"]    { --type-color: var(--accent); --type-glow: var(--accent-glow); }
.tl-bubble[data-type="DÉBAT"],
.tl-bubble[data-type="DEBAT"]        { --type-color: var(--blue);   --type-glow: var(--blue-glow); }
.tl-bubble[data-type="MEETING"]      { --type-color: var(--yellow); --type-glow: rgba(255, 213, 79, 0.45); }
.tl-bubble[data-type="NÉGOCIATION"],
.tl-bubble[data-type="NEGOCIATION"]  { --type-color: var(--green);  --type-glow: rgba(74, 222, 128, 0.4); }

/* unlocked / available — pulse with the type color */
.tl-node.available .tl-bubble {
  background: var(--type-color, var(--accent));
  border-color: transparent;
  color: #0b1024;
  box-shadow: 0 6px 18px var(--type-glow, var(--accent-glow));
  animation: bubblePulse 2.5s infinite;
}

/* completed — green ring + checkmark */
.tl-node.completed .tl-bubble {
  background: var(--bg-elev);
  border-color: rgba(74, 222, 128, 0.4);
  color: var(--green);
}
.tl-node.completed .tl-bubble::after {
  content: '✓';
  position: absolute;
  top: -4px; right: -4px;
  width: 20px; height: 20px;
  background: var(--green);
  color: #06160d;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  animation: popIn 0.4s var(--ease);
}

/* future — greyed out, but the type color stays as a tint */
.tl-node.future .tl-bubble {
  background: var(--type-color, #2a2f4a);
  border-color: rgba(255, 255, 255, 0.04);
  color: rgba(0, 0, 0, 0.45);
  cursor: not-allowed;
  filter: saturate(0.35) brightness(0.55);
  opacity: 0.85;
}
.tl-node.future .tl-day-label { color: var(--text-mute); }

@keyframes bubblePulseRing {
  0%, 100% { box-shadow: 0 6px 18px var(--type-glow, var(--accent-glow)); }
  50%      { box-shadow: 0 6px 26px var(--type-glow, var(--accent-glow)), 0 0 0 5px rgba(255, 255, 255, 0.08); }
}

/* premium — purple padlock */
.tl-node.premium .tl-bubble {
  background: linear-gradient(160deg, #5a3a8a, #34225a);
  border-color: rgba(176, 123, 255, 0.5);
  color: var(--purple-soft);
  box-shadow: 0 6px 18px var(--purple-glow);
  cursor: pointer;
}
.tl-node.premium .tl-bubble::before {
  content: '🔒';
  position: absolute;
  top: -6px; right: -6px;
  width: 24px; height: 24px;
  background: var(--purple);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  box-shadow: 0 2px 8px var(--purple-glow);
}

@keyframes bubblePulse {
  0%, 100% { box-shadow: 0 6px 18px var(--accent-glow); }
  50% { box-shadow: 0 6px 24px var(--accent-glow), 0 0 0 5px rgba(255, 107, 129, 0.15); }
}
@keyframes popIn {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* =========================================
   MONUMENTS (timeline)
   ========================================= */
.tl-monument {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}
.tl-monument-img {
  width: 120px;
  height: auto;
  object-fit: contain;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.18s var(--ease), opacity 0.2s;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.55));
  display: block;
}
.tl-monument-img:active { transform: scale(0.9); }
.tl-monument-img.tl-monument-locked {
  opacity: 0.4;
  filter: grayscale(1) brightness(0.55);
  cursor: default;
  pointer-events: none;
}

/* monument popup card */
.monument-card { text-align: center; }
.monument-popup-img-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.monument-popup-img {
  width: 160px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,0.4));
}

/* =========================================
   BRIEFING
   ========================================= */
.briefing-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 8px var(--pad-screen) 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brief-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
}
.brief-head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 14px;
}
.brief-icon {
  width: 60px; height: 60px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  flex: 0 0 60px;
}
.brief-head-text { flex: 1; min-width: 0; }
.brief-setting {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.brief-title {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
}
.brief-desc {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 14px;
}
.brief-role {
  display: flex; flex-direction: column;
  padding: 12px 14px;
  background: rgba(255, 107, 129, 0.08);
  border: 1px solid rgba(255, 107, 129, 0.18);
  border-radius: 12px;
  margin-bottom: 14px;
}
.role-key {
  font-size: 10px; letter-spacing: 1.2px;
  color: var(--accent); font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.role-val { font-size: 13.5px; color: var(--text); line-height: 1.45; }

.brief-topics { display: flex; flex-direction: column; }
.topics-key {
  font-size: 10px; letter-spacing: 1.2px;
  color: var(--text-dim); font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.topics-list { display: flex; flex-wrap: wrap; gap: 6px; }
.topic-chip {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
}

.brief-stakes {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.stake {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 10px;
  text-align: center;
}
.stake-up   { border-color: rgba(74, 222, 128, 0.3); }
.stake-down { border-color: rgba(239, 79, 94, 0.3); }
.stake-key {
  display: block;
  font-size: 10px; letter-spacing: 1.1px;
  color: var(--text-dim); font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.stake-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px; font-weight: 700;
  color: var(--text);
}
.stake-up .stake-val   { color: var(--green); }
.stake-down .stake-val { color: var(--red); }

.brief-meta {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.meta-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  font-size: 13px;
}
.meta-row + .meta-row { border-top: 1px solid var(--line); }
.meta-key {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}
.meta-val { color: var(--text); font-weight: 600; font-size: 13px; }
.meta-val.ai-on { color: var(--blue); }

/* dedicated start button — extra prominent */
.btn-start { padding: 18px 20px; }

/* =========================================
   DIALOGUE
   ========================================= */
.char-zone {
  position: relative;
  height: min(150px, 24dvh);
  flex: 0 0 auto;
  margin: 4px 0;
  overflow: hidden;
}
.char {
  position: absolute;
  top: 18px;
  width: 50%;
  display: flex; flex-direction: column;
  align-items: center;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.char-player { left: 0; }
.char-npc { right: 0; }

.char-avatar {
  width: 92px; height: 92px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a1d4a, #4d2566);
  display: flex; align-items: center; justify-content: center;
  font-size: 46px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.4s var(--ease);
}
.char-npc .char-avatar { background: linear-gradient(135deg, #1d3a55, #2c5577); }

.char-name {
  margin-top: 8px;
  font-size: 11px; letter-spacing: 1.2px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  text-align: center;
}

.char.dimmed { opacity: 0.35; transform: scale(0.88); }
.char.active { opacity: 1; transform: scale(1.12); }
.char.active .char-avatar {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), 0 0 24px var(--accent-glow);
}
.char.active.char-npc .char-avatar {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), 0 0 24px var(--blue-glow);
}

.divider {
  position: absolute;
  top: 8px; bottom: 28px;
  left: 50%;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--accent) 30%, var(--blue) 70%, transparent);
  transform-origin: center;
  transform: translateX(-50%) rotate(0deg);
  transition: transform 0.6s var(--ease);
  border-radius: 99px;
  opacity: 0.85;
}
.divider.tilt-npc    { transform: translateX(-50%) rotate(16deg); }
.divider.tilt-player { transform: translateX(-50%) rotate(-16deg); }

.dialogue-text {
  flex: 1 1 0;
  min-height: 70px;
  margin: 6px var(--pad-screen);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.speaker-tag {
  font-size: 10px; letter-spacing: 1.4px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 6px;
}
.speaker-tag.player { color: var(--blue); }
.dialogue-line {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
}
.cursor::after {
  content: '▍';
  margin-left: 2px;
  color: var(--accent);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.choices {
  flex: 0 0 auto;
  padding: 4px var(--pad-screen) 10px;
  display: flex; flex-direction: column;
  gap: 6px;
}
.choice-btn {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  line-height: 1.4;
  transition: transform 0.15s, background 0.18s, border-color 0.18s;
}
.choice-btn:hover {
  background: var(--bg-elev);
  border-color: var(--line-strong);
}
.choice-btn:active { transform: scale(0.98); }
.choice-btn:disabled { opacity: 0.5; cursor: wait; }
.choice-num {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  color: var(--text-dim);
  margin-top: 1px;
}
.choice-btn[data-tone="absurd"] .choice-num { color: var(--yellow); }
.choice-btn[data-tone="left"]   .choice-num { color: var(--red);    }
.choice-btn[data-tone="right"]  .choice-num { color: var(--blue);   }
.choice-btn[data-tone="absurd"] { border-color: rgba(255, 213, 79, 0.18); }
.choice-btn[data-tone="left"]   { border-color: rgba(239, 79, 94, 0.18); }
.choice-btn[data-tone="right"]  { border-color: rgba(106, 168, 255, 0.18); }

.choice-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 9.5px;
  letter-spacing: 1.4px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.choice-btn[data-tone="absurd"] .choice-tag { color: var(--yellow); border-color: rgba(255, 213, 79, 0.3); }
.choice-btn[data-tone="left"]   .choice-tag { color: var(--red);    border-color: rgba(239, 79, 94, 0.3); }
.choice-btn[data-tone="right"]  .choice-tag { color: var(--blue);   border-color: rgba(106, 168, 255, 0.3); }
/* legacy fallback for older data */
.choice-btn[data-tone="logic"]    .choice-num { color: var(--blue); }
.choice-btn[data-tone="populist"] .choice-num { color: var(--accent); }
.choice-btn[data-tone="diplo"]    .choice-num { color: var(--yellow); }

/* "L'IA réfléchit" inside the dialogue text area */
.dialogue-line.thinking {
  color: var(--text-dim);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.dialogue-line.thinking::before {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.dialogue-line.thinking::after {
  content: ' ...';
  animation: dots 1.4s infinite;
  color: var(--accent);
}
@keyframes dots {
  0%, 20% { content: ' .'; }
  40%     { content: ' ..'; }
  60%, 100% { content: ' ...'; }
}

/* =========================================
   RESULT
   ========================================= */
.result-body {
  flex: 1;
  padding: 28px var(--pad-screen);
  text-align: center;
  display: flex; flex-direction: column;
  align-items: center;
  justify-content: center;
}
.screen-end {
  justify-content: space-between;
}
.screen[data-screen="end-win"] {
  background-image:
    radial-gradient(ellipse 70% 50% at 20% 15%, rgba(74, 222, 128, 0.18), transparent 60%),
    radial-gradient(ellipse 60% 45% at 80% 18%, rgba(255, 213, 79, 0.18), transparent 62%),
    radial-gradient(ellipse 90% 60% at 50% 90%, rgba(106, 168, 255, 0.12), transparent 65%);
}
.screen[data-screen="end-lose"] {
  background-image:
    radial-gradient(ellipse 70% 50% at 20% 15%, rgba(239, 79, 94, 0.20), transparent 60%),
    radial-gradient(ellipse 60% 45% at 80% 18%, rgba(255, 107, 129, 0.16), transparent 62%),
    radial-gradient(ellipse 90% 60% at 50% 90%, rgba(176, 123, 255, 0.10), transparent 65%);
}
.result-icon {
  font-size: 64px;
  margin-bottom: 14px;
  animation: popIn 0.5s var(--ease);
}
.result-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 10px;
}
.result-narrative {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.55;
  max-width: 320px;
  margin-bottom: 24px;
}
.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}
.end-body {
  padding-top: 42px;
  padding-bottom: 16px;
}
.end-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.result-stat {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
}
.stat-key {
  font-size: 11px;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
  font-weight: 600;
}
.stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

/* =========================================
   MODAL (settings)
   ========================================= */
.modal {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: modalIn 0.3s var(--ease);
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  width: 100%;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  padding: 22px var(--pad-screen) calc(22px + env(safe-area-inset-bottom));
  max-height: 80%;
  overflow-y: auto;
  animation: sheetUp 0.35s var(--ease);
}
@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.modal-title { font-size: 18px; font-weight: 800; }

.modal-body { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; }
.field-label {
  font-size: 11px; letter-spacing: 1.2px;
  color: var(--text-dim); font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.field-input {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  transition: border-color 0.2s, background 0.2s;
}
.field-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elev);
}
.field-hint {
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 6px;
  line-height: 1.5;
}

.field-row {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.custom-candidate-preview {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 14px;
  margin: 0 auto 4px;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.08), transparent 55%), var(--bg-card);
  border: 1px dashed var(--line);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}
.custom-candidate-preview.has-photo {
  border: none;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--c-color, #9bbcf2) 70%, white) 0%, var(--c-color, #9bbcf2) 60%, color-mix(in srgb, var(--c-color, #9bbcf2) 60%, #1d2a55) 100%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-color, #9bbcf2) 60%, white), 0 8px 22px color-mix(in srgb, var(--c-color, #9bbcf2) 50%, transparent);
}
.custom-candidate-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
.custom-photo-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

/* Badge "changer la photo" (appareil photo + petit +) sur l'image profil du
   candidat perso — indique que l'image est cliquable, même une fois posée. */
.custom-photo-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: var(--c-color, #6aa8ff);
  border: 2px solid var(--bg-card);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.custom-photo-badge::after {
  content: "+";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  color: #1d2a55;
  font-size: 12px;
  font-weight: 800;
  line-height: 13px;
  text-align: center;
}
.custom-candidate-preview.has-photo + .custom-photo-hint {
  display: none;
}
.custom-axis-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}
.custom-axis-wrap {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.custom-axis-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.custom-axis-left { color: var(--red); }
.custom-axis-right { color: var(--blue); }
#custom-candidate-axis {
  width: 100%;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red), var(--blue));
  outline: none;
}
#custom-candidate-axis::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: transparent;
}
#custom-candidate-axis::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--bg-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  margin-top: -6px; /* center thumb over track sometimes */
}
#custom-candidate-axis::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: transparent;
}
#custom-candidate-axis::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--bg-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.custom-candidate-file {
  display: none;
}
.field-row-text { flex: 1; }
.field-row-static { background: rgba(106, 168, 255, 0.06); border-color: rgba(106, 168, 255, 0.18); }
.field-row-static .field-label { color: var(--blue); }

.toggle {
  position: relative;
  width: 46px; height: 26px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slot {
  position: absolute; inset: 0;
  background: var(--bg-elev);
  border-radius: 99px;
  border: 1px solid var(--line);
  transition: background 0.2s;
  cursor: pointer;
}
.toggle-slot::before {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s var(--ease);
}
.toggle input:checked + .toggle-slot {
  background: var(--accent);
  border-color: transparent;
}
.toggle input:checked + .toggle-slot::before { left: 22px; }

.modal-foot {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}
.modal-foot .btn { flex: 1; }

.ai-status {
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 10px;
}
.ai-status.ok    { background: rgba(74, 222, 128, 0.12); color: var(--green); }
.ai-status.error { background: rgba(239, 79, 94, 0.12);  color: var(--red); }

.server-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-dim);
}
.server-badge .dot {
  width: 8px; height: 8px;
  background: var(--text-mute);
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.3s, box-shadow 0.3s;
}
.server-badge.online .dot {
  background: var(--green);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}
.server-badge.offline .dot {
  background: var(--red);
  box-shadow: 0 0 8px rgba(239, 79, 94, 0.6);
}
.server-badge.online  .badge-text { color: var(--green); }
.server-badge.offline .badge-text { color: var(--red); }

/* =========================================
   TOAST
   ========================================= */
.toast {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 60;
  animation: toastIn 0.3s var(--ease);
  text-align: center;
  max-width: 50vw;
  white-space: normal;
  line-height: 1.45;
}
.toast[hidden] { display: none; }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* =========================================
   AUTH SCREEN
   ========================================= */
.auth-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 50px var(--pad-screen) 30px;
  text-align: center;
  overflow-y: auto;
}
.auth-subtitle {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.55;
  max-width: 290px;
}
.auth-tabs {
  margin-top: 28px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 14px;
}
.auth-tab {
  padding: 10px 0;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.auth-tab.active {
  background: var(--bg-elev);
  color: var(--text);
}
.auth-form {
  margin-top: 22px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-form .field-input {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
}
.auth-error {
  font-size: 12.5px;
  color: var(--red);
  background: rgba(239, 79, 94, 0.1);
  border: 1px solid rgba(239, 79, 94, 0.2);
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
}
.auth-error[hidden] { display: none; }
.auth-form .btn { margin-top: 6px; }

.auth-divider {
  margin: 14px 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-mute);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.platform-web .auth-divider {
  display: none;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.btn-apple {
  background: #000;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.btn-apple:hover { background: #111; }
.apple-logo { font-size: 18px; line-height: 1; }

/* =========================================
   USER STRIP (menu)
   ========================================= */
.user-strip {
  margin-top: auto;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.user-strip[hidden] { display: none; }
.user-email {
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.user-strip .link-btn {
  font-size: 11px;
  padding: 4px 8px;
  white-space: nowrap;
  margin-left: auto;
}

/* =========================================
   AXIS ANCHOR (drift baseline)
   ========================================= */
.axis-anchor {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 99px;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
  transition: left 0.5s var(--ease);
}
.axis-hint {
  font-size: 11px;
  color: var(--text-mute);
  line-height: 1.45;
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

/* =========================================
   ABORT (centred mini-modal)
   ========================================= */
.modal-center {
  align-items: center;
  padding: 20px;
}
.modal-mini {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px 24px 22px;
  text-align: center;
  animation: popIn 0.3s var(--ease);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.modal-mini-icon {
  width: 56px; height: 56px;
  background: rgba(239, 79, 94, 0.12);
  border: 1px solid rgba(239, 79, 94, 0.3);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  color: var(--red);
  margin: 0 auto 14px;
}
.modal-mini-desc {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.55;
}
.modal-mini-actions {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.modal-mini-actions .btn { padding: 12px 14px; }

/* =========================================
   FLASH OVERLAY (pop ± feedback)
   ========================================= */
.flash-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 35;
  opacity: 0;
}
.flash-overlay.flash-pos {
  background: radial-gradient(ellipse at center, rgba(74, 222, 128, 0.45), transparent 70%);
  animation: flashPulse 0.7s var(--ease);
}
.flash-overlay.flash-neg {
  background: radial-gradient(ellipse at center, rgba(239, 79, 94, 0.45), transparent 70%);
  animation: flashPulse 0.7s var(--ease);
}
@keyframes flashPulse {
  0%   { opacity: 0; }
  25%  { opacity: 1; }
  100% { opacity: 0; }
}

.pop-badge {
  position: absolute;
  top: 28%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -2px;
  z-index: 36;
  pointer-events: none;
  opacity: 0;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}
.pop-badge.flash-pos { color: var(--green); animation: badgeFloat 1s var(--ease); }
.pop-badge.flash-neg { color: var(--red);   animation: badgeFloat 1s var(--ease); }
@keyframes badgeFloat {
  0%   { opacity: 0; transform: translate(-50%, -40%) scale(0.7); }
  25%  { opacity: 1; transform: translate(-50%, -55%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -110%) scale(1); }
}

/* =========================================
   PAYWALL MODAL
   ========================================= */
.paywall-card {
  max-width: 380px;
  text-align: left;
  padding: 24px 22px 20px;
  background: linear-gradient(165deg, #221a3d 0%, #1a1132 100%);
  border: 1px solid rgba(176, 123, 255, 0.3);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 60px rgba(176, 123, 255, 0.15);
}
.paywall-badge {
  display: inline-block;
  background: rgba(176, 123, 255, 0.15);
  border: 1px solid rgba(176, 123, 255, 0.3);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 10px;
  letter-spacing: 1.6px;
  font-weight: 700;
  margin-bottom: 16px;
}
.paywall-badge .pb-name { color: var(--purple-soft); margin-right: 6px; }
.paywall-badge .pb-tier { color: #fff; font-weight: 800; }

.paywall-title { text-align: left; font-size: 24px; margin-bottom: 8px; }
.paywall-price {
  margin: 0 0 6px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.price-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 38px;
  font-weight: 800;
  color: var(--purple-soft);
  letter-spacing: -1px;
  line-height: 1;
}
.price-suffix {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.paywall-features {
  list-style: none;
  margin: 18px 0 14px;
  padding: 0;
}
.paywall-features li {
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  grid-template-columns: 22px 1fr;
  column-gap: 10px;
  align-items: start;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}
.paywall-features li:last-child { margin-bottom: 0; }
.paywall-features .bullet {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(176, 123, 255, 0.2);
  color: var(--purple-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}
.paywall-features .ft { display: block; }
.paywall-features strong { color: var(--purple-soft); font-weight: 700; }

.paywall-actions { margin-top: 8px; }
.paywall-actions .btn-primary {
  background: linear-gradient(135deg, #b07bff, #8a4fe8);
  box-shadow: 0 8px 24px rgba(176, 123, 255, 0.35);
}
.paywall-actions .btn-primary:hover { background: linear-gradient(135deg, #c79bff, #9f6cee); }

.paywall-foot {
  margin-top: 14px;
  text-align: center;
  font-size: 10.5px;
  color: var(--text-mute);
  letter-spacing: 0.4px;
}
.paywall-error {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(239, 79, 94, 0.1);
  border: 1px solid rgba(239, 79, 94, 0.25);
  color: var(--red);
  font-size: 12px;
}
.paywall-error[hidden] { display: none; }

/* timeline header label tweaks for premium nodes */
.tl-node.premium .tl-day-label {
  color: var(--purple-soft);
  font-weight: 600;
}

/* =========================================
   CUSTOM ANSWER BUTTON (premium-gated)
   ========================================= */
.choice-custom {
  text-align: left;
  background: linear-gradient(135deg, rgba(176, 123, 255, 0.10), rgba(176, 123, 255, 0.04));
  border: 1px dashed rgba(176, 123, 255, 0.4);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  line-height: 1.4;
  transition: transform 0.15s, background 0.18s, border-color 0.18s;
  margin-top: 2px;
}
.choice-custom:hover {
  background: linear-gradient(135deg, rgba(176, 123, 255, 0.18), rgba(176, 123, 255, 0.08));
  border-color: rgba(176, 123, 255, 0.6);
}
.choice-custom:active { transform: scale(0.98); }
.choice-custom .choice-num {
  background: rgba(176, 123, 255, 0.2);
  color: var(--purple-soft);
}
.choice-custom .premium-pill {
  font-size: 9.5px;
  letter-spacing: 1.2px;
  font-weight: 800;
  background: var(--purple);
  color: #fff;
  padding: 3px 8px;
  border-radius: 99px;
}

/* =========================================
   CUSTOM ANSWER MODAL
   ========================================= */
.custom-card {
  max-width: 400px;
  text-align: left;
  padding: 22px 22px 18px;
}
.custom-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.custom-tag {
  font-size: 10px;
  letter-spacing: 1.6px;
  font-weight: 800;
  color: var(--purple-soft);
  background: rgba(176, 123, 255, 0.15);
  border: 1px solid rgba(176, 123, 255, 0.3);
  padding: 5px 10px;
  border-radius: 99px;
}
.custom-title {
  text-align: left;
  font-size: 20px;
  margin-bottom: 6px;
}
.custom-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 14px;
}
.custom-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  padding: 12px 14px;
  resize: none;
  transition: border-color 0.18s, background 0.18s;
}
.custom-textarea:focus {
  outline: none;
  border-color: var(--purple);
  background: var(--bg-elev);
}
.custom-foot {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.custom-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-mute);
  flex-shrink: 0;
}
.custom-foot .btn { flex: 1; }

/* =========================================================
   PIXEL STYLE — fonts + crisp edges
   ========================================================= */

html, body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 500;
  letter-spacing: 0.1px;
}

.title,
.modal-title,
.brief-title,
.card-name,
.result-title,
.screen-title,
.menu-eyebrow,
.menu-tagline,
.tag-w-red, .tag-w-white, .tag-w-blue,
.paywall-title,
.custom-title,
.choice-num,
.candidate-info-style,
.card-style {
  font-family: 'Silkscreen', 'Inter', system-ui, sans-serif;
  letter-spacing: 0;
}

.title,
.modal-title,
.brief-title,
.card-name,
.result-title,
.paywall-title,
.custom-title { font-weight: 700; }

.title { font-size: clamp(28px, 7.6vw, 42px); line-height: 1; letter-spacing: 0; }
@media (min-width: 480px) { .title { font-size: 22px; } }
.title .excl { color: var(--accent); }
.title .title-text { display: inline-block; }

.modal-title    { font-size: 18px; line-height: 1.35; letter-spacing: 0.4px; }
.brief-title    { font-size: 20px; line-height: 1.25; letter-spacing: 0.3px; }
.card-name      { font-size: 19px; line-height: 1.2; letter-spacing: 0.3px; }
.result-title   { font-size: 22px; line-height: 1.25; letter-spacing: 0.3px; }
.screen-title   { font-size: 15px; font-weight: 700; }
.menu-eyebrow   { font-size: 10px; letter-spacing: 1.8px; font-weight: 600; }
.paywall-title  { font-size: 22px; }
.custom-title   { font-size: 19px; }
.candidate-info-style, .card-style { font-size: 10px; letter-spacing: 1.6px; font-weight: 600; }

.menu-tagline {
  font-size: 11px;
  font-style: normal;
  line-height: 1.7;
  letter-spacing: 0.5px;
}

.hud-num,
.counter,
.btn-meta,
.stat-val,
.stake-val,
.tl-day-label,
.user-email,
.field-input,
.custom-count,
.price-num {
  font-family: 'VT323', 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
}

.hud-num { font-size: 14px; }
.counter { font-size: 13px; }
.tl-day-label { font-size: 11px; }
.stat-val { font-size: 22px; }
.stake-val { font-size: 22px; }
.price-num { font-size: 42px; }

/* HUD click affordance — buttons */
.hud-mini {
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
  font-family: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
}
.hud-mini:active { transform: scale(0.97); }

/* the parent .hud-top has pointer-events: none — re-enable on hud-mini */
.hud-top { pointer-events: none; }
.hud-top .hud-mini { pointer-events: auto; }

/* =========================================================
   CANDIDATE PNG AVATAR — talking animation + party halo
   ========================================================= */

.has-candidate-img {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--c-color, #9bbcf2) 70%, white) 0%, var(--c-color, #9bbcf2) 60%, color-mix(in srgb, var(--c-color, #9bbcf2) 60%, #1d2a55) 100%);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--c-color, #9bbcf2) 60%, white),
    0 8px 22px color-mix(in srgb, var(--c-color, #9bbcf2) 50%, transparent);
}
.has-candidate-img .avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  image-rendering: pixelated;
  display: block;
  pointer-events: none;
  user-select: -webkit-user-select: none;
}
.has-candidate-img .avatar-img.frame-1 { opacity: 0; }
/* talking : alterner rapidement frame-0 / frame-1 */
.has-candidate-img.talking .avatar-img.frame-0 { animation: talkA 0.18s steps(1, end) infinite; }
.has-candidate-img.talking .avatar-img.frame-1 { animation: talkB 0.18s steps(1, end) infinite; }
@keyframes talkA { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes talkB { 0%, 49% { opacity: 0; } 50%, 100% { opacity: 1; } }

/* Hero orb — when a candidate is set, paint with their party color */
.hero-orb {
  position: relative;
}
.hero-orb #hero-face.has-candidate-img {
  position: absolute;
  inset: 8px;
  width: auto;
  height: auto;
  border-radius: 50%;
}

/* Card avatar — bigger image fit */
.card-avatar.has-candidate-img {
  font-size: 0;
}

/* Char avatar in dialogue */
#dlg-player-avatar.has-candidate-img {
  font-size: 0;
}
#dlg-player-avatar.has-candidate-img .char-face {
  position: absolute;
  inset: 0;
  font-size: 0;
}
#dlg-npc-avatar.has-candidate-img {
  font-size: 0;
}
#dlg-npc-avatar.has-candidate-img .char-face {
  position: absolute;
  inset: 0;
  font-size: 0;
}

/* =========================================================
   POLL TEXT — bigger so the popularity narrative is easy to read
   ========================================================= */
.hud-top .poll-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  font-weight: 500;
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 8px;
  pointer-events: none;
}

/* Box popularité centrée horizontalement sur l'écran des jours (timeline). */
.screen[data-screen="timeline"] .hud-top .poll-text {
  width: min(340px, 100%);
  margin-left: auto;
  margin-right: auto;
}

/* =========================================================
   CANDIDATE BADGE (bottom-left of timeline)
   ========================================================= */
.candidate-badge {
  position: absolute;
  left: 14px;
  bottom: calc(env(safe-area-inset-bottom) + 14px);
  z-index: 5;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.premium-flag {
  font-family: 'Silkscreen', 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  padding: 3px 8px;
  border-radius: 6px;
  background: linear-gradient(135deg, #b07bff, #8a4fe8);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 2px rgba(176, 123, 255, 0.25), 0 4px 10px rgba(176, 123, 255, 0.4);
  white-space: nowrap;
  pointer-events: none;
  align-self: center;
}
.premium-flag[hidden] { display: none; }

/* le `display: flex` du .btn écrase [hidden] de l'UA stylesheet — on rétablit. */
.btn[hidden],
button[hidden] { display: none !important; }

/* =========================================================
   MAIN MENU — animation d'entrée séquencée
   ========================================================= */
.screen[data-screen="menu"].active .menu-eyebrow,
.screen[data-screen="menu"].active .title .title-text,
.screen[data-screen="menu"].active .title .excl,
.screen[data-screen="menu"].active .menu-tagline > span {
  opacity: 0;
  animation: menuIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.screen[data-screen="menu"].active .menu-eyebrow         { animation-delay: 0.10s; }
.screen[data-screen="menu"].active .title .title-text    { animation-delay: 0.45s; animation-name: titleIn; }
.screen[data-screen="menu"].active .title .excl          { animation-delay: 0.85s; animation-name: titleExcl; }
.screen[data-screen="menu"].active .tag-w-red            { animation-delay: 1.10s; }
.screen[data-screen="menu"].active .tag-w-white          { animation-delay: 1.30s; }
.screen[data-screen="menu"].active .tag-w-blue           { animation-delay: 1.50s; }
.screen[data-screen="menu"].active .tag-w-end            { animation-delay: 1.85s; }

@keyframes menuIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes titleIn {
  0%   { opacity: 0; transform: translateY(-14px) scale(0.92); }
  60%  { opacity: 1; transform: translateY(2px)   scale(1.04); }
  100% { opacity: 1; transform: translateY(0)     scale(1); }
}
@keyframes titleExcl {
  0%   { opacity: 0; transform: translateY(-22px) scale(0.5)  rotate(-8deg); }
  60%  { opacity: 1; transform: translateY(4px)   scale(1.25) rotate(6deg); }
  100% { opacity: 1; transform: translateY(0)     scale(1)    rotate(0deg); }
}

.title .excl { display: inline-block; transform-origin: 50% 60%; }
.menu-tagline > span { display: inline-block; }

/* =========================================================
   SETTINGS MODAL — section AUDIO
   ========================================================= */
.audio-settings {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings-section-title {
  font-family: 'Silkscreen', 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin: 0 0 4px;
}
.audio-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.audio-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}
.audio-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.toggle-mini {
  position: relative;
  width: 38px; height: 22px;
  flex-shrink: 0;
}
.toggle-mini input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-mini-slot {
  position: absolute; inset: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 99px;
  transition: background 0.2s, border-color 0.2s;
  cursor: pointer;
}
.toggle-mini-slot::before {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.18s var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.toggle-mini input:checked + .toggle-mini-slot {
  background: var(--accent);
  border-color: transparent;
}
.toggle-mini input:checked + .toggle-mini-slot::before { left: 18px; }

.audio-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--v, 50%), rgba(255,255,255,0.1) var(--v, 50%), rgba(255,255,255,0.1) 100%);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
}
.audio-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  cursor: pointer;
}
.audio-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  cursor: pointer;
}

.credits {
  margin-top: 6px;
  text-align: center;
  font-family: 'Silkscreen', 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 1.6px;
  color: var(--text-mute);
  text-transform: uppercase;
  padding: 8px 0 2px;
}

.modal-foot.modal-foot-single { display: block; }
.modal-foot.modal-foot-single .btn { width: 100%; }

/* =========================================================
   CHOICES — entrée séquencée par le bas
   ========================================================= */
.choices .choice-btn,
.choices .choice-custom {
  opacity: 0;
  transform: translateY(18px);
  animation: choiceIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.choices .choice-btn:nth-child(1)  { animation-delay: 0.00s; }
.choices .choice-btn:nth-child(2)  { animation-delay: 0.08s; }
.choices .choice-btn:nth-child(3)  { animation-delay: 0.16s; }
.choices .choice-custom            { animation-delay: 0.26s; }

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

.candidate-badge:active { transform: scale(0.94); }
.candidate-badge-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--c-color, #9bbcf2) 70%, white) 0%, var(--c-color, #9bbcf2) 60%, color-mix(in srgb, var(--c-color, #9bbcf2) 60%, #1d2a55) 100%);
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px color-mix(in srgb, var(--c-color, #9bbcf2) 70%, #000),
    0 6px 18px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}
.candidate-badge-ring.has-candidate-img .candidate-badge-face {
  position: absolute;
  inset: 0;
  font-size: 0;
}
.candidate-badge-ring .avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  image-rendering: pixelated;
}
.candidate-badge-ring .avatar-img.frame-1 { opacity: 0; }

/* =========================================================
   INFO POPUPS (popularity / energy / axis / candidate)
   ========================================================= */
.info-card .modal-mini-icon {
  background: rgba(106, 168, 255, 0.12);
  border-color: rgba(106, 168, 255, 0.35);
  color: var(--blue);
}
.info-icon-pop  { background: rgba(74, 222, 128, 0.12) !important; border-color: rgba(74, 222, 128, 0.35) !important; color: var(--green) !important; }
.info-icon-energy { background: rgba(255, 213, 79, 0.14) !important; border-color: rgba(255, 213, 79, 0.4) !important; color: var(--yellow) !important; }
.info-icon-axis { background: rgba(176, 123, 255, 0.14) !important; border-color: rgba(176, 123, 255, 0.4) !important; color: var(--purple-soft) !important; font-size: 32px !important; }

.modal-mini-actions-single { grid-template-columns: 1fr; }

/* button text centered in modal-mini buttons (info / abort / candidate-info, NOT paywall) */
.btn-label-center { width: 100%; text-align: center; font-size: 13px; }
.modal-mini-actions:not(.paywall-actions) .btn { justify-content: center; padding: 12px 14px; }
.modal-mini-actions:not(.paywall-actions) .btn .btn-arrow { display: none; }
.btn-centered { justify-content: center; }
.btn-centered .btn-arrow { display: none; }

/* candidate-info modal — portrait */
.candidate-info-card { padding: 22px 22px 18px; }
.candidate-info-portrait {
  width: 92px; height: 92px;
  border-radius: 50%;
  margin: 0 auto 12px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--c-color, #9bbcf2) 70%, white) 0%, var(--c-color, #9bbcf2) 60%, color-mix(in srgb, var(--c-color, #9bbcf2) 60%, #1d2a55) 100%);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--c-color, #9bbcf2) 60%, white),
    0 6px 18px rgba(0, 0, 0, 0.45);
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
}
.candidate-info-portrait .avatar-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 18%;
  image-rendering: pixelated;
}
.candidate-info-portrait .avatar-img.frame-1 { opacity: 0; }
.candidate-info-style {
  margin-top: 6px;
  color: var(--text-dim);
}
.candidate-info-party {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  margin: 4px 0 12px;
  letter-spacing: 0.5px;
}

/* =========================================================
   PIXEL STYLE — buttons, cards, hard edges
   ========================================================= */
.btn {
  border-radius: 6px;
  border: 2px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
.btn-primary {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 0 0 #b94055, 0 8px 18px var(--accent-glow);
}
.btn-primary:active { transform: translateY(2px); box-shadow: 0 2px 0 0 #b94055, 0 4px 10px var(--accent-glow); }
.btn-blue {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 0 0 #2c5da8, 0 8px 18px var(--blue-glow);
}
.btn-blue:active { transform: translateY(2px); box-shadow: 0 2px 0 0 #2c5da8, 0 4px 10px var(--blue-glow); }
.btn-ghost { border-color: var(--line-strong); }
.btn-danger {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 0 0 #952d3a, 0 6px 18px rgba(239, 79, 94, 0.3);
}
.btn-danger:active { transform: translateY(2px); box-shadow: 0 2px 0 0 #952d3a, 0 3px 10px rgba(239, 79, 94, 0.3); }

.btn-arrow { border-radius: 4px; }
.icon-btn { border-radius: 6px; }
.counter { border-radius: 6px; }
.field-input { border-radius: 6px; }
.field-row { border-radius: 6px; }
.candidate-card { border-radius: 10px; }
.brief-card,
.brief-meta,
.stake,
.result-stat,
.hud-mini,
.modal-mini { border-radius: 10px; }
.modal-mini { border-width: 2px; }
.modal-card { border-radius: 12px 12px 0 0; }

.dialogue-text { border-radius: 10px; border-width: 2px; }
.choice-btn,
.choice-custom { border-radius: 6px; border-width: 2px; }

.tl-bubble {
  border-radius: 10px;
  border-width: 2px;
  image-rendering: pixelated;
}
.tl-node.available .tl-bubble {
  border: 2px solid rgba(0, 0, 0, 0.35);
}

/* hero-orb — slightly more square pixel feel */
.hero-orb { border-radius: 18px; }
.hero-orb::before, .hero-orb::after { border-radius: 18px; }
.hero-orb #hero-face.has-candidate-img { border-radius: 14px; }

/* card-avatar — pixel-square portrait */
.card-avatar { border-radius: 12px; }
.has-candidate-img.card-avatar .avatar-img,
.has-candidate-img#dlg-player-face .avatar-img,
#dlg-player-avatar.has-candidate-img .avatar-img {
  image-rendering: pixelated;
}
#dlg-player-avatar { border-radius: 14px; }
#dlg-player-avatar.has-candidate-img { border-radius: 14px; }
.char-avatar { border-radius: 14px; }

.candidate-badge-ring { border-radius: 14px; }
.candidate-info-portrait { border-radius: 16px; }

/* =========================================================
   TIMELINE NODE COLOR — keep pulse but with pixel border
   ========================================================= */
.tl-bubble { box-shadow: 0 4px 0 0 rgba(0, 0, 0, 0.35); }
.tl-node.available .tl-bubble { box-shadow: 0 4px 0 0 rgba(0, 0, 0, 0.35), 0 6px 18px var(--type-glow, var(--accent-glow)); }

/* tag-w lines — slightly stronger weight in pixel font */
.menu-tagline .tag-w-red, .menu-tagline .tag-w-white, .menu-tagline .tag-w-blue { font-weight: 700; }

/* dialogue bubble look-and-feel */
.speaker-tag { font-family: 'Silkscreen', 'Inter', sans-serif; font-size: 11px; letter-spacing: 1.4px; font-weight: 700; }

/* paywall already has its own visual identity */
.paywall-card { border-radius: 14px; border-width: 2px; }

