/* Opération Minuit · charte « Lumière de pierre » (exception au mode clair, validée le 13/11/2026 pour ce projet) */
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url("/fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url("/fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-display: swap; src: url("/fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }

:root {
    --fond: #0E1420;
    --carte: #1A2333;
    --texte: #F4EDE2;
    --doux: #B9B3A9;
    --or: #D4A24C;
    --rouge: #C2323E;
    --bleu: #4A7FD8;
    --givre: rgba(221, 235, 245, .6);
    --bord: rgba(244, 237, 226, .16);
    --champ: #121A29;
    color-scheme: dark;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--fond);
    color: var(--texte);
    font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 18px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
.grand { font-size: 20px; }
a { color: var(--or); text-decoration: none; }
a:hover { color: var(--texte); }
img { display: block; max-width: 100%; }
.icone { width: 1.2em; height: 1.2em; flex: none; }

/* --- Barre du haut --- */
.barre { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 600px; margin: 0 auto; padding: 12px 16px; }
.marque { display: inline-flex; align-items: center; gap: 8px; color: var(--or); font-weight: 700; font-size: 15px; letter-spacing: 1px; text-transform: uppercase; }
.marque.grande { font-size: 16px; margin: 0 0 24px; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--doux); font-size: 16px; padding: 8px 10px; border-radius: 6px; border: 1px solid transparent; }
.nav a:hover { color: var(--texte); border-color: var(--bleu); }
.nav a[aria-current="page"] { color: var(--texte); }

/* --- Page --- */
.page { max-width: 600px; margin: 0 auto; padding: 8px 16px 48px; }
h1 { font-size: 1.6em; line-height: 1.15; font-weight: 700; margin: 4px 0 12px; }
h2 { font-size: 1.15em; margin: 0; }
.surtitre { margin: 16px 0 0; color: var(--or); font-size: 15px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.doux { color: var(--doux); margin: 0 0 16px; }
.petit { font-size: 15px; }
.centre { text-align: center; }
.pile { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.pile > .pile { margin: 0; }
.accueil { padding-top: 15vh; }
.titre-section { margin: 32px 0 12px; }

/* --- Boutons : 56 px minimum, un seul principal par écran --- */
.btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; min-height: 56px; padding: 0 20px;
    border-radius: 10px; border: 1px solid var(--bord);
    background: var(--carte); color: var(--texte);
    font: inherit; font-weight: 600; text-align: center;
    cursor: pointer; text-decoration: none;
}
.btn:hover, .btn-discret:hover, .btn-petit:hover, .case:hover { outline: 2px solid var(--bleu); outline-offset: 2px; color: inherit; }
.btn:focus-visible, .btn-discret:focus-visible, .btn-petit:focus-visible, .case:focus-within { outline: 2px solid var(--bleu); outline-offset: 2px; }
.btn-or { background: var(--or); border-color: var(--or); color: #1E1608; }
.btn-or:hover { color: #1E1608; }
.btn-rouge { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.btn-rouge:hover { color: #fff; }
.btn[disabled] { opacity: .4; cursor: not-allowed; outline: none; }
.btn.enregistre { border-color: var(--rouge); color: var(--texte); }
.btn-discret {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; min-height: 56px; padding: 0 16px;
    background: none; border: 1px solid transparent; border-radius: 10px;
    color: var(--doux); font: inherit; cursor: pointer;
}
.btn-petit {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px;
    background: var(--fond); border: 1px solid var(--bord); border-radius: 6px;
    color: var(--texte); font: inherit; font-size: 16px; cursor: pointer;
}
.cache { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
label.btn, label.btn-discret { position: relative; }

/* --- Choix : cases-boutons à coins discrets --- */
.choix { border: 0; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.choix legend { padding: 0; margin-bottom: 10px; font-weight: 600; }
.case {
    display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px;
    background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; cursor: pointer;
}
.case input { position: absolute; opacity: 0; pointer-events: none; }
.case:has(input:checked) { border-color: var(--or); box-shadow: inset 0 0 0 1px var(--or); color: var(--or); }

/* --- Champs (texte saisi au moins à 18 px) --- */
.etiquette-champ { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-weight: 600; }
textarea {
    width: 100%; padding: 12px 14px; font: inherit; color: var(--texte);
    background: var(--champ); border: 1px solid var(--bord); border-radius: 8px; resize: vertical;
}
textarea:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 1px var(--bleu); }
audio { width: 100%; height: 48px; }

/* --- Photos --- */
.photo { position: relative; overflow: hidden; border-radius: 12px; background: #0A0F18; aspect-ratio: 3 / 4; margin: 12px 0; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo.vide { display: flex; align-items: center; justify-content: center; color: var(--doux); }
.photo.vide .icone { width: 40px; height: 40px; }
.halo { box-shadow: 0 0 0 2px var(--or), 0 0 32px 6px rgba(212, 162, 76, .45); }

/* Givre posé sur la photo de l'auteur pendant l'attente (#DDEBF5 à 60 %) */
.givre-voile::after {
    content: ""; position: absolute; inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, .55) 0 2px, transparent 3px) 0 0 / 38px 41px,
        radial-gradient(circle at 70% 60%, rgba(255, 255, 255, .4) 0 1px, transparent 2px) 0 0 / 23px 29px,
        var(--givre);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

/* Givre à effacer au doigt (Nanou) */
.grattable img { visibility: hidden; }
.grattable img.visible { visibility: visible; }
.grattable canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }

.consigne-grande { margin: 0 0 16px; text-align: center; color: var(--or); font-size: 2em; line-height: 1.1; font-weight: 700; }
.consigne-rappel { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--or); font-weight: 600; margin: 0 0 16px; }

/* --- États d'attente --- */
.etats { list-style: none; padding: 0; margin: 8px 0 24px; display: grid; gap: 4px; }
.etats li { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--doux); }
.etats li.fait { color: var(--texte); }
.etats li.actuel { color: var(--texte); font-weight: 600; }
.point { width: 10px; height: 10px; border-radius: 50%; flex: none; background: rgba(244, 237, 226, .25); }
.etats li.fait .point, .point-termine { background: var(--or); }
.etats li.actuel .point, .point-degivrage, .point-recherche, .point-envoye { background: var(--bleu); box-shadow: 0 0 0 4px rgba(74, 127, 216, .25); animation: pouls 1.6s ease-in-out infinite; }
@keyframes pouls { 50% { box-shadow: 0 0 0 8px rgba(74, 127, 216, 0); } }

/* --- Deux photos côte à côte --- */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.duo figure { margin: 0; }
.duo .photo { margin: 0 0 6px; }
.duo figcaption { color: var(--doux); font-size: 16px; text-align: center; }

.mots { margin: 16px 0; }
.citation { margin: 6px 0 12px; padding-left: 14px; border-left: 2px solid var(--or); font-size: 1.1em; }
.reussi { display: flex; align-items: center; gap: 8px; color: var(--or); font-weight: 600; margin: 16px 0; }
.alerte { margin: 0; color: #F2A6AC; font-weight: 600; }
.apercu { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; padding: 10px 0; border-bottom: 1px solid var(--bleu); color: var(--texte); font-size: 16px; }

.attente-anim { display: flex; justify-content: center; margin: 48px 0; color: var(--givre); }
.attente-anim .icone { width: 72px; height: 72px; animation: tourne 12s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* --- Fil de l'équipe --- */
.fil { padding: 16px 0; border-bottom: 1px solid var(--bord); }
.fil-date { margin: 0; color: var(--doux); font-size: 15px; }
.fil-texte { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; font-weight: 600; }

/* --- Administration --- */
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 16px; margin: 16px 0; }
.archivee { opacity: .55; }
.admin-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.admin-tete .doux { margin: 2px 0 0; }
.etiquette { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border: 1px solid var(--bord); border-radius: 6px; font-size: 15px; white-space: nowrap; }
.admin-etapes { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 12px; }
.admin-etape-nom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-actions, .admin-whatsapp { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.admin-actions form { margin: 0; }
.admin-whatsapp { margin: 12px 0; padding-top: 12px; border-top: 1px solid var(--bord); }
.admin-whatsapp .reussi { width: 100%; margin: 4px 0; }
.admin-joueurs { padding-left: 20px; }
.sortir { margin-top: 32px; }

/* --- Traînée de lumière à l'envoi --- */
.trainee {
    position: fixed; left: -40vw; top: 45vh; width: 40vw; height: 3px; z-index: 10; pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--bleu), #fff);
    box-shadow: 0 0 18px 4px rgba(74, 127, 216, .6); border-radius: 3px;
    animation: trainee .9s cubic-bezier(.4, 0, .2, 1) forwards;
}
@keyframes trainee { to { transform: translate(150vw, -30vh) rotate(-12deg); opacity: 0; } }

/* --- Mouvement réduit : aucun effet animé --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .trainee { display: none; }
}
