/* ==========================================================================
   Le Village (MONDE-1, Lot 0) — prototype de place 3D en solo.
   Feuille AUTONOME : chargée seule sur /village/ (jamais avec demo-core.css).

   Couleurs et polices : la source unique public/css/woopets-tokens.css, recopiée dans la
   page ; le bloc :root ci-dessous n'a que les variables propres au Village.
   Les couleurs du décor 3D, elles, vivent dans public/js/village.js (PALETTE).
   ========================================================================== */

:root {
    /* Les zones sûres (encoche, barre du bas) : TOUJOURS par ces variables, jamais env() en direct.
       Dans l'app, le Village vit dans un cadre, et l'iPhone y donne PARFOIS une encoche nulle (selon le
       moment où le cadre se crée, ou au retour d'arrière-plan) : la barre du haut passait sous l'heure
       et la batterie (vu le 18/11/2026). L'app mesure donc les siennes et les envoie (message `insets`) ;
       la page prend la plus grande des deux (initFrame, village.js). Hors de l'app : env() tel quel. */
    --village-safe-top: env(safe-area-inset-top);
    --village-safe-right: env(safe-area-inset-right);
    --village-safe-bottom: env(safe-area-inset-bottom);
    --village-safe-left: env(safe-area-inset-left);
    /* La palette, les ombres, les rayons et les polices viennent de public/css/woopets-tokens.css,
       recopiée dans la page (templates/pages/village/index.twig). Ici, les variables du Village. */
    --village-top-h: 56px;
    --village-mat: rgba(250, 250, 247, 0.86);
    /* Le fond de la croix d'une fenêtre : du blanc qui laisse deviner la photo qu'il recouvre. */
    --village-glass: rgba(255, 255, 255, 0.92);
    /* Le voile posé derrière un panneau qui couvre tout (créer son compte). */
    --village-scrim: rgba(24, 46, 43, 0.42);
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body.village-page {
    margin: 0;
    height: 100%;
    overflow: hidden;
    /* Pas de retour en arrière ni de rebond déclenchés par un balayage au bord de la page. */
    overscroll-behavior: none;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--f-body);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

.village-page [hidden] { display: none !important; }

.village {
    position: fixed;
    inset: 0;
    overflow: hidden;
    /* On fait défiler les fiches, mais on ne zoome jamais la PAGE par un pincement ou un double
       toucher : la barre du haut, les fiches et les boutons gardent leur taille. Sur la scène,
       le pincement règle le recul de la caméra (village.js). Le zoom du navigateur lui-même
       (clavier, menu) reste possible. */
    touch-action: pan-x pan-y;
    /* Ciel de repli, visible le temps que le décor arrive (et si la 3D échoue). */
    background: linear-gradient(#d9f0ec 0%, #fafaf7 46%, #fcf0e9 100%);
}

/* --------------------------------------------------------------------------
   Décor 3D + calque des habitants
   -------------------------------------------------------------------------- */

.village-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    /* Le geste appartient à la place (tourner, pincer pour zoomer) : pas de défilement ni de
       zoom du navigateur. */
    touch-action: none;
    cursor: grab;
    outline: none;
}

.village-canvas.is-dragging { cursor: grabbing; }

.village-labels {
    position: absolute;
    inset: 0;
    /* Contexte d'empilement propre : les z-index des médaillons (triés par distance)
       restent sous la barre du haut et sous la fiche. */
    z-index: 10;
    overflow: hidden;
    pointer-events: none;
    /* Un doigt posé sur un médaillon fait partie du pincement : le navigateur ne doit pas
       s'en saisir (il annulerait le geste en cours). */
    touch-action: none;
}

.village[data-view="album"] .village-canvas,
.village[data-view="album"] .village-labels { visibility: hidden; }

.vl {
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    transform-origin: 50% 100%;
    will-change: transform;
    -webkit-user-select: none;
    user-select: none;
}

.vl[data-off] { visibility: hidden; }

/* Médaillon caché par un personnage ou un bâtiment situé devant lui : il s'efface
   (cf. updateLabels dans village.js) au lieu de passer par-dessus. */
.vl { transition: opacity 140ms linear; }
.vl.is-veiled { pointer-events: none; }

/* Médaillon : la vraie photo de l'animal, au-dessus de sa silhouette. */
.vl-pet,
.vl-agent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: auto;
    cursor: pointer;
    /* Cible tactile ≥ 44px garantie par la photo (52px). */
}

.vl-photo {
    display: block;
    width: 52px;
    height: 52px;
    border-radius: var(--r-full);
    border: 3px solid var(--c-bg-card);
    background: var(--c-primary-light);
    box-shadow: var(--shadow-md);
    object-fit: cover;
    transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.vl-pet:hover .vl-photo,
.vl-agent:hover .vl-photo { transform: scale(1.08); box-shadow: var(--shadow-lg); }

.vl-pet:focus-visible,
.vl-agent:focus-visible { outline: none; }

.vl-pet:focus-visible .vl-photo,
.vl-agent:focus-visible .vl-photo { box-shadow: var(--focus-ring), var(--shadow-md); }

.vl-pet.is-companion .vl-photo { border-color: var(--c-primary); }
.vl-pet.is-own .vl-photo { border-color: var(--c-primary-light); }
.vl-agent .vl-photo { border-color: var(--c-accent); }

.vl-name {
    max-width: 128px;
    padding: 2px 9px;
    border-radius: var(--r-full);
    background: var(--c-bg-card);
    box-shadow: var(--shadow-sm);
    color: var(--c-text);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vl-agent .vl-name { background: var(--c-accent-light); }

/* De loin, la photo suffit : le nom n'apparaît qu'en s'approchant. */
.vl.is-far .vl-name { display: none; }

.vl-place,
.vl-you {
    padding: 4px 11px;
    border-radius: var(--r-full);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.vl-place { background: var(--c-primary); color: var(--c-text-inverse); }
.vl-you { background: var(--c-bg-card); color: var(--c-primary); border: 1px solid var(--c-border); }
/* Un pseudo long ne s'étale pas : même largeur que le nom des autres membres (.vl-name) — dans
   l'Animalerie, il recouvrait les étiquettes de prix du rayon devant lequel on se tient.
   Seul le PSEUDO se coupe (.vl-you__name) : le médaillon porte aussi la bulle de ce que l'on dit,
   posée au-dessus de lui — un `overflow: hidden` sur .vl-you la faisait disparaître. */
.vl-you { max-width: 128px; }
.vl-you__name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------------------------------------------------------
   Barre du haut
   -------------------------------------------------------------------------- */

.village-top {
    position: absolute;
    inset: 0 0 auto 0;
    /* Au-dessus de l'accueil (40) : le logo reste net derrière le voile. */
    z-index: 45;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: calc(var(--village-top-h) + var(--village-safe-top));
    padding: var(--village-safe-top) max(14px, var(--village-safe-right)) 0 max(14px, var(--village-safe-left));
    background: var(--village-mat);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid var(--c-border-light);
}

.village-brand {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    color: var(--c-text);
    text-decoration: none;
    border-radius: var(--r-sm);
}

.village-brand:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.village-brand svg { display: block; flex: none; }

/* Badge AI du Logo Figé : valeurs imposées (cf. CLAUDE.md), pas des tokens. */
.village-brand__ai {
    padding: 3px 8px;
    border-radius: 6px;
    background: #184f52;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.village-brand__section {
    margin-left: 6px;
    padding-left: 12px;
    border-left: 1px solid var(--c-border);
    color: var(--c-primary);
    font-family: var(--f-display);
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
}

.village-count {
    margin-left: auto;
    padding: 5px 12px;
    border-radius: var(--r-full);
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    color: var(--c-text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.village-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.village-count:not([hidden]) + .village-actions { margin-left: 0; }

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */

.village-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--r-md);
    font: inherit;
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.village-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.village-btn:active { transform: scale(0.98); }
.village-btn[disabled] { opacity: 0.6; cursor: progress; }
.village-btn svg { flex: none; }

.village-btn--block { width: 100%; }

.village-btn--primary {
    background: var(--c-primary);
    color: var(--c-text-inverse);
    box-shadow: var(--shadow-sm);
}

.village-btn--primary:hover:not([disabled]) { background: var(--c-primary-hover); }

.village-btn--ghost {
    background: var(--c-bg-card);
    border-color: var(--c-border);
    color: var(--c-primary);
}

.village-btn--ghost:hover { border-color: var(--c-primary); }

.village-btn--ghost[aria-pressed="true"] {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: var(--c-text-inverse);
}

/* Corail = un chemin vers Woopets AI, et un seul par écran (texte Encre : contraste AA). */
.village-btn--ai {
    background: var(--c-accent-vivid);
    color: var(--c-on-vivid);
    box-shadow: var(--shadow-sm);
}

.village-btn--ai:hover { background: var(--c-accent-vivid-hover); }

.village-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 8px;
    color: var(--c-primary);
    font-size: 0.94rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    border-radius: var(--r-sm);
    /* (aussi posé sur un <button> : il garde l'allure d'un lien) */
    border-width: 0;
    background: none;
    font-family: inherit;
    cursor: pointer;
}

.village-link:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* --------------------------------------------------------------------------
   Composants communs : pastille, bouton rond, croix, bouton posé sur la scène
   (règles d'emploi : docs/village-regles-style.md — un module n'invente pas son bouton ;
   il ajoute sa propre classe à côté, pour la seule mise en page)
   -------------------------------------------------------------------------- */

/* Pastille (chip) : un choix, un filtre, une petite action dans une ligne de liste ou un
   bandeau. Pilule ; choisie (aria-pressed, aria-checked, .is-on) ou --primary : teal plein ;
   --soft : voile teal ; --sm : 36 px à l'œil, 44 px au doigt. `.village-look__choice` est son
   ancien nom, gardé par les fenêtres qui l'emploient déjà. */
.village-chip,
.village-look__choice {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    background: var(--c-bg-card);
    color: var(--c-text);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out);
}

.village-chip:hover,
.village-look__choice:hover { border-color: var(--c-primary); }

.village-chip[aria-pressed="true"],
.village-chip[aria-checked="true"],
.village-chip.is-on,
.village-chip--primary,
.village-look__choice[aria-pressed="true"] {
    border-color: var(--c-primary);
    background: var(--c-primary);
    color: var(--c-text-inverse);
}

.village-chip--primary:hover { border-color: var(--c-primary-hover); background: var(--c-primary-hover); }
.village-chip--soft { background: var(--c-primary-light); color: var(--c-primary); }
.village-chip--sm { min-height: 36px; padding: 0 12px; }
.village-chip--sm::after { content: ''; position: absolute; inset: -4px 0; }

.village-chip:disabled,
.village-look__choice:disabled { opacity: 0.5; cursor: default; }

.village-chip:focus-visible,
.village-look__choice:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Bouton rond à icône seule, DANS une fenêtre ou un panneau (flèches d'une allée…). */
.village-icon-btn {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    background: var(--c-bg-card);
    color: var(--c-primary);
    font: inherit;
    cursor: pointer;
    transition: border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.village-icon-btn:hover { border-color: var(--c-primary); }
.village-icon-btn:active { transform: scale(0.94); }
.village-icon-btn:disabled { opacity: 0.4; cursor: default; }
.village-icon-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* La croix : une par fenêtre et par vue rapprochée, en haut à droite (sa place exacte est
   celle de la fenêtre : cf. .village-sheet__close). --flat : sur une surface unie (petite
   fenêtre, en-tête de panneau, bandeau) ; --sm : 36 px à l'œil, 44 px au doigt (bandeaux). */
.village-close {
    position: relative;
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--r-full);
    background: var(--village-glass);
    box-shadow: var(--shadow-sm);
    color: var(--c-text);
    font: inherit;
    line-height: 1;
    cursor: pointer;
    transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.village-close svg { display: block; width: 18px; height: 18px; }
.village-close:hover { background: var(--c-bg-warm); }
.village-close:active { transform: scale(0.94); }
.village-close:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.village-close--flat { background: none; box-shadow: none; }
.village-close--sm { width: 36px; height: 36px; }
.village-close--sm::after { content: ''; position: absolute; inset: -4px; }
.village-close--sm svg { width: 16px; height: 16px; }

/* Bouton posé SUR la scène 3D (barre du bas, outils du coin, retour et flèches d'une vue
   rapprochée, boutons d'une affiche) : pilule blanche ombrée de 44 px. --primary : l'action de
   l'écran ; --icon : rond, icône seule ; --lg : 48 px, comme les actions à portée de main. */
.village-float {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;
    padding: 0 16px 0 13px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    background: var(--c-bg-card);
    box-shadow: var(--shadow-md);
    color: var(--c-primary);
    font: inherit;
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), transform 160ms var(--ease-out);
}

/* (sélecteurs simples : une vue rapprochée qui place ses flèches par `transform` garde la main
   sur leur survol et leur appui) */
.village-float:hover { border-color: var(--c-primary); box-shadow: var(--shadow-lg); }
.village-float:active { transform: scale(0.97); }
.village-float:disabled { opacity: 0.4; cursor: default; }
.village-float:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-md); }
.village-float--primary { border-color: var(--c-primary); background: var(--c-primary); color: var(--c-text-inverse); }
.village-float--primary:hover { border-color: var(--c-primary-hover); background: var(--c-primary-hover); }
.village-float--icon { width: 44px; padding: 0; }
.village-float--lg { min-height: 48px; padding: 0 22px; font-size: 1rem; font-weight: 700; box-shadow: var(--shadow-lg); }
.village-float--lg.village-float--icon { width: 48px; padding: 0; }
.village-float--lg:focus-visible { box-shadow: var(--focus-ring), var(--shadow-lg); }

/* --------------------------------------------------------------------------
   Accueil
   -------------------------------------------------------------------------- */

.village-intro {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: calc(var(--village-top-h) + var(--village-safe-top) + 16px) 16px calc(16px + var(--village-safe-bottom));
    background: linear-gradient(rgba(250, 250, 247, 0.5), rgba(250, 250, 247, 0.82));
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    transition: opacity 420ms var(--ease-out), visibility 420ms;
}

.village[data-state="live"] .village-intro {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.village-intro__card {
    width: min(440px, 100%);
    padding: 28px 24px 22px;
    border-radius: var(--r-xl);
    background: var(--c-bg-card);
    border: 1px solid var(--c-border-light);
    box-shadow: var(--shadow-xl);
}

.village-intro__card h1 {
    margin: 0 0 8px;
    font-family: var(--f-display);
    font-size: clamp(1.55rem, 6vw, 2rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.village-intro__lede {
    margin: 0 0 16px;
    color: var(--c-text-secondary);
    font-size: 0.94rem;
    line-height: 1.6;
}

.village-intro__points {
    display: grid;
    gap: 10px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.village-intro__points li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.94rem;
    line-height: 1.45;
}

.village-intro__points svg {
    flex: none;
    width: 36px;
    height: 36px;
    padding: 8px;
    border-radius: var(--r-full);
    background: var(--c-primary-light);
    color: var(--c-primary);
}

.village-intro__note {
    margin: 12px 0 0;
    color: var(--c-text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
    text-align: center;
}

/* Choix de langue (accueil). Une liste native : une seule ligne quel que soit le nombre de
   langues, le sélecteur du téléphone au toucher, et 16px pour qu'iOS ne zoome pas. */
.village-lang {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--c-border-light);
    color: var(--c-text-secondary);
}

.village-lang svg { flex: none; }

/* Le libellé reste lu par un lecteur d'écran : le globe suffit à l'œil. */
.village-lang__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.village-lang__select {
    min-height: 44px;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    background-color: transparent;
    color: var(--c-text-secondary);
    font: inherit;
    font-size: 16px;
    cursor: pointer;
}

.village-lang__select:hover { border-color: var(--c-border); }
.village-lang__select:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.village-lang__select:disabled { opacity: 0.55; cursor: default; }

.village-lang__error {
    margin: 4px 0 0;
    color: var(--c-danger);
    font-size: 0.8rem;
    line-height: 1.5;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Aide et messages
   -------------------------------------------------------------------------- */

.village-hint,
.village-toast {
    position: absolute;
    left: 50%;
    z-index: 25;
    max-width: min(520px, calc(100% - 32px));
    margin: 0;
    padding: 10px 16px;
    /* Pas une pilule : le texte peut passer sur deux lignes sur un petit écran. */
    border-radius: var(--r-xl);
    background: var(--c-bg-card);
    box-shadow: var(--shadow-lg);
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    transform: translateX(-50%);
    pointer-events: none;
}

.village-hint { bottom: calc(22px + var(--village-safe-bottom)); color: var(--c-text-secondary); }

.village-toast {
    top: calc(var(--village-top-h) + var(--village-safe-top) + 12px);
    color: var(--c-primary);
    border: 1px solid var(--c-border);
}

/* --------------------------------------------------------------------------
   Fiche d'un habitant
   -------------------------------------------------------------------------- */

.village-sheet {
    position: absolute;
    z-index: 35;
    right: 16px;
    top: calc(var(--village-top-h) + var(--village-safe-top) + 16px);
    width: 348px;
    max-height: calc(100% - var(--village-top-h) - var(--village-safe-top) - 32px);
    overflow-y: auto;
    padding: 16px;
    border-radius: var(--r-xl);
    background: var(--c-bg-card);
    border: 1px solid var(--c-border-light);
    box-shadow: var(--shadow-xl);
    animation: village-sheet-in 320ms var(--ease-out);
}

@keyframes village-sheet-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.village-sheet__close {
    /* Accrochée en haut de la fenêtre : celle-ci défile (`overflow-y: auto`), et une croix posée
       en `absolute` partait avec le contenu — il fallait remonter pour fermer (retour d'Anthony,
       2026-11-16). `sticky` à la même place qu'avant (22 px des bords = 16 de marge intérieure
       + 6), sans prendre de hauteur dans la fenêtre (marge du bas négative). Le décalage d'un
       élément `sticky` se compte À L'INTÉRIEUR de la marge intérieure de la fenêtre : `top: 6px`
       donne bien 22 px du bord, au repos comme en défilant (mesuré : `top: 22px` le posait à 38).
       Son allure est celle de toutes les croix (.village-close, posée avec elle par le socle). */
    position: sticky;
    top: 6px;
    z-index: 4;
    margin: 6px 6px -50px auto;
}

/* En-tête d'une fenêtre sans photo (le titre, ou le surtitre puis le titre, suivent la croix) :
   le texte ne passe jamais sous la croix. */
.village-sheet:not(.village-sheet--quick) > .village-sheet__close + .village-sheet__name,
.village-sheet:not(.village-sheet--quick) > .village-sheet__close + .village-sheet__eyebrow,
.village-sheet:not(.village-sheet--quick) > .village-sheet__close + .village-sheet__eyebrow + .village-sheet__name { padding-right: 48px; }

.village-sheet__photo {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: var(--r-lg);
    background: var(--c-primary-light);
    object-fit: cover;
    object-position: 50% 28%;
}

.village-sheet--agent .village-sheet__photo {
    width: 96px;
    aspect-ratio: 1;
    border-radius: var(--r-full);
    border: 3px solid var(--c-accent);
    object-position: 50% 50%;
}

.village-sheet__eyebrow {
    margin: 14px 0 0;
    color: var(--c-primary);
    font-size: 0.8rem;
    font-weight: 600;
}

.village-sheet__name {
    margin: 12px 0 6px;
    font-family: var(--f-display);
    font-size: clamp(1.55rem, 6vw, 2rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.village-sheet__eyebrow + .village-sheet__name { margin-top: 2px; }

/* Le titre reçoit le focus par script à l'ouverture (annonce au lecteur d'écran) :
   pas d'anneau visible, ce n'est pas un élément actionnable. */
.village-sheet__name:focus { outline: none; }

.village-sheet__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.village-sheet__chips li {
    padding: 3px 10px;
    border-radius: var(--r-full);
    border: 1px solid var(--c-border);
    color: var(--c-text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}

.village-sheet__text {
    margin: 0 0 16px;
    color: var(--c-text-secondary);
    font-size: 0.94rem;
    line-height: 1.6;
}

.village-sheet__status {
    margin: 0 0 12px;
    padding: 8px 12px;
    border-radius: var(--r-md);
    background: var(--c-primary-light);
    color: var(--c-primary);
    font-size: 0.8rem;
    font-weight: 600;
}

.village-sheet__actions {
    display: grid;
    gap: 6px;
}

/* --------------------------------------------------------------------------
   Album (vue 2D)
   -------------------------------------------------------------------------- */

.village-album {
    position: absolute;
    inset: calc(var(--village-top-h) + var(--village-safe-top)) 0 0 0;
    z-index: 20;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px max(16px, var(--village-safe-right)) calc(32px + var(--village-safe-bottom)) max(16px, var(--village-safe-left));
    background: var(--c-bg);
}

.village-album__head {
    max-width: 1080px;
    margin: 0 auto 20px;
}

.village-album__head h2 {
    margin: 0 0 6px;
    font-family: var(--f-display);
    font-size: clamp(1.55rem, 6vw, 2rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.village-album__head p {
    margin: 0;
    color: var(--c-text-secondary);
    font-size: 0.94rem;
    line-height: 1.6;
}

.village-album__head .village-album__notice {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--r-md);
    background: var(--c-accent-light);
    color: var(--c-text);
    font-size: 0.94rem;
}

.village-album__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    max-width: 1080px;
    margin: 0 auto;
}

.village-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0;
    border: 1px solid var(--c-border-light);
    border-radius: var(--r-lg);
    background: var(--c-bg-card);
    box-shadow: var(--shadow-xs);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition: box-shadow 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.village-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.village-card:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.village-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    background: var(--c-primary-light);
    object-fit: cover;
    object-position: 50% 28%;
}

.village-card__body { min-width: 0; padding: 10px 12px 12px; }

.village-card__name {
    display: block;
    font-family: var(--f-display);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.village-card__meta {
    display: block;
    margin-top: 2px;
    color: var(--c-text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.village-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 20px;
    border-radius: var(--r-lg);
    background: var(--c-bg-card);
    border: 1px solid var(--c-border-light);
    color: var(--c-text-secondary);
    font-size: 0.94rem;
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Mesures (?perf=1) et sans JavaScript
   -------------------------------------------------------------------------- */

.village-perf {
    position: absolute;
    left: 10px;
    bottom: calc(10px + var(--village-safe-bottom));
    z-index: 50;
    padding: 6px 10px;
    border-radius: var(--r-sm);
    background: rgba(24, 46, 43, 0.78);
    color: #fff;
    font: 600 0.8rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: pre;
    pointer-events: none;
}

.village-noscript {
    position: fixed;
    inset: auto 16px 16px 16px;
    z-index: 60;
    margin: 0;
    padding: 14px 16px;
    border-radius: var(--r-md);
    background: var(--c-bg-card);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
    .village-brand svg { width: 80px; height: 20px; }
    .village-brand__section { font-size: 0.94rem; padding-left: 9px; margin-left: 3px; }
    .village-count { display: none; }
    /* Le compteur est masqué ici : les boutons reprennent l'alignement à droite. */
    .village-actions,
    .village-count:not([hidden]) + .village-actions { margin-left: auto; gap: 6px; }

    /* Sous 768px, les boutons de la barre gardent leur icône seule (libellé conservé
       pour les lecteurs d'écran). */
    .village-top .village-btn { width: 44px; padding: 0; }
    .village-top .village-btn span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    /* La fiche devient une feuille posée en bas de l'écran. */
    .village-sheet {
        inset: auto 0 0 0;
        width: auto;
        max-height: 74%;
        padding: 16px 16px calc(16px + var(--village-safe-bottom));
        border-radius: var(--r-xl) var(--r-xl) 0 0;
        border-width: 1px 0 0;
        animation-name: village-sheet-up;
    }

    @keyframes village-sheet-up {
        from { transform: translateY(100%); }
        to { transform: none; }
    }

    .village-sheet__photo { aspect-ratio: 16 / 9; max-height: 28vh; }
    .village-hint { bottom: calc(16px + var(--village-safe-bottom)); }
    .vl-photo { width: 48px; height: 48px; }
}

/* Avec la pastille des présents, la barre du haut ne tient plus sur un téléphone courant
   (il lui faut 400 px) : le nom de la rubrique s'efface, le logo reste. */
@media (max-width: 410px) {
    .village-top:has(.village-people) .village-brand__section { display: none; }
}

@media (max-width: 340px) {
    .village-brand__section { display: none; }
}

@media (max-height: 520px) and (orientation: landscape) {
    .village-intro__points { display: none; }
    .village-intro__card { padding: 18px 20px 16px; }
    .village-sheet { max-height: 86%; }
}

@media (prefers-reduced-motion: reduce) {
    .village-intro,
    .village-btn,
    .village-chip,
    .village-look__choice,
    .village-icon-btn,
    .village-close,
    .village-float,
    .vl-photo,
    .village-card { transition: none; }
    .village-icon-btn:active,
    .village-close:active,
    .village-float:active { transform: none; }
    .village-sheet { animation: none; }
}

/* ==========================================================================
   Lot 1 — présence : autres membres, bulles, barre du bas, panneaux
   (éléments créés par public/js/village-social.js)
   ========================================================================== */

/* Un autre membre : son pseudo, cliquable. Il reste lisible de loin (pas de photo à quoi se raccrocher). */
.vl-peer {
    position: absolute;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
    /* Le calque des étiquettes laisse passer les touchers : un médaillon cliquable doit les reprendre
       (sinon un VRAI clic tombait sur le décor et l'on marchait au lieu d'ouvrir la fiche du membre —
       « Inviter chez moi » n'était joignable que par « Qui est là ? » ; assemblage du Hameau, 18/11/2026). */
    pointer-events: auto;
}

.vl-nick {
    display: block;
    max-width: 150px;
    padding: 4px 11px;
    border-radius: var(--r-full);
    background: var(--c-primary-light);
    border: 1px solid var(--c-border);
    box-shadow: var(--shadow-sm);
    color: var(--c-primary);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Un visiteur (sans compte) : le même médaillon, plus discret — fond blanc, liseré en pointillé. */
.vl-peer.is-guest .vl-nick {
    background: var(--c-bg-card);
    border-style: dashed;
    color: var(--c-text-secondary);
    font-weight: 500;
}

.vl-peer:hover .vl-nick { border-color: var(--c-primary); }
.vl-peer:focus-visible { outline: none; }
.vl-peer:focus-visible .vl-nick { box-shadow: var(--focus-ring), var(--shadow-sm); }

/* Bulle : une phrase toute faite ou un geste, au-dessus de celui qui parle. */
.vl-bubble {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    width: max-content;
    max-width: 230px;
    padding: 7px 12px;
    border-radius: var(--r-lg);
    background: var(--c-bg-card);
    box-shadow: var(--shadow-md);
    color: var(--c-text);
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) scale(0.9);
    transform-origin: 50% 100%;
    transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.vl-bubble.is-on { opacity: 1; transform: translateX(-50%) scale(1); }

.vl-bubble--emote {
    padding: 3px 9px;
    font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
    line-height: 1.2;
}

/* Compteur de membres présents, à côté de celui des animaux. */
.village-people {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--c-primary);
}

.village-people[hidden] { display: none; }
.village-count:not([hidden]) + .village-people { margin-left: 0; }
.village-people__num { display: none; font-weight: 700; }
/* Pas de liaison avec la place en direct : on ne sait pas qui est là (« Hors ligne »). */
.village-people.is-offline { color: var(--c-text-secondary); }

/* Les visiteurs, après les membres : même pastille, ton plus discret (on ne les voit pas sur la place). */
.village-people__visitors {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
    padding-left: 10px;
    border-left: 1px solid var(--c-border);
    color: var(--c-text-secondary);
}

/* Barre du bas : parler, apparence, mes animaux… (L'invitation faite au visiteur est un
   bandeau du haut, cf. « Rangements partagés » en fin de fichier.) */
.village-dock {
    position: absolute;
    z-index: 30;
    left: max(16px, var(--village-safe-left));
    bottom: calc(18px + var(--village-safe-bottom));
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 32px);
}

.village-dock[hidden],
.village[data-view="album"] .village-dock { display: none; }

/* (ses boutons sont ceux posés sur la scène, .village-float : icône puis libellé) */
.village-dock__btn { gap: 8px; }

/* Pastille : quelque chose de nouveau attend (cadeaux reçus). */
.village-dock__badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--r-full);
    background: var(--c-primary);
    color: var(--c-text-inverse);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

.village-dock__badge[hidden] { display: none; }

/* (« Créer mon compte », une fois le bandeau du haut fermé : un lien, habillé comme les autres boutons) */

/* L'aide de départ passe au-dessus de la barre du bas. */
.village[data-dock] .village-hint { bottom: calc(76px + var(--village-safe-bottom)); }

/* Panneau « Dire quelque chose » */
.village-say {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 0 4px;
}

.village-say__phrase,
.village-say__emote {
    min-height: 44px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-bg);
    color: var(--c-text);
    font: inherit;
    cursor: pointer;
    transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.village-say__phrase {
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
}

.village-say__emotes { display: flex; gap: 8px; margin: 6px 0 4px; }

.village-say__emote {
    flex: 1;
    min-height: 48px;
    padding: 0;
    font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
    line-height: 1;
}

.village-say__phrase:hover,
.village-say__emote:hover { border-color: var(--c-primary); background: var(--c-primary-light); }

.village-say__phrase:focus-visible,
.village-say__emote:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Panneau « Mon apparence » */
.village-look__row { display: grid; gap: 6px; margin: 0 0 14px; }

.village-look__label {
    color: var(--c-text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
}

.village-look__swatches,
.village-look__choices { display: flex; flex-wrap: wrap; gap: 8px; }

.village-look__swatch {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 3px solid var(--c-bg-card);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--c-border);
    cursor: pointer;
}

.village-look__swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--c-primary); }
.village-look__swatch:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* (les choix eux-mêmes : .village-chip, dont .village-look__choice est l'ancien nom — cf. Composants communs) */

/* Choix du personnage à l'arrivée : deux portraits côte à côte. */
.village-person { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 14px; }
/* Les silhouettes d'un animal (fiche « À quoi ressemble… ») : jusqu'à trois cartes à portrait carré,
   dans une rangée étiquetée qui porte déjà sa marge. */
.village-person--pets { grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.village-person--pets .village-person__card { padding: 6px 6px 8px; gap: 6px; min-height: 44px; }
.village-person--pets .village-person__img { aspect-ratio: 1; }
.village-person--pets .village-person__name { font-size: 0.8rem; line-height: 1.2; }

/* Fenêtre « L'apparence de vos compagnons » : les compagnons en onglets, l'animal qui tourne,
   les réglages dessous. L'aperçu reste en vue quand on fait défiler les réglages. */
.village-petlook__tabs {
    display: flex;
    gap: 8px;
    margin: 0 -16px 12px;
    padding: 2px 16px 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.village-petlook__tabs::-webkit-scrollbar { display: none; }

.village-petlook__tab {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 4px 14px 4px 4px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    background: var(--c-bg-card);
    color: var(--c-text);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.village-petlook__tab .village-pet__photo { width: 34px; height: 34px; }
.village-petlook__tab[aria-selected="true"] { border-color: var(--c-primary); background: var(--c-primary-light); }
.village-petlook__tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Validé : une coche sur le portrait. */
.village-petlook__ok {
    position: absolute;
    left: 24px;
    top: 0;
    width: 18px;
    height: 18px;
    border: 2px solid var(--c-bg-card);
    border-radius: 50%;
    background: var(--c-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 10px no-repeat;
}

.village-petlook__stick {
    position: sticky;
    /* Collé sous le bord de la fenêtre : le décalage se compte depuis l'intérieur de sa marge (16 px). */
    top: -16px;
    z-index: 2;
    margin: 0 -16px 10px;
    padding: 16px 16px 6px;
    background: var(--c-bg-card);
}

.village-petlook__stage {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--r-lg);
    background: var(--c-primary-light);
    overflow: hidden;
}

/* Le canevas reçoit l'image dessinée par le moteur de la place (village.js, previewDraw).
   pan-y : faire glisser de côté tourne l'animal, de haut en bas fait défiler la fenêtre. */
.village-petlook__view {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: pan-y;
    cursor: grab;
}

.village-petlook__view:active { cursor: grabbing; }

/* Sa vraie photo, dans le coin : on compare d'un coup d'œil. */
.village-petlook__photo {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 64px;
    height: 64px;
    border: 3px solid var(--c-bg-card);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    object-fit: cover;
    pointer-events: none;
}

.village-petlook__note {
    margin: 0 0 12px;
    color: var(--c-text-secondary);
    font-size: 0.8rem;
}

/* La croix de fermeture passe au-dessus de l'aperçu resté en vue. */
.village-sheet--look .village-sheet__close { z-index: 3; }
/* Le titre laisse la place de la croix. */
.village-sheet--look .village-sheet__name { padding-right: 48px; }

@media (max-width: 767px) {
    /* Sur téléphone la fenêtre occupe le bas de l'écran : un aperçu plus bas laisse voir les réglages. */
    .village-petlook__stage { aspect-ratio: auto; height: clamp(150px, 25vh, 210px); }
    .village-petlook__photo { width: 56px; height: 56px; }
}

.village-person__card {
    display: grid;
    gap: 8px;
    padding: 8px 8px 10px;
    border: 2px solid var(--c-border);
    border-radius: var(--r-lg);
    background: var(--c-bg-card);
    color: var(--c-text);
    font: inherit;
    cursor: pointer;
}

.village-person__img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    border-radius: var(--r-md);
    background: var(--c-bg-warm);
    object-fit: cover;
}

.village-person__name { font-size: 0.9rem; font-weight: 600; text-align: center; }

.village-person__card[aria-pressed="true"] { border-color: var(--c-primary); background: var(--c-primary-light); }

.village-person__card:focus-visible { outline: none; box-shadow: var(--focus-ring); }

@media (hover: hover) {
    .village-person__card:hover { border-color: var(--c-primary); }
}

@media (max-width: 767px) {
    /* Barre du haut étroite : le compteur de membres se réduit à son nombre. */
    .village-people { display: inline-flex; padding: 5px 9px; }
    .village-people[hidden] { display: none; }
    .village-people__num { display: inline; }
    .village-people__text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .village-dock { left: max(12px, var(--village-safe-left)); bottom: calc(14px + var(--village-safe-bottom)); }
    .village[data-dock] .village-hint { bottom: calc(70px + var(--village-safe-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
    .vl-bubble,
    .village-dock__btn { transition: none; }
}

/* ==========================================================================
   Lot 2 — vie sociale : voisins, cadeaux, animaux de cœur, « Ma maison »
   ========================================================================== */

/* L'animal d'un membre se distingue de ceux du refuge par son liseré. */
.vl-pet.is-resident .vl-photo { border-color: var(--c-accent); }

/* Endormi (cf. e.asleep dans village.js) : des « z » qui s'envolent au-dessus de son médaillon. */
.vl-zzz { position: absolute; top: -8px; left: calc(50% + 16px); width: 30px; height: 42px; pointer-events: none; display: none; }
.vl-pet.is-asleep .vl-zzz { display: block; }
.vl-pet.is-asleep .vl-photo { filter: saturate(0.85) brightness(0.97); }
.vl-zzz i {
    position: absolute;
    left: 0;
    bottom: 0;
    font-style: normal;
    font-weight: 800;
    line-height: 1;
    color: var(--c-primary);
    text-shadow: 0 1px 0 #ffffff, 0 0 6px rgba(255, 255, 255, 0.9);
    opacity: 0;
    animation: vl-zzz 2.7s ease-out infinite;
}
.vl-zzz i:nth-child(1) { font-size: 0.72rem; }
.vl-zzz i:nth-child(2) { font-size: 0.9rem; animation-delay: 0.9s; }
.vl-zzz i:nth-child(3) { font-size: 1.1rem; animation-delay: 1.8s; }
@keyframes vl-zzz {
    0% { opacity: 0; transform: translate(0, 0) rotate(-8deg); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: translate(14px, -32px) rotate(8deg); }
}
@media (prefers-reduced-motion: reduce) {
    .vl-zzz i { animation: none; opacity: 1; }
    .vl-zzz i:nth-child(n+2) { display: none; }
}

/* Animal de cœur : un petit cœur sur son médaillon, pour le retrouver d'un regard. */
.vl-pet.is-heart::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--c-bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23184f52' d='M12 20.5s-7.5-4.6-7.5-10A4.3 4.3 0 0 1 12 7.900 4.300 4.300 0 0 1 19.500 10.500c0 5.400-7.500 10-7.500 10z'/%3E%3C/svg%3E") center / 12px no-repeat;
    box-shadow: var(--shadow-sm);
}

.village-album__members { max-width: 1080px; margin: 28px auto 0; }

.village-album__members h2 {
    margin: 0 0 14px;
    font-family: var(--f-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--c-text);
}

.village-card__blank {
    display: block;
    aspect-ratio: 4 / 3;
    background: var(--c-primary-light);
}

/* Album public d'un animal : bande de vignettes sous la photo principale. */
.village-strip {
    display: flex;
    gap: 8px;
    margin: 0 0 14px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.village-strip__item {
    flex: none;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 2px solid var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-bg);
    overflow: hidden;
    cursor: pointer;
}

.village-strip__item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.village-strip__item:hover { border-color: var(--c-primary); }
.village-strip__item:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Choix d'un cadeau */
.village-gifts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
    margin: 8px 0 4px;
}

.village-gifts__item {
    display: grid;
    justify-items: center;
    gap: 4px;
    min-height: 88px;
    padding: 12px 8px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: var(--c-bg);
    color: var(--c-text);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.village-gifts__glyph { font-size: clamp(1.75rem, 1.5rem + 0.8vw, 2rem); line-height: 1.1; }
.village-gifts__item:hover:not([disabled]) { border-color: var(--c-accent); background: var(--c-accent-light); }
.village-gifts__item:active:not([disabled]) { transform: scale(0.97); }
.village-gifts__item:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.village-gifts__item[disabled] { opacity: 0.55; cursor: default; }

/* Cadeaux reçus */
.village-inbox { margin: 0; padding: 0; list-style: none; }

.village-inbox__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--c-border-light);
}

.village-inbox__item:first-child { border-top: 0; }
.village-inbox__item.is-new .village-inbox__glyph { background: var(--c-accent-light); }

.village-inbox__glyph {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--c-bg);
    font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
    line-height: 1;
}

.village-inbox__body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.village-inbox__body strong { font-size: 0.94rem; font-weight: 600; color: var(--c-text); }
.village-inbox__body span,
.village-inbox__done { font-size: 0.8rem; color: var(--c-text-secondary); }
.village-inbox__done { flex: none; font-weight: 600; color: var(--c-primary); }

/* Ma maison */
.village-home {
    margin: 0 0 12px;
    padding: 14px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: var(--c-bg);
}

.village-home__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 10px;
}

.village-home__head h3 {
    margin: 0;
    font-family: var(--f-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--c-text);
}

.village-home__state {
    padding: 3px 10px;
    border-radius: var(--r-full);
    background: var(--c-primary-light);
    color: var(--c-primary);
    font-size: 0.8rem;
    font-weight: 600;
}

.village-home__label,
.village-home__field span {
    display: block;
    margin: 0 0 6px;
    color: var(--c-text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
}

.village-home__field { display: block; margin: 0 0 12px; }

/* 16px : en dessous, Safari sur iPhone zoome à la prise de focus. */
.village-home__field input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-bg-card);
    color: var(--c-text);
    font: inherit;
    font-size: 16px;
}

.village-home__field input:focus-visible { outline: none; border-color: var(--c-primary); box-shadow: var(--focus-ring); }

.village-home__photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
}

.village-home__photo {
    position: relative;
    aspect-ratio: 1;
    padding: 0;
    border: 2px solid transparent;
    border-radius: var(--r-md);
    background: var(--c-bg-card);
    overflow: hidden;
    cursor: pointer;
    opacity: 0.55;
}

.village-home__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.village-home__photo[aria-pressed="true"] { border-color: var(--c-primary); opacity: 1; }
.village-home__photo:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.village-home__tag {
    position: absolute;
    inset: auto 0 0 0;
    padding: 2px 4px;
    background: rgba(24, 46, 43, 0.72);
    color: var(--c-text-inverse);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
}

.village-home__note { margin: 8px 0 0; color: var(--c-text-secondary); font-size: 0.8rem; }
.village-home__actions { display: grid; gap: 8px; margin-top: 12px; }
.village-home__actions [hidden] { display: none; }

@media (max-width: 767px) {
    /* Barre du bas étroite : seul « Dire » garde son libellé, les autres se réduisent à leur icône. */
    .village-dock__btn:not(:first-child) { padding: 0 12px; }
    .village-dock__btn:not(:first-child) > span:not(.village-dock__badge) {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .village-gifts__item { transition: none; }
}

/* ==========================================================================
   Lot 3 — lieux : jardin du souvenir, avis de recherche, rendez-vous, Refuge
   ========================================================================== */

/* Enseigne d'un lieu que l'on peut ouvrir. */
/* (le calque des étiquettes laisse passer les clics vers le sol : une enseigne que l'on
   ouvre doit les reprendre, sinon le doigt la traverse et l'on marche au lieu d'ouvrir) */
.vl-place--link { pointer-events: auto; cursor: pointer; }
.vl-place--link:hover { background: var(--c-primary-hover); }
.vl-place--link:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-sm); }

/* L'enseigne du portail du jardin : le nom du lieu et, dessous, ce que l'on y fait. */
.vl-gate {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 7px 10px 8px;
    border: 0;
    border-radius: var(--r-lg);
    font-family: inherit;
    box-shadow: var(--shadow-md);
}

.vl-gate__go {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    padding: 0 11px 0 13px;
    border-radius: var(--r-full);
    background: var(--c-bg-card);
    color: var(--c-primary);
    font-size: 0.88rem;
    font-weight: 700;
}

.vl-gate:active .vl-gate__go { transform: scale(0.96); }

/* Une action à portée de main, posée sur ce qui la permet (un banc : « S'asseoir »). */
.vl-act {
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    background: var(--c-bg-card);
    box-shadow: var(--shadow-md);
    color: var(--c-primary);
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    pointer-events: auto;
    cursor: pointer;
}

/* Cible tactile de 44 px sans grossir la pastille. */
.vl-act::after { content: ""; position: absolute; inset: -6px -4px; }
.vl-act:hover { border-color: var(--c-primary); }
.vl-act:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-md); }

/* Les actions à portée de main : un ou deux boutons en bas de l'écran, au-dessus de la barre. */
.village-prompt {
    position: absolute;
    z-index: 31;
    left: 50%;
    bottom: calc(84px + var(--village-safe-bottom));
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 8px;
    width: max-content;
    max-width: calc(100% - 24px);
    animation: village-prompt-in 180ms var(--ease-out);
}

.village-prompt[hidden],
.village[data-view="album"] .village-prompt { display: none; }

.village-prompt__btn {
    min-width: 0;
    min-height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: var(--r-full);
    background: var(--c-primary);
    box-shadow: var(--shadow-lg);
    color: var(--c-text-inverse);
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: transform 160ms var(--ease-out);
}

/* Deux actions côte à côte sur un écran étroit : c'est la seconde qui se raccourcit, pas la
   première (l'action du lieu). Dans l'Animalerie, « Voir chapeaux et s… » était coupé à côté de
   « Caresser Nou… » sur téléphone (assemblage, 2026-11-16). La première garde au plus 70 %. */
.village-prompt__btn:first-child:not(:only-child) { flex-shrink: 0; max-width: 70%; }

/* La seconde action est plus discrète : fond clair, liseré. */
.village-prompt__btn--second {
    border: 1px solid var(--c-border);
    background: var(--c-bg-card);
    color: var(--c-primary);
}

/* Une action d'appoint réduite à son pictogramme (« Changer d'animal », au terrain d'éducation) :
   elle laisse la largeur à l'action principale, qui porte un nom — sur téléphone, les deux
   libellés côte à côte étaient coupés. Son libellé reste dit à un lecteur d'écran (aria-label). */
.village-prompt__btn.village-prompt__btn--icon {
    flex: 0 0 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    padding: 0;
}

.village-prompt__btn:hover { background: var(--c-primary-hover); }
.village-prompt__btn--second:hover { background: var(--c-bg-card); border-color: var(--c-primary); }
.village-prompt__btn:active { transform: scale(0.97); }
.village-prompt__btn:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-lg); }

@keyframes village-prompt-in {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to { opacity: 1; transform: translateX(-50%); }
}

/* Les boutons d'action prennent la place de la bulle d'aide. */
.village[data-prompt] .village-hint { display: none; }

@media (max-width: 767px) {
    .village-prompt { bottom: calc(72px + var(--village-safe-bottom)); }
    .village-prompt__btn { padding: 0 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .village-prompt { animation: none; }
    .village-prompt__btn { transition: none; }
}

/* Les gestes que l'on peut faire avec un animal : caresser, friandise, balle, tours. */
.village-gestures {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.village-gestures__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 76px;
    padding: 8px 4px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-bg-card);
    color: var(--c-text);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: border-color 160ms var(--ease-out), background 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.village-gestures__glyph { font-size: 1.6rem; line-height: 1.1; }
.village-gestures__item:hover { border-color: var(--c-primary); background: var(--c-primary-light); }
.village-gestures__item:active { transform: scale(0.97); }
.village-gestures__item:focus-visible { outline: none; box-shadow: var(--focus-ring); }

@media (prefers-reduced-motion: reduce) {
    .village-gestures__item { transition: none; }
}

/* « Jouer » : une petite fenêtre d'actions et rien d'autre, posée en bas au centre — là où l'on
   vient de toucher le bouton. (`translate` à part : l'animation d'entrée garde `transform`.) */
.village-sheet--quick {
    left: 50%;
    right: auto;
    top: auto;
    bottom: calc(84px + var(--village-safe-bottom));
    width: min(400px, calc(100% - 24px));
    max-height: none;
    padding: 12px 16px 6px;
    translate: -50% 0;
}

/* (cette petite fenêtre ne défile pas : sa croix reste posée dans son coin) */
.village-sheet--quick .village-sheet__close { position: absolute; top: 8px; right: 8px; margin: 0; background: none; box-shadow: none; }
.village-sheet--quick .village-sheet__close:focus-visible { box-shadow: var(--focus-ring); }

.village-sheet--quick .village-sheet__name {
    display: flex;
    align-items: center;
    min-height: 36px;
    margin: 0 44px 0 0;
    font-size: 1.25rem;
}

.village-sheet--quick .village-gestures { margin-top: 6px; }
.village-sheet--quick .village-gestures__item { min-height: 72px; }

/* « Avec qui ? » : un animal par pastille (sa photo, sinon son espèce), celui des gestes cerclé.
   Six au plus, sur une ligne — qui défile si l'écran est trop étroit. */
.village-mates {
    display: flex;
    gap: 6px;
    margin: 6px -4px 0;
    padding: 2px 4px 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.village-mates::-webkit-scrollbar { display: none; }

.village-mates__item {
    flex: 0 0 54px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-height: 62px;
    padding: 2px 0;
    border: 0;
    border-radius: var(--r-md);
    background: none;
    color: var(--c-text-secondary);
    font: inherit;
    cursor: pointer;
}

.village-mates__face {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    overflow: hidden;
    border: 2px solid var(--c-border);
    border-radius: 50%;
    background: var(--c-bg-warm);
    font-size: 1.3rem;
    line-height: 1;
    transition: border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.village-mates__face img { width: 100%; height: 100%; object-fit: cover; }

.village-mates__name {
    max-width: 54px;
    overflow: hidden;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.village-mates__item:hover .village-mates__face { border-color: var(--c-primary-soft); }
.village-mates__item:active .village-mates__face { transform: scale(0.94); }
.village-mates__item:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.village-mates__item.is-on { color: var(--c-primary); }
.village-mates__item.is-on .village-mates__face { border-color: var(--c-primary); box-shadow: 0 0 0 2px var(--c-primary-light); }
.village-mates__item.is-on .village-mates__name { font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
    .village-mates__face { transition: none; }
}

.village-link--quiet {
    width: 100%;
    margin-top: 2px;
    border: 0;
    background: none;
    color: var(--c-text-secondary);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 767px) {
    /* Téléphone : la même feuille que les fiches, posée en bas — mais courte. */
    .village-sheet--quick {
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        padding: 12px 16px calc(6px + var(--village-safe-bottom));
        translate: none;
    }
}

/* Six boutons dans la barre du bas : sur téléphone ils tiennent sur UNE ligne — la pastille
   se pose sur le coin de son bouton au lieu de l'élargir, et l'écart se resserre. */
@media (max-width: 767px) {
    .village-dock { gap: 6px; max-width: calc(100% - 24px); }
    .village-dock__btn:not(:first-child) > .village-dock__badge { position: absolute; top: -5px; right: -4px; }
}

/* Écrans très étroits : « Dire » se réduit lui aussi à son icône. */
@media (max-width: 374px) {
    .village-dock__btn:first-child { padding: 0 12px; }
    .village-dock__btn:first-child > span:not(.village-dock__badge) {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

/* Médaillon d'un compagnon disparu, posé sur sa pierre : plus doux que ceux des vivants. */
.vl-pet.is-memorial .vl-photo { border-color: var(--c-border); filter: saturate(0.82); }
.vl-pet.is-memorial .vl-name { background: var(--c-bg-warm); }

/* Lignes cliquables d'une liste (jardin, panneau). */
.village-rows { display: grid; gap: 8px; margin: 0 0 12px; }

.village-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 60px;
    padding: 8px 12px 8px 8px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: var(--c-bg);
    color: var(--c-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.village-row:hover { border-color: var(--c-primary); background: var(--c-primary-light); }
.village-row:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.village-row__photo {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--c-bg-card);
}

.village-row__photo--blank {
    display: grid;
    place-items: center;
    border: 1px solid var(--c-border);
    color: var(--c-primary);
    font-family: var(--f-display);
    font-size: 1.1rem;
    font-weight: 600;
}

.village-row__body { min-width: 0; display: grid; gap: 2px; }
.village-row__body strong { font-size: 0.94rem; font-weight: 600; }
.village-row__body span { font-size: 0.8rem; color: var(--c-text-secondary); }

/* Rendez-vous */
.village-agenda { display: grid; gap: 8px; margin: 0 0 4px; }

.village-agenda__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: var(--c-bg);
}

.village-agenda__item.is-live { border-color: var(--c-primary); background: var(--c-primary-light); }
.village-agenda__body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.village-agenda__body strong { font-size: 0.94rem; font-weight: 600; color: var(--c-text); }
.village-agenda__body span { font-size: 0.8rem; color: var(--c-text-secondary); }
.village-agenda__item.is-live .village-agenda__body span { color: var(--c-primary); font-weight: 600; }

/* Bannière : un rendez-vous a commencé. */
.village-banner {
    position: absolute;
    z-index: 26;
    left: 50%;
    top: calc(var(--village-top-h) + var(--village-safe-top) + 12px);
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    /* max-content : sans lui, un élément centré par left:50% se tasse sur la moitié de l'écran. */
    width: max-content;
    max-width: min(560px, calc(100% - 24px));
    padding: 6px 6px 6px 16px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    background: var(--c-bg-card);
    box-shadow: var(--shadow-lg);
    color: var(--c-text);
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.35;
}

.village-banner[hidden],
.village[data-view="album"] .village-banner { display: none; }

/* Son bouton et sa croix sont les composants communs, en petit : .village-chip--primary--sm et
   .village-close--flat--sm (36 px à l'œil, 44 px au doigt). */
.village-banner__go,
.village-banner__close { flex: none; }

/* Une annonce passagère (toast) se place sous les bandeaux quand il y en a (leur hauteur est
   publiée par le socle ; 48 px tant qu'elle n'est pas connue : un bandeau d'une ligne). */
.village-banner:not([hidden]) ~ .village-toast,
.village:has(.village-banner:not([hidden])) .village-toast { top: calc(var(--village-top-h) + var(--village-safe-top) + 20px + var(--village-banners-h, 48px)); }

/* Le Refuge : campagne de clics solidaires en cours. */
.village-campaign {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: var(--r-lg);
    background: var(--c-accent-light);
    color: var(--c-text);
    font-size: 0.8rem;
    line-height: 1.5;
}

.village-campaign p { margin: 0 0 6px; }

@media (max-width: 767px) {
    .village-banner { border-radius: var(--r-lg); }
}

@media (prefers-reduced-motion: reduce) {
    .village-row { transition: none; }
}

/* ==========================================================================
   Mes animaux : qui m'accompagne (choix à la première visite, puis réglage)
   ========================================================================== */

/* En-tête d'un animal : portrait, nom, et à droite son interrupteur ou son état. */
.village-pet {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 10px;
}

.village-pet__photo {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--c-bg-card);
}

.village-pet__photo--blank {
    display: grid;
    place-items: center;
    border: 1px solid var(--c-border);
    color: var(--c-primary);
    font-family: var(--f-display);
    font-size: 1.1rem;
    font-weight: 600;
}

.village-pet__name {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-family: var(--f-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--c-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Interrupteur « au Village ». La zone sensible déborde un peu du dessin (cible de 44 px). */
.village-switch {
    position: relative;
    flex: none;
    width: 56px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    background: var(--c-bg-card);
    cursor: pointer;
    transition: background-color 180ms var(--ease-out), border-color 180ms var(--ease-out);
}

.village-switch::before { content: ''; position: absolute; inset: -7px -4px; }

.village-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--c-border);
    box-shadow: var(--shadow-sm);
    transition: transform 180ms var(--ease-out), background-color 180ms var(--ease-out);
}

.village-switch[aria-checked="true"] { border-color: var(--c-primary); background: var(--c-primary); }
.village-switch[aria-checked="true"]::after { background: var(--c-bg-card); transform: translateX(24px); }
.village-switch:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.village-home > .village-look__choices { margin: 0 0 10px; }
.village-home > .village-link { display: inline-block; margin: 0 0 8px; padding: 0; border: 0; background: none; cursor: pointer; }

.village-home__warn {
    margin: 0 0 10px;
    padding: 8px 12px;
    border-radius: var(--r-md);
    background: var(--c-accent-light);
    color: var(--c-text);
    font-size: 0.8rem;
    line-height: 1.45;
}

/* Choix à la première visite : une ligne par animal, cochée ou non. */
.village-pick .village-pet__photo { width: 48px; height: 48px; }
.village-pick .village-row__body { flex: 1; }

.village-pick__mark {
    flex: none;
    width: 26px;
    height: 26px;
    border: 2px solid var(--c-border);
    border-radius: 50%;
    background: var(--c-bg-card);
}

.village-pick[aria-checked="true"] { border-color: var(--c-primary); background: var(--c-primary-light); }

.village-pick[aria-checked="true"] .village-pick__mark {
    border-color: var(--c-primary);
    background: var(--c-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.500l4.500 4.500L19 7.500'/%3E%3C/svg%3E") center / 16px no-repeat;
}

@media (prefers-reduced-motion: reduce) {
    .village-switch,
    .village-switch::after { transition: none; }
}

/* ==========================================================================
   Le jardin du souvenir, lieu où l'on entre
   ========================================================================== */

/* Voile de passage d'un lieu à l'autre. */
.village-fade {
    position: absolute;
    inset: 0;
    z-index: 60;
    background: var(--c-bg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms var(--ease-out);
}

.village-fade.is-on { opacity: 1; pointer-events: auto; }

/* Bandeau du jardin (16 novembre 2026 : « dissocier la recherche du bouton pour sortir ») : en
   haut, toujours là, « Sortir du jardin » et « Rechercher » ; dessous, le panneau qui se replie
   (vos compagnons, la recherche, les allées, « Ajouter un compagnon disparu »). Replié, il ne
   prend que deux petits boutons. */
.village-garden {
    position: absolute;
    z-index: 26;
    left: max(16px, var(--village-safe-left));
    top: calc(var(--village-top-h) + var(--village-safe-top) + 12px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 336px;
    pointer-events: none; /* entre les boutons, le toucher va à la scène */
}

.village-garden > * { pointer-events: auto; }

.village-garden__top { display: flex; gap: 8px; max-width: 100%; }

/* « Sortir du jardin » et « Rechercher » : les boutons posés sur la scène (.village-float). */
.village-garden__toggle[aria-expanded="true"] { border-color: var(--c-primary); }
.village-garden__chev { display: inline-grid; transition: transform 200ms var(--ease-out); }
.village-garden__toggle[aria-expanded="true"] .village-garden__chev { transform: rotate(180deg); }

.village-garden__panel {
    display: grid;
    gap: 10px;
    width: 100%;
    max-height: calc(100vh - var(--village-top-h) - 190px);
    max-height: calc(100dvh - var(--village-top-h) - 190px);
    overflow-y: auto;
    padding: 14px;
    border: 1px solid var(--c-border-light);
    border-radius: var(--r-lg);
    background: var(--village-mat);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
    box-shadow: var(--shadow-md);
}

.village-garden__panel[hidden] { display: none; }

/* « Mes compagnons » : vos animaux partis, chacun mène à sa pierre. */
.village-garden__mine { display: grid; gap: 6px; }
.village-garden__mine[hidden] { display: none; }
.village-garden__label { font-size: 0.78rem; font-weight: 600; color: var(--c-text-secondary); }
.village-garden__friends { display: flex; flex-wrap: wrap; gap: 6px; }
/* (une pastille, .village-chip, qui commence par le visage du compagnon) */
.village-garden__friend { gap: 8px; padding: 3px 12px 3px 5px; }
.village-garden__face {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--c-bg-warm);
    font-size: 1rem;
}
.village-garden__face img { width: 100%; height: 100%; object-fit: cover; }

/* Les résultats de la recherche : où est la pierre de chacun. */
.village-garden__results { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.village-garden__results[hidden] { display: none; }
.village-garden__result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 6px 12px;
    border: 1px solid var(--c-border-light);
    border-radius: var(--r-md);
    background: var(--c-bg-card);
    color: var(--c-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.village-garden__result:hover { border-color: var(--c-primary); }
.village-garden__result:focus-visible { outline: none; box-shadow: var(--focus-ring); }
/* « Voir la suite » : les homonymes au-delà de la première page (Luna, Max…). */
.village-garden__more { justify-content: center; border-style: dashed; color: var(--c-primary); font-size: 0.86rem; font-weight: 600; }
.village-garden__more:disabled { opacity: 0.6; cursor: progress; }
.village-garden__who { display: grid; min-width: 0; }
.village-garden__who strong { overflow: hidden; font-size: 0.9rem; text-overflow: ellipsis; white-space: nowrap; }
.village-garden__who small,
.village-garden__where { color: var(--c-text-secondary); font-size: 0.76rem; }
.village-garden__where { flex: none; font-weight: 600; color: var(--c-primary); }
.village-garden__empty { padding: 4px 2px; color: var(--c-text-secondary); font-size: 0.82rem; }

@media (prefers-reduced-motion: reduce) {
    .village-garden__chev { transition: none; }
}

.village-garden[hidden],
.village[data-view="album"] .village-garden,
.village[data-place="memorial"] .village-banner { display: none; }

.village-garden__head { display: grid; gap: 2px; }
/* « Ajouter un compagnon disparu » : un lien discret, sur toute la largeur du bandeau. */
.village-garden__add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px dashed var(--c-primary-muted);
    border-radius: var(--r-md);
    background: transparent;
    color: var(--c-primary);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
}
.village-garden__add[hidden] { display: none; }
.village-garden__add:hover { background: var(--c-primary-light); }
.village-garden__add:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.village-garden__head strong { font-family: var(--f-display); font-size: 1.1rem; font-weight: 600; color: var(--c-text); }
.village-garden__head span { font-size: 0.8rem; color: var(--c-text-secondary); }

/* 16px : en dessous, Safari sur iPhone zoome à la prise de focus. */
.village-garden__search input,
.village-msgform textarea,
.village-home__field textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-bg-card);
    color: var(--c-text);
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
}

.village-msgform textarea,
.village-home__field textarea { resize: vertical; }

.village-garden__search input:focus-visible,
.village-msgform textarea:focus-visible,
.village-home__field textarea:focus-visible { outline: none; border-color: var(--c-primary); box-shadow: var(--focus-ring); }

.village-garden__pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--c-text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
}

/* (les flèches de l'allée : le bouton rond commun, .village-icon-btn) */

/* Le mot du maître. */
.village-word {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-left: 3px solid var(--c-accent);
    border-radius: 0 var(--r-md) var(--r-md) 0;
    background: var(--c-accent-light);
}

.village-word p { margin: 0 0 6px; color: var(--c-text); font-family: var(--f-display); font-size: 1.1rem; font-weight: 600; line-height: 1.45; }
.village-word cite { color: var(--c-text-secondary); font-size: 0.8rem; font-style: normal; }

/* Messages laissés devant un compagnon. */
.village-messages { margin: 0 0 12px; padding: 0; list-style: none; }

.village-messages__item { padding: 10px 0; border-top: 1px solid var(--c-border-light); }
.village-messages__item:first-child { border-top: 0; padding-top: 2px; }
.village-messages__text { margin: 0 0 4px; color: var(--c-text); font-size: 0.94rem; line-height: 1.5; overflow-wrap: anywhere; }

.village-messages__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    margin: 0;
    color: var(--c-text-secondary);
    font-size: 0.8rem;
}

.village-messages__act {
    padding: 0;
    border: 0;
    background: none;
    color: var(--c-primary);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.village-messages__act:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

.village-msgform { display: grid; gap: 8px; margin: 0 0 14px; }
.village-msgform .village-home__note { margin: 0; }

@media (max-width: 767px) {
    /* Téléphone : « Sortir » à gauche, « Rechercher » à droite, en pleine largeur sous la barre du
       haut ; le panneau, ouvert, dessous. Replié par défaut. */
    .village-garden {
        left: 8px;
        right: 8px;
        top: calc(var(--village-top-h) + var(--village-safe-top) + 8px);
        width: auto;
    }
    .village-garden__top { width: 100%; justify-content: space-between; }
    .village-garden__panel { padding: 12px; max-height: calc(100dvh - var(--village-top-h) - 230px); }
    .village-garden__add { min-height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
    .village-fade { transition: none; }
}

/* ==========================================================================
   La cagnotte (patounes) et les missions du jour — public/js/village-missions.js
   Rien de ce bloc ne s'applique tant que le module n'a pas posé sa pastille
   (VILLAGE_MISSIONS_ENABLED éteint, ou visiteur sans compte).
   ========================================================================== */

/* La pièce : un disque pêche frappé d'une patte. */
.village-coin { display: inline-flex; flex: none; width: 18px; height: 18px; }
.village-coin svg { display: block; width: 100%; height: 100%; }
.village-coin__disc { fill: var(--c-accent); }
.village-coin__ring { stroke: var(--c-accent-hover); }
.village-coin__paw { fill: var(--c-bg-card); }
.village-coin--big { width: 44px; height: 44px; }

/* Barre du haut : le solde, puis l'avancement des missions du jour (un point par mission). */
.village-wallet {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 0 12px 0 8px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    background: var(--c-bg-card);
    color: var(--c-text);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

/* Cible tactile de 44 px sans grossir la pastille. */
.village-wallet::after { content: ""; position: absolute; inset: -4px 0; }
.village-wallet:hover { border-color: var(--c-primary); }
.village-wallet:active { transform: scale(0.98); }
.village-wallet:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.village-wallet__coins { display: inline-flex; align-items: center; gap: 6px; }
.village-wallet__coins strong { font-size: 0.94rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.village-wallet__missions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-left: 10px;
    border-left: 1px solid var(--c-border);
    color: var(--c-primary);
}

/* Un chevron après les pastilles : « Missions » s'ouvre (on ne le devinait pas — retour
   d'Anthony, 2026-11-16). Dessiné par deux bordures : ni image ni caractère. */
.village-wallet__missions::after {
    content: "";
    width: 6px;
    height: 6px;
    margin-left: -1px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
}

.village-wallet__dots { display: inline-flex; gap: 4px; }
.village-wallet__dots i { width: 10px; height: 10px; border: 1.5px solid var(--c-primary); border-radius: var(--r-full); }
.village-wallet__dots i.is-done { background: var(--c-primary); }

/* Une mission vient d'être payée : la pastille le fait sentir. */
.village-wallet.is-bump { animation: village-wallet-bump 560ms var(--ease-out); }

@keyframes village-wallet-bump {
    0% { box-shadow: 0 0 0 0 rgba(247, 171, 119, 0.7); }
    40% { transform: scale(1.06); }
    100% { box-shadow: 0 0 0 12px rgba(247, 171, 119, 0); }
}

/* La pastille se range avec les compteurs ; les boutons restent à droite. */
.village-count:not([hidden]) ~ .village-wallet { margin-left: 0; }

/* Fenêtre « Missions du jour » */
.village-purse {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 6px 0 12px;
    padding: 12px 14px;
    border-radius: var(--r-lg);
    background: var(--c-accent-light);
}

.village-purse__text { display: grid; gap: 2px; }
.village-purse__text span { color: var(--c-text-secondary); font-size: 0.8rem; font-weight: 500; }
.village-purse__text strong { font-family: var(--f-display); font-size: 1.4rem; font-weight: 600; line-height: 1.2; }

.village-missions { display: grid; gap: 8px; margin: 0 0 4px; padding: 0; list-style: none; }
.village-missions + .village-sheet__eyebrow { margin-bottom: 8px; }

.village-mission {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--c-border-light);
    border-radius: var(--r-lg);
    background: var(--c-bg-card);
}

.village-mission.is-done { border-color: transparent; background: var(--c-bg); }
.village-mission.is-new { border-color: var(--c-accent); background: var(--c-accent-light); }
/* Une mission qui mène à ce qu'il y a à faire : toute la ligne se touche (cf. howTo). */
.village-mission.is-go { cursor: pointer; transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
.village-mission.is-go .village-mission__go { color: var(--c-primary); font-weight: 700; }
.village-mission.is-go .village-mission__go::after { content: ' →'; }
@media (hover: hover) {
    .village-mission.is-go:hover { border-color: var(--c-primary-soft); box-shadow: var(--shadow-sm); }
}
.village-mission.is-go:active { transform: scale(0.99); }

.village-mission__glyph {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--r-full);
    background: var(--c-primary-light);
    font-size: 1.25rem;
    line-height: 1;
}

.village-mission.is-new .village-mission__glyph { background: var(--c-bg-card); }

.village-mission__body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.village-mission__body strong { color: var(--c-text); font-size: 0.94rem; font-weight: 600; line-height: 1.3; }
.village-mission__body span { color: var(--c-text-secondary); font-size: 0.8rem; line-height: 1.4; }
/* Mission faite : plus besoin du mode d'emploi. */
.village-mission.is-done:not(.is-daily) .village-mission__body span { display: none; }

.village-mission__body .village-mission__progress {
    justify-self: start;
    margin-top: 2px;
    padding: 1px 8px;
    border-radius: var(--r-full);
    background: var(--c-primary-light);
    color: var(--c-primary);
    font-weight: 600;
}

.village-mission__reward {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px 4px 10px;
    border-radius: var(--r-full);
    background: var(--c-accent-light);
    color: var(--c-text);
    font-size: 0.94rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.village-mission.is-new .village-mission__reward { background: var(--c-bg-card); }
.village-mission__reward.is-done { padding: 0; background: none; color: var(--c-primary); font-size: 0.8rem; font-weight: 600; }

.village-missions__foot { margin: 12px 0 6px; font-size: 0.8rem; }
.village-missions__about { margin: 0; font-size: 0.8rem; }

/* Barre du haut qui se resserre : pour que les boutons de droite restent sur une ligne,
   on laisse partir ce qui compte le moins — le nombre d'animaux, puis le libellé de la
   pastille (le solde et les points restent), puis le nom de la rubrique. */
@media (max-width: 1139px) {
    .village[data-wallet] #villageCount { display: none; }
}

@media (max-width: 939px) {
    .village-wallet__label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

@media (max-width: 879px) {
    .village[data-wallet] .village-brand__section { display: none; }
}

@media (max-width: 519px) {
    /* Téléphone : la barre du haut n'a plus de place (logo, présents, deux boutons). La
       cagnotte prend donc une seconde ligne, pleine largeur ; tout ce qui se cale sous la
       barre (messages, bandeaux, fiches) suit, puisqu'il lit --village-top-h. */
    .village[data-wallet] { --village-top-h: 98px; }
    .village[data-wallet] .village-top { flex-wrap: wrap; row-gap: 0; }
    .village-wallet {
        order: 5;
        flex: 1 0 100%;
        justify-content: space-between;
        min-height: 40px;
        margin: 0;
        padding: 0 2px;
        border: 0;
        border-top: 1px solid var(--c-border-light);
        border-radius: 0;
        background: none;
    }
    .village-wallet::after { inset: -2px 0; }
    .village-wallet:hover { border-color: var(--c-border-light); }
    .village-wallet:active { transform: none; }
    .village-wallet:focus-visible { box-shadow: inset 0 0 0 2px rgba(24, 79, 82, 0.3); }
    /* Sur cette ligne à plat, « Missions » est dessiné comme un bouton (pastille bordée). */
    .village-wallet__missions {
        min-height: 30px;
        padding: 0 12px;
        border: 1px solid var(--c-border);
        border-radius: var(--r-full);
        background: var(--c-bg-card);
    }
    .village-wallet:active .village-wallet__missions { background: var(--c-primary-light); }
    /* La seconde ligne a toute la largeur : le libellé y a sa place. */
    .village-wallet__label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
}

@media (prefers-reduced-motion: reduce) {
    .village-wallet { transition: none; }
    .village-wallet.is-bump { animation: none; }
}

/* ==========================================================================
   Le son — public/js/village-audio.js
   Rien de ce bloc ne s'applique tant que le module n'a pas posé ses boutons
   (VILLAGE_SOUND_ENABLED éteint).
   ========================================================================== */

/* À l'accueil, sous « Entrer » : on choisit avant d'entrer si la place va sonner. */
.village-sound-choice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    margin-top: 6px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--r-md);
    background: none;
    color: var(--c-primary);
    font: inherit;
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 160ms var(--ease-out), color 160ms var(--ease-out);
}

.village-sound-choice svg { flex: none; }
.village-sound-choice:hover { background: var(--c-bg-warm); }
.village-sound-choice:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.village-sound-choice[aria-pressed="false"] { color: var(--c-text-secondary); }

/* Sur la place : un bouton rond, en bas à droite (la barre du bas est à gauche, les
   actions à portée de main au centre). */
/* (son allure : un bouton rond posé sur la scène, .village-float--icon ; ici, sa seule place) */
.village-sound {
    position: absolute;
    z-index: 30;
    right: max(16px, var(--village-safe-right));
    bottom: calc(18px + var(--village-safe-bottom));
}

.village-sound[hidden] { display: none; }
.village-sound.is-muted { color: var(--c-text-secondary); }

@media (max-width: 767px) {
    /* Téléphone : au-dessus de la rangée des actions à portée de main (elle peut occuper
       toute la largeur), contre le bord droit. */
    .village-sound {
        right: max(12px, var(--village-safe-right));
        bottom: calc(140px + var(--village-safe-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    .village-sound,
    .village-sound-choice { transition: none; }
}

/* La fenêtre « Réglages » (ouverte par le bouton rond) : tout le son, puis la musique et les
   bruitages, chacun son interrupteur et son volume. */
.village-settings {
    display: grid;
    gap: 4px;
    margin: 8px 0 4px;
}

.village-settings__line {
    padding: 10px 12px 4px;
    border: 1px solid var(--c-border-light);
    border-radius: var(--r-md);
    background: var(--c-bg);
}

.village-settings__line--all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 4px;
    background: var(--c-bg-warm);
}

.village-settings__top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.village-settings__label {
    flex: 1;
    min-width: 0;
    font-size: 0.97rem;
    font-weight: 600;
    color: var(--c-text);
}

.village-settings__value {
    min-width: 3.4em;
    color: var(--c-text-secondary);
    font-size: 0.86rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.village-settings__note {
    margin: 6px 0 8px;
    color: var(--c-text-secondary);
    font-size: 0.84rem;
    line-height: 1.5;
}

/* Tout le son coupé : musique et bruitages restent réglables, mais en retrait. */
.village-settings.is-off .village-settings__line:not(.village-settings__line--all),
.village-settings__line.is-off .village-settings__label { opacity: 0.6; }

/* (L'interrupteur est celui de « Mes animaux » : .village-switch, plus haut.) */
.village-switch:disabled { opacity: 0.45; cursor: default; }

.village-range {
    display: block;
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.village-range::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--c-primary) var(--fill, 100%), var(--c-border) var(--fill, 100%));
}

.village-range::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    margin-top: -9px;
    border: 2px solid var(--c-primary);
    border-radius: 50%;
    background: var(--c-bg-card);
    box-shadow: var(--shadow-sm);
    -webkit-appearance: none;
    appearance: none;
}

.village-range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--c-border); }
.village-range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--c-primary); }

.village-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: 2px solid var(--c-primary);
    border-radius: 50%;
    background: var(--c-bg-card);
    box-shadow: var(--shadow-sm);
}

.village-range:disabled { opacity: 0.4; cursor: default; }
.village-range:focus-visible { outline: none; }
.village-range:focus-visible::-webkit-slider-thumb { box-shadow: var(--focus-ring); }
.village-range:focus-visible::-moz-range-thumb { box-shadow: var(--focus-ring); }

/* Banc d'essai des sons (?sons=1) : un outil de mise au point, pas une surface du produit. */
.village-board {
    position: absolute;
    z-index: 60;
    left: 12px;
    top: calc(var(--village-top-h) + var(--village-safe-top) + 12px);
    display: grid;
    gap: 8px;
    width: min(340px, calc(100% - 24px));
    max-height: calc(100% - var(--village-top-h) - var(--village-safe-top) - 24px);
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: var(--c-bg-card);
    box-shadow: var(--shadow-lg);
    font-size: 0.8rem;
}

.village-board p { margin: 4px 0 0; color: var(--c-text-secondary); font-weight: 600; }
.village-board select { min-height: 36px; font: inherit; }
.village-board__grid { display: flex; flex-wrap: wrap; gap: 6px; }

.village-board__grid button {
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    background: var(--c-bg);
    color: var(--c-primary);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.village-board__grid button:hover { border-color: var(--c-primary); }
.village-board__grid button.is-missing { color: var(--c-text-secondary); opacity: 0.55; cursor: default; }

/* --------------------------------------------------------------------------
   La promenade solidaire (MONDE-6, village-walk.js) : la pastille des pas en
   bas de l'écran, la note sur la fiche d'un animal du refuge, la carte de fin
   (un bouton par association).
   -------------------------------------------------------------------------- */

/* Au même endroit que les actions à portée de main ; elle monte d'un cran quand elles sont là. */
.village-walk {
    position: absolute;
    z-index: 31;
    left: 50%;
    bottom: calc(84px + var(--village-safe-bottom));
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 24px);
    animation: village-prompt-in 180ms var(--ease-out);
}

.village-walk[hidden],
.village[data-view="album"] .village-walk { display: none; }

.village[data-prompt] .village-walk { bottom: calc(142px + var(--village-safe-bottom)); }

/* La pastille prend la place de la bulle d'aide (même bas d'écran). */
.village[data-walk] .village-hint { display: none; }

.village-walk__count {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 16px 0 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    background: var(--c-bg-card);
    box-shadow: var(--shadow-lg);
    color: var(--c-primary);
    font-size: 0.94rem;
    font-weight: 700;
    white-space: nowrap;
}

.village-walk__count[hidden],
.village-walk__give[hidden] { display: none; }

.village-walk__icon { display: grid; place-items: center; flex: none; }
.village-walk__label { font-variant-numeric: tabular-nums; }

.village-walk__track {
    flex: none;
    width: 76px;
    height: 8px;
    overflow: hidden;
    border-radius: var(--r-full);
    background: var(--c-primary-light);
}

.village-walk__track i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--c-primary);
    transition: width 220ms var(--ease-out);
}

/* Les pas sont faits : la pastille devient le bouton du don (.village-float--lg--primary, posé
   avec elle dans village-walk.js : l'allure des actions à portée de main). */

/* Sur la fiche d'un animal du refuge : ce que vaut la promenade aujourd'hui. */
.village-walk-note {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: var(--r-lg);
    background: var(--c-accent-light);
    color: var(--c-text);
    font-size: 0.86rem;
    line-height: 1.5;
}

.village-walk-note strong { display: block; margin-bottom: 2px; color: var(--c-primary); font-size: 0.8rem; letter-spacing: 0.02em; }
.village-walk-note p { margin: 0; }
.village-walk-note .village-link { display: inline-block; margin-top: 6px; }
.village-walk-note .village-btn { margin-top: 10px; }
.village-walk-note.is-done { background: var(--c-primary-light); }

/* La carte de fin : une association par ligne, toute la ligne est le bouton. */
.village-walk-gives { display: grid; gap: 8px; margin: 0 0 14px; }

.village-walk-give {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 64px;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: var(--c-bg-card);
    color: var(--c-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.village-walk-give:hover:not([disabled]) { border-color: var(--c-primary); }
.village-walk-give:active:not([disabled]) { transform: scale(0.99); }
.village-walk-give:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.village-walk-give[disabled] { opacity: 0.6; cursor: progress; }

.village-walk-give__logo {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
    background: var(--c-bg);
    object-fit: contain;
}

.village-walk-give__logo--none {
    display: grid;
    place-items: center;
    background: var(--c-accent-light);
    color: var(--c-accent-vivid);
    font-size: 1.1rem;
}

.village-walk-give__body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.village-walk-give__body strong { overflow: hidden; font-size: 0.94rem; text-overflow: ellipsis; }
.village-walk-give__body span { color: var(--c-text-secondary); font-size: 0.8rem; }

.village-walk-give__go {
    flex: none;
    padding: 8px 14px;
    border-radius: var(--r-full);
    background: var(--c-primary);
    color: var(--c-text-inverse);
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
}

.village-walk-total { margin: -8px 0 16px; color: var(--c-primary); font-size: 0.94rem; font-weight: 700; }

.village-walk-error {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: var(--r-md);
    border-left: 3px solid var(--c-danger);
    background: var(--c-accent-light);
    color: var(--c-text);
    font-size: 0.86rem;
    font-weight: 600;
}

@media (max-width: 767px) {
    .village-walk { bottom: calc(72px + var(--village-safe-bottom)); }
    .village[data-prompt] .village-walk { bottom: calc(130px + var(--village-safe-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
    .village-walk { animation: none; }
    .village-walk__track i,
    .village-walk-give { transition: none; }
}

/* Promenade solidaire, lot 2 : l'animal du jour, ce que la promenade rapporte, le compteur
   collectif, la ligne ajoutée à la fenêtre des missions. */

/* L'animal du jour : une patte sur son médaillon (en haut à gauche — le cœur des animaux de
   cœur est en haut à droite), tant que la promenade du membre reste à faire. */
.vl-pet.is-today::before,
.vl-pet.is-featured::before {
    content: '';
    position: absolute;
    top: -5px;
    left: calc(50% - 32px);
    z-index: 1;
    width: 22px;
    height: 22px;
    border: 2px solid var(--c-bg-card);
    border-radius: 50%;
    background: var(--c-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23184f52'%3E%3Cellipse cx='12' cy='15.6' rx='4.4' ry='3.5'/%3E%3Ccircle cx='6.4' cy='11.2' r='1.9'/%3E%3Ccircle cx='9.9' cy='7.6' r='1.9'/%3E%3Ccircle cx='14.1' cy='7.6' r='1.9'/%3E%3Ccircle cx='17.6' cy='11.2' r='1.9'/%3E%3C/g%3E%3C/svg%3E") center / 13px no-repeat;
    box-shadow: var(--shadow-sm);
}

.vl-pet.is-today .vl-photo,
.vl-pet.is-featured .vl-photo { border-color: var(--c-accent); }

/* Ce que la promenade vient de rapporter : série, patounes, prochain palier. */
.village-walk-rewards {
    display: grid;
    gap: 6px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: var(--r-lg);
    background: var(--c-primary-light);
    color: var(--c-text);
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.4;
    list-style: none;
}

.village-walk-rewards li { display: flex; align-items: baseline; gap: 8px; }
.village-walk-rewards__glyph { flex: none; width: 1.3em; text-align: center; }

.village-walk-community { margin: 0 0 14px; color: var(--c-text-secondary); font-size: 0.8rem; line-height: 1.5; }

.village-walk-note__bonus { margin-top: 4px; color: var(--c-primary); font-weight: 600; }
.village-walk-note__facts { margin-top: 6px; color: var(--c-text-secondary); font-size: 0.8rem; }

/* Dans la fenêtre des missions : « Rencontrer {l'animal du jour} ». */
.village-mission__go {
    justify-self: start;
    justify-content: flex-start;
    margin-top: 2px;
    padding: 0;
    text-align: left;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Les échanges (MONDE-7, village-talk.js) : phrases adressées et leurs réponses,
   réactions, ce qu'un compagnon dit de lui, visites, connaissances.
   Rien ici ne s'applique tant que le module n'est pas chargé.
   -------------------------------------------------------------------------- */

/* La fenêtre « Dire quelque chose » peut être longue : elle défile au lieu de dépasser l'écran. */
.village-sheet--quick:has(.village-talk__to, .village-visits, .village-met) {
    max-height: calc(100% - var(--village-top-h) - var(--village-safe-top) - 110px);
    overflow-y: auto;
    padding-bottom: 12px;
}

.village-talk__to { display: flex; margin: 2px 0 6px; }

/* À qui l'on parle : une pastille serrée (.village-chip--soft--sm) cerclée de teal, qu'une croix
   retire ; « À tout le monde » n'est qu'une étiquette (pastille sans action). */
.village-talk__chip { gap: 8px; padding: 0 6px 0 14px; border-color: var(--c-primary); font-size: 0.86rem; }
.village-talk__chip--all,
.village-talk__chip--all:hover { padding: 0 14px; border-color: var(--c-border); background: var(--c-bg); color: var(--c-text-secondary); cursor: default; }
.village-talk__chip--all::after { content: none; }

.village-talk__x {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--c-bg-card);
    font-size: 1rem;
    line-height: 1;
}

.village-talk__lede { margin: 0 0 8px; color: var(--c-text-secondary); font-size: 0.8rem; }
.village-talk__duos { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }

/* La réponse proposée : à la place des boutons du bas, le temps de répondre. */
.village-reply {
    position: absolute;
    z-index: 32;
    left: 50%;
    bottom: calc(84px + var(--village-safe-bottom));
    width: min(440px, calc(100% - 24px));
    padding: 10px 12px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-xl);
    background: var(--c-bg-card);
    box-shadow: var(--shadow-lg);
    transform: translateX(-50%);
    animation: village-prompt-in 180ms var(--ease-out);
    overflow: hidden;
}

.village-reply[hidden],
.village[data-view="album"] .village-reply { display: none; }

/* Pendant qu'une réponse est proposée, les boutons du bas lui laissent la place. */
.village[data-reply] .village-prompt { display: none; }
/* La promenade solidaire tient son compteur au même endroit : la réponse passe au-dessus. */
.village:has(.village-walk:not([hidden])) .village-reply { bottom: calc(152px + var(--village-safe-bottom)); }

.village-reply__head { display: flex; align-items: flex-start; gap: 8px; }

/* Qui a parlé (une pastille voile teal, serrée), ce qu'il a dit, la croix commune (sans fond, serrée). */
.village-reply__who {
    flex: none;
    display: block;
    max-width: 40%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 34px;
}

.village-reply__text { flex: 1; min-width: 0; padding-top: 8px; color: var(--c-text); font-size: 0.9rem; font-weight: 500; line-height: 1.35; }

.village-reply__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Les réponses : des pastilles (.village-chip, la première --primary) ; une phrase longue passe à la ligne. */
.village-reply__chip { flex: 1 1 auto; padding: 6px 14px; font-size: 0.86rem; line-height: 1.25; }

/* Le temps qu'il reste pour répondre. */
.village-reply__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c-border-light); }
.village-reply__bar i { display: block; height: 100%; background: var(--c-primary); transform-origin: 0 50%; transition: transform 250ms linear; }

@media (max-width: 767px) {
    .village-reply { bottom: calc(72px + var(--village-safe-bottom)); }
    .village:has(.village-walk:not([hidden])) .village-reply { bottom: calc(140px + var(--village-safe-bottom)); }
}

/* Une bulle de texte se touche (pour y poser un geste) : elle reprend les clics que le calque laisse passer. */
.village[data-talk] .vl-bubble.is-on:not(.vl-bubble--emote) { pointer-events: auto; cursor: pointer; }

.vl-bubble__react {
    display: block;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--c-border-light);
    font-size: 0.86rem;
    line-height: 1.2;
}

.village-react {
    position: absolute;
    z-index: 33;
    display: flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    background: var(--c-bg-card);
    box-shadow: var(--shadow-lg);
    transform: translateX(-50%);
}

.village-react[hidden] { display: none; }

.village-react__item {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: var(--c-bg);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.village-react__item:hover { background: var(--c-primary-light); }
.village-react__item:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Les questions que l'on peut poser à un animal. */
.village-ask { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }

/* « Mes animaux » : ce que le compagnon dit de lui. */
.village-facts { margin-top: 12px; padding-top: 4px; border-top: 1px solid var(--c-border-light); }
/* Replié : une ligne (son titre, ses goûts), un chevron. */
.village-facts__summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    cursor: pointer;
    list-style: none;
}
.village-facts__summary::-webkit-details-marker { display: none; }
.village-facts__summary::after {
    content: '';
    flex: none;
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-right: 2px solid var(--c-text-secondary);
    border-bottom: 2px solid var(--c-text-secondary);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 160ms var(--ease-out);
}
.village-facts[open] > .village-facts__summary::after { transform: rotate(-135deg) translateY(-2px); }
.village-facts__summary:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }
.village-facts__title { flex: none; color: var(--c-text); font-size: 0.86rem; font-weight: 600; }
.village-facts__likes { min-width: 0; overflow: hidden; color: var(--c-text-secondary); font-size: 0.82rem; text-overflow: ellipsis; white-space: nowrap; }
.village-facts[open] .village-facts__likes { display: none; }
.village-facts > .village-home__note { margin-top: 0; }
.village-facts__count { margin: 8px 0 8px; color: var(--c-text); font-size: 0.84rem; font-weight: 600; }
.village-facts__traits { display: flex; flex-wrap: wrap; gap: 6px; }
.village-facts__traits .village-look__choice { min-height: 36px; padding: 4px 12px; font-size: 0.84rem; }
/* (pastilles serrées, comme .village-chip--sm : 36 px à l'œil, 44 px au doigt) */
.village-facts__traits .village-look__choice::after,
.village-inbox__thanks .village-look__choice::after { content: ''; position: absolute; inset: -4px 0; }
.village-facts__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-top: 8px; color: var(--c-text); font-size: 0.9rem; font-weight: 500; }
.village-facts__row .village-switch { flex: none; }

/* Visites reçues, connaissances : de courtes listes. */
.village-visits,
.village-met { margin: 4px 0 10px; padding: 0; list-style: none; }

.village-visits__item,
.village-met__item { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--c-border-light); }

.village-visits__item:first-child,
.village-met__item:first-child { border-top: 0; }

.village-visits__item strong,
.village-met__item strong { color: var(--c-text); font-size: 0.94rem; font-weight: 600; }

.village-visits__item span,
.village-met__pets { color: var(--c-text-secondary); font-size: 0.8rem; line-height: 1.4; }

.village-met__here { color: var(--c-primary); font-size: 0.8rem; font-weight: 600; }

/* Le mot joint à un cadeau, et le choix du merci. */
.village-inbox__word { color: var(--c-text) !important; font-style: italic; }
.village-inbox__thanks { flex: none; display: grid; gap: 6px; max-width: 46%; }
.village-inbox__thanks .village-look__choice { min-height: 36px; padding: 4px 12px; white-space: normal; line-height: 1.2; }

@media (prefers-reduced-motion: reduce) {
    .village-reply { animation: none; }
    .village-reply__bar i,
    .village-reply__chip { transition: none; }
}

/* Lire le panneau du Refuge (MONDE-6) : la caméra est devant l'affiche (world.closeUp). Ce
   calque reçoit les touchers — toucher à côté des boutons referme —, porte les boutons et la
   version de l'affiche lue par un lecteur d'écran (le dessin 3D, lui, ne se lit pas). */
.village-notice {
    position: absolute;
    inset: calc(var(--village-top-h) + var(--village-safe-top)) 0 0 0;
    z-index: 34;
    cursor: zoom-out;
}

.village-notice[hidden],
.village[data-view="album"] .village-notice { display: none; }

.village-notice__text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.village-notice__bar {
    position: absolute;
    left: 50%;
    bottom: calc(22px + var(--village-safe-bottom));
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: max-content;
    max-width: calc(100% - 24px);
}

.village-notice__cta { display: contents; }

/* Les boutons de la barre sont ceux posés sur la scène (.village-float--lg) ; la croix
   (.village-close), en haut à droite de la vue, comme sur toute fenêtre. */
.village-notice__close {
    position: absolute;
    top: 12px;
    right: max(12px, var(--village-safe-right));
    cursor: pointer;
}

/* Pendant la lecture, rien d'autre à l'écran que l'affiche et ses boutons. */
.village[data-notice] .village-labels,
.village[data-notice] .village-prompt,
.village[data-notice] .village-dock,
.village[data-notice] .village-walk,
.village[data-notice] .village-hint,
.village[data-notice] .village-banner { visibility: hidden; }

/* --------------------------------------------------------------------------
   Le panneau des avis de recherche, lu de près (MONDE-28) : les affichettes
   sont dessinées dans la scène ; un bouton transparent suit chacune à l'écran
   (village-places.js, placeSpots). En haut, de quoi la page se tient.
   -------------------------------------------------------------------------- */
.village-wanted__spots {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.village-wanted__spot {
    position: absolute;
    padding: 0;
    border: 3px solid transparent;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.village-wanted__spot[hidden] { display: none; }
.village-wanted__spot:hover { border-color: rgba(255, 255, 255, 0.85); background: rgba(255, 255, 255, 0.08); }
.village-wanted__spot:active { background: rgba(255, 255, 255, 0.16); }
.village-wanted__spot:focus-visible { outline: none; border-color: var(--c-bg-card); box-shadow: var(--focus-ring); }

.village-wanted__note {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    /* (centrée, elle laisse de chaque côté la place de la croix, en haut à droite) */
    max-width: calc(100% - 136px);
    margin: 0;
    padding: 8px 16px;
    border-radius: var(--r-full);
    background: var(--c-bg-card);
    box-shadow: var(--shadow-lg);
    color: var(--c-text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    pointer-events: none;
}

.village-wanted__note[hidden] { display: none; }

/* (les flèches : des boutons ronds posés sur la scène, .village-float--lg--icon) */
.village-wanted__nav { font-size: 1.5rem; line-height: 1; }
.village-wanted__nav[hidden] { display: none; }

@media (hover: none) and (pointer: coarse) {
    /* Au doigt, on voit d'emblée que chaque affichette se touche. */
    .village-wanted__spot { border-color: rgba(255, 255, 255, 0.5); }
}

@media (prefers-reduced-motion: reduce) {
    .village-wanted__spot { transition: none; }
}

/* ==========================================================================
   Rangements partagés par-dessus la scène — public/js/village.js (buildChrome)
   Les bandeaux du haut s'empilent ; les outils du bas à droite aussi.
   ========================================================================== */

/* Sous la barre du haut : « créez un compte », un rendez-vous qui a commencé… l'un sous
   l'autre, jamais l'un sur l'autre. */
.village-banners {
    position: absolute;
    z-index: 26;
    left: 50%;
    top: calc(var(--village-top-h) + var(--village-safe-top) + 12px);
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: min(560px, calc(100% - 24px));
    pointer-events: none; /* entre deux bandeaux, le toucher va à la scène */
}

.village-banners:empty { display: none; }

.village-banners > .village-banner {
    position: static;
    transform: none;
    max-width: 100%;
    pointer-events: auto;
}

/* Le message fait au visiteur passe au-dessus d'un rendez-vous en cours. */
.village-banner--note { order: -1; }

/* Son bouton est un lien (« Créer mon compte ») ou un geste (« Reprendre ici ») : même allure que
   « S'y rendre » (la pastille commune, lien ou bouton). */
.village-banner__go { white-space: nowrap; }

/* Deux boutons (« Se connecter », « Créer mon compte » — retours du 19/11/2026) sur un téléphone : le
   texte et la croix sur une ligne, les deux boutons dessous ; sinon le texte s'écrivait mot par mot. */
@media (max-width: 520px) {
    .village-banners > .village-banner--two { flex-wrap: wrap; row-gap: 6px; border-radius: var(--r-lg); padding: 8px 6px 8px 14px; }
    .village-banner--two > .village-banner__text { order: 0; flex: 1 1 calc(100% - 52px); }
    .village-banner--two > .village-banner__close { order: 1; }
    .village-banner--two > .village-banner__go { order: 2; flex: 1 1 0; justify-content: center; text-align: center; }
}

/* En bas à droite, l'un au-dessus de l'autre : « vue normale » (quand la vue s'en écarte),
   puis le son. La barre du bas est à gauche, les actions à portée de main au centre. */
.village-tools {
    position: absolute;
    z-index: 30;
    right: max(16px, var(--village-safe-right));
    bottom: calc(18px + var(--village-safe-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.village-tools:empty { display: none; }

/* Le bouton du son, rangé ici, ne se place plus tout seul. */
.village-tools .village-sound { position: static; }

/* (« vue normale » et le son : des boutons ronds posés sur la scène, .village-float--icon) */
.village-tool[hidden],
.village[data-view="album"] .village-tool--view { display: none; }

@media (max-width: 767px) {
    /* Téléphone : dans le coin, sous le pouce. */
    .village-tools {
        right: max(12px, var(--village-safe-right));
        bottom: calc(14px + var(--village-safe-bottom));
    }
    /* La rangée des actions à portée de main (« Caresser », « Jouer ») peut occuper toute la
       largeur : elle passe ENTRE le son, dans le coin, et « vue normale », au-dessus d'elle. */
    .village-tools:not(.is-raised) .village-tool--view:not(:last-child) { margin-bottom: 62px; }
    /* La barre du bas arrive jusqu'au coin (un membre et ses six boutons) : toute la colonne
       passe au-dessus des actions (cf. seatTools). */
    .village-tools.is-raised { bottom: calc(140px + var(--village-safe-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
    .village-tool { transition: none; }
}

/* ==========================================================================
   15 novembre 2026 — la balle se lance au doigt ; « Lieux » ; ajouter un animal ;
   la photo souvenir montrée en entier
   ========================================================================== */

/* --- Viser : la balle à faire glisser, en bas au centre -------------------
   Posée par le socle (cf. « Viser » dans village.js). Seules la balle et sa croix se
   touchent : le reste laisse passer le doigt vers la scène (tourner la caméra, marcher). */
.village-aim {
    --ball: #d4e545; /* la couleur de la balle de la place */
    position: absolute;
    z-index: 32;
    left: 50%;
    bottom: calc(96px + var(--village-safe-bottom));
    translate: -50% 0;
    display: grid;
    justify-items: center;
    gap: 12px;
    pointer-events: none;
    animation: village-aim-in 200ms var(--ease-out);
}

.village-aim[hidden],
.village[data-view="album"] .village-aim { display: none; }

@keyframes village-aim-in {
    from { opacity: 0; translate: -50% 10px; }
    to { opacity: 1; translate: -50% 0; }
}

.village-aim__hint {
    margin: 0;
    padding: 6px 14px;
    border-radius: var(--r-full);
    background: rgba(24, 46, 43, 0.74);
    color: var(--c-text-inverse);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.village-aim__pad {
    position: relative;
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
}

/* La jauge : un anneau qui s'épaissit et s'élargit avec la force du geste. */
.village-aim__pad::before {
    content: '';
    position: absolute;
    inset: 0;
    border: calc(3px + var(--aim-p, 0) * 6px) solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(24, 46, 43, 0.12);
    scale: calc(1 + var(--aim-p, 0) * 0.3);
    transition: border-color 160ms var(--ease-out);
}

.village-aim.is-max .village-aim__pad::before { border-color: var(--ball); }
.village-aim.is-blocked .village-aim__pad::before { border-style: dashed; opacity: 0.6; }

.village-aim__ball {
    position: relative;
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--c-bg-card);
    box-shadow: var(--shadow-lg);
    cursor: grab;
    pointer-events: auto;
    touch-action: none; /* le geste est le lancer : ni défilement ni zoom */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    transition: translate 260ms cubic-bezier(0.34, 1.56, 0.64, 1); /* lâchée, elle revient à sa place d'un petit rebond */
}

.village-aim.is-drag .village-aim__ball { cursor: grabbing; transition: none; }
.village-aim__ball:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-lg); }
.village-aim__glyph { font-size: 2.1rem; line-height: 1; pointer-events: none; }

/* Ranger la balle : une croix discrète, à droite (cible de 44 px). */
.village-aim__stop {
    position: absolute;
    left: calc(100% + 6px);
    top: 50%;
    translate: 0 -50%;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--c-text-inverse);
    cursor: pointer;
    pointer-events: auto;
}

.village-aim__stop::before {
    content: '';
    position: absolute;
    inset: 6px;
    z-index: -1;
    border-radius: 50%;
    background: rgba(24, 46, 43, 0.6);
}

.village-aim__stop:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.village-aim.is-drag .village-aim__stop { visibility: hidden; }

/* La balle à lancer prend la place de la bulle d'aide. */
.village[data-aim] .village-hint { display: none; }

@media (max-width: 767px) {
    .village-aim { bottom: calc(84px + var(--village-safe-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
    .village-aim { animation: none; }
    .village-aim__ball,
    .village-aim__pad::before { transition: none; }
}

/* --- « Lieux » : la fenêtre où l'on choisit où aller ----------------------- */
.village-places .village-gestures__item { min-height: 84px; padding: 8px 6px; }

/* --- Photo souvenir : montrée EN ENTIER ------------------------------------
   Une photo au format portrait, rognée en bandeau par la fiche, n'était plus la photo
   (retour d'Anthony, 15 novembre 2026 : « tronquée, on n'a pas envie de la partager »). */
.village-sheet .village-sheet__photo--full {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(58vh, 520px);
    aspect-ratio: auto;
    margin: 0 auto;
    background: none;
    box-shadow: var(--shadow-md);
    object-fit: contain;
}

@media (max-width: 767px) {
    .village-sheet:has(.village-sheet__photo--full) { max-height: 92%; }
    .village-sheet .village-sheet__photo--full { max-height: 50vh; }
}

/* --- Ajouter un animal, sans quitter le Village ------------------------------ */
.village-add { margin-top: 12px; }
.village-add__open { margin-top: 10px; }

.village-add__photo {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 6px;
    width: max-content;
    margin: 0 auto 14px;
    cursor: pointer;
}

/* Le champ de fichier reste atteignable au clavier, sans se voir. */
.village-add__photo input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.village-add__round {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    overflow: hidden;
    border: 2px dashed var(--c-border);
    border-radius: 50%;
    background: var(--c-primary-light);
    color: var(--c-primary);
}

.village-add__photo.has-photo .village-add__round { border: 3px solid var(--c-accent); }
.village-add__round img { width: 100%; height: 100%; object-fit: cover; }
.village-add__photo.is-busy .village-add__round img { opacity: 0.45; }
.village-add__photo:focus-within .village-add__round { box-shadow: var(--focus-ring); }
.village-add__caption { color: var(--c-primary); font-size: 0.86rem; font-weight: 600; }

.village-add__group { margin: 0 0 12px; }
.village-add__died { margin: 8px 0 0; }

/* « Ajouter une photo » d'un animal, dans « Mes animaux » : un bouton qui ouvre le choix d'une image. */
.village-home__addphoto { position: relative; margin-top: 10px; cursor: pointer; }
.village-home__addphoto input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.village-home__addphoto:focus-within { box-shadow: var(--focus-ring); }
.village-home__addphoto.is-busy { opacity: 0.6; cursor: progress; }
.village-add__breed { margin: 0 0 12px; }
.village-add__breed .village-home__field { margin: 0; }
.village-add__breed input.is-set { border-color: var(--c-primary); }

.village-add__suggest {
    display: grid;
    gap: 2px;
    margin-top: 4px;
    padding: 4px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-bg-card);
    box-shadow: var(--shadow-md);
}

.village-add__suggest[hidden] { display: none; }

.village-add__option {
    min-height: 44px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--r-sm);
    background: none;
    color: var(--c-text);
    font: inherit;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
}

.village-add__option:hover,
.village-add__option:focus-visible { outline: none; background: var(--c-primary-light); }

/* Le champ de date d'un iPhone : même hauteur et même alignement que les autres. */
.village-add .village-home__field input[type="date"] {
    display: block;
    -webkit-appearance: none;
    appearance: none;
    text-align: left;
}

.village-add .village-btn:disabled { opacity: 0.6; cursor: default; }

/* Pendant que l'on vise, ce qui se pose d'habitude au même endroit passe au-dessus de la balle :
   la réponse proposée à une phrase que l'on vous adresse, le compteur de la promenade solidaire. */
.village[data-aim] .village-reply,
.village[data-aim]:has(.village-walk:not([hidden])) .village-reply { bottom: calc(232px + var(--village-safe-bottom)); }
.village[data-aim] .village-walk { bottom: calc(232px + var(--village-safe-bottom)); }
.village[data-aim]:has(.village-reply:not([hidden])) .village-walk { display: none; }

@media (max-width: 767px) {
    .village[data-aim] .village-reply,
    .village[data-aim]:has(.village-walk:not([hidden])) .village-reply { bottom: calc(220px + var(--village-safe-bottom)); }
    .village[data-aim] .village-walk { bottom: calc(220px + var(--village-safe-bottom)); }
}

/* Les gestes en haut de la fiche d'un animal, juste sous son nom (plus tout en bas : sur
   téléphone il fallait faire défiler la fiche pour les atteindre). */
.village-gestures--top { margin: 10px 0; }

/* ==========================================================================
   La visite guidée (MONDE-10 — village-tuto.js)
   ========================================================================== */

/* La carte : dans la pile des bandeaux du haut, au-dessus des autres. Elle garde le cadre
   d'un bandeau (bord, ombre, masquée en album et dans le jardin du souvenir) mais se lit
   comme une carte : titre, deux phrases, boutons. Tout le bas de l'écran reste libre —
   barre du bas, actions à portée de main — pour que l'on puisse essayer pendant qu'elle parle. */
.village-banners > .village-tuto {
    order: -2;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 440px;
    max-width: 100%;
    padding: 10px 12px 14px 16px;
    border-radius: var(--r-xl);
    font-size: 0.94rem;
    font-weight: 400;
    animation: village-tuto-in 260ms var(--ease-out);
}

@keyframes village-tuto-in {
    from { opacity: 0; translate: 0 -8px; }
    to { opacity: 1; translate: 0 0; }
}

/* Pendant la visite, les autres bandeaux se taisent (« créez un compte » : la dernière carte le
   dit ; un rendez-vous en cours : il revient à la fin). Sur téléphone, la carte et un bandeau
   l'un sous l'autre prenaient près de la moitié de l'écran. */
.village[data-tuto] .village-banners > .village-banner:not(.village-tuto) { display: none; }

.village-tuto__head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.village-tuto__eyebrow {
    color: var(--c-primary);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.village-tuto__dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}

.village-tuto__dots i {
    width: 6px;
    height: 6px;
    border-radius: var(--r-full);
    background: var(--c-border);
    transition: width 200ms var(--ease-out), background-color 200ms var(--ease-out);
}

.village-tuto__dots i.is-done { background: var(--c-primary); opacity: 0.45; }
.village-tuto__dots i.is-on { width: 18px; background: var(--c-primary); }

/* La carte de première visite d'un lieu (MONDE-31) : la même, en une étape — ni points d'étape
   (display: inline-flex écraserait l'attribut hidden), et la croix reste à droite. */
.village-tuto__dots[hidden] { display: none; }
.village-tuto--first .village-tuto__close { margin-left: auto; }
/* Au jardin du souvenir, les bandeaux se taisent (son panneau les remplace) — sauf celle-ci, que
   village-tuto.js pose sous ce panneau quand ils se chevauchent (téléphone). */
.village[data-place="memorial"] .village-banners > .village-tuto--first:not([hidden]) { display: flex; }

.village-tuto__body { padding-right: 4px; }

.village-tuto__title {
    margin: 0 0 4px;
    color: var(--c-text);
    font-family: var(--f-display);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.25;
}

.village-tuto__text {
    margin: 0;
    color: var(--c-text-secondary);
    line-height: 1.45;
}

.village-tuto__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
    padding-right: 4px;
}

/* Ses boutons sont ceux des fenêtres (.village-btn--primary / --ghost) : la carte se lit comme une fenêtre. */
.village-tuto__btn { white-space: nowrap; }

/* L'anneau : entoure le bouton dont la carte parle (« Dire », la cagnotte, « Lieux »). Posé
   par-dessus sans rien capter : le bouton se touche à travers lui. */
.village-tuto-ring {
    position: absolute;
    z-index: 46;
    border: 2px solid var(--c-primary);
    border-radius: var(--r-full);
    pointer-events: none;
    animation: village-tuto-ring 1.4s ease-in-out infinite;
}

.village-tuto-ring[hidden],
.village[data-view="album"] .village-tuto-ring { display: none; }

@keyframes village-tuto-ring {
    0%, 100% { box-shadow: 0 0 0 2px rgba(24, 79, 82, 0.28); }
    50% { box-shadow: 0 0 0 9px rgba(24, 79, 82, 0); }
}

/* L'habitant dont la carte parle : son médaillon bat, son nom passe en couleur. */
.village-labels .is-tuto .vl-photo {
    outline: 3px solid var(--c-primary);
    outline-offset: 3px;
    animation: village-tuto-beat 1.3s ease-in-out infinite;
}

.village-labels .is-tuto .vl-name {
    display: block; /* même de loin, on lit de qui l'on parle */
    background: var(--c-primary);
    color: var(--c-text-inverse);
}

@keyframes village-tuto-beat {
    50% { outline-offset: 7px; outline-color: rgba(24, 79, 82, 0.3); }
}

@media (max-width: 520px) {
    .village-banners > .village-tuto { width: 100vw; }
    .village-tuto__btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .village-banners > .village-tuto,
    .village-tuto-ring,
    .village-labels .is-tuto .vl-photo { animation: none; }
    .village-tuto__dots i,
    .village-tuto__btn { transition: none; }
}

/* ==========================================================================
   Créer son compte sans quitter le Village (MONDE-11 — village-join.js)
   ========================================================================== */

/* Le panneau : par-dessus tout (écran d'accueil compris), la place reste visible derrière.
   Il encadre la page /village/join/ — le formulaire n'est pas ici. Aucune fermeture au toucher
   du fond : on ne perd pas ce que l'on est en train de saisir. */
.village-join {
    position: absolute;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    padding: 16px;
    background: var(--village-scrim);
    animation: village-join-in 200ms var(--ease-out);
}

@keyframes village-join-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.village-join__panel {
    display: flex;
    flex-direction: column;
    width: min(460px, 100%);
    height: min(660px, 100%);
    overflow: hidden;
    border-radius: var(--r-xl);
    background: var(--c-bg-card);
    box-shadow: var(--shadow-xl);
}

.village-join__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 8px 20px;
    border-bottom: 1px solid var(--c-border-light);
}

.village-join__title {
    flex: 1;
    margin: 0;
    color: var(--c-text);
    font-family: var(--f-display);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.25;
}

/* (sa croix : la croix commune, sans fond — .village-close--flat) */

.village-join__status {
    margin: 0;
    padding: 16px 20px;
    color: var(--c-text-secondary);
    font-size: 0.94rem;
    line-height: 1.45;
}

.village-join__frame {
    flex: 1;
    min-height: 0;
    width: 100%;
    border: 0;
    background: var(--c-bg-card);
}

.village-join__status[hidden],
.village-join__frame[hidden] { display: none; }

.village-join__foot {
    margin: 0;
    padding: 10px 20px 12px;
    border-top: 1px solid var(--c-border-light);
    font-size: 0.8rem;
    text-align: center;
}

/* Sur l'écran d'accueil, sous « Entrer » : « J'ai déjà un compte ». */
.village-intro__login {
    margin: 2px 0 0;
    text-align: center;
}

/* (c'est un bouton — il ouvre le panneau — qui a l'allure d'un lien : .village-link s'en charge) */

@media (max-width: 767px) {
    /* Téléphone : plein écran, comme une page — le clavier et le défilement s'y comportent bien. */
    .village-join { padding: 0; }
    .village-join__panel { width: 100%; height: 100%; border-radius: 0; }
    .village-join__head { padding-top: calc(8px + var(--village-safe-top)); }
    .village-join__foot { padding-bottom: calc(12px + var(--village-safe-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
    .village-join { animation: none; }
}

/* Lancement : messages longs du jardin repliés au-delà de cinq lignes, et bouton « Quitter » du cadre de l'app. */
.village-messages__text.is-folded {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.village-messages__more {
    margin: 2px 0 0;
    padding: 6px 0;
    min-height: 44px;
    border: 0;
    background: none;
    color: var(--c-primary);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* « Quitter » (le Village affiché dans l'app) : un bouton à icône comme les autres boutons de la
   barre du haut, à gauche, à la place du logo — sur téléphone la barre garde ainsi une seule
   ligne, comme dans Safari (avec son texte à côté du logo, elle passait à trois lignes). */
.village-quit { white-space: nowrap; flex: 0 0 auto; }
.village[data-frame="app"] .village-brand { display: none; }

/* --------------------------------------------------------------------------
   Écran tactile : rien ne se sélectionne
   --------------------------------------------------------------------------
   Un appui long ou un glissé pendant qu'on se déplace sélectionnait la page — dans l'app,
   le cadre entier se couvrait d'une surbrillance bleue impossible à retirer (retour d'Anthony,
   2026-11-16). Sur un écran tactile, plus de sélection ni de menu d'appui long ; les champs
   de saisie gardent la leur. À la souris, rien ne change : on peut toujours copier un texte. */
@media (pointer: coarse) {
    .village-page,
    .village-page * {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
    .village-page input,
    .village-page textarea,
    .village-page [contenteditable="true"] {
        -webkit-user-select: text;
        user-select: text;
    }
}

/* ==========================================================================
   Le jardin du souvenir — les pierres (public/js/village-places.js)
   La photo du compagnon est SUR sa pierre (dessinée dans l'image 3D) ; on touche la pierre,
   la caméra vient devant elle (world.closeUp), et ce calque porte ce qui l'entoure : ses
   photos à faire défiler, la bougie, la fleur, le mot, les mots laissés, le partage.
   ========================================================================== */

/* L'étiquette d'une pierre ne porte que le nom (la cible tactile reste de 44 px). Elle ne
   garde la photo que si celle-ci n'a pas pu être posée sur la pierre (classe has-photo). */
.vl-pet.is-memorial:not(.has-photo) { min-height: 44px; justify-content: flex-end; }
.vl-pet.is-memorial:not(.has-photo) .vl-photo { display: none; }
.vl-pet.is-memorial:not(.has-photo) .vl-name { padding: 4px 12px; box-shadow: var(--shadow-md); }
.vl-pet.is-memorial:hover .vl-name { background: var(--c-bg-card); }

/* À la souris, une pierre qui se touche le dit. */
.village-canvas.is-pointing { cursor: pointer; }

.village-tomb {
    position: absolute;
    inset: calc(var(--village-top-h) + var(--village-safe-top)) 0 0 0;
    z-index: 34;
    display: grid;
    grid-template-columns: minmax(0, 1fr) min(400px, 40%);
}

.village-tomb[hidden],
.village[data-view="album"] .village-tomb { display: none; }

/* La scène : la part de l'écran où l'on voit la pierre. Toucher passe de la pierre à sa plaque. */
.village-tomb__stage {
    position: relative;
    min-width: 0;
    min-height: 0;
    cursor: zoom-in;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.village-tomb.is-near .village-tomb__stage { cursor: zoom-out; }

/* Retour, loupe et flèches : les boutons posés sur la scène (.village-float), à leur place. */
.village-tomb__back,
.village-tomb__zoom,
.village-tomb__nav { position: absolute; }

.village-tomb__back { top: 12px; left: max(12px, var(--village-safe-left)); }
.village-tomb__zoom { top: 12px; right: 12px; }
.village-tomb__nav { top: 46%; transform: translateY(-50%); }
.village-tomb__nav--prev { left: max(12px, var(--village-safe-left)); }
.village-tomb__nav--next { right: 12px; }
.village-tomb__nav[hidden] { display: none; }
/* (les flèches sont centrées par `transform` : leur appui le garde) */
.village-tomb__nav:active { transform: translateY(-50%) scale(0.94); }

.village-tomb__dots {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    padding: 7px 10px;
    border-radius: var(--r-full);
    background: rgba(15, 32, 34, 0.42);
    pointer-events: none;
}

.village-tomb__dots[hidden] { display: none; }
.village-tomb__dot { width: 7px; height: 7px; border-radius: var(--r-full); background: rgba(255, 255, 255, 0.5); transition: background-color 200ms, transform 200ms var(--ease-out); }
.village-tomb__dot.is-on { background: #ffffff; transform: scale(1.3); }

/* Ce que l'on vient de faire, dit au-dessus de la pierre. */
.village-tomb__said {
    position: absolute;
    left: 50%;
    bottom: 48px;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 12px;
    width: max-content;
    max-width: calc(100% - 28px);
    margin: 0;
    padding: 11px 18px;
    border-radius: var(--r-lg);
    background: rgba(18, 62, 62, 0.95);
    box-shadow: var(--shadow-lg);
    color: var(--c-text-inverse);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    animation: village-tomb-said 320ms var(--ease-out);
}

.village-tomb__said[hidden] { display: none; }
.village-tomb__join { color: var(--c-text-inverse); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

@keyframes village-tomb-said {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* Le panneau : qui il est, ce que l'on dépose, les mots laissés. */
.village-tomb__panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    margin: 12px max(12px, var(--village-safe-right)) calc(12px + var(--village-safe-bottom)) 0;
    padding: 22px 20px;
    border: 1px solid var(--c-border-light);
    border-radius: var(--r-xl);
    background: var(--c-bg-card);
    box-shadow: var(--shadow-xl);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    animation: village-tomb-panel 380ms var(--ease-out);
}

@keyframes village-tomb-panel {
    from { opacity: 0; transform: translateX(18px); }
    to { opacity: 1; transform: none; }
}

.village-tomb__head { display: grid; gap: 4px; padding-right: 40px; }

/* La croix (.village-close) : accrochée en haut du panneau (il défile), sans y prendre de place
   (marge du bas négative = sa hauteur + l'écart entre les éléments du panneau). */
.village-tomb__close {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: -10px -8px -60px auto;
}
.village-tomb__eyebrow { margin: 0; color: var(--c-text-secondary); font-size: 0.8rem; font-weight: 600; }
.village-tomb__name { margin: 0; color: var(--c-text); font-family: var(--f-display); font-size: 2rem; font-weight: 600; line-height: 1.1; overflow-wrap: anywhere; }
.village-tomb__since { margin: 0; color: var(--c-text-secondary); font-size: 0.92rem; }
.village-tomb__head .village-word { margin: 10px 0 0; }

/* Sa photo, quand elle n'a pas pu être posée sur la pierre. */
.village-tomb__photo { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r-md); object-fit: cover; background: var(--c-primary-light); }
.village-tomb__photo[hidden] { display: none; }

/* Ce que l'on dépose : une bougie, une fleur, un mot — et la partager. */
.village-tomb__gifts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: 8px; }

.village-tomb__gift {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 12px 4px 10px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: var(--c-bg);
    color: var(--c-text);
    font: inherit;
    cursor: pointer;
    transition: transform 160ms var(--ease-out), border-color 160ms, background-color 160ms;
}

.village-tomb__gift:hover { border-color: var(--c-primary); background: var(--c-bg-card); }
.village-tomb__gift:active { transform: scale(0.96); }
.village-tomb__gift:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.village-tomb__gift-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: var(--r-full);
    background: var(--c-bg-card);
    box-shadow: var(--shadow-sm);
    color: var(--c-primary);
    transition: background-color 200ms, color 200ms;
}

.village-tomb__gift[data-kind="candle"] .village-tomb__gift-icon { background: var(--c-accent-light); }
.village-tomb__gift.is-done .village-tomb__gift-icon { background: var(--c-primary); color: var(--c-text-inverse); }
.village-tomb__gift-label { max-width: 100%; color: var(--c-text); font-size: 0.82rem; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.village-tomb__gift.is-done .village-tomb__gift-label { color: var(--c-text-secondary); }

.village-tomb__gift-count,
.village-tomb__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border-radius: var(--r-full);
    background: var(--c-primary);
    color: var(--c-text-inverse);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.village-tomb__gift-count { position: absolute; top: -5px; right: -9px; border: 2px solid var(--c-bg); }
.village-tomb__gift.is-done .village-tomb__gift-count { background: var(--c-bg-card); color: var(--c-primary); border-color: var(--c-primary); }

/* Le partage : l'image de la pierre, puis ce que l'on peut en faire. */
.village-tomb__share { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--c-border-light); border-radius: var(--r-lg); background: var(--c-bg); }
.village-tomb__share[hidden] { display: none; }
.village-tomb__shot { display: block; width: min(220px, 62%); margin: 0 auto; border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
.village-tomb__share-acts { display: grid; gap: 8px; justify-items: stretch; }
.village-tomb__share-acts .village-link { justify-self: center; }
.village-tomb__note { margin: 0; color: var(--c-text-secondary); font-size: 0.9rem; line-height: 1.5; }

/* Les mots laissés. La colonne est bornée à la largeur du panneau (minmax(0, 1fr)) et le titre
   passe à la ligne : un nom long (« Messages laissés pour Bichon Del Green ») élargissait sinon
   la colonne, et tout le panneau défilait en largeur. */
.village-tomb__words { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }

.village-tomb__words-title {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--c-text);
    font: inherit;
    font-family: var(--f-display);
    font-size: 1.12rem;
    font-weight: 600;
    text-align: left;
    cursor: default;
}

.village-tomb__words-title > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.village-tomb__words-title .village-tomb__badge { flex: none; }
.village-tomb__words-title svg { display: none; margin-left: auto; flex: none; color: var(--c-text-secondary); transition: transform 200ms var(--ease-out); }
.village-tomb__words-title:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }
.village-tomb__words-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.village-tomb__words .village-messages,
.village-tomb__words .village-msgform { margin: 0; }
.village-tomb__words .village-messages__item { padding: 12px 14px; border: 1px solid var(--c-border-light); border-radius: var(--r-md); background: var(--c-bg); }
.village-tomb__words .village-messages__item + .village-messages__item { margin-top: 8px; }
.village-tomb__words .village-messages__text { font-size: 0.96rem; line-height: 1.5; }

/* Pendant que l'on regarde une pierre, rien d'autre à l'écran qu'elle et ce qui l'entoure. */
.village[data-tomb] .village-labels,
.village[data-tomb] .village-prompt,
.village[data-tomb] .village-dock,
.village[data-tomb] .village-walk,
.village[data-tomb] .village-hint,
.village[data-tomb] .village-banners,
.village[data-tomb] .village-banner,
.village[data-tomb] .village-garden,
.village[data-tomb] .village-tools { visibility: hidden; }

/* Téléphone : la pierre en haut, le panneau en bas. Replié, il ne montre que le nom, ce que
   l'on dépose et le titre des mots ; on le déplie pour lire les mots (classe is-wide). */
@media (max-width: 767px) {
    .village-tomb { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }

    .village-tomb__panel {
        gap: 12px;
        max-height: 100%;
        margin: 0;
        padding: 14px 16px calc(14px + var(--village-safe-bottom));
        border-width: 1px 0 0;
        border-radius: var(--r-xl) var(--r-xl) 0 0;
        animation-name: village-tomb-rise;
    }

    .village-tomb.is-wide { grid-template-rows: minmax(0, 1fr) minmax(0, 62%); }
    .village-tomb.is-wide .village-tomb__dots,
    .village-tomb.is-wide .village-tomb__zoom { display: none; }
    .village-tomb__name { font-size: 1.5rem; }
    .village-tomb__close { margin: -6px -8px -56px auto; }
    .village-tomb__gift { padding: 9px 2px 8px; gap: 5px; }
    .village-tomb__gift-icon { width: 42px; height: 42px; }
    .village-tomb__words-title { min-height: 44px; margin: -6px 0; cursor: pointer; }
    .village-tomb__words-title svg { display: block; }
    .village-tomb.is-wide .village-tomb__words-title svg { transform: rotate(180deg); }
    .village-tomb:not(.is-wide) .village-tomb__words-body,
    .village-tomb:not(.is-wide) .village-tomb__since,
    .village-tomb:not(.is-wide) .village-tomb__head .village-word { display: none; }
    .village-tomb__nav { top: 50%; }
    .village-tomb__said { bottom: 44px; }
}

@keyframes village-tomb-rise {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .village-tomb__panel,
    .village-tomb__said { animation: none; }
    .village-tomb__back,
    .village-tomb__close,
    .village-tomb__zoom,
    .village-tomb__nav,
    .village-tomb__gift,
    .village-tomb__dot,
    .village-tomb__words-title svg { transition: none; }
}

/* --------------------------------------------------------------------------
   Qui est là, et le rejoindre (MONDE-23)
   Le compteur des présents (barre du haut) est un bouton : il s'ouvre sur la liste de ceux qui
   sont au Woopets Village (module village-people.js). Tant que le relais ne sait pas la donner,
   il ne fait rien et n'en a pas l'air (pas de classe `is-list`).
   -------------------------------------------------------------------------- */

button.village-people {
    font: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.4;
    cursor: default;
    -webkit-tap-highlight-color: transparent;
}

button.village-people.is-list {
    cursor: pointer;
    transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

button.village-people:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Une petite flèche : la pastille s'ouvre (sur ordinateur ; la barre d'un téléphone est pleine). */
button.village-people.is-list::after {
    content: '';
    width: 6px;
    height: 6px;
    margin: -3px 1px 0 2px;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.7;
}

@media (hover: hover) {
    button.village-people.is-list:hover { border-color: var(--c-primary); background: var(--c-primary-light); }
}

@media (max-width: 767px) {
    button.village-people.is-list::after { display: none; }
}

.village-who__lede { margin-bottom: 2px; color: var(--c-text-secondary); font-size: 0.85rem; }

.village-sheet__eyebrow.village-who__title { margin-top: 14px; margin-bottom: 0; }

.village-who { margin: 0; padding: 0; list-style: none; }

.village-who__row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid var(--c-border-light);
}

.village-who__row:first-child { border-top: 0; }

/* À la couleur de sa veste, avec son initiale (le numéro, pour un visiteur). */
.village-who__dot {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--r-full);
    background: var(--who-c, var(--c-primary));
    color: var(--c-text-inverse);
    font-size: 0.9rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(10, 30, 20, 0.35);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.village-who__body { flex: 1; min-width: 0; display: grid; gap: 1px; }

.village-who__name {
    overflow: hidden;
    color: var(--c-text);
    font-size: 0.94rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.village-who__where { color: var(--c-text-secondary); font-size: 0.8rem; line-height: 1.35; }

/* « Rejoindre » (--primary) et « Voir » : l'action de la ligne, une pastille (.village-chip). */
.village-who__go { flex: none; }

.village-who__note { margin: 10px 0 0; color: var(--c-text-secondary); font-size: 0.8rem; }

@media (prefers-reduced-motion: reduce) {
    button.village-people.is-list { transition: none; }
}

/* ── Les repères d'action (world.mark, règle des lieux : docs/village-regles-lieux.md) ─────────
   Une pastille ronde qui flotte et rebondit au-dessus de ce que l'on peut faire, quand on s'en
   approche (comme dans un jeu vidéo) ; plus nette et teal à portée d'action (is-near). Le `.vl`
   porte la position (transform posé par updateLabels) : l'animation est sur l'intérieur. */
.vl-mark { pointer-events: auto; cursor: pointer; padding: 0 0 10px; }
.vl-mark[hidden] { display: none; }
.vl-mark__glyph {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--c-bg-card);
    border: 2px solid var(--c-primary-light);
    box-shadow: var(--shadow-md);
    font-size: 20px;
    line-height: 1;
    opacity: 0.82;
    animation: vl-mark-bob 1.6s ease-in-out infinite;
    transition: opacity 160ms linear, background-color 160ms linear, border-color 160ms linear, transform 160ms ease-out;
}
/* La petite pointe sous la pastille : elle désigne l'objet. */
.vl-mark__glyph::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    background: inherit;
    border-right: 2px solid var(--c-primary-light);
    border-bottom: 2px solid var(--c-primary-light);
    transform: rotate(45deg);
    border-radius: 0 0 3px 0;
}
.vl-mark__glyph { position: relative; }
.vl-mark.is-near .vl-mark__glyph {
    opacity: 1;
    border-color: var(--c-primary);
    animation: vl-mark-bob 0.9s ease-in-out infinite, vl-mark-ring 1.4s ease-out infinite;
}
.vl-mark.is-near .vl-mark__glyph::after { border-color: var(--c-primary); }
.vl-mark:focus-visible { outline: none; }
.vl-mark:focus-visible .vl-mark__glyph { box-shadow: var(--focus-ring), var(--shadow-md); }
@keyframes vl-mark-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}
@keyframes vl-mark-ring {
    0% { box-shadow: var(--shadow-md), 0 0 0 0 rgba(24, 79, 82, 0.38); }
    70% { box-shadow: var(--shadow-md), 0 0 0 12px rgba(24, 79, 82, 0); }
    100% { box-shadow: var(--shadow-md), 0 0 0 0 rgba(24, 79, 82, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .vl-mark__glyph, .vl-mark.is-near .vl-mark__glyph { animation: none; }
}
