@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700;900&display=swap');

@font-face {
  font-family: 'TikTokSans';
  src: local('TikTok Sans'),
       url('fonts/TikTokSans-VariableFont_opsz,slnt,wdth,wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
}

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

body {
  background: #000;
  overflow: hidden;
  font-family: 'TikTokSans', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}

/* ── LOGIN SCREEN ────────────────────────────────────────────────────────── */
/* ── LOGIN ────────────────────────────────────────────────────────────────── */
#login-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .6s ease;
}
#login-screen.fade-out { opacity: 0; pointer-events: none; }

#login-inner {
  width: 100%;
  max-width: 560px;
  padding: 0 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Bloc titre : fond noir, texte blanc, pleine largeur */
#login-title-block {
  width: 100%;
  background: transparent;
  text-align: center;
  padding: 0;
  margin-bottom: 20px;
}
#login-title {
  font-size: clamp(40px, 9.5vw, 160px);
  font-weight: 900;
  letter-spacing: -.5px;
  text-transform: uppercase;
  margin: 0 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.login-title-line {
  display: inline-block;
  background: #000;
  color: #fff;
  padding: 2px 4px;
  white-space: nowrap;
  line-height: 1.05;
  opacity: 0;
  transform: translateY(-40px);
  animation: titleDrop 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.login-title-line:nth-child(1) { animation-delay: 0.1s; }
.login-title-line:nth-child(2) { animation-delay: 0.35s; }

@keyframes titleDrop {
  0%   { opacity: 0; transform: translateY(-40px) scaleX(0.92); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scaleX(1); }
}
#login-sub {
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 600;
  color: #fff;
  background: #000;
  line-height: 1.4;
  margin: 6px 0 24px;
  text-align: center;
  padding: 4px 8px;
  display: inline-block;
}

/* Formulaire */
#login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-field {
  position: relative;
  display: flex;
  flex-direction: column;
}

.login-field input {
  width: 100%;
  background: #000;
  border: none;
  color: #fff;
  font-size: clamp(16px, 2vw, 22px);
  padding: 14px 18px;
  outline: none;
  -webkit-appearance: none;
  text-align: center;
}
.login-field input::placeholder { color: rgba(255,255,255,.35); }
.login-field input[type=number]::-webkit-inner-spin-button,
.login-field input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Réponse affichée sous chaque champ */
.login-answer {
  display: block;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 600;
  font-style: italic;
  color: #000;
  text-align: center;
  padding: 4px 0 8px;
  font-family: 'TikTokSans', 'Roboto', sans-serif;
}

.login-eye {
  position: absolute;
  right: 14px;
  top: 14px;
  cursor: pointer;
  font-size: 18px;
  opacity: .4;
  user-select: none;
}

#login-btn {
  width: 100%;
  background: #000;
  border: none;
  color: #fff;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 700;
  padding: 16px;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity .15s;
}
#login-btn:hover  { opacity: .8; }
#login-btn:active { opacity: .6; }

#login-terms {
  font-size: clamp(11px, 1.2vw, 13px);
  color: #fff;
  background: #000;
  padding: 10px 16px;
  text-align: center;
  line-height: 1.6;
  margin-top: 10px;
  width: 100%;
  font-weight: 600;
}
#login-terms span { text-decoration: underline; cursor: pointer; }

/* ── INTRO (overlay fixe, disparaît au scroll) ───────────────────────────── */
#intro {
  position: fixed;
  inset: 0;
  z-index: 900;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  transition: opacity .7s ease;
}
#intro.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Fond de thumbnails défilantes — caché, fond noir pur à la place */
#intro-bg {
  display: none;
}

.intro-bg-row {
  display: flex;
  gap: 3px;
  min-height: 0;
  overflow: hidden;
  will-change: transform;
}

.intro-bg-row img {
  height: 100%;
  width: auto;
  flex-shrink: 0;
  border-radius: 3px;
  display: block;
}

@keyframes ibg-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes ibg-right {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

.intro-bg-row:nth-child(1) { animation: ibg-left  30s linear infinite; }
.intro-bg-row:nth-child(2) { animation: ibg-right 38s linear infinite; }
.intro-bg-row:nth-child(3) { animation: ibg-left  25s linear infinite; }
.intro-bg-row:nth-child(4) { animation: ibg-right 42s linear infinite; }
.intro-bg-row:nth-child(5) { animation: ibg-left  33s linear infinite; }
.intro-bg-row:nth-child(6) { animation: ibg-right 27s linear infinite; }

/* Voile sombre sur les thumbnails pour la lisibilité du texte */
#intro::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0,0,0,.6);
  pointer-events: none;
}

#intro-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

#intro-name {
  font-size: clamp(40px, 7vw, 96px);
  font-weight: 700;
  letter-spacing: -2px;
  color: #fff;
  line-height: 1;
}

#intro-subject {
  font-size: clamp(22px, 3.5vw, 52px);
  font-weight: 300;
  letter-spacing: -1px;
  color: rgba(255,255,255,.4);
  line-height: 1;
}

#intro-scroll {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: rgba(255,255,255,.55);
  white-space: nowrap;
}

#intro-cta {
  font-size: clamp(28px, 4.5vw, 64px);
  font-weight: 300;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#intro-arrow {
  font-size: clamp(24px, 3vw, 42px);
  animation: bounce 2.2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(7px); }
}


/* ── SIDEBAR ──────────────────────────────────────────────────────────────── */
#sidebar {
  display: none !important;
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: 110px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: #000;
  border-left: 1px solid rgba(255,255,255,.08);
  padding: 24px 0 18px;
}

#sidebar-modes {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 10px;
}

.sb-btn {
  width: 100%;
  padding: 13px 8px;
  background: none;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  color: rgba(255,255,255,.32);
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: .3px;
  cursor: pointer;
  text-align: center;
  transition: color .15s, background .15s, border-color .15s;
}
.sb-btn:hover {
  color: rgba(255,255,255,.75);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.18);
}
.sb-btn.active {
  color: #fff;
  background: rgba(255,255,255,.11);
  border-color: rgba(255,255,255,.28);
}

#mute-btn {
  margin: 14px 10px 0;
  padding: 11px 8px;
  background: none;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: rgba(255,255,255,.38);
  font-size: 9px;
  font-family: inherit;
  letter-spacing: .3px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: color .15s, background .15s;
}
#mute-btn:hover { color: rgba(255,255,255,.75); background: rgba(255,255,255,.06); }
#mute-btn.muted { color: rgba(255,255,255,.2); }
#mute-icon  { font-size: 16px; line-height: 1; }
#mute-label { font-size: 9px; letter-spacing: .3px; text-transform: uppercase; }

/* ── ABOUT PANEL ─────────────────────────────────────────────────────────── */
#about-panel {
  position: fixed;
  top: var(--header-h, 147px);   /* sous le header : la nav reste cliquable */
  bottom: 0; left: 0;
  right: 0;
  z-index: 610;                  /* au-dessus du mode courant, sous le header */
  background: #000;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow-y: auto;
  overscroll-behavior: contain;  /* le scroll s'arrête au texte, pas de fond visible */
  scrollbar-width: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
#about-panel::-webkit-scrollbar { display: none; }
#about-panel.open { opacity: 1; pointer-events: auto; }

/* Tant que « À propos » est ouvert : on masque TOUTES les couches qui jouent
   des vidéos, pour qu'il n'y ait jamais rien derrière le texte (ni pendant la
   transition, ni au rebond du scroll). Le header reste visible/cliquable. */
body:has(#about-panel.open) #chaos-stage,
body:has(#about-panel.open) #fyp-container,
body:has(#about-panel.open) #viewport,
body:has(#about-panel.open) #ts-bg-video,
body:has(#about-panel.open) #text-scroll-overlay,
body:has(#about-panel.open) .tc-zoom,
body:has(#about-panel.open) #fyp-overlay,
body:has(#about-panel.open) #fyp-popup {
  display: none !important;
}

#about-inner {
  position: relative;
  max-width: none;       /* presque tout l'écran… */
  width: 100%;
  padding: 40px 22vw 100px 64px;   /* …avec une grande bande noire à droite */
}

#about-close {
  position: absolute;
  top: 20px; right: 20px;
  background: none;
  border: none;
  color: rgba(255,255,255,.35);
  font-size: 18px;
  cursor: pointer;
  transition: color .15s;
}
#about-close:hover { color: #fff; }

#about-title {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -.5px;
  line-height: 1.05;
  margin-bottom: 32px;
}

#about-body {
  display: flex;
  flex-direction: column;
  gap: 8px;            /* paragraphes plus resserrés */
}
#about-body p {
  font-size: 25px;
  line-height: 1.17;   /* façon InDesign : interlignage ≈ corps × 14/12 */
  color: rgba(255,255,255,.82);
  font-weight: 400;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  orphans: 2;
  widows: 2;
  text-wrap: pretty;   /* évite les lignes orphelines (mot seul en fin) */
  margin: 0;
}
#about-body .about-h {
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  margin: 26px 0 6px;
}
#about-body .about-h:first-child { margin-top: 0; }

/* ── CHAOS WORDS (conservé pour compatibilité) ───────────────────────────── */
.chaos-word {
  position: fixed;
  pointer-events: none;
  color: #fff;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.85;
  z-index: 150;
  opacity: 0;
  transition: opacity .5s ease;
  white-space: nowrap;
  mix-blend-mode: difference;
}
.chaos-word.visible { opacity: 1; }

/* ── BOTTOM NAV ───────────────────────────────────────────────────────────── */
#bnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 400;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: #000;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-top: env(safe-area-inset-top);
}

.bnav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  margin: 0 3px;
  color: rgba(255,255,255,.45);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .3px;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.bnav-btn svg { width: 22px; height: 22px; }
.bnav-btn:hover { color: rgba(255,255,255,.8); background: rgba(255,255,255,.1); }
.bnav-btn.active { color: #fff; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); }

#bnav-plus {
  flex: 0 0 52px;
  width: 52px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  border: none;
  color: #000;
  font-size: 22px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, background .15s;
  line-height: 1;
}
#bnav-plus:hover { background: #e0e0e0; transform: scale(1.05); }
#bnav-plus.active { background: rgba(255,255,255,.15); color: #fff; }

/* ── FIT BUTTON ───────────────────────────────────────────────────────────── */
#btn-fit {
  position: fixed;
  bottom: 14px;
  right: 14px;
  z-index: 300;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(10,10,10,.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255,255,255,.45);
  font-size: 14px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
#btn-fit:hover { color: #fff; border-color: rgba(255,255,255,.4); }

/* ── ZOOM LABEL ───────────────────────────────────────────────────────────── */
#zoom-label { display: none; }
#btn-fit    { display: none; }

/* ── PLUS MENU ────────────────────────────────────────────────────────────── */
#plus-menu {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 500;
  display: flex;
  gap: 10px;
  background: rgba(12,12,12,.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 10px 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
#plus-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.plus-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.7);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.plus-item:hover { background: rgba(255,255,255,.12); color: #fff; }
.plus-item.active { background: #fff; color: #000; }
.plus-item-icon { font-size: 18px; line-height: 1; }

/* ── JOURS PANEL ──────────────────────────────────────────────────────────── */
#jours-panel {
  position: fixed;
  top: 0;
  left: 0; right: 110px;
  z-index: 350;
  background: rgba(10,10,10,.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  transform: translateY(-100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  max-height: 60vh;
  overflow-y: auto;
}
#jours-panel.open { transform: translateY(0); }

#jours-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  letter-spacing: .3px;
}
#jours-close {
  background: none; border: none;
  color: rgba(255,255,255,.4);
  font-size: 14px; cursor: pointer;
}

#jours-list { padding: 0 12px 16px; }

.jour-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s;
}
.jour-row:hover { background: rgba(255,255,255,.06); }
.jour-row-label {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  min-width: 56px;
}
.jour-row-count {
  font-size: 11px;
  color: rgba(255,255,255,.35);
  flex: 1;
}
.jour-row-thumbs {
  display: flex;
  gap: 3px;
}
.jour-row-thumbs img {
  width: 32px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  opacity: .7;
}

/* ── LOUISE PROFILE ───────────────────────────────────────────────────────── */
#louise-profile {
  position: fixed;
  top: var(--header-h, 147px);   /* sous le header : la nav reste cliquable */
  left: 0; right: 0; bottom: 0;
  z-index: 600;
  background: #000;
  overflow-y: auto;
  display: none;
}
#louise-profile.open { display: flex; align-items: flex-start; justify-content: flex-start; }

#louise-close {
  position: fixed;
  top: calc(var(--header-h, 147px) + 14px); right: 24px;
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  transition: color .2s;
}
#louise-close:hover { color: #fff; }

#louise-inner {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  padding: 64px 40px;
  gap: 40px;
}

#louise-right {
  display: flex;
  flex-direction: column;
  gap: 0;
}

#louise-top {
  display: flex;
  align-items: center;
  gap: 24px;
}
#louise-avatar {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
}
#louise-stats {
  display: flex;
  gap: 36px;
  margin-top: 4px;
}
.louise-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.louise-stat-n {
  font-family: 'TikTokSans', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.louise-stat-l {
  font-family: 'TikTokSans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,.45);
}

#louise-name,
#louise-meta,
#louise-meta div,
#louise-bio {
  font-family: 'TikTokSans', sans-serif;
  font-size: 24px;
  font-weight: 400;
  color: #fff;
  line-height: 1.45;
  letter-spacing: 0;
  white-space: normal;
}

#louise-bio {
  flex: 1 1 320px;
  max-width: 1000px;
  margin: 0;
  text-align: left;
  line-height: 1.17;
}

#louise-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  width: 100%;
  margin-top: 10px;
}
#louise-grid img {
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: cover;
  display: block;
  cursor: pointer;
  opacity: .85;
  transition: opacity .2s;
}
#louise-grid img:hover { opacity: 1; }

/* ── TEXTE PLEIN ÉCRAN ────────────────────────────────────────────────────── */
#text-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 10vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s;
  cursor: pointer;
}
#text-fullscreen.visible {
  opacity: 1;
  pointer-events: auto;
}
#text-fs-content {
  font-size: clamp(20px, 2.8vw, 42px);
  line-height: 1.75;
  color: rgba(255,255,255,.88);
  text-align: center;
  max-width: 820px;
  max-height: 80vh;
  overflow-y: auto;
  transition: opacity .12s ease;
}

/* Mode mot par mot — un seul mot, très grand */
#text-fs-content.word-mode {
  font-size: clamp(52px, 11vw, 150px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 2px 30px rgba(0,0,0,.9);
  max-height: none;
  overflow: visible;
}

/* ── TRIAGE PANEL ─────────────────────────────────────────────────────────── */

/* ── SONDAGE PANEL ────────────────────────────────────────────────────────── */
#sondage-panel {
  position: fixed;
  inset: 0;
  z-index: 620;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
#sondage-panel.open { transform: translateY(0); }

#sondage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  flex-shrink: 0;
}
#sondage-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}
#sondage-close:hover { color: #fff; }

#sondage-inner {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 40px;
}

#sondage-total {
  font-size: 13px;
  color: rgba(255,255,255,.4);
  margin-bottom: 28px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.sondage-group-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  color: rgba(255,255,255,.25);
  text-transform: uppercase;
  margin: 24px 0 10px;
}
.sondage-group-label:first-child { margin-top: 0; }

.sondage-row {
  display: grid;
  grid-template-columns: 130px 1fr 42px 38px 64px;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sondage-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sondage-bar-wrap {
  height: 6px;
  background: rgba(255,255,255,.07);
  border-radius: 3px;
  overflow: hidden;
}
.sondage-bar {
  height: 100%;
  border-radius: 3px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

.sondage-count {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-align: right;
}
.sondage-pct {
  font-size: 12px;
  color: rgba(255,255,255,.35);
  text-align: right;
}

.sondage-voir {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: transparent;
  border: 1px solid;
  cursor: pointer;
  letter-spacing: .03em;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}
.sondage-voir:hover { opacity: .75; }

.sondage-empty {
  color: rgba(255,255,255,.3);
  font-size: 14px;
  text-align: center;
  margin-top: 40px;
}

/* ── FILTER CHIP ─────────────────────────────────────────────────────────── */
#filter-chip {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  z-index: 450;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(20,20,20,.92);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px;
  padding: 6px 14px 6px 16px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s;
}
#filter-chip.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
#filter-chip-label {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .03em;
}
#filter-chip-clear {
  font-size: 11px;
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: 12px;
  color: rgba(255,255,255,.7);
  padding: 3px 9px;
  cursor: pointer;
  white-space: nowrap;
}
#filter-chip-clear:hover { background: rgba(255,255,255,.2); }

/* Tuiles masquées par le filtre */
.tile.cat-hidden { opacity: 0.06 !important; }

/* ── VIEWPORT ─────────────────────────────────────────────────────────────── */
#viewport {
  position: fixed;
  top: var(--header-h, 140px); bottom: 0; left: 0;
  right: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── WALL ─────────────────────────────────────────────────────────────────── */
#wall {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 2px;
  padding: 2px;
  width: 100%;
  align-content: start;
}

/* ── FYP ─────────────────────────────────────────────────────────────────── */
#fyp-container {
  display: none;
  position: fixed;
  top: var(--header-h, 140px); left: 0; right: 0; bottom: 0;
  background: #000;
  z-index: 590;
  overflow: hidden;
  flex-direction: column;
}
#fyp-filter-bar {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 48px;
  padding: 20px 32px 16px;
  background: none;
  border-bottom: 1px solid rgba(255,255,255,.15);
  flex-wrap: wrap;
  pointer-events: all;
}
.fyp-day-btn {
  background: none;
  border: none;
  color: #fff;
  font-family: 'TikTokSans', sans-serif;
  font-size: 26px;        /* même taille que les thèmes (.tc-cat-btn) */
  font-weight: 500;       /* même graisse que les thèmes / mots suggérés */
  padding: 8px 0;
  cursor: pointer;
  transition: color .2s;
  letter-spacing: .01em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
/* Icône Couleur (dégradés) à côté de Jour 7 */
.fyp-color-btn {
  background: none;
  border: none;
  padding: 0 0 2px;
  margin-left: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  line-height: 0;
  opacity: .85;
  transition: opacity .2s, transform .2s;
}
.fyp-color-btn:hover { opacity: 1; transform: scale(1.1); }
.fyp-color-btn.active { opacity: 1; }
.fyp-color-btn svg { display: block; }
.fyp-day-count {
  font-size: 19px;
  font-weight: 400;
  opacity: .55;
  letter-spacing: .02em;
}
.fyp-day-btn:hover  { color: #25f4ee; }
.fyp-day-btn.active { color: #25f4ee; }
.fyp-btn-count { opacity: .55; font-weight: 400; font-size: 13px; margin-left: 3px; }
#fyp-grid {
  display: grid;
  gap: 2px;
  padding: 4px;
  flex: 1;
  overflow: hidden;
  align-content: start;
  position: relative;
  will-change: transform;
}
.fyp-thumb {
  overflow: hidden;
  cursor: pointer;
  background: #111;
  transition: transform .25s cubic-bezier(0.22,1,0.36,1), opacity .15s;
}
.fyp-thumb:hover { transform: scale(1.08); z-index: 2; }
/* Quand la grille est zoomée, on désactive le micro-zoom au survol (évite les sauts) */
#fyp-grid.zoomed .fyp-thumb:hover { transform: none; }
.fyp-thumb.playing { z-index: 5; }
.fyp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; filter: brightness(1.15) contrast(1.05); }

/* ── Feed « Pour toi » scrollable (séparateurs par jour) ── */
#fyp-grid.feed {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  padding: 0 2px 50px;
  will-change: auto;
}
#fyp-grid.feed::-webkit-scrollbar { display: none; }
#fyp-grid.feed .fyp-thumb { aspect-ratio: 9 / 16; }
#fyp-grid.feed .fyp-thumb:hover { transform: none; }
#fyp-grid.feed .fyp-thumb .tile-like-heart {
  position: absolute; top: 5px; right: 6px;
  width: 14px; height: 14px; z-index: 4; pointer-events: none;
}
.fyp-day-sep2 {
  grid-column: 1 / -1;
  font-family: 'TikTokSans', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  padding: 28px 6px 12px;
  border-bottom: 1px solid rgba(255,255,255,.18);
  margin-bottom: 4px;
}
.fyp-day-sep2:first-child { padding-top: 12px; }
.fyp-sep-count { font-weight: 400; color: rgba(255,255,255,.55); font-size: 19px; margin-left: 6px; }
/* « J'aime » et « Couleur » : rouge au survol ET au clic */
.fyp-like-btn:hover,
.fyp-like-btn:hover .fyp-day-count,
.fyp-like-btn.active,
.fyp-like-btn.active .fyp-day-count,
.fyp-color-day:hover,
.fyp-color-day:hover .fyp-day-count,
.fyp-color-day.active,
.fyp-color-day.active .fyp-day-count { color: #fe2c55; }

/* ── COEUR TIKTOK ────────────────────────────────────────────────────────── */
.tiktok-heart {
  position: absolute;
  top: 50%; left: 50%;
  width: 60px; height: 60px;
  transform: translate(-50%, -50%) scale(0) rotate(-45deg);
  pointer-events: none;
  z-index: 999;
  transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tiktok-heart::before,
.tiktok-heart::after {
  content: '';
  position: absolute;
  width: 60px; height: 60px;
  background: #fe2c55;
  border-radius: 50% 50% 0 0;
}
.tiktok-heart::before { left: 0; transform-origin: 100% 100%; transform: rotate(-45deg); }
.tiktok-heart::after  { left: 30px; transform-origin: 0 100%; transform: rotate(45deg); }
.tiktok-heart.pop {
  transform: translate(-50%, -50%) scale(1) rotate(-45deg);
}
.tiktok-heart.fly {
  transform: translate(-50%, -120%) scale(0.6) rotate(-45deg);
  opacity: 0;
  transition: transform .6s ease, opacity .5s ease;
}


#fyp-popup {
  position: fixed;
  z-index: 2000;
  background: #000;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.8);
  animation: popupIn .2s ease;
}
#fyp-popup video { width: 100%; height: 100%; object-fit: cover; }
@keyframes popupIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── FYP MODE ────────────────────────────────────────────────────────────── */
body.mode-fyp #wall {
  grid-template-columns: repeat(auto-fill, var(--fyp-tile-w, 36px));
  grid-auto-rows: var(--fyp-tile-h, 64px);
  gap: 2px;
  padding: 0;
}
body.mode-fyp .tile {
  width: 100%;
  height: var(--fyp-tile-h, 64px);
  aspect-ratio: unset;
}

/* Overlay plein écran FYP */
#fyp-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
#fyp-overlay.open { display: flex; }
#fyp-overlay video {
  max-height: 95vh;
  max-width: 95vw;
  aspect-ratio: 9/16;
  object-fit: contain;
}

/* ── BARRE FILTRE JOURS (modes texte / couleur / classification) ─────────── */
#day-filter-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  top: auto;
  z-index: 500;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  gap: 0;
  padding: 0 48px 28px;
  background: none;
  border-top: 1px solid rgba(255,255,255,.15);
  pointer-events: all;
}
.day-filter-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  font-family: 'TikTokSans', sans-serif;
  font-size: 22px;
  font-weight: 600;
  padding: 8px 0;
  cursor: pointer;
  transition: color .2s;
  letter-spacing: .01em;
}
.day-filter-btn:hover { color: #25f4ee; }
.day-filter-btn.active { color: #25f4ee; }
.fyp-btn-count { display: none; }

/* ── DÉGRADÉ FILTER BAR ──────────────────────────────────────────────────── */
#degrade-filter-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 110px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.92);
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.deg-filter-btn {
  background: none;
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  font-family: 'TikTokSans', 'Roboto', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  white-space: nowrap;
}
.deg-filter-btn span { opacity: .6; margin-left: 4px; font-weight: 400; }
.deg-filter-btn:hover { background: rgba(255,255,255,.1); }
.deg-filter-btn.active {
  background: var(--fam-color, #fff);
  border-color: var(--fam-color, #fff);
  color: #000;
}
.deg-filter-btn.active span { opacity: .7; }
body.mode-degrade #viewport { padding-top: 48px; }

/* ── FYP DAY SEPARATOR ───────────────────────────────────────────────────── */
.fyp-day-sep {
  grid-column: 1 / -1;
  background: #000;
  color: #fff;
  font-family: 'TikTokSans', 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 6px 12px;
  border-top: 1px solid rgba(255,255,255,.3);
  border-bottom: 1px solid rgba(255,255,255,.3);
  margin-top: 8px;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
}
.fyp-day-count {
  font-weight: 400;
  opacity: 0.55;
  font-size: 16px;
}

/* ── TILE ─────────────────────────────────────────────────────────────────── */
.tile {
  position: relative;
  overflow: hidden;
  background: #0a0a0a;
  cursor: pointer;
  width: 100%;
  aspect-ratio: 9/16;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s ease, transform .5s ease, box-shadow .35s;
}
/* Mode normal : apparition au scroll (IntersectionObserver) */
.tile.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ── MODE CHAOS : grille visible ─────────────────────────────────────────────── */
body.mode-chaos #viewport { overflow: hidden; }
body.mode-chaos .tile { opacity: 0; }
body.mode-chaos .tile.scattered { opacity: 1; }

/* ── CHAOS STAGE ─────────────────────────────────────────────────────────────── */
#chaos-stage {
  position: fixed;
  top: var(--header-h, 140px); left: 0; right: 0; bottom: 0;
  z-index: 600;
  background: #000;
  display: none;
}
body.mode-chaos #chaos-stage { display: block; }

#cs-scroll-hint {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.7;
  font-family: 'TikTokSans', 'Roboto', sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: #00d4cf;
  pointer-events: none;
  z-index: 700;
  transition: opacity 0.4s ease;
}
#cs-scroll-hint.hidden { opacity: 0; }
.cs-arrow {
  font-size: 28px;
  animation: arrowBounce 1.2s ease-in-out infinite;
}
@keyframes arrowBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(8px); }
}

/* ── INTRO ────────────────────────────────────────────────────────────────── */
#intro-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
#intro-screen.exit {
  opacity: 0;
  pointer-events: none;
}

/* ── Phase 1-5 : stack de mots (absolute, white centré) ── */
#intro-stack {
  position: absolute;
  inset: 0;
  transition: opacity 0.4s ease;
}
#intro-stack.hidden { opacity: 0; pointer-events: none; }

.iword {
  position: absolute;
  left: 0; right: 0;
  text-align: center;
  font-size: clamp(52px, 9vw, 112px);
  font-weight: bold;
  letter-spacing: -0.02em;
  font-family: 'TikTokSans', 'Arial Black', 'Roboto', sans-serif;
  white-space: nowrap;
  font-weight: bold;
  /* off-screen bas par défaut */
  transform: translateY(110vh);
  opacity: 0;
  transition: transform 0.7s cubic-bezier(0.25, 1, 0.35, 1),
              opacity 0.35s ease,
              top 0.6s cubic-bezier(0.25, 1, 0.35, 1);
  will-change: transform, top;
}
/* en place → chaque mot centré verticalement sur son top */
.iword.in  { transform: translateY(-50%); opacity: 1; }
/* sortie vers le bas */
.iword.out { transform: translateY(110vh); opacity: 0;
             transition-timing-function: cubic-bezier(0.5, 0, 0.75, 0.2), ease, ease;
             transition-duration: 0.8s, 0.55s, 0.3s; }

/* Positions */
#iw-pink  { top: calc(50% - 1.3em); color: #fe2c55; z-index: 2; }
#iw-white { top: 50%;               color: #ffffff; z-index: 4; } /* toujours au-dessus */
#iw-cyan  { top: calc(50% + 1.3em); color: #25f4ee; z-index: 1; }

/* Entassement : rose en premier, bleu ensuite */
#iw-pink.stacked { top: 50%; }
#iw-cyan.stacked { top: 50%; }

/* Sortie douce : fondu sans glissement (pour ne pas masquer le blanc) */
.iword.out-fade {
  opacity: 0;
  transition: opacity 0.7s ease !important;
}

/* ── Phase 6 : phrase ── */
#intro-phrase {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8vw;
  text-align: center;
  font-size: clamp(18px, 2.3vw, 34px);
  font-weight: 300;
  font-family: 'Arial', sans-serif;
  color: #fff;
  letter-spacing: normal;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}
#intro-phrase.visible { opacity: 1; }

/* ── Phase 7 : chevrons ── */
#intro-arrows {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease,
              transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}
#intro-arrows.visible {
  opacity: 1;
  pointer-events: auto;
}
/* Sortie : les flèches glissent vers le haut */
#intro-arrows.exit-up {
  transform: translateY(-110vh);
  opacity: 0;
  pointer-events: none;
}

#intro-chevrons-svg {
  width: clamp(600px, 95vw, 1600px);
  height: auto;
  animation: chevFloat 1.5s ease-in-out infinite;
}

/* Lévitation haut/bas — amplitude plus marquée */
@keyframes chevFloat {
  0%, 100% { transform: translateY(-18px); }
  50%       { transform: translateY(18px); }
}

/* hint scroll */
#intro-scroll-hint {
  position: absolute;
  bottom: 7%;
  left: 0; right: 0;
  text-align: center;
  font-family: 'TikTokSans', 'Arial', sans-serif;
  font-size: clamp(20px, 2vw, 30px);
  letter-spacing: 0.04em;
  color: #ffffff;
}
@keyframes hintPulse {
  0%, 100% { opacity: 0.35; }
  50%       { opacity: 0.7; }
}

#cs-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 650;
  background: #000;
  border-bottom: 2px solid rgba(255,255,255,.9);
  padding: 14px 28px 18px;
}

#cs-header-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
#cs-title {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  cursor: pointer;
  gap: 14px 28px;
}
#cs-title-text {
  font-size: 44px;
  font-weight: 700;
  font-family: 'TikTokSans', 'Roboto', sans-serif;
  color: #fff;
  letter-spacing: 0.02em;
  position: relative;
  display: inline-block;
  cursor: pointer;
  font-style: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

#cs-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cs-nav-group {
  position: relative;
  display: flex;
  align-items: center;
}
.cs-nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding-top: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.cs-nav-group:hover .cs-nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.cs-nav-sub-btn {
  background: #000;               /* rectangle noir */
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 0;               /* rectangle franc, pas d'arrondi */
  color: #fff;                    /* typo blanche au repos */
  font-family: 'TikTokSans', 'Roboto', sans-serif;
  font-size: 22px;
  font-weight: 500;
  padding: 8px 24px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
/* Au survol : la typo devient rose, le rectangle reste noir */
.cs-nav-sub-btn:hover  { color: #fe2c55; background: #000; border-color: #fe2c55; }
.cs-nav-sub-btn.active { color: #fe2c55; background: #000; border-color: #fe2c55; }
.cs-nav-btn {
  background: none;
  border: none;
  color: #fff;
  font-family: 'TikTokSans', 'Roboto', sans-serif;
  font-size: 30px;
  font-weight: 500;
  padding: 4px 12px 8px;
  cursor: pointer;
  letter-spacing: .01em;
  position: relative;
  transition: color .15s;
}
.cs-nav-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: #e83759;
  transition: width .2s ease;
}
.cs-nav-btn:hover { color: #e83759; }
.cs-nav-btn:hover::after { width: 24px; }
.cs-nav-btn.active { color: #e83759; }
.cs-nav-btn.active::after { width: 24px; }

body.custom-cursor,
body.custom-cursor * {
  cursor: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=') 0 0, none !important;
}

#cs-mute {
  position: absolute;      /* épinglé dans le coin haut-droit du header */
  top: 14px;
  right: 28px;
  background: none;
  border: none;
  color: rgba(255,255,255,.6);
  padding: 4px;
  margin: 0;
  cursor: pointer;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  transition: color .15s;
}
#cs-mute:hover { color: #fe2c55; }
#cs-mute svg { display: block; width: 40px; height: 40px; }

/* Zone de scène */
#cs-stage-area {
  position: absolute;
  top: 72px; left: 0; right: 0; bottom: 0;
  overflow: hidden;
}

/* Vidéo flottante — glisse depuis le bas vers position aléatoire */
.cs-video-float {
  position: absolute;
  overflow: hidden;
  background: #000;
  z-index: 3;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.cs-thumb {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.cs-vid {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0; transition: opacity .35s;
}
.cs-vid.active { opacity: 1; }

/* Bloc mot magenta — apparaît après la vidéo */
.cs-word-block {
  position: absolute;
  background: #fff;
  color: #000;
  outline: 2px solid #000;
  font-family: 'TikTokSans', 'Roboto', 'Arial Black', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
  display: block;
  padding: 0;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  transform: translateX(-50%);
}

body.mode-chaos #text-fullscreen { display: none; }
body.mode-texte #text-fullscreen { display: none; }

/* Script derrière la vidéo en mode chaos */
body.mode-chaos .tile.chaos-playing .text {
  opacity: 1;
  background: transparent;
  font-family: 'TikTokSans', 'Roboto', sans-serif;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
  overflow: hidden;
  /* Le fond magenta est mis sur le texte lui-même via box-decoration-break */
  color: #fff;
}
/* Fond magenta uniquement sous les mots */
body.mode-chaos .tile.chaos-playing .text::before {
  content: '';
}
body.mode-chaos .tile.chaos-playing .vid.active {
  z-index: 2;
  opacity: 0.55;
}

/* Quand une vidéo est active : les autres tuiles s'estompent (pas en mode triage) */
body.has-playing:not(.mode-triage) .tile:not(.is-playing) {
  opacity: 0.3;
}

/* La tuile en lecture : plein feu */
.tile.is-playing {
  opacity: 1 !important;
  z-index: 1;
}

/* Thumbnail image — visible par défaut */
.tile .thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .35s;
  display: block;
}
.tile .thumb.hidden { opacity: 0; pointer-events: none; }

/* Vidéo — cachée jusqu'au premier frame */
.tile .vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .35s;
}
.tile .vid.active { opacity: 1; }

/* ── NUMÉRO DE VIDÉO ──────────────────────────────────────────────────────── */
.tile .num {
  position: absolute;
  bottom: 3px;
  left: 3px;
  font-size: 9px;
  font-family: monospace;
  color: rgba(255,255,255,0.8);
  background: rgba(0,0,0,0.55);
  padding: 1px 3px;
  line-height: 1;
  pointer-events: none;
  z-index: 10;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
} .tile .num-hidden {
  position: absolute;
  bottom: 3px;
  left: 3px;
  font-size: 9px;
  font-family: monospace;
  color: rgba(255,255,255,0.55);
  line-height: 1;
  pointer-events: none;
  z-index: 10;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* ── GRADIENT OVERLAY ─────────────────────────────────────────────────────── */
.tile .grad {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}

/* ── TEXT OVERLAY ─────────────────────────────────────────────────────────── */
.tile .text {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.88);
  color: rgba(255,255,255,.82);
  font-size: 8px;
  line-height: 1.35;
  padding: 3px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}

/* ── VIZ CANVAS ───────────────────────────────────────────────────────────── */
.tile .viz {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}

/* ── MODE : TRIAGE ────────────────────────────────────────────────────────── */
#triage-panel {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 110px;
  z-index: 400;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 8px 16px;
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: hidden;
}
body.mode-triage #triage-panel { display: flex; }

#triage-cats {
  display: flex;
  gap: 8px;
  flex: 1;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}
#triage-cats::-webkit-scrollbar { display: none; }

.triage-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.triage-group-glowup {
  flex-shrink: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid rgba(255, 107, 157, 0.4);
  border-radius: 10px;
  background: rgba(255, 107, 157, 0.07);
}

.triage-group-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ff6b9d;
  text-transform: uppercase;
  margin-right: 2px;
  flex-shrink: 0;
}

.triage-cat-btn {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1.5px solid;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, opacity .15s;
  font-family: inherit;
}
.triage-cat-btn:hover { opacity: 0.8; }
.triage-cat-btn .key {
  opacity: 0.5;
  font-size: 9px;
  margin-right: 3px;
}

#triage-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}
.triage-add-btn {
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,0.25);
  background: transparent;
  color: rgba(255,255,255,0.35);
  font-size: 11px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.triage-add-btn:hover { color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.5); }

.cat-add-form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(30,30,30,0.95);
  border-top: 1px solid rgba(255,255,255,0.1);
  width: 100%;
}
.cat-add-form input[type="text"] {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  outline: none;
}
.cat-add-form input[type="text"]:focus { border-color: rgba(255,255,255,0.5); }
.cat-add-form input[type="color"] {
  width: 28px; height: 28px;
  border: none; border-radius: 50%;
  cursor: pointer; padding: 0;
  background: none;
}
.cat-add-form button {
  padding: 4px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}
.cat-add-form #caf-ok { border-color: rgba(255,255,255,0.6); }

#triage-export, #triage-clear, #triage-sondage {
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  cursor: pointer;
}
#triage-export  { border-color: rgba(255,255,255,0.4); color: #fff; }
#triage-sondage { border-color: rgba(255,255,255,0.5); color: #fff; font-weight: 600; }

/* Tuile sélectionnée en triage */
.tile.triage-selected {
  outline: 2px solid #fff;
  outline-offset: -2px;
  z-index: 5;
  opacity: 1 !important;
}

/* Teinte de catégorie sur chaque tuile (visible uniquement en mode triage) */
.tile .cat-dot {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
}
body.mode-triage .tile.has-cat .cat-dot { opacity: 1; }

/* ── MODE : DÉGRADÉ ───────────────────────────────────────────────────────── */
body.mode-degrade .tile .thumb     { opacity: 0; }
body.mode-degrade .tile .vid.active { opacity: 0; }
body.mode-degrade .tile .grad      { opacity: 1; }

/* ── MODE : TEXTE ─────────────────────────────────────────────────────────── */
body.mode-texte #bnav-texte { display: none; }
body.mode-texte .tile .thumb      { opacity: .08; }
body.mode-texte .tile .vid.active { opacity: .08; }
body.mode-texte .tile .text       { opacity: 1; }

body.mode-text-grid #wall {
  grid-template-columns: repeat(auto-fill, 180px) !important;
  grid-auto-rows: 220px !important;
  gap: 0 !important;
}
body.mode-text-grid .tile {
  width: 180px !important;
  height: 220px !important;
  aspect-ratio: unset !important;
  border: 1px solid rgba(255,255,255,.35) !important;
}
/* ── ZOOM EDITION TEXTE ──────────────────────────────────────────────────── */
#text-edit-zoom {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,.88);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px;
}
.tez-video {
  width: 240px;
  height: 426px;
  flex-shrink: 0;
  background: #000;
  border: 1px solid rgba(255,255,255,.2);
}
.tez-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 480px;
}
.tez-textarea {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  font-family: 'TikTokSans', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  padding: 20px;
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
  outline: none;
  cursor: text;
}
.tez-textarea:focus { border-color: #fff; background: rgba(255,255,255,.1); }
#save-indicator {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  background: #fff; color: #000;
  font-family: 'TikTokSans', sans-serif;
  font-size: 13px; font-weight: 700;
  padding: 8px 20px;
  z-index: 9999;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.tez-close {
  align-self: flex-start;
  background: #fff;
  color: #000;
  border: none;
  font-family: 'TikTokSans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 24px;
  cursor: pointer;
}

#text-edit-panel {
  display: none;
  position: fixed;
  z-index: 2000;
  background: #000;
  border: 1px solid rgba(255,255,255,.4);
  box-shadow: 0 8px 32px rgba(0,0,0,.9);
}
#export-float {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 800;
  background: #fff;
  color: #000;
  border: none;
  font-family: 'TikTokSans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  transition: opacity .15s;
}
#export-float:hover { opacity: .8; }
body.mode-triage #export-float { display: block; }

#text-export-btn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 800;
  background: #fff;
  color: #000;
  border: none;
  font-family: 'TikTokSans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  cursor: pointer;
}
body.mode-text-grid .tile .text {
  position: absolute;
  inset: 0;
  padding: 8px;
  font-size: 10px;
  line-height: 1.5;
  color: #fff;
  overflow-y: auto;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
  font-weight: 500;
  z-index: 3;
  cursor: text;
  outline: none;
}
body.mode-text-grid .tile .text:focus {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.6);
}

/* ── MODE : VIZ ───────────────────────────────────────────────────────────── */
body.mode-viz .tile .thumb      { opacity: .25; }
body.mode-viz .tile .vid.active { opacity: .25; }
body.mode-viz .tile .viz        { opacity: 1; }

/* ── TEXTE CONTINU INTERACTIF ────────────────────────────────────────────── */
#text-scroll-overlay {
  display: none;
  position: fixed;
  top: var(--header-h, 100px);
  left: 0; right: 0; bottom: 0;
  z-index: 500;
  background: #000;
  flex-direction: column;
  overflow: hidden;
}

#text-scroll-tabs {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid rgba(255,255,255,.15);
}

/* ── Recherche (petite barre centrée, bleu glow up) ── */
#ts-search-wrap {
  padding: 16px 24px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
#ts-search-row {
  position: relative;
  width: 100%;
  max-width: 540px;
  display: flex;
  align-items: center;
}
#ts-search-input {
  background: none;
  border: none;
  border-bottom: 2px solid #25f4ee;
  border-radius: 0;
  color: #25f4ee;
  font-family: 'TikTokSans', sans-serif;
  font-size: 22px;
  text-align: left;
  padding: 8px 40px 8px 0;
  outline: none;
  width: 100%;
  transition: border-color .2s;
}
#ts-search-input:focus { border-bottom-color: #25f4ee; }
#ts-search-input::placeholder { color: rgba(37,244,238,.55); text-align: left; }
#ts-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255,255,255,.6);
  font-size: 18px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  transition: color .15s;
}
#ts-search-clear:hover { color: #fff; }

/* Compteur d'occurrences sous la barre de recherche */
#ts-search-count {
  font-family: 'TikTokSans', sans-serif;
  font-size: 22px;
  color: rgba(255,255,255,.7);
  text-align: left;
}
#ts-search-count b { color: #fff; font-weight: 800; }

#ts-chips {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
#ts-chips::-webkit-scrollbar { display: none; }
.ts-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(37,244,238,.08);
  border: 1px solid rgba(37,244,238,.55);
  border-radius: 0;
  color: #25f4ee;
  font-family: 'TikTokSans', sans-serif;
  font-size: 23px;
  font-weight: 500;
  padding: 9px 20px;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
  text-transform: lowercase;
  flex-shrink: 0;
}
.ts-chip:hover { background: #25f4ee; color: #000; }
.ts-chip.active { background: #25f4ee; color: #000; border-color: #25f4ee; }
.ts-chip-n { opacity: .6; font-size: 19px; }

/* Tabs jours */
#text-scroll-tabs .ts-tab-row {
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 8px;
  height: 44px;
  overflow-x: auto;
  scrollbar-width: none;
}
#text-scroll-tabs .ts-tab-row::-webkit-scrollbar { display: none; }

/* Mot recherché : rectangle blanc plein, typo noire */
.ts-highlight {
  background: #25f4ee;
  color: #000 !important;
  font-weight: 700;
  border-radius: 0;
  padding: 1px 5px;
  font-style: normal;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

#text-scroll-tabs::-webkit-scrollbar { display: none; }

.ts-tab {
  flex-shrink: 0;
  background: none;
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.45);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 6px 16px;
  cursor: pointer;
  transition: all .18s;
}
.ts-tab:hover { color: #fff; border-color: rgba(255,255,255,.5); }
.ts-tab.active { background: #fff; color: #000; border-color: #fff; }
.ts-tab-spiral { border-color: rgba(37,244,238,.4); color: rgba(37,244,238,.6); }
.ts-tab-spiral:hover { border-color: #25f4ee; color: #25f4ee; }
.ts-tab-spiral.active { background: #25f4ee; color: #000; border-color: #25f4ee; }

#ts-spiral-canvas {
  display: none;
}

#text-scroll-wrap {
  flex: 1;
  position: relative;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-width: none;
}
#text-scroll-wrap::-webkit-scrollbar { display: none; }

#text-scroll-block {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

/* ── MUR DE TEXTE (façon affiche) ── */
#text-scroll-block.ts-wall {
  max-width: none;
  text-align: justify;
  text-justify: inter-word;
  font-family: 'TikTokSans', 'Arial', sans-serif;
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 400;
  line-height: 1.35;
  padding: 30px 60px 160px;
  word-break: break-word;
  hyphens: auto;
}
.ts-wall .ts-label {
  color: #fe2c55;
  white-space: nowrap;
  cursor: pointer;
  font-weight: 700;
  transition: opacity .15s;
}
.ts-wall .ts-script {
  color: #fff;
  cursor: pointer;
  transition: color .15s, background .15s, opacity .15s;
}
/* Les autres textes restent à 100 % (pas d'atténuation au survol). */
/* Survol : le texte visé reçoit un rectangle blanc à ~40 % d'opacité. */
.ts-wall .ts-script.ts-hover {
  background: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0 2px;
}
/* Appui (avant le clic) : le texte visé tombe à 50 %. */
.ts-wall .ts-script:active,
.ts-wall .ts-label:active { opacity: .5; }
/* Clic confirmé → surlignage rose plein + typo blanche. */
.ts-wall .ts-script.ts-playing {
  background: #fe2c55;
  color: #fff;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0 2px;
}

.ts-card {
  position: absolute;
  font-family: 'TikTokSans', sans-serif;
  color: #111;
  text-align: left;
  line-height: 1.5;
  padding: 14px 18px;
  background: #f5f2ed;
  border: 3px solid #111;
  cursor: pointer;
  user-select: none;
  max-width: 320px;
  transition: box-shadow 0.2s;
}
.ts-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  z-index: 10;
}

/* ── TEXTE CONTINU ────────────────────────────────────────────────────────── */
.ts-entry {
  padding: 32px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  transition: opacity .2s;
}
.ts-entry:last-child { border-bottom: none; }
.ts-entry:hover { opacity: .75; }
.ts-entry.ts-entry-playing .ts-entry-text { color: #fff; }
.ts-entry.ts-entry-playing .ts-entry-day  { color: #fe2c55; }

.ts-entry-text {
  font-family: 'TikTokSans', 'Roboto', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: rgba(255,255,255,.88);
  font-weight: 400;
}

.ts-entry-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ts-entry-day {
  font-family: 'TikTokSans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #25f4ee;
}
.ts-entry-num {
  font-family: 'TikTokSans', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,.3);
  letter-spacing: .05em;
}

/* Vidéo arrière-plan */
#ts-bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 499;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
#ts-bg-video.active {
  opacity: 1;
}

.ts-sep {
  display: none;
}

.ts-script-inline {
  display: block;
  cursor: pointer;
  padding: 0.4em 0;
  transition: color .15s;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.ts-script-inline:hover {
  color: rgba(255,255,255,.7);
}
.ts-script-inline.ts-playing {
  color: #fe2c55;
}
.ts-glow {
  color: #fe2c55;
}

/* Vidéo intégrée dans le flux texte */
.ts-inline-video {
  display: block;
  width: 180px;
  height: 320px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.8);
  margin: 0.6em auto;
  cursor: pointer;
  opacity: 0;
  max-height: 0;
  transform: scaleY(0.8);
  transform-origin: top center;
  transition: opacity .35s ease, max-height .4s cubic-bezier(0.22,1,0.36,1), transform .35s ease;
  overflow: hidden;
}
.ts-inline-video.ts-vid-visible {
  opacity: 1;
  max-height: 340px;
  transform: scaleY(1);
}

#text-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  pointer-events: none;
  transition: opacity .5s;
  z-index: 510;
}

/* ── PLAYER VIDÉO TEXTE ───────────────────────────────────────────── */
#ts-video-player {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 160px;
  height: 284px;
  background: #000;
  border: 2px solid rgba(255,255,255,0.25);
  z-index: 520;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
#ts-video-player.active {
  display: flex;
}
#ts-video-player video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#ts-video-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  z-index: 2;
  text-shadow: 0 1px 4px #000;
}

/* ── MOTS FRÉQUENTS ──────────────────────────────────────────────── */
#ts-top-words {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.ts-top-label {
  font-family: 'TikTokSans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  margin-bottom: 4px;
}
.ts-top-word {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.ts-top-w {
  font-family: 'TikTokSans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.ts-top-n {
  font-family: 'TikTokSans', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,.4);
}

/* ── LOADER ──────────────────────────────────────────────────────────────── */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}
#page-loader.hidden {
  opacity: 0;
  pointer-events: none;
}
#loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
#loader-bar {
  width: 200px;
  height: 2px;
  background: rgba(255,255,255,.15);
  overflow: hidden;
}
#loader-fill {
  height: 100%;
  width: 0%;
  background: #25f4ee;
  transition: width 0.2s ease;
}
#loader-label {
  font-family: 'TikTokSans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
}

/* ── TRIAGE : GROS BOUTONS + TABLEAU ─────────────────────────────── */
#tc-cats {
  display: flex;
  flex-wrap: nowrap;
  gap: 18px;
  padding: 24px 32px 20px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  justify-content: flex-start;
  overflow-x: auto;
  scrollbar-width: none;
}
#tc-cats::-webkit-scrollbar { display: none; }
.tc-cat-btn { white-space: nowrap; flex-shrink: 0; }
.tc-cat-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  font-family: 'TikTokSans', 'Roboto', sans-serif;
  font-size: 26px;
  font-weight: 500;
  padding: 4px 12px 8px;
  cursor: pointer;
  letter-spacing: .01em;
  position: relative;
  transition: color .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tc-cat-btn::after { display: none; }
.tc-cat-btn:hover { color: #25f4ee; }
.tc-cat-btn.active { color: #25f4ee; }

/* ── CLASSIFICATION : colonnes verticales par jour ───────────────── */
#tc-table-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
#tc-grid-area {
  display: flex;
  flex: 1;
  overflow: hidden;
  order: 1;
  align-items: flex-end;
}
#tc-header {
  display: flex;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,.1);
  order: 2;
}
.tc-header-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  padding: 8px 0 28px;
  font-family: 'TikTokSans', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .01em;
  border-right: 3px solid #000;
  line-height: 1.2;
}
.tc-header-cell:last-child { border-right: none; }
.tc-count {
  display: block;
  font-size: 19px;
  font-weight: 400;
  color: rgba(255,255,255,.55);
  letter-spacing: .02em;
}
.tc-cat-total {
  display: block;
  font-size: 19px;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  letter-spacing: .02em;
  margin-top: 6px;
  transition: color .15s;
}
.tc-cat-btn.active .tc-cat-total {
  color: #25f4ee;
  opacity: .85;
}
.tc-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;             /* barre centrée sous le jour */
  overflow: hidden;
  transition: opacity .2s;
  border-right: 3px solid #000;
}
.tc-col:last-child { border-right: none; }
.tc-col-thumbs {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  justify-content: center;
  overflow: hidden;
}
.tc-thumb {
  position: relative;
  background: #111;
  flex-shrink: 0;
  cursor: pointer;
  overflow: hidden;
}
.tc-spacer {
  background: transparent !important;
  pointer-events: none;
}
.tc-thumb img { width:100%;height:100%;object-fit:cover;display:block;transition:opacity .2s; }
.tc-thumb:hover img { opacity: .75; }

/* ── THÈMES : une ligne horizontale par jour (jour à gauche, vidéos à droite) ── */
#tc-chart {
  flex: 1;
  display: flex;
  flex-direction: column;        /* un jour par ligne, empilés du haut vers le bas */
  align-items: stretch;
  justify-content: flex-start;
  gap: 14px;
  padding: 16px 40px 24px;
  overflow: hidden;
}
.tc-day-col {                    /* = une LIGNE de jour */
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: row;           /* label à gauche, vidéos à droite */
  align-items: center;
  justify-content: flex-start;
  transition: opacity .2s;
}
.tc-day-stack {
  display: flex;
  flex-direction: row;           /* les vignettes s'alignent à l'horizontale */
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.tc-day-col .tc-thumb {
  border-radius: 1px;
}
.tc-day-label {
  width: 150px;
  flex-shrink: 0;
  margin: 0 24px 0 0;
  text-align: left;
  font-family: 'TikTokSans', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  cursor: pointer;
  transition: color .2s;
}
.tc-day-count {
  display: block;
  font-size: 19px;
  font-weight: 400;
  color: rgba(255,255,255,.55);
}
.tc-day-label:hover { color: #25f4ee; }
/* Jour sélectionné (clic sur une vidéo ou son label) → bleu */
.tc-day-label.active,
.tc-day-label.active .tc-day-count { color: #25f4ee; }

/* Zoom plein écran d'une vidéo (clic sur une vignette de Thèmes) */
.tc-zoom {
  position: fixed;
  inset: 0;
  z-index: 620;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.82);
  animation: tcZoomIn .2s ease;
}
.tc-zoom-frame {
  position: relative;
  display: inline-block;
  line-height: 0;
}
.tc-zoom video {
  height: 82vh;
  max-width: 92vw;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: #000;
  box-shadow: 0 12px 50px rgba(0,0,0,.85);
}
.tc-zoom-num,
.tc-zoom-theme {
  position: absolute;
  top: 12px;
  font-family: 'TikTokSans', 'Arial', sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.tc-zoom-num   { left: 14px;  color: #fe2c55; }
.tc-zoom-theme { right: 14px; color: #fe2c55; }
@keyframes tcZoomIn {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── BARRE CATÉGORIES CLASSIFICATION ────────────────────────────── */
#triage-cat-bar {
  position: fixed;
  top: var(--header-h, 100px);
  left: 0; right: 0;
  z-index: 601;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid rgba(255,255,255,.15);
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
}
#triage-cat-bar::-webkit-scrollbar { display: none; }

.triage-cat-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.45);
  font-family: 'TikTokSans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 0;
  cursor: pointer;
  transition: color .2s;
  flex-shrink: 0;
}
.triage-cat-btn:hover { color: #fff; }
.triage-cat-btn.active {
  color: var(--cat-color, #fff);
  font-weight: 700;
}

/* ── PROJECTION MODE (5760 × 1080 — 3 projecteurs panoramiques) ──────────── */
body.projection-mode {
  --header-h: 72px;
  width: 5760px;
  height: 1080px;
  overflow: hidden;
}

/* Header fin, full-width */
body.projection-mode #cs-header {
  height: var(--header-h);
}
body.projection-mode #cs-header-inner {
  padding: 0 60px;
}
body.projection-mode #cs-title-text {
  font-size: 22px;
}
body.projection-mode .cs-nav-btn {
  font-size: 15px;
}

/* Grid et container couvrent les 5760px */
body.projection-mode #fyp-container,
body.projection-mode #viewport,
body.projection-mode #chaos-stage,
body.projection-mode #text-scroll-overlay {
  width: 5760px;
}

/* Barre de jours : répartie sur 5760px */
body.projection-mode #fyp-filter-bar,
body.projection-mode #day-filter-bar,
body.projection-mode #triage-cat-bar {
  width: 5760px;
  padding: 0 120px 28px;
}
body.projection-mode .fyp-day-btn,
body.projection-mode .day-filter-btn {
  font-size: 28px;
}

/* Panneaux flottants centrés sur les 5760px */
body.projection-mode #about-panel,
body.projection-mode #louise-profile,
body.projection-mode #jours-panel,
body.projection-mode #sondage-panel {
  width: 5760px;
}
body.projection-mode #about-inner,
body.projection-mode #louise-inner {
  margin: 0 auto;
  max-width: 900px;
}

/* Intro logo centré */
body.projection-mode #intro-screen {
  width: 5760px;
}

/* Loader centré */
body.projection-mode #page-loader {
  width: 5760px;
}

/* Texte mode : bloc centré sur 5760px */
body.projection-mode #text-scroll-wrap {
  width: 800px;
  left: calc(2880px - 400px);
}
body.projection-mode #ts-top-words {
  right: 2000px;
}


/* ─── TRANSITIONS ENTRE MODES ──────────────────────────────────────────── */
#fyp-container,
#text-scroll-overlay,
#ts-spiral-canvas {
  transition: opacity 0.18s ease;
}
