/* BONGO · feuille commune (application et Régie). Les couleurs viennent du thème réglé dans la Régie. */
:root {
  --primaire: #4895ef; --accent: #ffb703; --fond: #0b0a1f; --surface: #141130; --surface2: #1d1946;
  --texte: #ffffff; --attenue: #bfc8ff; --rayon: 14px; --sur-primaire: #fff; --sur-accent: #0b0a1f;
  --ligne: color-mix(in srgb, var(--attenue) 18%, transparent);
  --bon: #4fd1a5; --mauvais: #ff5c93; --alerte: #ffb703;
  --police-titre: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --police-texte: "Montserrat", system-ui, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font-family: var(--police-texte); font-size: 16px; line-height: 1.5; min-height: 100vh; }
h1, h2, h3, h4 { font-family: var(--police-titre); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 5vw, 3.2rem); } h2 { font-size: 1.35rem; } h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; } a { color: var(--primaire); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.attenue { color: var(--attenue); } .petit { font-size: .85rem; } .centre { text-align: center; }
.cache { display: none !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 44px; padding: .6em 1.25em; border: 1px solid transparent;
  border-radius: 999px; background: var(--surface2); color: var(--texte); font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .12s, filter .12s; }
.btn:hover { filter: brightness(1.12); } .btn:active { transform: scale(.97); }
.btn.principal { background: var(--accent); color: var(--sur-accent); }
.btn.bleu { background: var(--primaire); color: var(--sur-primaire); }
.btn.contour { background: transparent; border-color: var(--ligne); }
.btn.danger { background: transparent; border-color: var(--mauvais); color: var(--mauvais); }
.btn.mini { min-height: 34px; padding: .3em .85em; font-size: .85rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.carte { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 1.1rem; }
.pastille { display: inline-block; padding: .12em .6em; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; background: var(--surface2); color: var(--attenue); white-space: nowrap; }
.pastille.or { background: var(--accent); color: var(--sur-accent); } .pastille.bleu { background: var(--primaire); color: var(--sur-primaire); }
.pastille.vert { background: color-mix(in srgb, var(--bon) 22%, transparent); color: var(--bon); }
.pastille.rose { background: color-mix(in srgb, var(--mauvais) 22%, transparent); color: var(--mauvais); }

.champ { display: grid; gap: .3rem; margin-bottom: .9rem; }
.champ > span { font-size: .82rem; font-weight: 600; color: var(--attenue); }
.champ input[type=radio] { accent-color: var(--primaire); width: 18px; height: 18px; vertical-align: -3px; }
.champ input:not([type=checkbox]):not([type=color]):not([type=range]):not([type=radio]), .champ select, .champ textarea {
  width: 100%; min-height: 44px; padding: .55em .8em; background: var(--fond); border: 1px solid var(--ligne); border-radius: calc(var(--rayon) * .6); }
.champ textarea { min-height: 96px; resize: vertical; }
.champ input[type=color] { width: 56px; height: 40px; padding: 2px; background: var(--fond); border: 1px solid var(--ligne); border-radius: 8px; }
.coche { display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; cursor: pointer; }
.coche input { width: 20px; height: 20px; accent-color: var(--primaire); }

/* ----- application des apprenants ----- */
.entete { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .6rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--fond) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--ligne); }
.entete img.logo { height: 30px; width: auto; display: block; }
.entete nav { display: flex; gap: .25rem; margin-left: auto; }
.entete nav a, .barre a { color: var(--attenue); text-decoration: none; font-weight: 600; font-size: .92rem; padding: .5em .85em; border-radius: 999px; }
.entete nav a.actif, .entete nav a:hover { color: var(--texte); background: var(--surface2); }
.barre { display: none; }
main.page { padding: 0 0 5.5rem; max-width: 1280px; margin: 0 auto; }
.bloc { padding: 1.4rem clamp(1rem, 4vw, 2.5rem) 0; }
.bandeau-env { background: var(--accent); color: var(--sur-accent); font-size: .8rem; font-weight: 700; text-align: center; padding: .3rem 1rem; }
.annonce { margin: 1rem clamp(1rem, 4vw, 2.5rem) 0; padding: .8rem 1rem; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 var(--rayon) var(--rayon) 0; }

.billboard { position: relative; margin: 1rem clamp(1rem, 4vw, 2.5rem) 0; border-radius: calc(var(--rayon) * 1.5); overflow: hidden; padding: clamp(1.5rem, 6vw, 4rem);
  min-height: min(62vh, 460px); display: flex; flex-direction: column; justify-content: flex-end;
  background: radial-gradient(120% 90% at 85% 10%, color-mix(in srgb, var(--teinte, var(--primaire)) 75%, transparent), transparent 60%),
              radial-gradient(90% 80% at 0% 100%, color-mix(in srgb, #4d22d2 70%, transparent), transparent 65%), var(--surface); }
.billboard::after { content: ""; position: absolute; right: -6%; top: -18%; width: 46%; aspect-ratio: 1; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--texte) 16%, transparent);
  box-shadow: 0 0 0 38px color-mix(in srgb, var(--texte) 5%, transparent), 0 0 0 86px color-mix(in srgb, var(--texte) 3%, transparent); pointer-events: none; }
.billboard > * { position: relative; z-index: 1; max-width: 38rem; }
.billboard .sur { font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; color: var(--accent); margin-bottom: .6rem; }
.billboard p { color: var(--attenue); font-size: 1.05rem; }
.billboard .actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .4rem; }

.rail-titre { display: flex; align-items: baseline; gap: .8rem; margin-bottom: .7rem; }
.rail-titre a { margin-left: auto; font-size: .85rem; font-weight: 600; text-decoration: none; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(132px, 38vw, 176px); gap: .8rem; overflow-x: auto; padding: .2rem .1rem 1rem; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--surface2) transparent; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(132px, 38vw, 176px), 1fr)); gap: .9rem; }
.affiche { position: relative; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 2 / 3; padding: .8rem; border-radius: var(--rayon); overflow: hidden; scroll-snap-align: start;
  text-decoration: none; color: #fff; border: 1px solid var(--ligne); cursor: pointer; text-align: left; font: inherit;
  background: linear-gradient(165deg, color-mix(in srgb, var(--teinte) 92%, #fff 8%) 0%, color-mix(in srgb, var(--teinte) 55%, #0b0a1f) 55%, #0b0a1f 100%); transition: transform .15s; }
.affiche:hover { transform: translateY(-4px); }
.affiche .num { position: absolute; top: .3rem; right: .6rem; font-family: var(--police-titre); font-size: 3.6rem; font-weight: 700; line-height: 1; color: rgba(255,255,255,.2); }
.affiche .haut { position: absolute; top: .65rem; left: .65rem; display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.affiche .pastille.bleu { background: rgba(11,10,31,.78); color: #fff; }
.affiche .nature { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.affiche .titre { font-family: var(--police-titre); font-size: 1.02rem; font-weight: 600; line-height: 1.15; margin: .15rem 0 .35rem; text-wrap: balance; }
.affiche .meta { font-size: .72rem; opacity: .8; }
.affiche .avance { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255,255,255,.18); }
.affiche .avance i { display: block; height: 100%; background: var(--accent); }
.affiche.ferme { filter: saturate(.45) brightness(.72); }
.affiche .verrou { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.6rem; opacity: .9; pointer-events: none; }

.saison-carte { display: grid; gap: .3rem; padding: 1.2rem; border-radius: var(--rayon); text-decoration: none; color: #fff; border: 1px solid var(--ligne);
  background: linear-gradient(120deg, color-mix(in srgb, var(--teinte) 70%, #0b0a1f), var(--surface) 75%); }
.saison-carte .n { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.saison-carte h3 { font-size: 1.3rem; margin: 0; }
.jauge { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--texte) 14%, transparent); overflow: hidden; }
.jauge i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

.fiche-ep { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 1.5rem; align-items: start; }
.radar { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.radar .piege { padding: .8rem; border-radius: var(--rayon); background: var(--surface); border: 1px solid var(--ligne); }
.radar .piege b { display: block; font-family: var(--police-titre); } .radar .piege.touche { border-color: var(--mauvais); }
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; }
.chiffre { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 1rem; }
.chiffre b { display: block; font-family: var(--police-titre); font-size: 1.9rem; line-height: 1.1; } .chiffre > span { font-size: .8rem; color: var(--attenue); }

/* Parloir */
.parloir { display: flex; flex-direction: column; height: calc(100dvh - 190px); min-height: 380px; max-width: 760px; margin: 0 auto; }
.fil-chat { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; padding: .5rem .2rem 1rem; }
.bulle { max-width: 86%; padding: .7rem 1rem; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bulle.elle { align-self: flex-start; background: var(--surface2); border-bottom-left-radius: 4px; }
.bulle.moi { align-self: flex-end; background: var(--primaire); color: var(--sur-primaire); border-bottom-right-radius: 4px; }
.bulle .qui { display: block; font-size: .7rem; font-weight: 700; color: var(--accent); margin-bottom: .15rem; }
.saisie { display: flex; gap: .5rem; align-items: flex-end; }
.saisie textarea { flex: 1; min-height: 48px; max-height: 140px; padding: .7em 1em; background: var(--surface); border: 1px solid var(--ligne); border-radius: 24px; resize: none; }
.suggestions { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .6rem; }

/* fenêtres */
.voile { position: fixed; inset: 0; z-index: 50; background: rgba(5,4,16,.78); display: grid; place-items: center; padding: 1rem; overflow-y: auto; }
.fenetre { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--ligne); border-radius: calc(var(--rayon) * 1.3); padding: 1.5rem; max-height: calc(100dvh - 2rem); overflow-y: auto; }
.fenetre.large { width: min(860px, 100%); }
.salle { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; }
.salle .haut { display: flex; align-items: center; gap: .8rem; padding: .4rem .8rem; background: var(--fond); border-bottom: 1px solid var(--ligne); }
.salle .haut b { font-family: var(--police-titre); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.salle iframe { flex: 1; width: 100%; border: 0; background: #0b0a1f; }
.grille-choix { display: grid; gap: .6rem; }
.choix { text-align: left; padding: .85rem 1rem; border-radius: var(--rayon); background: var(--surface2); border: 2px solid transparent; cursor: pointer; min-height: 48px; }
.choix:hover { border-color: var(--ligne); } .choix.pris { border-color: var(--primaire); }
.choix.juste { border-color: var(--bon); } .choix.faux { border-color: var(--mauvais); }
.toast { position: fixed; left: 50%; bottom: 5.5rem; transform: translateX(-50%); z-index: 90; background: var(--texte); color: var(--fond); padding: .6rem 1.1rem; border-radius: 999px; font-weight: 600; font-size: .9rem; box-shadow: 0 8px 30px rgba(0,0,0,.4); max-width: 90vw; }

/* lecteur d'épisodes créés dans la Régie */
.lecteur { flex: 1; overflow-y: auto; background: radial-gradient(100% 60% at 50% 0%, color-mix(in srgb, var(--teinte, var(--primaire)) 35%, transparent), transparent 70%), var(--fond); }
.lecteur .scene { max-width: 640px; margin: 0 auto; padding: 1.5rem 1.1rem 6rem; }
.lecteur .avancee { height: 4px; background: var(--surface2); } .lecteur .avancee i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.lecteur .recit { font-size: 1.12rem; } .lecteur .recit .qui { font-family: var(--police-titre); color: var(--accent); font-weight: 600; display: block; margin-bottom: .2rem; }
.lecteur .telephone { background: var(--surface); border: 1px solid var(--ligne); border-radius: 22px; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.lecteur .outil { border: 2px dashed var(--accent); border-radius: var(--rayon); padding: 1.1rem; background: color-mix(in srgb, var(--accent) 9%, transparent); }
.lecteur img, .lecteur video { max-width: 100%; border-radius: var(--rayon); display: block; }
.certitude { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1rem 0; }

@media (max-width: 760px) {
  .entete nav { display: none; }
  .barre { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: color-mix(in srgb, var(--fond) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--ligne); padding: .3rem .2rem calc(.3rem + env(safe-area-inset-bottom)); }
  .barre a { display: grid; justify-items: center; gap: .1rem; font-size: .68rem; padding: .35rem .1rem; border-radius: 12px; }
  .barre a svg { width: 22px; height: 22px; } .barre a.actif { color: var(--accent); }
  .fiche-ep { grid-template-columns: 1fr; } .fiche-ep .affiche { max-width: 170px; }
  .parloir { height: calc(100dvh - 230px); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ----- fil d'actualité ----- */
.fil { max-width: 680px; margin: 0 auto; }
.post { background: var(--surface); border: 2px solid var(--ligne); border-radius: var(--rayon); padding: 1.1rem; margin-bottom: 1rem; box-shadow: 5px 5px 0 color-mix(in srgb, var(--texte) 9%, transparent); }
.post header { display: flex; gap: .7rem; align-items: center; margin-bottom: .7rem; }
.post h2 { font-size: 1.25rem; margin-bottom: .35rem; }
.post img { max-width: 100%; border-radius: calc(var(--rayon) * .7); display: block; margin-bottom: .8rem; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--teinte); color: #0b0a1f; font-family: var(--police-manchette); font-size: 1.3rem; border: 2px solid var(--texte); }
.post footer { display: flex; gap: .4rem; flex-wrap: wrap; border-top: 1px dashed var(--ligne); padding-top: .7rem; }
.reaction { background: transparent; border: 1.5px solid var(--ligne); color: var(--attenue); border-radius: 999px; padding: .3em .8em; font-size: .82rem; font-weight: 600; cursor: pointer; min-height: 36px; }
.reaction b { color: var(--texte); } .reaction.active { background: var(--accent); color: var(--sur-accent); border-color: var(--accent); } .reaction.active b { color: inherit; }
.sondage { display: grid; gap: .45rem; margin-bottom: .9rem; }
.sondage .resultat { position: relative; overflow: hidden; border-radius: calc(var(--rayon) * .7); background: var(--surface2); padding: .6rem .8rem; display: flex; justify-content: space-between; gap: 1rem; }
.sondage .resultat i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--primaire) 45%, transparent); }
.sondage .resultat.moi { outline: 2px solid var(--accent); } .sondage .resultat span, .sondage .resultat b { position: relative; }
.commentaires { margin-top: .8rem; display: grid; gap: .5rem; }
.commentaire { background: var(--surface2); border-radius: calc(var(--rayon) * .7); padding: .55rem .8rem; font-size: .92rem; }
.commentaires .saisie textarea { min-height: 40px; border-radius: 14px; padding: .5em .8em; }

/* ----- identité : l'affiche, le dossier d'enquête, le tampon (reprise de la charte des épisodes) ----- */
:root { --police-manchette: "Anton", "Fredoka", Impact, sans-serif; --police-machine: "Special Elite", "Courier New", monospace; }
body { background-image: radial-gradient(color-mix(in srgb, var(--texte) 7%, transparent) 1px, transparent 1.4px); background-size: 22px 22px; }
h1 { font-family: var(--police-manchette); font-weight: 400; text-transform: uppercase; letter-spacing: .01em; line-height: 1.02; }
.btn { border-radius: calc(var(--rayon) * .75); border-width: 2px; }
.btn.principal, .btn.bleu { border-color: #0b0a1f; box-shadow: 3px 3px 0 #0b0a1f; }
.btn.principal:active, .btn.bleu:active { box-shadow: 0 0 0 #0b0a1f; transform: translate(3px, 3px); }
.btn.mini { box-shadow: none; border-width: 1.5px; }
.carte, .chiffre { border-width: 2px; }
.chiffre b { font-family: var(--police-manchette); font-weight: 400; letter-spacing: .01em; }
.pastille { font-family: var(--police-machine); font-weight: 400; letter-spacing: .04em; text-transform: uppercase; border-radius: 4px; }
.billboard { border: 2px solid var(--texte); box-shadow: 8px 8px 0 var(--accent); background:
  repeating-linear-gradient(135deg, transparent 0 18px, color-mix(in srgb, #000 14%, transparent) 18px 20px),
  linear-gradient(120deg, color-mix(in srgb, var(--teinte, var(--primaire)) 88%, #0b0a1f) 0%, color-mix(in srgb, var(--teinte, var(--primaire)) 40%, #0b0a1f) 60%, var(--surface) 100%); }
.billboard::after { border-radius: 0; border: 0; box-shadow: none; right: 4%; top: 8%; width: auto; aspect-ratio: auto; content: "KANISA LIBOSO"; font-family: var(--police-machine); font-size: clamp(.8rem, 2vw, 1.05rem); letter-spacing: .18em; color: var(--texte); border: 3px double var(--texte); padding: .35em .8em; transform: rotate(7deg); opacity: .8; }
.billboard h1 { font-size: clamp(2.4rem, 8vw, 5rem); text-shadow: 4px 4px 0 rgba(0,0,0,.35); }
.billboard .sur { font-family: var(--police-machine); font-weight: 400; }
.billboard p { color: #fff; opacity: .92; }
.affiche { border: 2px solid #0b0a1f; outline: 1px solid color-mix(in srgb, var(--texte) 25%, transparent); border-radius: calc(var(--rayon) * .6); box-shadow: 4px 4px 0 color-mix(in srgb, var(--teinte) 55%, #000);
  background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(0,0,0,.10) 14px 16px), linear-gradient(170deg, color-mix(in srgb, var(--teinte) 96%, #fff) 0%, color-mix(in srgb, var(--teinte) 62%, #0b0a1f) 58%, #0b0a1f 100%); }
.affiche:hover { transform: translate(-2px, -3px) rotate(-.6deg); }
.affiche .num { font-family: var(--police-manchette); font-size: 5.2rem; font-weight: 400; color: rgba(11,10,31,.34); top: -.1rem; right: .35rem; }
.affiche .titre { font-family: var(--police-manchette); font-weight: 400; text-transform: uppercase; font-size: 1.12rem; line-height: 1.08; letter-spacing: .01em; }
.affiche .nature, .affiche .meta { font-family: var(--police-machine); font-weight: 400; letter-spacing: .05em; }
.affiche .pastille { transform: rotate(-4deg); border: 1.5px solid currentColor; }
.rail-titre h2 { font-family: var(--police-manchette); font-weight: 400; text-transform: uppercase; font-size: 1.5rem; letter-spacing: .02em; }
.rail-titre h2::before { content: ""; display: inline-block; width: .55em; height: .55em; background: var(--accent); margin-right: .45em; transform: rotate(45deg) translateY(-.08em); }
.saison-carte { border: 2px solid #0b0a1f; box-shadow: 5px 5px 0 color-mix(in srgb, var(--teinte) 60%, #000); border-radius: calc(var(--rayon) * .7); }
.saison-carte h3 { font-family: var(--police-manchette); font-weight: 400; text-transform: uppercase; font-size: 1.7rem; }
.saison-carte .n { font-family: var(--police-machine); font-weight: 400; }
.entete nav a, .barre a { font-family: var(--police-titre); }
.bulle.elle { border: 1.5px solid var(--ligne); } .lecteur .outil { border-style: solid; box-shadow: 5px 5px 0 var(--accent); }
.barre { grid-template-columns: none !important; grid-auto-flow: column; grid-auto-columns: 1fr; }
