/* Charte de la campagne calendrier de l'Avent, reprise du prototype (docs/prototype) */
:root {
    --red: #b92e3c;
    --green: #152e18;
    --green-hover: #26744a;
    --gold: #e76a97;
    --gold-light: #ecc4cb;
    --muted: #8a4a52;
    --cream: #fff6e6;
    --choco: #3a2313;
    --night: #0c1a33;
    --night-light: #152847;
    --night-panel: #1b2a45;
    --footer-text: #a9b6d0;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --space-xs: 6px;
    --space-sm: 10px;
    --space-md: 16px;
    --space-lg: 24px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
    background: linear-gradient(180deg, var(--night) 0%, var(--night-light) 100%);
    color: var(--cream);
    min-height: 100vh;
}
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Page ---------- */
.app {
    max-width: 1200px; margin: 0 auto; padding: 0 var(--space-md) 40px;
    display: flex; flex-direction: column; gap: var(--space-md);
}
/* Trois colonnes : le logo reste centré quel que soit le lien de retour à droite */
.topbar {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: var(--space-sm);
    padding-top: var(--space-lg);
}
.brand-home { grid-column: 2; }
.return-link {
    justify-self: end; white-space: nowrap; text-decoration: none;
    padding: var(--space-xs) var(--space-md); border-radius: 24px; border: 1px solid var(--gold);
    color: var(--gold-light); font-size: 14px; font-weight: 600; transition: .15s;
}
.return-link:hover { background: rgba(231, 106, 151, .15); }
.brand-logo { display: block; height: 96px; width: auto; }
.brand-logo--mobile { display: none; }

.banner {
    padding: 12px 18px; border-radius: var(--radius); text-align: center; font-size: 14px;
    background: linear-gradient(90deg, rgba(231, 106, 151, .20), rgba(231, 106, 151, .06));
    border: 1px solid rgba(231, 106, 151, .45); color: var(--gold-light);
}
/* Visiteur arrivé par le lien de partage d'un joueur */
.banner--invitation { border-color: var(--gold); background: rgba(231, 106, 151, .22); }
.audience-badge {
    align-self: center; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    padding: 4px 12px; border-radius: 12px; background: var(--gold); color: #fff;
}

/* ---------- Maison ---------- */
.house { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
/* Desktop : la page tient dans l'écran, la façade prend la hauteur restante sans être rognée ; plancher de 300px pour les écrans très bas */
@media (min-width: 701px) {
    .app { min-height: 100svh; padding-bottom: var(--space-md); }
    .house-stage { flex: 1 0 300px; container-type: size; display: flex; justify-content: center; align-items: flex-start; }
    .house { width: min(100cqw, 100cqh * 1672 / 941); }
}

/* Neige qui tombe sur la maison : trois couches de flocons (petits lents, moyens, gros rapides) en arrière-plans répétés.
   Chaque couche descend d'exactement une tuile par cycle : la boucle est invisible. Aucun élément ajouté, clics non bloqués */
.house::after, .error-page::after {
    content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none;
    background-image:
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, .9) 0 1.5px, transparent 2px),
        radial-gradient(circle at 47% 62%, rgba(255, 255, 255, .8) 0 1.5px, transparent 2px),
        radial-gradient(circle at 81% 33%, rgba(255, 255, 255, .85) 0 1.5px, transparent 2px),
        radial-gradient(circle at 60% 90%, rgba(255, 255, 255, .8) 0 1.5px, transparent 2px),
        radial-gradient(circle at 5% 70%, rgba(255, 255, 255, .85) 0 1.5px, transparent 2px),
        radial-gradient(circle at 30% 85%, rgba(255, 255, 255, .9) 0 2.5px, transparent 3px),
        radial-gradient(circle at 68% 12%, rgba(255, 255, 255, .85) 0 2.5px, transparent 3px),
        radial-gradient(circle at 90% 70%, rgba(255, 255, 255, .8) 0 2.5px, transparent 3px),
        radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .85) 0 2.5px, transparent 3px),
        radial-gradient(circle at 20% 40%, rgba(255, 255, 255, .95) 0 3.5px, transparent 4.5px),
        radial-gradient(circle at 75% 88%, rgba(255, 255, 255, .9) 0 3.5px, transparent 4.5px);
    background-size: 180px 180px, 180px 180px, 180px 180px, 180px 180px, 180px 180px, 260px 260px, 260px 260px, 260px 260px, 260px 260px, 380px 380px, 380px 380px;
    animation: snowfall 18s linear infinite;
    opacity: .85;
}
@keyframes snowfall {
    from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
    to {
        background-position: 30px 180px, 30px 180px, 30px 180px, 30px 180px, 30px 180px, -40px 520px, -40px 520px, -40px 520px, -40px 520px, 60px 1140px, 60px 1140px;
    }
}
/* Père Noël et son traîneau : traversent une bande pleine largeur entre le logo et la bannière du jour, d'un bord à l'autre de
   l'écran, toutes les 45 s (8 s de passage), sans jamais croiser la maison. Silhouette dorée sur le fond de nuit,
   rennes qui galopent chacun à leur rythme */
.santa-sleigh {
    position: absolute; top: 0; left: -20%; width: clamp(130px, 13vw, 230px); aspect-ratio: 2601 / 734; z-index: 0; pointer-events: none;
    overflow: visible; fill: #f6d684;
    filter: drop-shadow(0 0 3px rgba(255, 214, 120, .8));
    /* backwards : pendant les 3 s d'attente, le traîneau est déjà à son point de départ hors écran (sinon visible à gauche sur mobile) */
    animation: santaFlight 45s linear 3s infinite backwards;
}
.santa-sleigh-reindeer { transform-box: fill-box; animation: reindeerGallop .5s ease-in-out infinite; }
.santa-sleigh-reindeer:nth-of-type(3) { animation-delay: -.12s; }
.santa-sleigh-reindeer:nth-of-type(4) { animation-delay: -.25s; }
.santa-sleigh-reindeer:nth-of-type(5) { animation-delay: -.37s; }
/* Galop vertical uniquement : le tracé partagé fait que la rotation pivoterait autour de toute la silhouette */
@keyframes reindeerGallop {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6%); }
}
@keyframes santaFlight {
    0% { left: -20%; transform: translateY(10%) rotate(-4deg); }
    9% { transform: translateY(-15%) rotate(1deg); }
    18% { left: 105%; transform: translateY(10%) rotate(4deg); }
    18.01%, 100% { left: 105%; }
}
/* Bande pleine largeur entre le logo et la bannière (sort du conteneur centré). Le traîneau hors écran est coupé par la bande
   elle-même : Safari iOS ignore l'overflow du body et laisserait la page glisser sur le côté */
.sleigh-lane { position: relative; width: 100vw; margin-left: calc(50% - 50vw); height: clamp(50px, 5vw, 80px); overflow-x: clip; }
body { overflow-x: clip; }
@media (max-width: 700px) {
    .santa-sleigh { width: 32vw; }
    .sleigh-lane { height: 12vw; }
    @keyframes santaFlight {
        0% { left: -40%; transform: translateY(10%) rotate(-4deg); }
        9% { transform: translateY(-10%) rotate(2deg); }
        18% { left: 105%; transform: translateY(10%) rotate(-3deg); }
        18.01%, 100% { left: 105%; }
    }
}
/* Pendant l'entrée dans une fenêtre, le traîneau s'efface comme la neige */
body:has(.is-entering) .santa-sleigh, body:has(.is-leaving) .santa-sleigh { opacity: 0; }

/* Pendant l'entrée dans une fenêtre, la neige s'efface pour ne pas zoomer avec la maison */
.house:has(.is-entering)::after, .house:has(.is-leaving)::after { opacity: 0; transition: opacity .3s; }
@media (prefers-reduced-motion: reduce) {
    .house::after, .error-page::after { animation: none; opacity: .5; }
    .santa-sleigh { display: none; }
}
.house-frame { position: relative; width: 100%; background: var(--night); }
.house-frame--desktop { aspect-ratio: 1672 / 941; }
.house-frame--mobile { aspect-ratio: 853 / 1844; display: none; }
.house-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

.hotspot {
    position: absolute; transform: translate(-50%, -50%);
    border: none; background: transparent; cursor: pointer; padding: 0; border-radius: 16px;
}
.hotspot--window { width: 4.2%; height: 10.4%; }
.hotspot--door { width: 5.3%; height: 15%; }
.hotspot--star { width: 6%; height: 8%; }
.house-frame--mobile .hotspot--window { width: 8.21%; height: 5.31%; }
.house-frame--mobile .hotspot--door { width: 12.93%; height: 11.66%; }
.house-frame--mobile .hotspot--star { width: 11.72%; height: 4.07%; }
.hotspot.is-locked { cursor: not-allowed; }
.hotspot:focus-visible { outline: 3px solid var(--gold); }

/* Case jouée : la fenêtre reste allumée en permanence (vitre allumée seule, PNG transparent) */
.hotspot .lit {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 110%; height: 110%; object-fit: cover; pointer-events: none;
    opacity: 0; animation: litOn .5s ease forwards;
}
@keyframes litOn { from { opacity: 0; } to { opacity: 1; } }
/* Fenêtres : chaque vignette est taillée sur mesure pour couvrir exactement la zone cliquable */
.hotspot--window .lit { width: 100%; height: 100%; object-fit: fill; }

/* Case du jour : halo diffus qui vacille autour de la fenêtre comme un feu de camp, pour guider le joueur.
   Lumière floue uniquement (pas de trait net), hors de la fenêtre pour garder le numéro lisible */
.hotspot.is-today:not(.is-opening) { animation: campfireHalo 2.4s ease-in-out infinite; }
/* Fenêtres et porte cintrées : le halo épouse l'arc du haut */
.hotspot--window.is-today { border-radius: 50% 50% 10% 10% / 36% 36% 7% 7%; }
.hotspot--door.is-today { border-radius: 50% 50% 4% 4% / 24% 24% 2% 2%; }
@keyframes campfireHalo {
    0%, 100% { box-shadow: 0 0 14px 4px rgba(255, 150, 40, .65), 0 0 32px 10px rgba(255, 95, 20, .3); }
    20% { box-shadow: 0 0 18px 6px rgba(255, 170, 55, .8), 0 0 40px 14px rgba(255, 105, 20, .38); }
    35% { box-shadow: 0 0 11px 3px rgba(255, 140, 35, .5), 0 0 26px 8px rgba(255, 85, 20, .22); }
    60% { box-shadow: 0 0 20px 7px rgba(255, 180, 65, .85), 0 0 44px 16px rgba(255, 110, 30, .42); }
    80% { box-shadow: 0 0 15px 5px rgba(255, 158, 48, .7), 0 0 34px 11px rgba(255, 98, 20, .32); }
}
@media (prefers-reduced-motion: reduce) {
    .hotspot.is-today:not(.is-opening), .error-window { animation: none; box-shadow: 0 0 15px 5px rgba(255, 155, 45, .7), 0 0 34px 11px rgba(255, 98, 20, .32); }
}

/* Entrée dans la fenêtre : la fenêtre s'illumine, ses volets s'ouvrent, puis la maison zoome dessus (transform calculé en JS) */
.house-frame { transform-origin: 0 0; transition: transform .45s cubic-bezier(.4, 0, .2, 1); }
.house-frame.is-entering { transform: var(--enter-transform); transition: transform .65s cubic-bezier(.55, 0, .35, 1) .25s; }
/* Pendant le zoom, la maison déborde de son cadre pour remplir l'écran */
/* Sortie : la maison revient à sa place ; elle reste hors de son cadre le temps du dézoom pour ne pas être coupée */
.house-frame.is-leaving { transition: transform .6s cubic-bezier(.45, 0, .25, 1); }
.house:has(.is-entering), .house:has(.is-leaving) { overflow: visible; position: relative; z-index: 900; }
body:has(.is-entering), body:has(.is-leaving) { overflow: hidden; }

.hotspot.is-opening,
.hotspot.is-closing {
    perspective: 400px;
    background: radial-gradient(circle, #fff7d6 0%, #ffd27a 55%, rgba(255, 190, 90, 0) 100%);
    box-shadow: 0 0 24px 8px rgba(255, 205, 120, .85);
    transition: background .2s, box-shadow .2s;
}
.hotspot--window.is-opening::before,
.hotspot--window.is-opening::after,
.hotspot--window.is-closing::before,
.hotspot--window.is-closing::after {
    /* Au-dessus de la vignette allumée d'une case déjà jouée : sinon le volet gauche passe derrière elle */
    content: ''; position: absolute; top: 0; bottom: 0; width: 50%; z-index: 1;
    background: linear-gradient(180deg, #7a1f2b, #4e1119); border: 1px solid rgba(0, 0, 0, .35);
    animation: .35s ease-in forwards;
}
.hotspot--window.is-opening::before { left: 0; transform-origin: left center; border-radius: 16px 0 0 16px; animation-name: shutterOpenLeft; }
.hotspot--window.is-opening::after { right: 0; transform-origin: right center; border-radius: 0 16px 16px 0; animation-name: shutterOpenRight; }
@keyframes shutterOpenLeft { to { transform: rotateY(-115deg); opacity: 0; } }
@keyframes shutterOpenRight { to { transform: rotateY(115deg); opacity: 0; } }
/* Volets qui se referment après le dézoom, puis s'effacent pour rendre la fenêtre peinte */
.hotspot.is-closing { animation: windowLightOff .4s ease-in .45s both; }
.hotspot--window.is-closing::before { left: 0; transform-origin: left center; border-radius: 16px 0 0 16px; animation: shutterCloseLeft .4s ease-out .45s both; }
.hotspot--window.is-closing::after { right: 0; transform-origin: right center; border-radius: 0 16px 16px 0; animation: shutterCloseRight .4s ease-out .45s both; }
@keyframes shutterCloseLeft { 0% { transform: rotateY(-115deg); opacity: 0; } 70% { transform: rotateY(0); opacity: 1; } 100% { transform: rotateY(0); opacity: 0; } }
@keyframes shutterCloseRight { 0% { transform: rotateY(115deg); opacity: 0; } 70% { transform: rotateY(0); opacity: 1; } 100% { transform: rotateY(0); opacity: 0; } }
@keyframes windowLightOff { to { background: transparent; box-shadow: none; } }
/* Sur mobile, pas de dézoom : les volets se referment tout de suite */
.house-frame--mobile .hotspot.is-closing,
.house-frame--mobile .hotspot--window.is-closing::before,
.house-frame--mobile .hotspot--window.is-closing::after { animation-delay: 0s; }

@media (prefers-reduced-motion: reduce) {
    .house-frame, .house-frame.is-entering, .house-frame.is-leaving { transition: none; }
}

.closure { text-align: center; padding: 60px 20px; }
.closure h2 { font-size: 26px; color: var(--gold-light); }
.closure p { font-size: 15px; color: #cdd7ea; max-width: 520px; margin: 10px auto; }

/* ---------- Page introuvable : hors campagne, donc sans logo ni visuel de campagne ---------- */
.error-page {
    --error-ground-height: min(20vh, 170px);
    min-height: 100svh; padding: var(--space-lg) var(--space-md) calc(var(--error-ground-height) + var(--space-lg));
    display: flex; flex-direction: column; align-items: center; gap: var(--space-lg); text-align: center;
}
/* Même neige que sur la maison, mais sur toute la page et derrière le texte */
.error-page::after { position: fixed; z-index: 0; }
/* Sol enneigé : deux congères au pied de la page. Le texte s'arrête au-dessus (padding bas de la page), il ne les recouvre jamais */
.error-page::before {
    content: ''; position: fixed; left: 0; right: 0; bottom: 0; height: var(--error-ground-height); z-index: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 62% 100% at 22% 100%, #eef3fb 0 99%, transparent 100%),
        radial-gradient(ellipse 70% 82% at 82% 100%, #cfdbef 0 99%, transparent 100%);
}
.error-card {
    position: relative; z-index: 1; flex: 1; max-width: 640px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-md);
}
.error-card p { margin: 0; font-size: clamp(15px, 1.1vw, 19px); line-height: 1.6; color: var(--footer-text); }
.error-card .error-code {
    display: flex; align-items: center; gap: .1em;
    font-size: clamp(96px, 24vw, 260px); font-weight: 800; line-height: 1; color: var(--cream);
}
.error-title { margin: 0; font-size: clamp(24px, 2.2vw, 40px); color: var(--gold-light); }
/* Le zéro de 404 : une fenêtre cintrée de la maison, allumée comme la case du jour */
.error-window {
    position: relative; width: .6em; height: .82em;
    border: .045em solid var(--cream); border-radius: 50% 50% 10% 10% / 36% 36% 7% 7%;
    background: radial-gradient(circle at 50% 65%, #ffe9a8 0%, #f6b94f 55%, #d98a35 100%);
    animation: campfireHalo 2.4s ease-in-out infinite;
}
.error-window::before, .error-window::after { content: ''; position: absolute; background: var(--cream); }
.error-window::before { top: 0; bottom: 0; left: 50%; width: .035em; transform: translateX(-50%); }
.error-window::after { left: 0; right: 0; top: 55%; height: .035em; }

/* ---------- Pied de page ---------- */
.footer {
    padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12);
    display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center;
    font-size: 13px; color: var(--footer-text);
}
.social-links { display: flex; gap: 14px; justify-content: center; }
.social-links a { color: var(--gold-light); text-decoration: none; }
.social-links a:hover { text-decoration: underline; }
.legal-links { display: flex; gap: 14px; flex-wrap: wrap; }
.legal-links a { color: var(--footer-text); }
.legal-links a:hover { color: var(--gold-light); }

/* ---------- Toast ---------- */
.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
    background: var(--night-panel); color: var(--cream); padding: 12px 20px; border-radius: 24px;
    border: 1px solid var(--gold); font-size: 14px; opacity: 0; pointer-events: none;
    /* Au-dessus de la modale (.overlay) : le message « connexion perdue » s'affiche formulaire ouvert */
    transition: .25s; box-shadow: var(--shadow); z-index: 1100; text-align: center; max-width: 90%;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Boutons ---------- */
.btn {
    border: none; border-radius: 24px; padding: 10px 18px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: .15s; width: 100%;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-hover); }
.btn-outline { background: transparent; border: 1px solid var(--gold); color: var(--muted); }
.btn-outline:hover { background: rgba(231, 106, 151, .15); }
.btn:disabled { opacity: .5; cursor: wait; }
.link-btn { color: var(--muted); text-decoration: underline; }

/* ---------- Modale ---------- */
.overlay {
    position: fixed; inset: 0; background: rgba(6, 10, 20, .78);
    display: flex; align-items: center; justify-content: center; padding: var(--space-md); z-index: 1000;
    animation: fadeIn .2s ease;
}
.overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: linear-gradient(180deg, #fff, #f7dde3); color: var(--choco);
    border-radius: 18px; max-width: 480px; width: 100%;
    /* Hauteur réellement visible sur mobile (barre d'adresse comprise), vh en repli pour les anciens navigateurs */
    max-height: 92vh; max-height: 92dvh;
    display: flex; flex-direction: column; overflow: hidden;
    padding: 26px 24px 22px; position: relative; box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    animation: popIn .28s cubic-bezier(.2, .9, .3, 1.3); border: 4px solid var(--gold);
}
/* Seul le contenu défile : la croix de fermeture reste visible en haut de la fenêtre */
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
/* La fenêtre s'élargit pendant la révélation pour que la vidéo (encodée en 960 px) soit bien visible */
.modal:has(.shutter-stage) { max-width: 760px; }
@keyframes popIn { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: scale(1); } }
.close-x {
    /* Sur sa propre ligne, au-dessus du contenu qui défile : le texte ne passe jamais dessous */
    flex: none; align-self: flex-end; margin: -14px -10px 0 0; background: none; border: none; font-size: 22px;
    cursor: pointer; color: var(--red); line-height: 1;
}
.close-x[hidden] { display: none; }
.modal h2 { margin: 2px 30px 6px 0; font-size: 21px; color: var(--red); }
.modal h3 { margin: 14px 0 6px; font-size: 15px; color: var(--green); }
.modal p { font-size: 14px; line-height: 1.5; margin: 6px 0; }
.day-tag {
    display: inline-block; background: var(--green); color: #fff; font-size: 12px; font-weight: 700;
    padding: 3px 10px; border-radius: 12px; margin-bottom: 8px;
}

/* ---------- Formulaires ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.field input {
    width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--gold-light);
    /* 16 px minimum : en dessous, Safari iOS zoome sur le champ et la page reste agrandie pour la vidéo et le résultat */
    font-size: 16px; background: #fff;
}
.field input:focus { outline: 2px solid var(--gold); }
.field ul, .form-errors ul { list-style: none; margin: 4px 0 0; padding: 0; color: var(--red); font-size: 12.5px; }
/* Champ piège anti-robot : hors écran plutôt que display: none, que certains robots savent ignorer */
.form-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.checkbox-row { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 4px; font-size: 12.5px; line-height: 1.4; }
.checkbox-row input { margin-top: 3px; }
.cta-row { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.rgpd-text {
    font-size: 11.5px !important; color: var(--muted); line-height: 1.5; margin-top: 16px !important;
    border-top: 1px solid var(--gold-light); padding-top: 12px;
}
.rgpd-text a { color: var(--muted); }

/* ---------- Pièce à allumer (interrupteur + vidéo) ---------- */
.shutter-stage {
    position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 8px auto 14px;
    border-radius: 14px; overflow: hidden; background: #12233f; box-shadow: inset 0 0 0 3px var(--gold);
}
.shutter-stage .day-number {
    position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
    background: var(--red); color: #fff; font-size: 15px; font-weight: 700; padding: 4px 14px; border-radius: 14px; z-index: 5;
}
.reveal-media { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.reveal-animal {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 70px; opacity: 0;
}
.reveal-animal.is-visible { opacity: 1; animation: bounceWag 1s ease infinite; }
.reveal-video { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s ease; }
.reveal-video.is-visible { opacity: 1; }
.reveal-skip {
    position: absolute; bottom: 14px; right: 14px; z-index: 7; background: rgba(0, 0, 0, .6); border: 1px solid rgba(255, 255, 255, .6); color: #fff;
    padding: 9px 20px; border-radius: 22px; cursor: pointer; font-size: 15px; font-weight: 600; opacity: 0; transition: opacity .3s ease, background .15s ease;
}
.reveal-skip.is-visible { opacity: 1; }
.reveal-skip:hover, .reveal-skip:focus-visible { background: rgba(0, 0, 0, .8); }
.room-dark-overlay {
    position: absolute; inset: 0; z-index: 6; background: #050810; opacity: 1; transition: opacity .6s ease; pointer-events: none;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 18px; text-align: center; line-height: 1.5; text-shadow: 0 2px 6px rgba(0, 0, 0, .7);
}
.room-dark-overlay.is-lit { opacity: 0; }
@keyframes bounceWag {
    0%, 100% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-8px) rotate(-6deg); }
    75% { transform: translateY(-8px) rotate(6deg); }
}
.shutter-caption { text-align: center; font-size: 13px; color: var(--muted); min-height: 18px; }

.light-switch {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: none; border: none; cursor: pointer; margin: 2px auto 8px; padding: 4px;
}
.switch-plate {
    width: 60px; height: 60px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff8ec, #cbb98a 70%, #8a7645);
    box-shadow: 0 4px 0 #6b5a35, 0 8px 18px rgba(0, 0, 0, .4);
    display: flex; align-items: center; justify-content: center; transition: transform .12s ease, box-shadow .12s ease;
}
.switch-icon { font-size: 24px; filter: grayscale(1) brightness(.55); transition: filter .35s ease; }
.light-switch.is-on .switch-plate { transform: translateY(3px); box-shadow: 0 1px 0 #6b5a35, 0 3px 8px rgba(0, 0, 0, .4); }
.light-switch.is-on .switch-icon { filter: none; }
.switch-label { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.light-switch:not(.is-on) .switch-plate { animation: switchPulse 1.7s ease-in-out infinite; }
@keyframes switchPulse {
    0%, 100% { box-shadow: 0 4px 0 #6b5a35, 0 8px 18px rgba(0, 0, 0, .4); }
    50% { box-shadow: 0 4px 0 #6b5a35, 0 8px 18px rgba(0, 0, 0, .4), 0 0 0 8px rgba(231, 106, 151, .25); }
}

/* ---------- Résultats ---------- */
.result-scene-photo {
    display: block; width: 100%; max-width: 400px; margin: 10px auto 14px;
    border-radius: 14px; box-shadow: 0 12px 26px rgba(0, 0, 0, .4); border: 3px solid var(--gold);
}
.result-icon { font-size: 52px; text-align: center; margin: 6px 0 4px; }
.result-title { text-align: center; font-size: 20px; font-weight: 800; margin: 0 0 6px; }
.result-title--won { color: var(--green); }
.result-title--lost { color: var(--red); }
.revisit-note { font-size: 12px !important; color: var(--muted); }
.lot-card {
    display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--gold-light);
    border-radius: 12px; padding: 10px 14px; margin: 10px 0;
}
.lot-card .emoji { font-size: 30px; }
.lot-card .lot-name { font-weight: 700; font-size: 14px; color: var(--green); }
.reminder-box {
    background: rgba(231, 106, 151, .15); border: 1px dashed var(--gold); border-radius: 10px;
    padding: 10px 12px; font-size: 12.5px; margin-top: 12px;
}

/* ---------- Partage ---------- */
.share { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.share-x2 { font-size: 12px; color: var(--muted); margin: 0; font-weight: 600; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn {
    flex: 1; min-width: 100px; border: none; border-radius: 10px; padding: 10px 8px;
    font-size: 12.5px; font-weight: 700; color: #fff; cursor: pointer; text-align: center;
}
.share-btn--facebook { background: #1877f2; }
.share-btn--whatsapp { background: #25d366; }
.share-btn--instagram { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af, #515bd4); }
.share-btn:hover { filter: brightness(1.08); }
.gauge-track { display: flex; gap: 6px; }
.gauge-step { flex: 1; height: 10px; border-radius: 6px; background: var(--gold-light); }
.gauge-step.is-filled { background: var(--gold); }
.gauge-label { font-size: 12px; color: var(--muted); }
.share-impact { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.share-impact--bonus { color: var(--green); font-weight: 700; }

/* ---------- Pages légales ---------- */
.legal-page {
    background: #fff; color: var(--choco); border-radius: var(--radius); padding: var(--space-lg);
    line-height: 1.6; font-size: 14px;
}
.legal-page h1 { color: var(--red); font-size: 22px; margin-top: 0; }
.back-link { color: var(--gold-light); }

/* Bascule sur la maquette mobile sous 700 px (règle de gestion § 12) */
@media (max-width: 700px) {
    .modal { padding: 20px 16px 18px; }
    .share-row { flex-direction: column; }
    .brand-logo--desktop { display: none; }
    .brand-logo--mobile { display: block; height: 78px; }
    .topbar { grid-template-columns: 1fr; }
    .brand-home { grid-column: 1; justify-self: center; }
    .return-link { grid-row: 1; padding: 4px var(--space-sm); font-size: 12px; }
    .house-frame--desktop { display: none; }
    .house-frame--mobile { display: block; }
}

/* Outil de recette (absent en production) : choix du jour simulé */
.day-simulation {
    position: fixed;
    left: var(--space-sm);
    top: var(--space-sm);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border: 2px dashed var(--gold);
    border-radius: var(--radius);
    background: var(--choco);
    color: var(--cream);
    font-size: .85rem;
    box-shadow: var(--shadow);
}
.day-simulation select,
.day-simulation button { font: inherit; border-radius: 8px; padding: 4px 8px; }
.day-simulation button { border: 0; background: var(--gold); color: #fff; cursor: pointer; }
/* Même seuil que les champs du jeu : sous 16 px, Safari iOS zoome sur la liste et la page reste agrandie */
.day-simulation select { font-size: 16px; }
