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

   Le bloc :root est un MIROIR d'un sous-ensemble de demo-core.css (mêmes noms,
   mêmes valeurs) — À GARDER EN SYNC à chaque refonte de palette, comme guide.css.
   Les couleurs du décor 3D, elles, vivent dans public/js/village.js (PALETTE).
   ========================================================================== */

@font-face {
    font-family: 'Fraunces';
    src: url('/fonts/fraunces-latin-600-normal.woff2') format('woff2');
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

:root {
    --c-primary: #1b555c;
    --c-primary-hover: #134148;
    --c-primary-light: #dcf0ed;
    --c-accent: #f7ab77;
    --c-accent-light: #fcf0e9;
    --c-accent-vivid: #ff7a59;
    --c-accent-vivid-hover: #e85a3a;
    --c-bg: #f0f9f9;
    --c-bg-warm: #e2f1ef;
    --c-bg-card: #ffffff;
    --c-text: #131516;
    --c-text-secondary: #545454;
    --c-text-inverse: #ffffff;
    --c-border: #cce7e3;
    --c-border-light: #dde8e4;
    --c-danger: #dc2626;

    --shadow-xs: 0 1px 2px rgba(10, 30, 20, 0.04);
    --shadow-sm: 0 1px 3px rgba(10, 30, 20, 0.06), 0 1px 2px rgba(10, 30, 20, 0.04);
    --shadow-md: 0 4px 12px rgba(10, 30, 20, 0.08), 0 2px 4px rgba(10, 30, 20, 0.04);
    --shadow-lg: 0 8px 24px rgba(10, 30, 20, 0.1), 0 2px 4px rgba(10, 30, 20, 0.04);
    --shadow-xl: 0 20px 48px rgba(10, 30, 20, 0.14);
    --focus-ring: 0 0 0 3px rgba(27, 85, 92, 0.3);

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 20px;
    --r-full: 9999px;

    --f-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --f-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    --village-top-h: 56px;
    --village-mat: rgba(240, 249, 249, 0.86);
}

*,
*::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%, #f0f9f9 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); }

/* --------------------------------------------------------------------------
   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) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-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: #1b555c;
    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-text);
    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);
}

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

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

.village-intro {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: calc(var(--village-top-h) + env(safe-area-inset-top) + 16px) 16px calc(16px + env(safe-area-inset-bottom));
    background: linear-gradient(rgba(240, 249, 249, 0.5), rgba(240, 249, 249, 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 + env(safe-area-inset-bottom)); color: var(--c-text-secondary); }

.village-toast {
    top: calc(var(--village-top-h) + env(safe-area-inset-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) + env(safe-area-inset-top) + 16px);
    width: 348px;
    max-height: calc(100% - var(--village-top-h) - env(safe-area-inset-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 {
    position: absolute;
    top: 22px;
    right: 22px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--r-full);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-sm);
    color: var(--c-text);
    cursor: pointer;
}

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

.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) + env(safe-area-inset-top)) 0 0 0;
    z-index: 20;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px max(16px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-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 + env(safe-area-inset-bottom));
    z-index: 50;
    padding: 6px 10px;
    border-radius: var(--r-sm);
    background: rgba(19, 21, 22, 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 + env(safe-area-inset-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 + env(safe-area-inset-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,
    .vl-photo,
    .village-card { transition: 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;
}

.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; }

/* 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, env(safe-area-inset-left));
    bottom: calc(18px + env(safe-area-inset-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; }

.village-dock__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    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;
    cursor: pointer;
    transition: border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.village-dock__btn:hover { border-color: var(--c-primary); }
.village-dock__btn:active { transform: scale(0.97); }
.village-dock__btn:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-md); }

/* 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. */
.village-dock__btn--cta { text-decoration: none; }

/* L'aide de départ passe au-dessus de la barre du bas. */
.village[data-dock] .village-hint { bottom: calc(76px + env(safe-area-inset-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); }

.village-look__choice {
    min-height: 40px;
    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;
    cursor: pointer;
}

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

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

/* 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, env(safe-area-inset-left)); bottom: calc(14px + env(safe-area-inset-bottom)); }
    .village[data-dock] .village-hint { bottom: calc(70px + env(safe-area-inset-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); }

/* 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='%231b555c' 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(19, 21, 22, 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 + env(safe-area-inset-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);
}

/* 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);
}

.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 + env(safe-area-inset-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 + env(safe-area-inset-bottom));
    width: min(400px, calc(100% - 24px));
    max-height: none;
    padding: 12px 16px 6px;
    translate: -50% 0;
}

.village-sheet--quick .village-sheet__close { top: 8px; right: 8px; 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; }

.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 + env(safe-area-inset-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) + env(safe-area-inset-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; }

.village-banner__go {
    flex: none;
    min-height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--r-full);
    background: var(--c-primary);
    color: var(--c-text-inverse);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.village-banner__go:hover { background: var(--c-primary-hover); }

.village-banner__close {
    flex: none;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--c-text-secondary);
    cursor: pointer;
}

.village-banner__close:hover { background: var(--c-bg-warm); }
.village-banner__go:focus-visible,
.village-banner__close:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* 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) + env(safe-area-inset-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 : combien ils sont, chercher, changer d'allée, sortir. */
.village-garden {
    position: absolute;
    z-index: 26;
    left: max(16px, env(safe-area-inset-left));
    top: calc(var(--village-top-h) + env(safe-area-inset-top) + 12px);
    display: grid;
    gap: 10px;
    width: 300px;
    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[hidden],
.village[data-view="album"] .village-garden,
.village[data-place="memorial"] .village-banner { display: none; }

.village-garden__head { display: grid; gap: 2px; }
.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;
}

.village-garden__arrow {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--c-border);
    border-radius: 50%;
    background: var(--c-bg-card);
    color: var(--c-primary);
    cursor: pointer;
}

.village-garden__arrow:hover:not([disabled]) { border-color: var(--c-primary); }
.village-garden__arrow[disabled] { opacity: 0.4; cursor: default; }
.village-garden__arrow:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* 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 : le bandeau tient sur deux lignes, en pleine largeur sous la barre du haut. */
    .village-garden {
        left: 8px;
        right: 8px;
        top: calc(var(--village-top-h) + env(safe-area-inset-top) + 8px);
        width: auto;
        grid-template-columns: 1fr auto;
        gap: 8px;
        padding: 10px;
    }
    .village-garden__head { grid-column: 1; }
    .village-garden > .village-btn { grid-column: 2; grid-row: 1; min-height: 40px; padding: 0 12px; }
    .village-garden__search { grid-column: 1; }
    .village-garden__pager { grid-column: 2; gap: 4px; }
    .village-garden__pager span { display: none; }
    .village-garden__arrow { width: 40px; height: 40px; }
}

@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).
   ========================================================================== */

/* Liseré de la pièce : même valeur que --c-accent-hover de demo-core.css (miroir, cf. en-tête). */
:root { --c-accent-hover: #ec8e4f; }

/* 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);
}

.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); }

.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(27, 85, 92, 0.3); }
    .village-wallet__missions { padding-left: 0; border-left: 0; }
    /* 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). */
.village-sound {
    position: absolute;
    z-index: 30;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(18px + env(safe-area-inset-bottom));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    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);
    cursor: pointer;
    transition: border-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.village-sound[hidden] { display: none; }
.village-sound:hover { border-color: var(--c-primary); }
.village-sound:active { transform: scale(0.96); }
.village-sound:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-md); }
.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, env(safe-area-inset-right));
        bottom: calc(140px + env(safe-area-inset-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) + env(safe-area-inset-top) + 12px);
    display: grid;
    gap: 8px;
    width: min(340px, calc(100% - 24px));
    max-height: calc(100% - var(--village-top-h) - env(safe-area-inset-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 + env(safe-area-inset-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 + env(safe-area-inset-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-walk__give {
    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;
    cursor: pointer;
    transition: transform 160ms var(--ease-out);
}

.village-walk__give:hover { background: var(--c-primary-hover); }
.village-walk__give:active { transform: scale(0.97); }
.village-walk__give:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-lg); }

/* 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 + env(safe-area-inset-bottom)); }
    .village[data-prompt] .village-walk { bottom: calc(130px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
    .village-walk { animation: none; }
    .village-walk__track i,
    .village-walk__give,
    .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='%231b555c'%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) - env(safe-area-inset-top) - 110px);
    overflow-y: auto;
    padding-bottom: 12px;
}

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

.village-talk__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 6px 0 14px;
    border: 1px solid var(--c-primary);
    border-radius: var(--r-full);
    background: var(--c-primary-light);
    color: var(--c-primary);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
}

.village-talk__chip--all { padding: 0 14px; border-color: var(--c-border); background: var(--c-bg); color: var(--c-text-secondary); cursor: default; }
.village-talk__chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.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 + env(safe-area-inset-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 + env(safe-area-inset-bottom)); }

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

.village-reply__who {
    flex: none;
    max-width: 40%;
    min-height: 28px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--r-full);
    background: var(--c-primary-light);
    color: var(--c-primary);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

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

.village-reply__close {
    flex: none;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--c-text-secondary);
    font: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.village-reply__who:focus-visible,
.village-reply__close:focus-visible,
.village-reply__chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }

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

.village-reply__chip {
    flex: 1 1 auto;
    min-height: 44px;
    padding: 6px 14px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    background: var(--c-bg);
    color: var(--c-text);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.village-reply__chip:hover { border-color: var(--c-primary); background: var(--c-primary-light); }
.village-reply__chip--primary { border-color: var(--c-primary); background: var(--c-primary); color: var(--c-text-inverse); }
.village-reply__chip--primary:hover { background: var(--c-primary-hover); }

/* 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 + env(safe-area-inset-bottom)); }
    .village:has(.village-walk:not([hidden])) .village-reply { bottom: calc(140px + env(safe-area-inset-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: 14px; padding-top: 12px; border-top: 1px solid var(--c-border-light); }
.village-facts__count { margin: 10px 0 8px; color: var(--c-text); font-size: 0.86rem; font-weight: 600; }
.village-facts__traits { display: flex; flex-wrap: wrap; gap: 8px; }
.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) + env(safe-area-inset-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 + env(safe-area-inset-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; }

.village-notice__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    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: inherit;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 160ms var(--ease-out);
}

.village-notice__btn--main { border-color: transparent; background: var(--c-primary); color: var(--c-text-inverse); }
.village-notice__btn:hover { border-color: var(--c-primary); }
.village-notice__btn--main:hover { background: var(--c-primary-hover); }
.village-notice__btn:active { transform: scale(0.97); }
.village-notice__btn:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-lg); }

/* 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; }

@media (prefers-reduced-motion: reduce) {
    .village-notice__btn { 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) + env(safe-area-inset-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 ») : même allure que « S'y rendre ». */
a.village-banner__go {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    white-space: nowrap;
}

/* 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, env(safe-area-inset-right));
    bottom: calc(18px + env(safe-area-inset-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; }

.village-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    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);
    cursor: pointer;
    transition: border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.village-tool[hidden],
.village[data-view="album"] .village-tool--view { display: none; }
.village-tool:hover { border-color: var(--c-primary); }
.village-tool:active { transform: scale(0.96); }
.village-tool:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-md); }

@media (max-width: 767px) {
    /* Téléphone : dans le coin, sous le pouce. */
    .village-tools {
        right: max(12px, env(safe-area-inset-right));
        bottom: calc(14px + env(safe-area-inset-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 + env(safe-area-inset-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 + env(safe-area-inset-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(19, 21, 22, 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(19, 21, 22, 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(19, 21, 22, 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 + env(safe-area-inset-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__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 + env(safe-area-inset-bottom)); }
.village[data-aim] .village-walk { bottom: calc(232px + env(safe-area-inset-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 + env(safe-area-inset-bottom)); }
    .village[data-aim] .village-walk { bottom: calc(220px + env(safe-area-inset-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); }

.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;
}

.village-tuto__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    background: var(--c-bg-card);
    color: var(--c-primary);
    font: inherit;
    font-size: 0.94rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

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

.village-tuto__btn--primary {
    border-color: var(--c-primary);
    background: var(--c-primary);
    color: var(--c-text-inverse);
}

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

/* 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(27, 85, 92, 0.28); }
    50% { box-shadow: 0 0 0 9px rgba(27, 85, 92, 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(27, 85, 92, 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: rgba(19, 21, 22, 0.42);
    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;
}

.village-join__close {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--r-full);
    background: none;
    color: var(--c-text-secondary);
    cursor: pointer;
}

.village-join__close:hover { background: var(--c-bg-warm); }
.village-join__close:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.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-intro__login .village-link {
    border: 0;
    background: none;
    font-family: inherit;
    cursor: pointer;
}

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

@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 + env(safe-area-inset-top)); }
    .village-join__foot { padding-bottom: calc(12px + env(safe-area-inset-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;
}

.village-quit { white-space: nowrap; }
/* Sur téléphone, les boutons de la barre du haut sont réduits à leur icône (44 px de large).
   « Quitter » n'a pas d'icône : il garde son texte, donc sa largeur (vu coupé sur iPhone le
   2026-11-16). Règle placée APRÈS celle des boutons-icônes, à spécificité égale. */
.village-top .village-quit { width: auto; min-width: 44px; padding: 0 14px; flex: 0 0 auto; }
