/* ==========================================================================
   Secret Santa — feuille de style
   Une étiquette cadeau en papier kraft est l'élément fort ; le reste reste calme.
   ========================================================================== */

@font-face {
    font-family: "Bricolage Grotesque";
    src: url("fonts/bricolage-latin.woff2") format("woff2");
    font-weight: 400 800;
    font-stretch: 75% 100%;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Bricolage Grotesque";
    src: url("fonts/bricolage-latin-ext.woff2") format("woff2");
    font-weight: 400 800;
    font-stretch: 75% 100%;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Couleurs */
    --bg: #F3F6F2;           /* neige */
    --surface: #FFFFFF;
    --ink: #17322A;          /* sapin de nuit */
    --ink-soft: #566E64;
    --line: #DAE3DD;
    --line-strong: #B7C6BD;
    --holly: #C0262F;        /* baie de houx */
    --holly-press: #9E1C25;
    --on-holly: #FFFFFF;
    --fir: #2C5B46;          /* sapin */
    --gold: #E0A63A;
    --kraft: #DDBF92;        /* étiquette */
    --kraft-ring: #EBD6B5;
    --kraft-ink: #3A2610;
    --kraft-soft: #7A5730;
    --tag-waiting: #E2E0D8;
    --twine: #C0262F;
    --target-bg: #F3E6CF;      /* ligne de la personne tirée */
    --target-line: #E2CFAE;
    --tab-active-bg: #F3E6CF;
    --ok-bg: #17322A;
    --ok-ink: #F3F6F2;
    --err-bg: #8E1C23;
    --err-ink: #FFFFFF;
    --err-soft-bg: #FBE7E6;
    --err-soft-ink: #8E1C23;
    --focus: #2C7A57;

    /* Typo */
    --font-display: "Bricolage Grotesque", ui-rounded, system-ui, sans-serif;
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0F1E18;
        --surface: #172A21;
        --ink: #E8F0EB;
        --ink-soft: #9DB3A8;
        --line: #24392F;
        --line-strong: #3B5347;
        --holly: #D9383F;
        --holly-press: #B92B32;
        --fir: #8CC7A8;
        --kraft: #D6B686;
        --kraft-ring: #E3CBA4;
        --tag-waiting: #33443B;
        --twine: #E0474E;
        --target-bg: #3A3223;
        --target-line: #54472F;
        --tab-active-bg: #3A3223;
        --ok-bg: #E8F0EB;
        --ok-ink: #0F1E18;
        --err-soft-bg: #3B1B1D;
        --err-soft-ink: #F6C7C9;
        --focus: #8CC7A8;
        color-scheme: dark;
    }
}

/* --- Base ---------------------------------------------------------------- */

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

html {
    -webkit-text-size-adjust: 100%;
    scrollbar-gutter: stable; /* la place de la barre de défilement est toujours réservée */
}
@supports not (scrollbar-gutter: stable) {
    html { overflow-y: scroll; }
}
html, body { overflow-x: clip; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: 4px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* --- Page ---------------------------------------------------------------- */

.page {
    max-width: 34rem;
    margin: 0 auto;
    padding: max(16px, env(safe-area-inset-top)) 20px max(120px, env(safe-area-inset-bottom));
}
.is-wide .page { max-width: 44rem; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
    margin-bottom: clamp(28px, 7vw, 56px);
}
.topbar__family {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    color: var(--ink-soft);
}
.back {
    color: var(--ink-soft);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    padding: 12px 0;
}
.back:hover { color: var(--ink); }

/* --- Typographie -------------------------------------------------------- */

.display {
    font-family: var(--font-display);
    font-weight: 800;
    font-stretch: 84%;
    font-size: clamp(2.6rem, 11vw, 3.9rem);
    line-height: 0.98;
    letter-spacing: -0.025em;
    margin: 0 0 18px;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

.lead {
    font-size: 1.2rem;
    color: var(--ink-soft);
    max-width: 30em;
    text-wrap: pretty;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-stretch: 90%;
    font-size: 1.65rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0 0 6px;
}

.soft { color: var(--ink-soft); }
.small { font-size: 0.95rem; }
.optional { font-weight: 400; font-size: 0.88em; color: var(--ink-soft); margin-left: 4px; }
code { font-size: 0.92em; background: var(--surface); padding: 1px 6px; border-radius: 6px; }

.link {
    color: var(--fir);
    font-weight: 600;
    text-underline-offset: 3px;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 28px;
    border: 0;
    border-radius: 999px;
    font-weight: 650;
    font-size: 1.05rem;
    line-height: 1.1;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease, transform .12s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { cursor: progress; opacity: .8; }

.btn--primary { background: var(--holly); color: var(--on-holly); }
.btn--primary:hover { background: var(--holly-press); }

.btn--secondary {
    background: transparent;
    color: var(--ink);
    box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.btn--secondary:hover { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--ink-soft); }

.btn--big {
    min-height: 66px;
    padding: 0 44px;
    font-size: 1.25rem;
}

.link-button {
    background: none;
    border: 0;
    padding: 10px 0;
    font-size: 0.98rem;
    color: var(--ink-soft);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.link-button:hover { color: var(--ink); }
.link-button--danger { color: var(--holly); }
.link-button--danger:hover { color: var(--holly-press); }

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
}

/* --- Formulaires --------------------------------------------------------- */

.stack > * + * { margin-top: 18px; }
.narrow { max-width: 24rem; }

.label {
    display: block;
    font-weight: 600;
    font-size: 0.98rem;
    margin-bottom: 6px;
}

.input {
    display: block;
    width: 100%;
    min-height: 54px;
    padding: 12px 16px;
    border: 1.5px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    font-size: 1.06rem; /* >= 16px : pas de zoom automatique sur iPhone */
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--ink-soft); opacity: .7; }
.input:focus {
    outline: none;
    border-color: var(--fir);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--fir) 22%, transparent);
}
textarea.input { min-height: 0; resize: vertical; line-height: 1.45; }
select.input {
    appearance: none;
    padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23566E64' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}
.is-invalid, .is-invalid:focus { border-color: var(--holly); }

.field-error {
    margin-top: 8px;
    color: var(--holly);
    font-weight: 600;
    font-size: 0.98rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.inline-form .input { flex: 1 1 220px; width: auto; }

.notice {
    padding: 16px 18px;
    border-radius: 14px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1.5px var(--line);
}
.notice--error {
    background: var(--err-soft-bg);
    color: var(--err-soft-ink);
    box-shadow: none;
}

/* --- Message flash (bas d'écran) ---------------------------------------- */

.flash {
    position: fixed;
    z-index: 20;
    left: 16px;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    max-width: 32rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 10px 14px 20px;
    border-radius: 16px;
    background: var(--ok-bg);
    color: var(--ok-ink);
    font-weight: 550;
    box-shadow: 0 14px 34px rgba(10, 25, 18, 0.28);
    animation: flash-in .35s cubic-bezier(.2, .8, .3, 1);
}
.flash p { flex: 1; }
.flash--error { background: var(--err-bg); color: var(--err-ink); }
.flash.is-leaving { opacity: 0; transform: translateY(12px); transition: opacity .25s ease, transform .25s ease; }
.flash__close {
    flex: none;
    width: 40px; height: 40px;
    border: 0; border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    opacity: .75;
}
.flash__close:hover { opacity: 1; }
@keyframes flash-in {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

/* --- Pastilles (initiales) ---------------------------------------------- */

.avatar {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 42px; height: 42px;
    border-radius: 50%;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1;
    color: #fff;
}
.avatar--lg { width: 76px; height: 76px; font-size: 2.1rem; }
.avatar--holly { background: #C0262F; }
.avatar--fir { background: #2C5B46; }
.avatar--gold { background: #E0A63A; color: #3A2610; }
.avatar--kraft { background: #DDBF92; color: #3A2610; }
.avatar--plum { background: #7B3B6A; }
.avatar--sky { background: #2D6A88; }

/* --- Choix du prénom ----------------------------------------------------- */

.names {
    list-style: none;
    padding: 0;
    margin: 36px 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 12px;
}
.name-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 80px;
    padding: 14px 18px 14px 16px;
    border-radius: 20px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1.5px var(--line);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: box-shadow .15s ease, transform .12s ease;
}
.name-tile:hover { box-shadow: inset 0 0 0 2px var(--fir); }
.name-tile:active { transform: scale(0.97); }
.name-tile__name {
    min-width: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    line-height: 1.15;
    overflow-wrap: break-word;
}

/* --- Code à 4 chiffres -------------------------------------------------- */

.code-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
}
.code-form { margin-top: 32px; }
.pin-input {
    display: block;
    width: 11.5rem;
    min-height: 80px;
    padding: 8px 0 8px 0.5em;
    border: 1.5px solid var(--line-strong);
    border-radius: 18px;
    background: var(--surface);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2.4rem;
    letter-spacing: 0.5em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.pin-input:focus {
    outline: none;
    border-color: var(--fir);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--fir) 22%, transparent);
}
.pin-input.is-invalid { border-color: var(--holly); }
.pin-input::placeholder { color: var(--line-strong); opacity: 1; }
.code-form .btn { display: flex; width: 100%; max-width: 22rem; margin-top: 28px; }
.code-form + .soft { margin-top: 28px; }

/* --- Petit mot de l'organisateur ---------------------------------------- */

.note {
    margin-top: 24px;
    padding: 16px 20px;
    background: var(--surface);
    border-left: 4px solid var(--kraft);
    border-radius: 0 14px 14px 0;
}

/* --- L'étiquette cadeau ------------------------------------------------- */

.draw { margin-top: 32px; }

.tag-stage {
    position: relative;
    padding: 84px 0 12px 14px;
}

.tag {
    position: relative;
    max-width: 30rem;
    transform: rotate(-2.5deg);
    transform-origin: 32px 50%;
    filter: drop-shadow(0 14px 18px rgba(58, 38, 16, 0.16)) drop-shadow(0 2px 2px rgba(58, 38, 16, 0.18));
}

.tag__body {
    position: relative;
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 34px 30px 36px 78px;
    background-color: var(--kraft);
    /* Fibres du papier */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .22 0 0 0 0 .08 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    color: var(--kraft-ink);
    clip-path: polygon(32px 0, 100% 0, 100% 100%, 32px 100%, 0 calc(100% - 32px), 0 32px);
}

/* Le trou renforcé de l'étiquette */
.tag__body::before {
    content: "";
    position: absolute;
    left: 32px;
    top: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    background: var(--bg);
    box-shadow: 0 0 0 7px var(--kraft-ring), inset 0 2px 3px rgba(0, 0, 0, 0.25);
}

/* La ficelle */
.tag__string {
    position: absolute;
    z-index: 1;
    left: 2px;
    bottom: calc(50% - 2px);
    width: 60px;
    height: 124px;
    overflow: visible;
    pointer-events: none;
}
.tag__string path {
    fill: none;
    stroke: var(--twine);
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-dasharray: 7 5;
}

.tag__label {
    font-weight: 650;
    font-size: 1.02rem;
    color: var(--kraft-soft);
    margin-bottom: 6px;
}

.tag__name {
    font-family: var(--font-display);
    font-weight: 800;
    font-stretch: 78%;
    font-size: clamp(3rem, 15vw, 5rem);
    line-height: 0.95;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
    min-height: 0.95em;
}
.tag__name[data-len="l"] { font-size: clamp(2.4rem, 11vw, 3.8rem); }
.tag__name[data-len="xl"] { font-size: clamp(1.9rem, 8.5vw, 2.9rem); }
.tag__name--mystery { color: var(--kraft-soft); }
.tag__name { transform-origin: left center; }

/* Juste après le tirage : le nom reste caché jusqu'au lancement du rouleau
   (filet de sécurité : il réapparaît seul après 6 s si le script ne tourne pas) */
[data-just-drawn] .tag__name:not(.is-ready),
[data-just-drawn] [data-after-reveal]:not(.is-shown) {
    visibility: hidden;
    animation: show-anyway 0s 6s forwards;
}
@keyframes show-anyway { to { visibility: visible; } }
[data-after-reveal].is-shown { animation: rise-in .6s cubic-bezier(.2, .8, .3, 1); }
@keyframes rise-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

/* Rouleau façon machine à sous */
.reel {
    display: block;
    height: 1.12em;
    overflow: hidden;
    line-height: 1.12;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
}
.reel__strip { display: block; will-change: transform, filter; }
.reel__strip > span {
    display: block;
    height: 1.12em;
    white-space: nowrap;
    overflow: hidden;
}

.tag--waiting { filter: none; }
.tag--waiting .tag__body { background-color: var(--tag-waiting); background-image: none; }
.tag--waiting .tag__body::before { box-shadow: 0 0 0 7px color-mix(in srgb, var(--tag-waiting) 60%, var(--surface)); }
.tag--waiting .tag__label,
.tag--waiting .tag__name { color: var(--ink-soft); }
.tag--waiting .tag__string path { stroke: var(--line-strong); }

.tag.is-shaking { animation: tag-shake .45s ease-in-out infinite; }
.tag.is-landed { animation: tag-swing 1.5s cubic-bezier(.3, .7, .4, 1); }

@keyframes tag-shake {
    0%, 100% { transform: rotate(-2.5deg); }
    25% { transform: rotate(-7deg); }
    75% { transform: rotate(2.5deg); }
}
@keyframes tag-swing {
    0% { transform: rotate(-16deg); }
    30% { transform: rotate(7deg); }
    55% { transform: rotate(-6deg); }
    78% { transform: rotate(0.5deg); }
    100% { transform: rotate(-2.5deg); }
}

.confetti {
    position: absolute;
    left: 50%;
    top: 58%;
    width: 8px;
    height: 14px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 2;
}

.draw__action { margin-top: 36px; }
.draw__action .btn { width: 100%; max-width: 24rem; }
.draw__hint { margin-top: 16px; color: var(--ink-soft); max-width: 28em; }
.draw > .draw__hint { margin-top: 28px; }

.after-reveal .btn { white-space: normal; padding-top: 14px; padding-bottom: 14px; }

/* --- Listes d'idées : une petite carte par idée --------------------------- */

.wishes {
    list-style: none;
    padding: 0;
    margin: 22px 0 0;
    display: grid;
    gap: 10px;
}
.wish {
    position: relative;
    padding: 14px 16px 14px 14px;
    border-radius: 16px;
    background: var(--wish-bg, var(--surface));
    box-shadow: inset 0 0 0 1px var(--wish-line, var(--line));
}
.wish__main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.wish__icon {
    flex: none;
    width: 30px;
    height: 30px;
}
.wish__icon .tab-icon {
    width: 30px;
    height: 30px;
    transform: none;
}
.wish__content { flex: 1; min-width: 0; padding-top: 2px; }
.wish__title {
    font-weight: 650;
    font-size: 1.1rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.wish--editable .wish__title { padding-right: 84px; }
.wish__note {
    margin-top: 3px;
    color: var(--ink-soft);
    font-size: 1rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
/* Le lien : une petite pastille, discrète */
.wish__link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    padding: 4px 11px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--fir) 11%, transparent);
    color: var(--fir);
    font-size: 0.86rem;
    font-weight: 650;
    line-height: 1.4;
    text-decoration: none;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.wish__link:hover { background: color-mix(in srgb, var(--fir) 20%, transparent); }

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details[open] .when-closed, details:not([open]) .when-open { display: none; }

.wish__edit > summary {
    position: absolute;
    top: 12px;
    right: 14px;
    padding: 6px 0 6px 12px;
    font-size: 0.98rem;
    color: var(--ink-soft);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.wish__edit > summary:hover { color: var(--ink); }
.wish__edit > form {
    margin-top: 14px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.empty {
    margin-top: 20px;
    color: var(--ink-soft);
    max-width: 30em;
}

.lead + .wishes, .lead + .empty { margin-top: 32px; }
.add-wish { margin-top: 40px; }
.add-wish__more > summary {
    display: inline-block;
    padding: 6px 0;
    color: var(--fir);
    font-weight: 600;
    font-size: 1rem;
}
.add-wish__more > summary::before { content: "+ "; }
.add-wish__more[open] > summary { color: var(--ink-soft); }
.add-wish__more[open] > summary::before { content: "– "; }
.add-wish__more > .stack { margin-top: 14px; }

/* --- Idées cadeaux : une ligne par personne ---------------------------- */

.people-ideas {
    list-style: none;
    padding: 0;
    margin: 28px -14px 0;
}
.people-ideas > li {
    position: relative;
    padding: 0 14px;
    border-radius: 22px;
    transition: background-color .25s ease, box-shadow .25s ease;
    scroll-margin: 24px 0 130px;
}
.people-ideas > li + li { margin-top: 8px; }

/* Trait fin entre deux lignes fermées */
.people-ideas > li + li::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 14px;
    right: 14px;
    height: 1px;
    background: var(--line);
}
.people-ideas > li.is-open::before,
.people-ideas > li.is-target::before,
.people-ideas > li.is-open + li::before,
.people-ideas > li.is-target + li::before { display: none; }

/* Ligne ouverte : une carte blanche, pour voir clairement à qui sont les idées */
.people-ideas > li.is-open {
    background: var(--surface);
    box-shadow: 0 0 0 1.5px var(--line);
}
.people-ideas > li:not(.is-open):not(.is-target):hover { background: color-mix(in srgb, var(--surface) 65%, transparent); }

/* La personne tirée au sort : fond kraft, en tête de liste */
.people-ideas > li.is-target {
    background: var(--target-bg);
    box-shadow: none;
}
.people-ideas > li.is-open { --wish-bg: var(--bg); --wish-line: transparent; }
.people-ideas > li.is-target { --wish-bg: var(--surface); --wish-line: var(--target-line); }

.people-ideas summary {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 84px;
    padding: 14px 0;
    -webkit-tap-highlight-color: transparent;
}
.people-ideas__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.people-ideas__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    line-height: 1.2;
    overflow-wrap: break-word;
}
.people-ideas__meta { color: var(--ink-soft); font-size: 0.95rem; }

/* Rond avec flèche : « on peut toucher ici » */
.people-ideas summary .icon {
    flex: none;
    box-sizing: content-box;
    width: 22px;
    height: 22px;
    padding: 9px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--line) 70%, transparent);
    fill: none;
    stroke: var(--ink);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .3s cubic-bezier(.2, .7, .3, 1), background-color .2s ease;
}
.people-ideas > li.is-open summary .icon { transform: rotate(180deg); }
.people-ideas > li.is-target summary .icon { background: color-mix(in srgb, var(--kraft) 55%, transparent); }

.people-ideas__body { padding: 0 0 16px; }
.people-ideas__body .wishes { margin-top: 0; gap: 8px; }
.people-ideas__body .empty { margin-top: 0; padding-left: 56px; }

.badge {
    flex: none;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--kraft);
    color: var(--kraft-ink);
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

/* --- Onglets en bas d'écran : une barre flottante, icônes autocollants -- */

.has-tabbar .page { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }
.has-tabbar .flash { bottom: calc(112px + env(safe-area-inset-bottom)); }

.tabbar {
    position: fixed;
    z-index: 15;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    max-width: 30rem;
    margin: 0 auto;
    padding: 6px;
    border-radius: 32px;
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--line), 0 14px 34px rgba(10, 25, 18, 0.16);
}
.tabbar__inner { display: flex; gap: 4px; }
.tabbar__item {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 78px;
    padding: 6px 2px 8px;
    border-radius: 26px;
    color: var(--ink-soft);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .2s ease, color .2s ease;
}
.tabbar__bubble { display: block; }
.tab-icon {
    display: block;
    width: 42px;
    height: 42px;
    transform: scale(.86);
    transition: transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
.tabbar__item:hover .tab-icon { transform: scale(.95) rotate(-7deg); }
.tabbar__item:active .tab-icon { transform: scale(.75); }
.tabbar__item[aria-current="page"] {
    background: var(--tab-active-bg);
    color: var(--ink);
}
.tabbar__item[aria-current="page"] .tab-icon {
    transform: none;
    animation: tab-pop .55s cubic-bezier(.3, 1.6, .5, 1);
}
@keyframes tab-pop {
    from { transform: scale(.6) rotate(-14deg); }
    to { transform: none; }
}
.tabbar__dot {
    position: absolute;
    top: 7px;
    left: calc(50% + 12px);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--holly);
    box-shadow: 0 0 0 3px var(--surface);
}

/* --- Ma liste : « Pour qui ? » (moi ou mes enfants) --------------------- */

.whose { margin: -12px 0 28px; }
.whose .label { margin-bottom: 10px; }
.whose__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.whose__chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 7px 18px 7px 7px;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1.5px var(--line);
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .2s ease, box-shadow .2s ease, transform .12s ease;
}
.whose__chip .avatar { width: 40px; height: 40px; font-size: 1.05rem; }
.whose__chip:hover { box-shadow: inset 0 0 0 2px var(--fir); }
.whose__chip:active { transform: scale(.96); }
.whose__chip[aria-current="page"] {
    background: var(--tab-active-bg);
    box-shadow: inset 0 0 0 2px var(--kraft);
}

/* --- Idées cadeaux : section des enfants -------------------------------- */

.kids { margin-top: 64px; }
.kids > .soft { margin-bottom: 4px; }

/* --- Pages simples ------------------------------------------------------- */

.intro { padding-top: 16vh; }
.intro .lead + .soft { margin-top: 28px; }

/* --- Espace organisateur ------------------------------------------------- */

.block { margin-top: 80px; }
.block > .soft { margin-bottom: 4px; }
.block > .section-title + form { margin-top: 22px; }

.rows {
    list-style: none;
    padding: 0;
    margin: 28px 0 0;
    border-top: 1px solid var(--line);
}
.row-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 18px 8px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    transition: background-color .15s ease;
}
.row-link:hover { background: var(--surface); }
.row-link__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    line-height: 1.2;
}
.row-link__meta { color: var(--ink-soft); font-size: 0.98rem; }

.share {
    margin-top: 28px;
    padding: 20px;
    border-radius: 18px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1.5px var(--line);
}
.share__row { display: flex; flex-wrap: wrap; gap: 10px; }
.share__input { flex: 1 1 240px; width: auto; color: var(--fir); font-size: 0.98rem; }
.share .small { margin-top: 12px; }

.step {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--bg);
    font-size: 1.05rem;
    vertical-align: 0.15em;
}

.people {
    list-style: none;
    padding: 0;
    margin: 20px 0 28px;
    border-top: 1px solid var(--line);
}
.person {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.person__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-right: 80px;
}
.person__name { font-weight: 650; overflow-wrap: anywhere; }
.person__meta { color: var(--ink-soft); font-size: 0.93rem; line-height: 1.4; }
.person__menu { grid-column: 1 / -1; }
.person__menu > summary {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    padding: 8px 0 8px 12px;
    font-size: 0.98rem;
    color: var(--ink-soft);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.person__menu[open] > summary { top: 34px; }
.person__panel {
    margin-top: 14px;
    padding: 18px;
    border-radius: 16px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1.5px var(--line);
}

.pairs {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
    border-top: 1px solid var(--line);
}
.pair {
    position: relative;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.pair__names {
    display: block;
    min-height: 32px;
    padding-right: 96px;
    font-weight: 650;
    line-height: 32px;
}
.pair__edit > summary {
    position: absolute;
    top: 14px;
    right: 0;
    padding: 4px 0 4px 12px;
    font-size: 0.98rem;
    color: var(--ink-soft);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.pair__edit > summary:hover { color: var(--ink); }
.pair__panel {
    margin-top: 14px;
    padding: 18px;
    border-radius: 16px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1.5px var(--line);
}
.pair__panel .pair-form { margin-top: 0; }
.pair__panel .actions { margin-top: 18px; }
.add-pair { margin-top: 28px; }
.add-pair .pair-form { margin-top: 0; }
#exclusions .notice { margin-top: 20px; }
.pair-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}
.pair-form select { flex: 1 1 150px; width: auto; }
.pair-form__and { color: var(--ink-soft); }

/* Cases à cocher des parents, en grosses pastilles */
.checks { border: 0; margin: 0; padding: 0; min-width: 0; }
.checks legend { padding: 0; }
.checks__list { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 8px 16px 8px 12px;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1.5px var(--line-strong);
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.check-chip input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--fir);
}
.check-chip:has(input:checked) {
    background: var(--tab-active-bg);
    box-shadow: inset 0 0 0 2px var(--kraft);
}
.check-chip:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.add-child { margin-top: 24px; }
.warn { color: var(--holly); font-weight: 650; }

#tirage .lead { color: var(--ink); }
.status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0 10px;
    font-weight: 700;
    font-size: 1.05rem;
}
.status::before {
    content: "";
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: currentColor;
}
.status--open { color: var(--fir); }
.status--locked { color: var(--holly); }
.status--done { color: var(--ink); }
.status--done::before { background: var(--gold); }
#tirage .actions, #tirage .notice { margin-top: 20px; }

.danger-zone {
    margin-top: 96px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

/* --- Petits écrans ------------------------------------------------------- */

@media (max-width: 480px) {
    .field-row { grid-template-columns: 1fr; }
    .tag-stage { padding-left: 6px; }
    .tag__body { padding: 30px 22px 32px 70px; min-height: 170px; }
    .block { margin-top: 64px; }
    .pair-form { display: grid; grid-template-columns: 1fr; justify-items: start; }
    .pair-form select { width: 100%; }
}

/* --- Mouvement réduit ---------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
