/* =====================================================================
   grignote.css — Article « Le distributeur » (street food, snacks, tapas)
   ---------------------------------------------------------------------
   Chargé après mag.css. Un seul fil conducteur : un distributeur
   automatique. Seize cases (A1 → D4) rangées par forme : ce qui se plie,
   se roule, se coupe en deux, se partage. Chaque case a la couleur de son
   sachet (style="--c: #xxxxxx"), reprise par l'étiquette de l'adresse.
   grignote.js anime le clavier, la chute dans le bac, les envies, les
   tampons « J'ai goûté » et le ticket de la quête.
   Sans JavaScript : les cases restent des liens, le clavier, le ticket et
   la carte sont masqués.
   ===================================================================== */

.page-grignote {
    --moutarde: #ffc93c;
    --ketchup: #e0412b;
    --tole: #1b1b19;
    --tole-bord: #2d2c29;
    --papier: #f4eee1;
    --encre: #1a1917;
    --halo: var(--moutarde);
}

.page-grignote .mag-hero {
    background:
        radial-gradient(ellipse 60% 50% at 15% 85%, rgba(255, 201, 60, 0.16), transparent 70%),
        radial-gradient(ellipse 50% 45% at 85% 20%, rgba(224, 65, 43, 0.14), transparent 70%),
        radial-gradient(ellipse 55% 50% at 70% 95%, rgba(46, 157, 91, 0.10), transparent 70%),
        var(--bg);
}

.page-grignote .title-accent {
    color: var(--moutarde);
}

.page-grignote .mag-lede strong {
    color: var(--moutarde);
}

/* =====================
   Le distributeur
   ===================== */
.distrib {
    max-width: 1000px;
    margin: 0 auto;
    padding: 96px 20px 0;
    scroll-margin-top: 60px;
}

.machine {
    position: relative;
    padding: 0 22px 22px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 8%, transparent 92%, rgba(255, 255, 255, 0.04)),
        linear-gradient(180deg, #c8361f, #a82914);
    border-radius: 18px 18px 10px 10px;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.18),
        inset 0 -6px 0 rgba(0, 0, 0, 0.25),
        0 40px 80px rgba(0, 0, 0, 0.45);
}

/* Le fronton lumineux */
.machine-fronton {
    padding: 18px 0 16px;
    text-align: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(30px, 5vw, 46px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff4c8;
    text-shadow: 0 0 6px rgba(255, 220, 120, 0.9), 0 0 22px rgba(255, 201, 60, 0.7), 0 0 44px rgba(255, 140, 40, 0.5);
}

.machine-fronton span {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 0.6em;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    vertical-align: 0.25em;
}

.mag-js .machine-fronton {
    animation: fronton 6s infinite;
}

@keyframes fronton {
    0%, 91%, 93%, 96%, 100% { opacity: 1; }
    92%, 95% { opacity: 0.55; }
}

.machine-corps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.mag-js .machine-corps {
    grid-template-columns: 1fr 210px;
}

/* La vitre et ses rangées */
.vitre {
    position: relative;
    padding: 14px 18px 18px;
    background: linear-gradient(180deg, #121211, #0b0b0a);
    border: 6px solid #0d0d0c;
    border-radius: 6px;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9), 0 0 0 2px rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

/* Reflet sur le verre */
.vitre::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.07) 38%, transparent 46%, transparent 62%, rgba(255, 255, 255, 0.04) 66%, transparent 70%);
}

.rangee-titre {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.rangee-titre span {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    background: var(--moutarde);
    color: var(--encre);
    font-weight: 700;
    letter-spacing: 0;
}

.rangee {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
    padding-bottom: 6px;
    list-style: none;
    /* L'étagère */
    border-bottom: 4px solid #2b2a27;
    box-shadow: 0 2px 0 #050505;
}

.slot-lien {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: inherit;
    text-decoration: none;
    border-radius: 6px;
    outline-offset: 3px;
}

.slot-lien:focus-visible {
    outline: 2px solid var(--moutarde);
}

/* Le sachet : bords dentelés, couleur du lieu, bandeau crème au milieu */
.sachet {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: min(78%, 104px);
    aspect-ratio: 3 / 4;
    padding: 10px 4px;
    background:
        linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.35) 28%, transparent 36%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.15), transparent 30%, transparent 70%, rgba(0, 0, 0, 0.25)),
        var(--c);
    --dent: 7px;
    -webkit-mask:
        conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--dent) 51% repeat-x,
        conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--dent) 51% repeat-x;
    mask:
        conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--dent) 51% repeat-x,
        conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--dent) 51% repeat-x;
    transform-origin: 50% 100%;
    transition: transform 0.25s, filter 0.25s, opacity 0.25s;
}

.produit-ico {
    width: 58%;
    height: auto;
    fill: none;
    stroke: rgba(20, 18, 15, 0.82);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sachet-nom {
    max-width: 100%;
    padding: 3px 5px;
    background: var(--papier);
    border-radius: 2px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(10px, 1.5vw, 13px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: uppercase;
    color: var(--encre);
    overflow-wrap: anywhere;
}

.slot-lien:hover .sachet,
.slot-lien:focus-visible .sachet {
    transform: rotate(-3deg) translateY(-3px);
}

/* Le ressort, vu de face */
.ressort {
    display: block;
    width: 92%;
    height: 9px;
    margin-top: 2px;
    border-radius: 4px;
    background:
        repeating-linear-gradient(100deg, #8d8a82 0 2px, #3a3935 2px 4px, transparent 4px 9px),
        linear-gradient(180deg, #2a2926, #111);
}

.slot.is-vend .ressort {
    animation: ressort 0.7s linear;
}

@keyframes ressort {
    to { background-position: 18px 0, 0 0; }
}

.slot-etiquette {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    margin-top: 6px;
    text-align: center;
}

.slot-code {
    padding: 1px 6px;
    background: #050505;
    border: 1px solid #3a3935;
    border-radius: 2px;
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--moutarde);
}

.slot-lieu {
    font-family: 'Barlow', sans-serif;
    font-size: 11px;
    line-height: 1.2;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

/* États : envies, sélection, déjà goûté */
.slot.is-dim .sachet {
    opacity: 0.22;
    filter: grayscale(1);
}

.slot.is-dim .slot-lieu {
    opacity: 0.4;
}

.slot.is-lit .sachet {
    filter: drop-shadow(0 0 10px var(--c));
}

.slot.is-choisi .slot-code {
    background: var(--moutarde);
    color: var(--encre);
}

.slot.is-vide .sachet {
    visibility: hidden;
}

.slot.is-goute .slot-code::after {
    content: ' ✓';
    color: #7dff8a;
}

.slot.is-choisi.is-goute .slot-code::after {
    color: var(--encre);
}

/* Le panneau de commande */
.panneau {
    display: none;
}

.mag-js .panneau {
    position: sticky;
    top: 72px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 14px;
    background: linear-gradient(180deg, #232320, var(--tole));
    border: 1px solid var(--tole-bord);
    border-radius: 6px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ecran {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 74px;
    padding: 10px 12px;
    background: #08120a;
    border: 3px solid #050505;
    border-radius: 4px;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.9);
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-transform: uppercase;
    color: #7dff8a;
    text-shadow: 0 0 6px rgba(125, 255, 138, 0.7);
}

.ecran-ligne {
    display: block;
    min-height: 1.35em;
}

.ecran-ligne:nth-child(2) {
    color: #c9ffcf;
}

.ecran.is-erreur {
    color: #ff7a6b;
    text-shadow: 0 0 6px rgba(255, 122, 107, 0.7);
}

.clavier {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.touche {
    aspect-ratio: 1;
    background: linear-gradient(180deg, #e9e5db, #b9b4a8);
    border: none;
    border-radius: 5px;
    box-shadow: 0 3px 0 #6d6a62, 0 4px 6px rgba(0, 0, 0, 0.5);
    font-family: 'Courier Prime', monospace;
    font-size: 17px;
    font-weight: 700;
    color: var(--encre);
    cursor: pointer;
    transition: transform 0.06s, box-shadow 0.06s;
}

.touche:active,
.touche.is-appui {
    transform: translateY(3px);
    box-shadow: 0 0 0 #6d6a62, 0 1px 2px rgba(0, 0, 0, 0.5);
}

.touche:focus-visible,
.hasard:focus-visible {
    outline: 2px solid var(--moutarde);
    outline-offset: 2px;
}

.hasard {
    padding: 12px 10px;
    background: radial-gradient(circle at 50% 30%, #ffd866, var(--moutarde) 55%, #c9961a);
    border: none;
    border-radius: 999px;
    box-shadow: 0 4px 0 #8a6510, 0 6px 12px rgba(0, 0, 0, 0.45);
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--encre);
    cursor: pointer;
    transition: transform 0.06s, box-shadow 0.06s;
}

.hasard:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #8a6510, 0 2px 4px rgba(0, 0, 0, 0.45);
}

/* Le bac de sortie */
.bac {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    padding: 12px;
    background: linear-gradient(180deg, #050505, #141413);
    border: 4px solid #0d0d0c;
    border-radius: 4px;
    box-shadow: inset 0 14px 20px rgba(0, 0, 0, 0.9);
}

.bac-vide {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: #3d3c38;
}

.bac-produit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: center;
    animation: bac-arrive 0.35s ease-out;
}

@keyframes bac-arrive {
    from { transform: translateY(-10px); opacity: 0; }
}

.bac-produit .sachet {
    flex: none;
    width: 52px;
    gap: 2px;
    padding: 6px 2px;
    --dent: 5px;
    transform: rotate(-8deg);
}

.bac-produit .sachet-nom {
    display: none;
}

.bac-texte {
    flex: 1;
    min-width: 0;
}

.bac-code {
    font-family: 'Courier Prime', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--moutarde);
}

.bac-nom {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.05;
    text-transform: uppercase;
    color: var(--text);
}

.bac-lien {
    flex: none;
    padding: 9px 14px;
    background: var(--moutarde);
    border-radius: 999px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--encre);
    text-decoration: none;
}

.bac-lien:hover {
    background: #ffd866;
}

.bac-lien:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Le sachet qui tombe (clone animé par grignote.js) */
.sachet--chute {
    position: fixed;
    z-index: 1400;
    pointer-events: none;
}

/* Les envies, sous la machine */
.envies {
    display: none;
    margin-top: 32px;
    text-align: center;
}

.mag-js .envies {
    display: block;
}

.envies-title {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 22px;
    font-style: italic;
    color: var(--text);
}

.envies-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

.envie {
    padding: 8px 15px;
    background: transparent;
    border: 1px solid var(--border-hover);
    border-radius: 999px;
    color: var(--text);
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.envie:hover {
    border-color: var(--moutarde);
}

.envie[aria-pressed="true"] {
    background: var(--moutarde);
    border-color: var(--moutarde);
    color: var(--encre);
}

.envie:focus-visible {
    outline: 2px solid var(--moutarde);
    outline-offset: 2px;
}

.envies-result {
    min-height: 1.6em;
    margin-top: 12px;
    font-family: 'Newsreader', Georgia, serif;
    font-size: 17px;
    color: var(--text-muted);
}

.envies-result a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--moutarde);
    text-underline-offset: 3px;
}

.envies-result a:hover {
    color: var(--moutarde);
}

/* =====================
   Les rangées et les adresses
   ===================== */
.rayons {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 20px 0;
}

.rayon {
    position: relative;
    padding: 130px 0 10px;
    scroll-margin-top: 60px;
}

.rayon-lettre {
    position: absolute;
    top: 40px;
    right: 0;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(140px, 22vw, 220px);
    font-weight: 700;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 2px rgba(255, 201, 60, 0.28);
    pointer-events: none;
    user-select: none;
}

.rayon-titre {
    position: relative;
    font-size: clamp(34px, 5vw, 54px);
    line-height: 0.95;
    color: var(--text);
}

.rayon-titre span {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--moutarde);
}

.rayon-intro {
    position: relative;
    max-width: 520px;
    margin-top: 14px;
    font-family: 'Newsreader', Georgia, serif;
    font-size: 19px;
    font-style: italic;
    line-height: 1.5;
    color: var(--text-muted);
}

.grignote {
    position: relative;
    padding-top: 88px;
    scroll-margin-top: 40px;
}

.grignote + .grignote::before {
    content: '';
    position: absolute;
    top: 40px;
    left: 0;
    width: 64px;
    height: 0;
    border-top: 2px dashed var(--border-hover);
}

.grignote-head {
    position: relative;
}

.grignote-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.grignote-code {
    padding: 1px 8px;
    background: var(--c);
    border-radius: 2px;
    font-family: 'Courier Prime', monospace;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--encre);
}

.grignote-format {
    font-weight: 700;
    color: var(--text);
}

.grignote-origine::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 1px;
    margin-right: 14px;
    vertical-align: middle;
    background: var(--text-dim);
}

.grignote-nom {
    margin: 14px 0 10px;
    font-size: clamp(40px, 6vw, 72px);
    line-height: 0.92;
    letter-spacing: 0.005em;
    color: var(--text);
    text-wrap: balance;
}

.grignote-tags {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 19px;
    font-style: italic;
    color: var(--text-muted);
}

.grignote > p {
    max-width: 640px;
    margin-top: 24px;
    font-family: 'Newsreader', Georgia, serif;
    font-optical-sizing: auto;
    font-size: 19px;
    line-height: 1.65;
    color: var(--reading);
    hyphens: auto;
    -webkit-hyphens: auto;
    text-wrap: pretty;
}

/* Le tampon « Goûté », posé par grignote.js sur l'en-tête */
.tampon {
    position: absolute;
    top: -6px;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 104px;
    height: 104px;
    border: 3px solid var(--ketchup);
    border-radius: 50%;
    box-shadow: inset 0 0 0 4px rgba(12, 12, 11, 1), inset 0 0 0 5px var(--ketchup);
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
    color: var(--ketchup);
    opacity: 0.9;
    transform: rotate(-14deg);
    pointer-events: none;
    mix-blend-mode: screen;
}

.tampon small {
    display: block;
    margin-top: 3px;
    font-family: 'Courier Prime', monospace;
    font-size: 13px;
    letter-spacing: 0;
}

.tampon.is-neuf {
    animation: tamponner 0.35s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes tamponner {
    from { transform: rotate(-14deg) scale(1.8); opacity: 0; }
}

/* Photos */
.grignote-photos {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
    gap: 14px;
    margin: 36px 0 8px;
}

.grignote-photos img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 560px;
    object-fit: cover;
    border-radius: 2px;
    background: var(--bg2);
}

.grignote-photos img:nth-of-type(2) {
    margin-top: 48px;
}

.grignote-photos--une {
    grid-template-columns: minmax(0, 420px);
}

.grignote-photos figcaption {
    grid-column: 1 / -1;
    margin-top: 4px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* L'étiquette : un emballage, papier crème et code-barres */
.etiquette {
    max-width: 640px;
    margin-top: 32px;
    padding: 0 0 18px;
    background: var(--papier);
    border-radius: 3px;
    color: var(--encre);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.etiquette-titre {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 20px 9px;
    background:
        repeating-linear-gradient(90deg, var(--encre) 0 2px, transparent 2px 4px, var(--encre) 4px 5px, transparent 5px 8px, var(--encre) 8px 11px, transparent 11px 13px) right 20px center / 72px 18px no-repeat,
        var(--c);
    border-radius: 3px 3px 0 0;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.etiquette-titre span:last-child {
    margin-right: 84px;
    font-family: 'Courier Prime', monospace;
    letter-spacing: 0;
}

.etiquette dl {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 9px 18px;
    margin: 0 20px;
    padding-top: 16px;
    border-top: 2px dashed rgba(26, 25, 23, 0.25);
}

.etiquette dt {
    padding-top: 2px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6b665c;
}

.etiquette dd {
    font-family: 'Barlow', sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

.etiquette a {
    color: var(--encre);
    text-decoration: underline;
    text-decoration-color: var(--ketchup);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.etiquette a:hover {
    color: var(--ketchup);
}

.etiquette a:focus-visible {
    outline: 2px solid var(--ketchup);
    outline-offset: 2px;
}

.tampon-btn {
    display: none;
}

.mag-js .tampon-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 18px 20px 0;
    padding: 9px 16px;
    background: transparent;
    border: 2px solid var(--ketchup);
    border-radius: 999px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ketchup);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.mag-js .tampon-btn::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.tampon-btn[aria-pressed="true"] {
    background: var(--ketchup);
    color: var(--papier);
}

.tampon-btn[aria-pressed="true"]::before {
    background: currentColor;
}

.tampon-btn:focus-visible {
    outline: 2px solid var(--encre);
    outline-offset: 2px;
}

/* =====================
   La carte
   ===================== */
.grignote-carte {
    display: none;
}

.mag-js .grignote-carte {
    display: block;
    max-width: 1000px;
    margin: 0 auto;
    padding: 140px 20px 0;
}

.grignote-carte-intro {
    margin-top: 8px;
    font-family: 'Newsreader', Georgia, serif;
    font-size: 18px;
    font-style: italic;
    color: #bdb8ae;
}

.grignote-map {
    height: min(480px, 70vh);
    margin-top: 18px;
    background: var(--bg);
    border: 1px solid var(--border-hover);
    border-radius: 4px;
}

.grignote-map .leaflet-control-attribution {
    background: rgba(12, 12, 11, 0.7);
    color: var(--text-dim);
    font-size: 9px;
}

.grignote-map .leaflet-control-attribution a {
    color: var(--text-muted);
}

.gm-marker-wrap {
    background: none;
    border: none;
}

.gm-marker {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: var(--c);
    border-radius: 3px;
    box-shadow: 0 0 0 2px rgba(12, 12, 11, 0.85), 0 4px 12px rgba(0, 0, 0, 0.5);
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--encre);
    cursor: pointer;
    transition: transform 0.15s;
}

.gm-marker:hover {
    transform: scale(1.15);
}

.gm-tooltip {
    padding: 4px 8px;
    background: rgba(12, 12, 11, 0.92);
    border: 1px solid var(--border-hover);
    border-radius: 3px;
    box-shadow: none;
    color: var(--text);
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.gm-tooltip::before {
    display: none;
}

/* =====================
   Le ticket de la quête
   ===================== */
.quete {
    display: none;
}

.mag-js .quete {
    display: block;
    padding: 140px 20px 0;
    scroll-margin-top: 40px;
}

.ticket {
    max-width: 420px;
    margin: 0 auto;
    padding: 34px 26px 36px;
    background: var(--papier);
    color: var(--encre);
    font-family: 'Courier Prime', monospace;
    font-size: 15px;
    line-height: 1.45;
    --dent: 12px;
    -webkit-mask:
        conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--dent) 51% repeat-x,
        conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--dent) 51% repeat-x;
    mask:
        conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--dent) 51% repeat-x,
        conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--dent) 51% repeat-x;
    transform: rotate(-1deg);
}

.ticket-entete {
    padding-bottom: 14px;
    border-bottom: 1px dashed rgba(26, 25, 23, 0.5);
    text-align: center;
    font-size: 19px;
    font-weight: 700;
    text-transform: uppercase;
}

.ticket-entete span {
    display: block;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.2em;
}

.ticket-consigne {
    margin: 14px 0;
    font-size: 13px;
    color: #5f5a50;
}

.ticket-lignes {
    list-style: none;
    padding: 12px 0;
    border-top: 1px dashed rgba(26, 25, 23, 0.5);
    border-bottom: 1px dashed rgba(26, 25, 23, 0.5);
}

.ticket-lignes li {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.t-code {
    flex: none;
    width: 2.4em;
    font-weight: 700;
}

.t-nom {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Les points de conduite */
.t-nom::after {
    content: ' ........................................';
    color: rgba(26, 25, 23, 0.35);
}

.t-etat {
    flex: none;
    min-width: 5.5em;
    text-align: right;
    color: rgba(26, 25, 23, 0.4);
}

.ticket-lignes li.is-goute .t-etat {
    font-weight: 700;
    color: var(--ketchup);
}

.ticket-total {
    display: flex;
    justify-content: space-between;
    padding: 12px 0 4px;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
}

.ticket-message {
    min-height: 2.9em;
    font-size: 14px;
    color: #5f5a50;
}

.diplome {
    margin: 18px 0 4px;
    padding: 18px 14px;
    border: 3px double var(--ketchup);
    text-align: center;
    color: var(--ketchup);
    animation: bac-arrive 0.5s ease-out;
}

.diplome-titre {
    font-size: 13px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
}

.diplome-texte {
    margin: 8px 0;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

.diplome-sous {
    font-size: 13px;
    color: var(--encre);
}

.ticket-raz {
    display: block;
    margin: 18px auto 0;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(26, 25, 23, 0.4);
    border-radius: 3px;
    font-family: 'Courier Prime', monospace;
    font-size: 13px;
    color: #5f5a50;
    cursor: pointer;
}

.ticket-raz:hover {
    border-color: var(--encre);
    color: var(--encre);
}

.ticket-raz:focus-visible {
    outline: 2px solid var(--ketchup);
    outline-offset: 2px;
}

/* Crédits photo */
.mag-credits {
    margin-top: 28px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-dim);
}

@media (prefers-reduced-motion: reduce) {
    .mag-js .machine-fronton,
    .slot.is-vend .ressort,
    .tampon.is-neuf,
    .bac-produit,
    .diplome {
        animation: none;
    }
}

/* =====================
   Tablette et mobile
   ===================== */
@media (max-width: 820px) {
    .mag-js .machine-corps {
        grid-template-columns: 1fr;
    }

    .mag-js .panneau {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }

    .ecran {
        grid-column: 1 / -1;
        min-height: 64px;
    }

    .clavier {
        grid-column: 1 / -1;
        grid-template-columns: repeat(8, 1fr);
        gap: 6px;
    }

    .hasard,
    .bac {
        grid-column: 1 / -1;
    }

    .bac {
        min-height: 92px;
    }

    .bac-produit {
        flex-direction: row;
        gap: 14px;
        text-align: left;
    }
}

@media (max-width: 600px) {
    .distrib {
        padding: 64px 12px 0;
    }

    .machine {
        padding: 0 10px 12px;
        border-radius: 14px 14px 8px 8px;
    }

    .vitre {
        padding: 8px 8px 12px;
        border-width: 4px;
    }

    .rangee {
        gap: 6px;
    }

    .sachet {
        width: 90%;
        padding: 6px 2px;
        gap: 3px;
        --dent: 5px;
    }

    .sachet-nom {
        padding: 2px 3px;
        font-size: 9px;
    }

    .slot-lieu {
        display: none;
    }

    .slot-code {
        font-size: 11px;
    }

    .bac {
        min-height: 80px;
        padding: 10px;
    }

    .bac-produit {
        gap: 10px;
    }

    .bac-produit .sachet {
        width: 40px;
    }

    .bac-nom {
        font-size: 18px;
    }

    .bac-lien {
        padding: 8px 11px;
        font-size: 13px;
    }

    .rayons {
        padding: 24px 16px 0;
    }

    .rayon {
        padding-top: 96px;
    }

    .rayon-lettre {
        top: 30px;
        font-size: 130px;
    }

    .grignote {
        padding-top: 72px;
    }

    .grignote-meta {
        gap: 2px 10px;
        font-size: 12px;
    }

    .grignote-origine {
        flex-basis: 100%;
    }

    .grignote-origine::before {
        display: none;
    }

    .grignote-nom {
        max-width: calc(100% - 70px);
        font-size: min(calc(26px + 4vw), 11vw);
    }

    .grignote-tags,
    .grignote > p {
        font-size: 18px;
    }

    .tampon {
        top: -10px;
        width: 76px;
        height: 76px;
        font-size: 13px;
    }

    .tampon small {
        font-size: 11px;
    }

    .grignote-photos {
        gap: 8px;
    }

    .grignote-photos img:nth-of-type(2) {
        margin-top: 28px;
    }

    .etiquette-titre {
        padding: 9px 16px;
    }

    .etiquette dl {
        grid-template-columns: 1fr;
        gap: 2px;
        margin: 0 16px;
    }

    .etiquette dd + dt {
        margin-top: 8px;
    }

    .mag-js .tampon-btn {
        margin: 16px 16px 0;
    }

    .mag-js .grignote-carte,
    .mag-js .quete {
        padding-top: 96px;
    }

    .ticket {
        padding: 30px 18px 32px;
        font-size: 14px;
    }
}
