/* =====================================================================
   PANEL DU SAVOIR – Génies en Herbe
   Mobile d'abord · aucune image · aucune police externe (chargement instantané)
   ===================================================================== */
:root {
  --fond: #0e0820;
  --fond-2: #170d36;
  --carte: #1f1347;
  --carte-2: #281a5c;
  --bord: #3a2a78;
  --texte: #f6f3ff;
  --doux: #b9aee6;
  --or: #ffcc00;
  --neon: #b388ff;
  --vert: #2ee59d;
  --rouge: #ff4d6d;
  --rayon: 18px;
  --ombre: 0 10px 30px rgba(0, 0, 0, .45);
  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--police); color: var(--texte); line-height: 1.5;
  background:
    radial-gradient(120% 60% at 50% -10%, #34208a 0%, transparent 60%),
    radial-gradient(80% 50% at 100% 100%, #231060 0%, transparent 70%),
    var(--fond);
  background-attachment: fixed;
}
.cache { display: none !important; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; }

/* ---------- En-tête ---------- */
.entete {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: rgba(14, 8, 32, .82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bord);
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--texte); text-decoration: none; font-weight: 600; }
.logo-marque { font-size: 1.5rem; }
.logo-texte b { color: var(--or); }

/* ---------- Boutons ---------- */
.btn {
  appearance: none; border: 2px solid transparent; border-radius: 999px; cursor: pointer;
  padding: 11px 20px; font: inherit; font-weight: 800; letter-spacing: .2px;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-or { background: var(--or); color: #1a1033; box-shadow: 0 0 22px rgba(255, 204, 0, .35); }
.btn-or:hover:not(:disabled) { box-shadow: 0 0 30px rgba(255, 204, 0, .6); }
.btn-contour { background: transparent; color: var(--texte); border-color: var(--neon); }
.btn-contour:hover:not(:disabled) { background: rgba(179, 136, 255, .16); }
.btn-live { background: var(--vert); color: #052a1b; box-shadow: 0 0 22px rgba(46, 229, 157, .4); }
.btn-ok { background: rgba(46, 229, 157, .14); color: var(--vert); border-color: var(--vert); }
.btn-bloc { width: 100%; }

/* ---------- Contenu ---------- */
.contenu { width: 100%; max-width: 1040px; margin: 0 auto; padding: 8px 16px 40px; }

.hero { text-align: center; padding: 26px 0 8px; }
.surtitre {
  display: inline-block; margin: 0 0 8px; padding: 4px 14px; border-radius: 999px;
  background: rgba(255, 204, 0, .12); color: var(--or); font-weight: 700; font-size: .85rem; letter-spacing: 1.5px; text-transform: uppercase;
}
.hero h1 { margin: 6px 0 8px; font-size: clamp(1.7rem, 6vw, 2.8rem); line-height: 1.15; font-weight: 900; }
.accent { color: var(--or); text-shadow: 0 0 24px rgba(255, 204, 0, .4); }
.hero-texte { margin: 0 auto; max-width: 34ch; color: var(--doux); }

.banniere {
  margin: 14px 0 0; padding: 12px 16px; border-radius: 12px; font-weight: 600;
  background: rgba(255, 77, 109, .14); border: 1px solid var(--rouge); color: #ffd3da;
}
.banniere.info { background: rgba(179, 136, 255, .14); border-color: var(--neon); color: var(--texte); }

/* ---------- Blocs ---------- */
.bloc { margin-top: 30px; }
.bloc-entete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bloc-entete h2 { margin: 0; font-size: 1.25rem; display: flex; align-items: center; gap: 10px; }
.compteur {
  min-width: 32px; padding: 2px 10px; text-align: center; border-radius: 999px;
  background: var(--carte-2); border: 1px solid var(--bord); color: var(--doux); font-weight: 800; font-variant-numeric: tabular-nums;
}
.grille { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }

/* ---------- Cartes ---------- */
.carte {
  position: relative; padding: 18px; border-radius: var(--rayon);
  background: linear-gradient(150deg, var(--carte-2), var(--carte));
  border: 1px solid var(--bord); box-shadow: var(--ombre);
  display: flex; flex-direction: column; gap: 12px;
}
.carte.live { border-color: rgba(46, 229, 157, .6); box-shadow: var(--ombre), 0 0 28px rgba(46, 229, 157, .18); }
.carte-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.carte h3 { margin: 0; font-size: 1.1rem; line-height: 1.3; overflow-wrap: anywhere; }
.badge {
  flex: none; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800;
  background: rgba(179, 136, 255, .18); color: var(--neon); border: 1px solid rgba(179, 136, 255, .45);
}
.badge.buzzer { background: rgba(255, 204, 0, .14); color: var(--or); border-color: rgba(255, 204, 0, .5); }
.meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--doux); font-size: .92rem; }

/* Compte à rebours */
.compte-bloc { text-align: center; padding: 10px 0 2px; }
.compte-etiquette { margin: 0; font-size: .8rem; letter-spacing: 1.2px; text-transform: uppercase; color: var(--doux); }
.compte {
  margin: 2px 0 0; font-size: clamp(2rem, 9vw, 2.6rem); font-weight: 900; color: var(--or);
  font-variant-numeric: tabular-nums; letter-spacing: 1px; text-shadow: 0 0 22px rgba(255, 204, 0, .35);
}
.compte.proche { color: var(--rouge); animation: battement .9s ease-in-out infinite alternate; }
@keyframes battement { from { transform: scale(1); } to { transform: scale(1.06); } }

/* Barre de progression d'une partie en cours */
.progres { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.progres > i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--vert), var(--or)); transition: width .6s linear; }

/* Indicateur LIVE */
.pastille-live {
  position: relative; display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  background: var(--rouge); box-shadow: 0 0 0 0 rgba(255, 77, 109, .7); animation: onde 1.6s infinite;
}
@keyframes onde { 70% { box-shadow: 0 0 0 12px rgba(255, 77, 109, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0); } }
.etiquette-live {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--rouge); color: #fff; font-size: .75rem; font-weight: 900; letter-spacing: 1px;
}
.etiquette-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: clignote 1s steps(2) infinite; }
@keyframes clignote { 50% { opacity: .2; } }

/* États vides et chargement */
.vide { grid-column: 1 / -1; padding: 26px 16px; text-align: center; color: var(--doux); border: 2px dashed var(--bord); border-radius: var(--rayon); }
.squelette { min-height: 150px; background: linear-gradient(100deg, var(--carte) 30%, var(--carte-2) 50%, var(--carte) 70%); background-size: 300% 100%; animation: brille 1.4s linear infinite; }
@keyframes brille { to { background-position: -300% 0; } }

/* ---------- Dialogue d'inscription ---------- */
.dialogue {
  width: min(92vw, 420px); padding: 22px; color: var(--texte);
  background: linear-gradient(150deg, var(--carte-2), var(--carte)); border: 2px solid var(--bord); border-radius: 22px; box-shadow: var(--ombre);
}
.dialogue::backdrop { background: rgba(5, 2, 15, .75); backdrop-filter: blur(3px); }
.dialogue h2 { margin: 0 0 6px; font-size: 1.25rem; color: var(--or); }
.aide { margin: 0 0 8px; color: var(--doux); font-size: .9rem; }
.dialogue label { display: block; margin: 14px 0 6px; font-weight: 700; }
.dialogue input {
  width: 100%; padding: 13px 14px; font: inherit; color: var(--texte);
  background: var(--fond-2); border: 2px solid #5a3fa3; border-radius: 14px; outline: none;
}
.dialogue input:focus { border-color: var(--or); box-shadow: 0 0 0 3px rgba(255, 204, 0, .2); }
.erreur { min-height: 1.3em; margin: 10px 0 0; color: #ff9db0; font-weight: 600; font-size: .92rem; }
.dlg-actions { display: flex; gap: 10px; margin-top: 8px; }
.dlg-actions .btn { flex: 1; }

/* ---------- Pied de page ---------- */
.pied { padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px)); text-align: center; color: var(--doux); font-size: .85rem; border-top: 1px solid var(--bord); }
.pied p { margin: 0; }

/* ---------- Page de jeu provisoire ---------- */
.centre { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 24px; }

@media (min-width: 720px) {
  .entete { padding-left: max(24px, calc((100vw - 1040px) / 2)); padding-right: max(24px, calc((100vw - 1040px) / 2)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
