/* HubTesters : univers de shader.be (couchant mauve, verre, accents cyan, magenta et vert ; Bungee + Barlow).
   Tailwind (CDN du prototype) ne sert qu'à la mise en page ; couleurs et composants sont ici. */
@font-face { font-family: "Bungee"; src: url("/static/polices/Bungee.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/static/polices/Barlow-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/static/polices/Barlow-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
:root { --nuit: #1a1024; --texte: #f6eef6; --doux: #d6c8da; --pale: #a993b0; --cyan: #46e6f2; --magenta: #ff3fb4;
  --violet: #8a4dff; --vert: #3dffa2; --ambre: #ffc857; --verre: rgba(34, 19, 46, .78); --verre-2: rgba(246, 238, 246, .06);
  --bord: rgba(246, 238, 246, .14); --bord-cyan: rgba(70, 230, 242, .35); }
* { box-sizing: border-box; }
html { overflow-x: clip; }
body { margin: 0; color: var(--texte); font: 400 17px/1.5 "Barlow", system-ui, sans-serif; min-height: 100vh; overflow-x: clip;
  background: linear-gradient(180deg, #c97a9e 0%, #6b3f78 22%, #2f1c42 50%, #1a1024 80%) fixed; background-color: var(--nuit); }
a { color: var(--cyan); text-decoration: none; }
body .titre, body h1, body h2 { font-family: "Bungee", sans-serif; font-weight: 400; letter-spacing: .01em; line-height: 1.15; }
body h1 { font-size: clamp(1.9rem, 5.5vw, 3.2rem); margin: 0; text-shadow: 0 2px 18px rgba(26, 16, 36, .5); }
.sous-titre { font-family: "Bungee", sans-serif; font-size: .78rem; letter-spacing: .08em; color: var(--cyan); margin: 0 0 .7rem; }
.doux { color: var(--doux); }
.pale { color: var(--pale); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78em; }

/* Orbes du décor (Motion les fait dériver) */
.orbes { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orbe { position: absolute; border-radius: 50%; opacity: .5; will-change: transform; }
.o1 { width: 60vmax; height: 60vmax; left: -24vmax; top: -20vmax; background: radial-gradient(circle, rgba(255, 63, 180, .65), transparent 65%); }
.o2 { width: 50vmax; height: 50vmax; right: -22vmax; top: 20vh; background: radial-gradient(circle, rgba(70, 230, 242, .45), transparent 65%); }
.o3 { width: 56vmax; height: 56vmax; left: 8vw; bottom: -32vmax; background: radial-gradient(circle, rgba(138, 77, 255, .6), transparent 65%); }

/* Barre du haut */
.barre { position: sticky; top: 0; z-index: 20; background: rgba(26, 16, 36, .78); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--bord); }
.marque { font-family: "Bungee", sans-serif; font-size: 1.15rem; color: var(--texte); display: flex; align-items: center; gap: .55rem; }
.marque img { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 0 18px rgba(70, 230, 242, .35); }
/* Marque : lettres en dégradé, contour sombre, extrusion 3D par ombres empilées et halo néon (esprit du logo shader.be). */
.marque span { display: inline-block; font-size: 1.4rem; letter-spacing: .03em; transform: skewX(-7deg);
  background: linear-gradient(180deg, #ffffff 0%, #ffe3f5 45%, #ff9ad9 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: .6px rgba(26, 16, 36, .55);
  filter: drop-shadow(0 1px 0 #5a1f6e) drop-shadow(0 1px 0 #43165a) drop-shadow(0 1px 0 #2d0e40) drop-shadow(0 1px 0 #1d0829)
    drop-shadow(0 5px 6px rgba(0, 0, 0, .45)) drop-shadow(0 0 14px rgba(255, 63, 180, .45)); }
.marque b { font-weight: 400; background: linear-gradient(180deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 48%),
  linear-gradient(90deg, var(--magenta) 0%, var(--violet) 50%, var(--cyan) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.lien-haut { color: var(--doux); font-weight: 600; padding: .45rem .8rem; border-radius: 999px; white-space: nowrap; }
.lien-haut:hover { color: var(--texte); background: var(--verre-2); }
.lien-haut.actif { color: var(--nuit); background: var(--cyan); }
.demo { background: rgba(255, 200, 87, .14); border-bottom: 1px solid rgba(255, 200, 87, .3); color: #ffe6ad; font-size: .82rem; }
.demo select { background: rgba(26, 16, 36, .6); color: var(--texte); border: 1px solid rgba(255, 200, 87, .4); border-radius: 999px; padding: .25rem .6rem; }

/* Onglets du bas (mobile) */
.onglets { position: fixed; inset: auto 0 0; z-index: 20; background: rgba(26, 16, 36, .86); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--bord); padding-bottom: env(safe-area-inset-bottom); }
.onglet { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: .55rem 0 .5rem; font-size: .72rem; font-weight: 600; color: var(--pale); min-height: 56px; }
.onglet svg { width: 24px; height: 24px; }
.onglet.actif { color: var(--cyan); }
.onglet.actif svg { filter: drop-shadow(0 0 8px rgba(70, 230, 242, .7)); }

/* Cartes en verre */
.carte { position: relative; background: var(--verre); border: 1px solid var(--bord); border-radius: 22px; padding: 1.1rem;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 12px 34px rgba(0, 0, 0, .3); }
.carte.cyan { border-color: var(--bord-cyan); }
.carte.vive { background: linear-gradient(135deg, rgba(138, 77, 255, .5), rgba(255, 63, 180, .32)); border-color: rgba(255, 255, 255, .22); }
.tuile { background: var(--verre-2); border: 1px solid var(--bord); border-radius: 16px; padding: .8rem; }

/* Icône d'appli (image du jeu, ou initiale sur dégradé) */
.icone { width: 52px; height: 52px; flex: none; border-radius: 14px; object-fit: cover; box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
  display: grid; place-items: center; font: 400 1.2rem "Bungee", sans-serif; color: #fff; background: linear-gradient(135deg, var(--magenta), var(--violet)); }
.icone.p { width: 30px; height: 30px; border-radius: 9px; font-size: .75rem; }
.icone.g { width: 76px; height: 76px; border-radius: 20px; font-size: 1.8rem; }

/* Boutons */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: 0 1.3rem; border-radius: 999px;
  font: 600 1rem "Barlow", sans-serif; border: 0; cursor: pointer; transition: transform .15s ease, box-shadow .25s ease; }
.bouton:active { transform: scale(.97); }
.bouton.plein { background: var(--vert); color: var(--nuit); box-shadow: 0 8px 26px -6px rgba(61, 255, 162, .7); }
.bouton.plein:hover { box-shadow: 0 10px 34px -4px rgba(61, 255, 162, .9); }
.bouton.contour { background: rgba(0, 0, 0, .2); color: var(--texte); border: 1px solid var(--bord-cyan); }
.bouton.contour:hover { border-color: var(--cyan); }
.bouton:focus-visible, .champ:focus-visible, .onglet:focus-visible, .lien-haut:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.tester { min-height: 44px; padding: 0 1rem; border-radius: 999px; background: var(--cyan); color: var(--nuit); font-weight: 700; font-size: .9rem; border: 0; cursor: pointer; white-space: nowrap; }
.tester.htmx-request { opacity: .6; }
.fait { color: var(--vert); font-weight: 700; font-size: .9rem; display: inline-flex; align-items: center; gap: .3rem; text-shadow: 0 0 12px rgba(61, 255, 162, .6); }

/* Formulaires */
.champ { width: 100%; background: rgba(0, 0, 0, .25); color: var(--texte); border: 1px solid var(--bord); border-radius: 14px; padding: .8rem .9rem; font: inherit; }
.champ::placeholder { color: var(--pale); }
.etiquette { display: grid; gap: .35rem; font-weight: 600; font-size: .95rem; }
.aide { font-weight: 400; font-size: .82rem; color: var(--pale); }
.erreur { color: #ff8fc8; font-weight: 600; }
.depot-icone { display: flex; align-items: center; gap: .9rem; cursor: pointer; }
.depot-icone .icone { background: rgba(0, 0, 0, .25); border: 2px dashed var(--bord-cyan); box-shadow: none; color: var(--cyan); }

/* Ligne d'appli à tester */
.ligne { display: flex; align-items: center; gap: .85rem; padding: .7rem; border-radius: 18px; background: var(--verre); border: 1px solid var(--bord);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: border-color .3s, box-shadow .3s; }
.ligne.ok { border-color: rgba(61, 255, 162, .55); box-shadow: 0 0 22px -6px rgba(61, 255, 162, .55); }

/* Anneau de la journée */
.anneau { position: relative; width: 112px; height: 112px; flex: none; }
.anneau svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anneau .fond { stroke: rgba(246, 238, 246, .12); }
.anneau .trace { stroke: var(--vert); filter: drop-shadow(0 0 6px rgba(61, 255, 162, .8)); }
.anneau .valeur { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1; }
.anneau .valeur b { font: 400 1.9rem "Bungee", sans-serif; }
.anneau .valeur small { display: block; color: var(--pale); font-size: .78rem; margin-top: .2rem; }

/* Grille des 14 jours */
.case { width: 18px; height: 18px; border-radius: 5px; flex: none; }
.case.c2 { background: var(--vert); box-shadow: 0 0 8px rgba(61, 255, 162, .5); }
.case.c1 { background: rgba(70, 230, 242, .35); }
.case.c0 { border: 1px dashed rgba(246, 238, 246, .14); }
.jauge { height: 10px; background: rgba(0, 0, 0, .28); border-radius: 999px; overflow: hidden; }
.jauge i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--cyan), var(--vert)); box-shadow: 0 0 14px rgba(61, 255, 162, .6); }
.avertissement { background: rgba(255, 200, 87, .12); border: 1px solid rgba(255, 200, 87, .4); color: #ffe6ad; border-radius: 14px; padding: .65rem .85rem; font-size: .92rem; }
.rang { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 400 .85rem "Bungee", sans-serif; background: var(--verre-2); color: var(--doux); flex: none; }
.rang.r1 { background: var(--ambre); color: var(--nuit); box-shadow: 0 0 16px rgba(255, 200, 87, .6); }
.rang.r2 { background: #d9d4e8; color: var(--nuit); }
.rang.r3 { background: #e0a07a; color: var(--nuit); }
.etapes li { padding: .35rem 0; border-radius: 999px; background: var(--verre-2); color: var(--pale); text-align: center; font-size: .8rem; font-weight: 600; }
.etapes li.actif { background: var(--cyan); color: var(--nuit); }
pre, code { white-space: pre-wrap; word-break: break-all; }

/* --- Cinématique --- */
.cine { position: relative; overflow: hidden; height: 31rem; border-radius: 28px; border: 1px solid var(--bord-cyan);
  background: radial-gradient(120% 90% at 50% 0%, rgba(138, 77, 255, .55), rgba(26, 16, 36, .92) 70%); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
.cine-barre { position: absolute; inset: 0 0 auto; height: 3px; background: rgba(255, 255, 255, .1); z-index: 3; }
#cine-progres { height: 100%; width: 0; background: linear-gradient(90deg, var(--magenta), var(--cyan)); }
.cine-scene { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 2rem 1.5rem 4.2rem; opacity: 0; pointer-events: none; }
.cine-scene.active { opacity: 1; }
.cine-visuel { flex: 1; display: grid; place-items: center; }
.cine-texte { text-align: center; font-size: 1.12rem; line-height: 1.45; color: var(--doux); min-height: 4.5em; max-width: 30rem; margin: 0 auto; }
.cine-texte b { color: var(--texte); }
.cine-commandes { position: absolute; inset: auto 1.25rem 1rem; display: flex; justify-content: space-between; align-items: center; z-index: 3; }
#cine-points { display: flex; gap: .4rem; }
#cine-points button { width: .55rem; height: .55rem; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .3); transition: width .3s; cursor: pointer; padding: 0; }
#cine-points button.on { width: 1.6rem; background: var(--cyan); }
.cine-bouton { font-size: .7rem; color: #fff; background: rgba(255, 255, 255, .14); border: 0; border-radius: 999px; width: 2.2rem; height: 2.2rem; cursor: pointer; }
.tel { width: 13rem; height: 16rem; border-radius: 1.9rem; background: #0d0714; padding: .5rem; border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 24px 50px rgba(0, 0, 0, .5), 0 0 40px rgba(70, 230, 242, .15); }
.tel-ecran { width: 100%; height: 100%; border-radius: 1.45rem; background: linear-gradient(180deg, #2f1c42, #1a1024); overflow: hidden; }
.compteur { font: 400 2rem "Bungee", sans-serif; }
.cercle { width: 15.5rem; height: 15.5rem; overflow: visible; }
.cercle .lien { stroke: rgba(70, 230, 242, .45); stroke-width: 1.2; }
.cercle text { font-family: "Bungee", sans-serif; }
.ligne-test { display: flex; align-items: center; gap: .45rem; font-size: .74rem; background: rgba(255, 255, 255, .06); border: 1px solid var(--bord); border-radius: .7rem; padding: .35rem .45rem; }
.ligne-test img { width: 1.4rem; height: 1.4rem; border-radius: .4rem; }
.minuteur { width: 2.4rem; height: .32rem; border-radius: 999px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.minuteur i { display: block; height: 100%; width: 0; background: var(--vert); }
.coche { color: var(--vert); font-weight: 800; opacity: 0; }
.grille-cine { display: grid; gap: .5rem; }
.jour { width: .85rem; height: .85rem; border-radius: .22rem; background: rgba(255, 255, 255, .12); }
.jour.vide { background: transparent; }
.hexa { width: 7rem; height: 7rem; margin: auto; display: grid; place-items: center; font-size: 3.2rem; font-weight: 900; color: var(--vert);
  background: linear-gradient(135deg, var(--cyan), var(--violet)); clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); }

@media (min-width: 768px) {
  .cine { height: 34rem; }
}

/* Salon du cercle */
.bulle { max-width: min(78%, 34rem); background: var(--verre-2); border: 1px solid var(--bord); border-radius: 18px 18px 18px 6px; padding: .5rem .75rem; }
.bulle.moi { background: rgba(70, 230, 242, .16); border-color: var(--bord-cyan); border-radius: 18px 18px 6px 18px; }
