/* Espace des invités : parchemin, bordeaux et or, comme l'espace organisateurs. Pensé pour le pouce. */
:root {
    --bordeaux: #7A1F2B; --bordeaux-fonce: #4A121A; --or: #C9A24B; --or-fonce: #8A6A1F;
    --fond: #F5EFE3; --carte: #FFFCF5; --encre: #241A14; --discret: #66564A; --filet: #E2D5BD;
    --bon: #2F6B47; --faux: #A92B2B;
    --ombre: 0 1px 2px rgba(36,26,20,.06), 0 4px 14px rgba(36,26,20,.07);
    --titre: 'Cinzel', Georgia, 'Times New Roman', serif;
    --texte: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --nav: 64px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { font: 16px/1.5 var(--texte); background: var(--fond); color: var(--encre); min-height: 100dvh; -webkit-font-smoothing: antialiased; }
body.bloque { overflow: hidden; }
h1, h2 { font-family: var(--titre); font-weight: 600; line-height: 1.25; }
a { color: var(--bordeaux); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #CDBD9F; border-radius: 8px; background: #fff; color: var(--encre); font-size: 16px; }
input:focus { outline: 2px solid var(--or); outline-offset: 1px; border-color: var(--or); }
:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }
label { display: block; margin: 12px 0 5px; font-size: .88rem; font-weight: 500; color: var(--discret); }
[hidden] { display: none !important; }

/* Porte d'entrée */
.porte { display: flex; align-items: center; justify-content: center; padding: 20px 16px; background: radial-gradient(120% 90% at 50% 0%, #5B1721 0%, #2A1013 55%, #1C1512 100%); }
.porte__carte { width: 100%; max-width: 400px; padding: 30px 24px; background: var(--carte); border: 1px solid var(--or); border-radius: 14px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.porte__blason { width: 46px; height: 46px; fill: var(--or-fonce); }
.porte__sur { margin-top: 6px; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--or-fonce); font-weight: 600; }
.porte h1 { font-size: 1.9rem; color: var(--bordeaux-fonce); }
.porte__texte { margin: 8px 0 8px; color: var(--discret); }
.porte__erreur { margin: 12px 0 0; padding: 9px 12px; border-radius: 8px; background: #FBE6E3; color: #8A1F1F; font-size: .92rem; }
.porte form { text-align: left; }
.porte button { width: 100%; min-height: 52px; margin-top: 20px; border-radius: 10px; background: var(--bordeaux); color: #fff; font-weight: 600; }
.porte button:active { background: var(--bordeaux-fonce); }

/* Cadre */
#vue { display: block; max-width: 640px; margin: 0 auto; padding: 0 16px calc(var(--nav) + 28px + env(safe-area-inset-bottom)); outline: none; }
.onglets { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); background: var(--bordeaux-fonce); border-top: 2px solid var(--or); }
.onglets a { flex: 1; max-width: 128px; height: var(--nav); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #E9D9B8; text-decoration: none; font-size: .7rem; font-weight: 500; }
.onglets svg { width: 23px; height: 23px; }
.onglets a[aria-current] { color: #fff; background: rgba(201,162,75,.2); box-shadow: inset 0 3px 0 var(--or); }
.titre { padding-top: calc(22px + env(safe-area-inset-top)); font-size: 1.65rem; color: var(--bordeaux-fonce); }
.sous-titre { color: var(--discret); font-size: .93rem; margin-bottom: 10px; }
.intertitre { margin: 24px 0 10px; font-size: 1.08rem; color: var(--bordeaux-fonce); }
.vide { padding: 36px 12px; text-align: center; color: var(--discret); }
.etiquette { display: inline-block; margin-top: 4px; padding: 1px 9px; border-radius: 99px; background: rgba(201,162,75,.24); color: #6B4F12; font-size: .73rem; font-weight: 600; }
.direct-bandeau { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 8px 12px calc(8px); padding-top: calc(8px + env(safe-area-inset-top)); background: var(--or); color: #2C1D08; font-weight: 600; text-decoration: none; }
.pastille { width: 10px; height: 10px; border-radius: 50%; background: var(--faux); animation: battement 1.2s infinite; }
.pastille--grande { display: block; width: 18px; height: 18px; margin: 24px auto 0; background: var(--or); }
@keyframes battement { 50% { opacity: .35; transform: scale(.8); } }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 10px; background: var(--bordeaux); color: #fff; font-weight: 600; cursor: pointer; }
.btn:active { background: var(--bordeaux-fonce); }
.btn:disabled { opacity: .6; }
.btn svg { width: 21px; height: 21px; }
.btn--grand { width: 100%; min-height: 52px; margin-top: 14px; }
.btn--discret { width: 100%; margin-top: 6px; background: none; color: var(--discret); font-weight: 500; }
.btn--discret:active { background: none; }
.btn--fixe { position: sticky; top: 10px; z-index: 5; box-shadow: 0 6px 16px rgba(74,18,26,.3); margin-bottom: 14px; }

/* Accueil */
.heros { margin: 0 -16px; padding: calc(28px + env(safe-area-inset-top)) 18px 22px; text-align: center; color: #F6E9CC; background: radial-gradient(130% 110% at 50% 0%, #6B1B27 0%, #3A0F15 70%); border-bottom: 3px solid var(--or); }
.heros__sur { font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: #E2C47D; font-weight: 600; }
.heros h1 { margin-top: 3px; font-size: 1.65rem; color: #fff; overflow-wrap: anywhere; }
.prenom { font-family: inherit; font-weight: inherit; color: #F0D48B; text-decoration: underline dotted rgba(240,212,139,.6); text-underline-offset: 4px; }
.compte { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 340px; margin: 16px auto 0; }
.compte div { padding: 8px 2px; border: 1px solid rgba(201,162,75,.5); border-radius: 8px; background: rgba(0,0,0,.18); }
.compte strong { display: block; font: 600 1.4rem/1.1 var(--titre); color: #fff; font-variant-numeric: tabular-nums; }
.compte span { font-size: .7rem; color: #E2C47D; }
.compte__jour { grid-column: 1 / -1; font: 600 1.1rem var(--titre); color: #F0D48B; }
.annonce { margin-top: 16px; padding: 14px 16px; border-left: 4px solid var(--or); border-radius: 8px; background: #FBF3DF; }
.annonce h2 { font-size: .98rem; color: var(--bordeaux-fonce); margin-bottom: 2px; }
.annonce p { white-space: pre-line; }
.suite { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 12px 14px; background: var(--carte); border: 1px solid var(--filet); border-radius: 12px; box-shadow: var(--ombre); color: inherit; text-decoration: none; }
.suite__heure { flex: none; min-width: 64px; font: 600 1.2rem var(--titre); color: var(--bordeaux); }
.suite span:last-child { min-width: 0; }
.suite small { display: block; color: var(--discret); font-size: .8rem; }
.suite strong { display: block; }
.tuiles { display: grid; gap: 10px; margin-top: 14px; }
.tuile { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 14px; background: var(--carte); border: 1px solid var(--filet); border-radius: 12px; color: inherit; text-decoration: none; }
.tuile:active { border-color: var(--or); background: #FBF3DF; }
.tuile svg { flex: none; width: 42px; height: 42px; padding: 9px; border-radius: 10px; background: var(--bordeaux); color: #F6E9CC; }
.tuile strong, .tuile small { display: block; }
.tuile small { color: var(--discret); font-size: .85rem; }
.section { margin-top: 22px; }
.section__tete { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.section__tete h2 { font-size: 1.08rem; color: var(--bordeaux-fonce); }
.section__tete a { font-size: .88rem; padding: 6px 0; }

/* Programme */
.frise { list-style: none; margin-top: 10px; border-left: 2px solid var(--or); margin-left: 3px; }
.frise li { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 0 0 14px 14px; }
.frise li::before { content: ''; position: absolute; left: -7px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--fond); border: 2px solid var(--or-fonce); }
.frise li.en-cours::before { background: var(--bordeaux); border-color: var(--bordeaux); }
.frise li.passe { opacity: .55; }
.frise__heure { font: 600 1rem var(--titre); color: var(--bordeaux); padding-top: 5px; }
.frise__heure small { display: block; font: 400 .76rem var(--texte); color: var(--discret); }
.frise__carte { min-width: 0; padding: 10px 13px; background: var(--carte); border: 1px solid var(--filet); border-radius: 10px; }
.en-cours .frise__carte { border-color: var(--bordeaux); box-shadow: var(--ombre); }
.frise__carte h2 { font-family: var(--texte); font-size: 1rem; font-weight: 600; }
.frise__lieu { color: var(--or-fonce); font-size: .84rem; font-weight: 500; }

/* Photos */
.grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 0 -13px; }
.grille .vide { grid-column: 1 / -1; }
.grille--apercu { margin: 0; border-radius: 10px; overflow: hidden; }
.vignette { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: #E7DCC8; }
.vignette img { display: block; width: 100%; height: 100%; object-fit: cover; }
.vignette__coeurs { position: absolute; right: 4px; bottom: 4px; padding: 0 6px; border-radius: 99px; background: rgba(28,21,18,.7); color: #fff; font-size: .72rem; }
.sentinelle { height: 1px; }
.visionneuse { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: #120D0B; color: #fff; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.visionneuse__haut { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 4px 14px; font-size: .88rem; }
.visionneuse__haut button { width: 46px; height: 46px; font-size: 1.2rem; color: #fff; }
.visionneuse__image { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.visionneuse__image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fleche { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; font-size: 2rem; color: #fff; background: rgba(0,0,0,.28); }
.fleche--g { left: 0; border-radius: 0 8px 8px 0; } .fleche--d { right: 0; border-radius: 8px 0 0 8px; }
.visionneuse__bas { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.visionneuse__bas > div { flex: 1; min-width: 0; font-size: .92rem; overflow-wrap: anywhere; }
.coeur { min-width: 64px; min-height: 44px; padding: 0 12px; border: 1px solid rgba(255,255,255,.4); border-radius: 99px; color: #fff; }
.coeur--actif { background: var(--bordeaux); border-color: var(--bordeaux); }
.retirer { min-height: 44px; padding: 0 8px; color: #E7C7BE; font-size: .86rem; text-decoration: underline; }

/* Feuilles remontantes */
.feuille-fond { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: rgba(28,21,18,.55); }
.feuille { width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto; padding: 20px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--carte); border-radius: 16px 16px 0 0; }
.feuille h2 { color: var(--bordeaux-fonce); font-size: 1.15rem; }
.apercus { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; }
.apercus img { flex: none; width: 92px; height: 92px; object-fit: cover; border-radius: 6px; }
.progression { height: 8px; margin-top: 12px; border-radius: 9px; background: var(--filet); overflow: hidden; }
.progression div { width: 0; height: 100%; background: var(--or-fonce); transition: width .2s; }

/* Quiz */
.carte { margin-top: 14px; padding: 15px 16px; background: var(--carte); border: 1px solid var(--filet); border-radius: 12px; }
.carte h2 { font-size: 1.05rem; color: var(--bordeaux-fonce); margin-bottom: 3px; }
.carte--score { text-align: center; }
.carte--score strong { display: block; font: 700 2.8rem var(--titre); color: var(--bordeaux); }
.ligne-quiz { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 66px; margin-bottom: 8px; padding: 10px 14px; background: var(--carte); border: 1px solid var(--filet); border-radius: 12px; text-align: left; }
.ligne-quiz strong, .ligne-quiz small { display: block; }
.ligne-quiz small { color: var(--discret); font-size: .85rem; }
.retour { min-height: 44px; margin-top: calc(8px + env(safe-area-inset-top)); color: var(--bordeaux); font-weight: 500; }
.question { margin: 8px 0 16px; font-size: 1.32rem; color: var(--bordeaux-fonce); overflow-wrap: anywhere; }
.choix { display: grid; gap: 9px; }
.choix__b { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 9px 12px; background: var(--carte); border: 2px solid var(--filet); border-radius: 12px; text-align: left; font-weight: 500; overflow-wrap: anywhere; }
button.choix__b:not(:disabled):active { border-color: var(--or); background: #FBF3DF; }
.choix__b > span { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--bordeaux); color: #fff; font: 600 .95rem var(--titre); }
.choix__b em { margin-left: auto; padding-left: 8px; font-style: normal; font-size: .88rem; color: var(--discret); }
.choix__b.choisi { border-color: var(--bordeaux); background: #F7E8E6; }
.choix__b.bon { border-color: var(--bon); background: #E6F1E9; } .choix__b.bon > span { background: var(--bon); }
.choix__b.faux { border-color: var(--faux); background: #FBE6E3; } .choix__b.faux > span { background: var(--faux); }
.choix__b.eteint { opacity: .6; }
.explication { margin-top: 12px; padding: 10px 13px; border-radius: 8px; background: #FBF3DF; font-size: .93rem; }
.direct { padding-top: calc(16px + env(safe-area-inset-top)); }
.direct--plein { min-height: 64dvh; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.direct--plein h1 { font-size: 1.7rem; color: var(--bordeaux-fonce); margin-bottom: 6px; }
.direct__sur { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--or-fonce); font-weight: 600; }
.direct__tete { display: flex; align-items: center; justify-content: space-between; color: var(--discret); font-size: .9rem; }
.chrono { font: 700 1.5rem var(--titre); color: var(--bordeaux); font-variant-numeric: tabular-nums; }
.barre-temps { height: 7px; margin: 5px 0 12px; border-radius: 9px; background: var(--filet); overflow: hidden; }
.barre-temps div { height: 100%; background: var(--bordeaux); transition: width .2s linear; }
.direct__etat { margin-top: 12px; min-height: 1.5em; text-align: center; font-weight: 600; color: var(--bordeaux); }
.direct__score { margin-top: 14px; text-align: center; font: 600 1.08rem var(--titre); color: var(--bordeaux-fonce); }
.verdict { margin-bottom: 12px; font: 700 1.25rem var(--titre); color: var(--faux); }
.verdict--bon { color: var(--bon); }
.classement { margin-top: 12px; padding: 4px 14px 4px 34px; background: var(--carte); border: 1px solid var(--filet); border-radius: 10px; text-align: left; }
.classement li { padding: 7px 0; border-bottom: 1px solid var(--filet); }
.classement li:last-child { border: 0; }
.classement li span { display: inline-block; max-width: 70%; overflow-wrap: anywhere; }
.classement strong { float: right; color: var(--bordeaux); }
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; gap: 6px; margin-top: 18px; }
.podium div { min-width: 0; text-align: center; }
.podium strong { display: block; overflow-wrap: anywhere; font-size: .95rem; }
.podium small { display: block; color: var(--discret); }
.podium span { display: block; margin-top: 4px; padding-top: 8px; border-radius: 8px 8px 0 0; background: var(--bordeaux); color: #fff; font: 700 1.3rem var(--titre); }
.podium__p1 span { height: 104px; background: var(--or-fonce); } .podium__p2 span { height: 76px; } .podium__p3 span { height: 54px; background: var(--bordeaux-fonce); }
.podium__p1 { order: 2; } .podium__p2 { order: 1; } .podium__p3 { order: 3; }

/* Musique */
.musiques { list-style: none; }
.musiques li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 7px; background: var(--carte); border: 1px solid var(--filet); border-radius: 10px; }
.musiques li > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.musiques strong, .musiques small { display: block; }
.musiques small { color: var(--discret); font-size: .84rem; }
.musiques .jouee { opacity: .6; }
.vote { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 52px; height: 52px; border: 1px solid var(--filet); border-radius: 10px; color: var(--bordeaux); font-size: .8rem; line-height: 1.1; }
.vote span { font-size: .98rem; font-weight: 600; }
.vote--actif { background: var(--bordeaux); border-color: var(--bordeaux); color: #fff; }

.toast { position: fixed; z-index: 50; left: 16px; right: 16px; bottom: calc(var(--nav) + 12px + env(safe-area-inset-bottom)); max-width: 480px; margin: 0 auto; padding: 11px 14px; border-radius: 10px; background: #1F2E25; color: #fff; text-align: center; font-size: .94rem; opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; }
.toast.visible { opacity: 1; transform: none; }
.toast--erreur { background: #8A1F1F; }

@media (min-width: 620px) {
    .grille { grid-template-columns: repeat(4, 1fr); margin: 0; }
    .grille--apercu { grid-template-columns: repeat(6, 1fr); }
    .tuiles { grid-template-columns: repeat(3, 1fr); }
    .tuile { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { *, ::before, ::after { animation: none !important; transition: none !important; } }
