/* ============================================================
   MON BAR — vitrine personnalisable : meuble + lumière + signature
   Bouteilles détourées posées sur des étagères.
   Meubles : .barshelf--wood / --modernDark / --luminous / --speakeasy / --gallery
   Lumière : variables --bar-light (couleur) et --bar-light-strength (0–1)
   ============================================================ */

.barshelf {
    --slot-h: 240px;
    --plank-h: 18px;
    --cell-w: 132px;
    --col-gap: 10px;
    --bottle-top: 26px;
    --bar-light: #ffb066;          /* surchargé inline */
    --bar-light-strength: 0.55;    /* surchargé inline */
    max-width: 1750px;
    margin: 0 auto;
    padding: .5rem .5rem 4rem;
}
.barshelf--editing {
    max-width: 2350px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 350px);
    grid-template-areas:
        "debug debug"
        "header header"
        "scene editor";
    gap: 1rem 1.15rem;
    align-items: start;
}
.barshelf--editing .barshelf__debug { grid-area: debug; margin-bottom: 0; }
.barshelf--editing .barshelf__header { grid-area: header; }
.barshelf--editing .barshelf__editor {
    grid-area: editor;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
    margin-bottom: 0;
}
.barshelf--editing .barshelf__scene,
.barshelf--editing .barshelf__msg {
    grid-area: scene;
    min-width: 0;
}
.barshelf--editing > .bartpl {
    grid-area: scene;
    min-width: 0;
    align-self: start;
}
.barshelf--editing > .bartpl__calib {
    grid-column: 1;
    grid-row: 4;
    z-index: 80;
}
.barshelf--editing > .bartpl__calib-btn {
    grid-area: scene;
    position: relative;
    top: .65rem;
    right: .65rem;
    justify-self: end;
    align-self: start;
    z-index: 100;
}
.barshelf--editing .barshelf__editor-row {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}
.barshelf--editing .barshelf__drag-hint {
    align-self: flex-start;
    white-space: normal;
}
.barshelf--editing .barshelf__text {
    max-width: none;
    width: 100%;
}

/* ============================================================
   EN-TÊTE / SIGNATURE
   ============================================================ */
.barshelf__header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: .9rem;
}
.barshelf__signature {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: -.01em;
}
.barshelf__signature-icon { font-size: 1.25rem; }
.barshelf__signature-name {
    background: linear-gradient(120deg, #e91e84, #c850b9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.barshelf__count { opacity: .7; font-size: .88rem; font-weight: 600; }

.barshelf__edit-toggle {
    margin-left: auto;
    padding: .5rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(128,128,128,.3);
    background: rgba(255,255,255,.9);
    color: #333;
    font-weight: 700;
    cursor: pointer;
    transition: filter .15s, transform .12s, background .15s;
}
.barshelf__edit-toggle:hover { transform: translateY(-1px); }
.barshelf__edit-toggle.is-open {
    background: linear-gradient(135deg, #e91e84, #c850b9);
    color: #fff;
    border-color: transparent;
}

/* ============================================================
   ÉDITEUR D'AMBIANCE
   ============================================================ */
.barshelf__editor {
    position: relative;
    margin-bottom: 1.1rem;
    padding: 1.1rem 1.2rem;
    border-radius: 16px;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(122,63,102,.16);
    box-shadow: 0 12px 32px rgba(122,63,102,.16);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: #2a2433;
}
.barshelf__drag-hint { font-size: .8rem; font-weight: 600; opacity: .6; white-space: nowrap; align-self: flex-end; }
.barshelf__editor-group { display: flex; flex-direction: column; gap: .5rem; }
.barshelf__editor-group--grow { flex: 1; }
.barshelf__editor-label { font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; opacity: .65; }
.barshelf__editor-row { display: flex; gap: 1.5rem; align-items: flex-end; flex-wrap: wrap; }
.barshelf__editor-row--top { align-items: flex-start; gap: 1rem 1.5rem; }

.barshelf__chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.barshelf__chip {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .45rem .8rem; border-radius: 999px;
    border: 1px solid rgba(128,128,128,.3); background: #fff;
    font-weight: 700; font-size: .88rem; cursor: pointer;
    transition: all .15s;
}
.barshelf__chip:hover { border-color: #c850b9; }
.barshelf__chip.is-active {
    background: linear-gradient(135deg, #e91e84, #c850b9);
    color: #fff; border-color: transparent;
}
.barshelf__chip-emoji { font-size: 1.05rem; }

.barshelf__swatch {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .4rem .75rem; border-radius: 999px;
    border: 1px solid rgba(128,128,128,.3); background: #fff;
    font-weight: 700; font-size: .86rem; cursor: pointer; transition: all .15s;
}
.barshelf__swatch-dot {
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--sw); box-shadow: 0 0 8px var(--sw);
}
.barshelf__swatch:hover { border-color: var(--sw); }
.barshelf__swatch.is-active { border-color: var(--sw); box-shadow: 0 0 0 2px var(--sw); }

.barshelf__range { width: 100%; accent-color: #c850b9; cursor: pointer; }

.barshelf__switch { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.barshelf__switch input { width: 18px; height: 18px; accent-color: #c850b9; cursor: pointer; }

.barshelf__text {
    padding: .55rem .85rem; border-radius: 10px;
    border: 1px solid rgba(128,128,128,.35); background: #fff;
    font-size: .95rem; max-width: 360px;
}
/* badge « Enregistré » en overlay → ne décale plus la mise en page */
.barshelf__saved {
    position: absolute; top: 12px; right: 16px;
    display: inline-flex; align-items: center; gap: .3rem;
    color: #1e9e5a; font-weight: 800; font-size: .8rem;
    padding: .2rem .6rem; border-radius: 999px; background: rgba(30,158,90,.12);
    animation: barshelf-fade .25s ease;
}
@keyframes barshelf-fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.barshelf__saved--err {
    position: static; color: #b02a37; background: rgba(220,53,69,.12);
    margin-top: .5rem; padding: .4rem .7rem; border-radius: 8px; font-size: .8rem;
}
.barshelf__savebar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: .6rem; }
.barshelf__savebtn {
    padding: .55rem 1.1rem; border-radius: 10px; border: none; cursor: pointer;
    background: linear-gradient(135deg, #1e9e5a, #15994f); color: #fff; font-weight: 800;
    display: inline-flex; align-items: center; gap: .5rem; transition: filter .15s, transform .12s;
}
.barshelf__savebtn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.barshelf__savebtn:disabled { opacity: .6; cursor: wait; }
/* console de debug (admin uniquement) */
.barshelf__debug {
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
    margin-bottom: .8rem; padding: .5rem .8rem; border-radius: 10px;
    background: rgba(8,10,14,.92); color: #9fe; font-family: ui-monospace, monospace; font-size: .72rem;
    border: 1px solid rgba(120,200,255,.25);
}
.barshelf__debug strong { color: #ffce54; }
.barshelf__debug-err { color: #ff6b6b; }

.barshelf__savestate { font-size: .8rem; font-weight: 700; min-height: 1.2em; margin-bottom: .6rem; }
.barshelf__savestate--dirty { color: #c97a14; }
.barshelf__savestate--dirty .fa-circle { font-size: .55rem; vertical-align: middle; }

/* bouton Enregistrer dans le header */
.barshelf__header-actions { margin-left: auto; display: inline-flex; align-items: center; gap: .5rem; }
.barshelf__savebtn.is-dirty { animation: barshelf-pulse-btn 1.6s ease-in-out infinite; }
@keyframes barshelf-pulse-btn { 0%,100% { box-shadow: 0 0 0 0 rgba(30,158,90,.5); } 50% { box-shadow: 0 0 0 5px rgba(30,158,90,0); } }

/* sections repliables de l'éditeur */
.barshelf__section { border-top: 1px solid rgba(128,128,128,.18); }
.barshelf__section:first-of-type { border-top: none; }
.barshelf__section-head {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    padding: .7rem .2rem; background: none; border: none; cursor: pointer;
    font-weight: 800; font-size: .95rem; color: inherit;
}
.barshelf__section-head:hover { color: #c850b9; }
.barshelf__section-body { padding: 0 .2rem .9rem; display: flex; flex-direction: column; gap: .9rem; }

/* pastille d'info ⓘ avec tooltip natif (title) */
.barshelf__info {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; margin-left: 5px; border-radius: 50%;
    background: rgba(128,128,128,.25); color: inherit; font-size: .68rem; font-weight: 800;
    cursor: help; vertical-align: middle;
}
.barshelf__savestate--saving { color: #8a8a8a; }
.barshelf__savestate--ok { color: #1e9e5a; }
.barshelf__savestate--err { color: #b02a37; }

.barshelf__msg {
    padding: 1.2rem; border-radius: 12px;
    background: rgba(128,128,128,.08); opacity: .85;
}
.barshelf__msg--err { background: rgba(220,53,69,.12); color: #b02a37; }

:is([data-theme="dark"], [data-bs-theme="dark"]) .barshelf {
    color: rgba(255,255,255,.88);
}
:is([data-theme="dark"], [data-bs-theme="dark"]) .barshelf__editor {
    background: linear-gradient(180deg, rgba(31,29,42,.96), rgba(17,18,27,.97));
    border-color: rgba(255,255,255,.12);
    box-shadow: 0 18px 44px rgba(0,0,0,.34);
    color: rgba(255,255,255,.88);
}
:is([data-theme="dark"], [data-bs-theme="dark"]) .barshelf__chip,
:is([data-theme="dark"], [data-bs-theme="dark"]) .barshelf__swatch,
:is([data-theme="dark"], [data-bs-theme="dark"]) .barshelf__text,
:is([data-theme="dark"], [data-bs-theme="dark"]) .barshelf__edit-toggle {
    background: rgba(255,255,255,.065);
    border-color: rgba(255,255,255,.16);
    color: rgba(255,255,255,.9);
}
:is([data-theme="dark"], [data-bs-theme="dark"]) .barshelf__chip:hover,
:is([data-theme="dark"], [data-bs-theme="dark"]) .barshelf__swatch:hover {
    background: rgba(255,255,255,.11);
}
:is([data-theme="dark"], [data-bs-theme="dark"]) .barshelf__chip.is-active,
:is([data-theme="dark"], [data-bs-theme="dark"]) .barshelf__edit-toggle.is-open {
    background: linear-gradient(135deg, #e91e84, #c850b9);
    color: #fff;
}

/* ============================================================
   SCÈNE + ÉTAGÈRE
   ============================================================ */
.barshelf__scene {
    position: relative;
    border-radius: 20px;
    padding: 96px 22px 28px;
    overflow: visible;
}
.barshelf__ambient, .barshelf__light {
    position: absolute; inset: 0; border-radius: 20px;
    pointer-events: none; z-index: 0;
}

/* Couche LUMIÈRE globale (couleur + intensité pilotées par variables) */
.barshelf__light {
    background:
        radial-gradient(60% 36% at 50% -4%,
            color-mix(in srgb, var(--bar-light) calc(var(--bar-light-strength) * 60%), transparent),
            transparent 70%),
        radial-gradient(40% 24% at 50% 102%,
            color-mix(in srgb, var(--bar-light) calc(var(--bar-light-strength) * 25%), transparent),
            transparent 70%);
    mix-blend-mode: screen;
    z-index: 2;
}

/* grille : N bouteilles par étagère (--per-shelf), lignes de hauteur --slot-h
   (les planches du fond se répètent tous les --slot-h → alignées sous chaque rangée) */
.barshelf__rack {
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: repeat(var(--per-shelf, 7), 1fr);
    grid-auto-rows: var(--slot-h);
    column-gap: var(--col-gap); row-gap: 0;
}

.barshelf__bottle {
    position: relative;
    width: auto; height: var(--slot-h); cursor: pointer;
    z-index: var(--depth, 1);
    transform: translate(var(--layout-dx, 0), var(--layout-dy, 0)) rotate(var(--layout-rot, 0deg));
    transition: transform .3s cubic-bezier(.34,1.4,.64,1);
}
/* la bouteille survolée passe AU-DESSUS de toutes les autres (sinon sa carte d'info
   peut se retrouver sous une bouteille voisine qui a un --depth plus élevé) */
.barshelf__bottle:hover { z-index: 60; }

/* copies « fantômes » derrière la bouteille principale quand on en possède plusieurs
   → effet « plusieurs bouteilles du même gin regroupées » */
.barshelf__ghost {
    position: absolute; z-index: 1; left: 50%; bottom: var(--plank-h);
    width: 80%; height: calc(var(--slot-h) - var(--plank-h) - var(--bottle-top));
    object-fit: contain; object-position: bottom center;
    opacity: .5; pointer-events: none;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)) brightness(.88);
}
.barshelf--mode-chromatic .barshelf__ghost { display: none; }
.barshelf__ghost.ghost-1 { transform: translateX(calc(-50% + 17px)) scale(.95); }
.barshelf__ghost.ghost-2 { transform: translateX(calc(-50% - 17px)) scale(.90); }
.barshelf__bottle:hover .barshelf__ghost.ghost-1 { transform: translateX(calc(-50% + 20px)) translateY(-6px) scale(.96); }
.barshelf__bottle:hover .barshelf__ghost.ghost-2 { transform: translateX(calc(-50% - 20px)) translateY(-6px) scale(.91); }
.barshelf--editing .barshelf__bottle { cursor: grab; }
.barshelf--editing .barshelf__bottle:active { cursor: grabbing; }
.barshelf__bottle.is-dragging { opacity: .38; }
.barshelf__bottle.is-chosen { cursor: grabbing; }
.barshelf__bottle.is-sorting { transform: scale(1.03); }
.barshelf__bottle.is-dropover::before {
    border-color: color-mix(in srgb, var(--bar-light) 74%, #fff);
    box-shadow: 0 0 24px color-mix(in srgb, var(--bar-light) 38%, transparent);
}
.barshelf__bottle.is-flash .barshelf__img,
.barshelf__bottle.is-flash .barshelf__abstract-bottle {
    animation: barshelf-item-flash .9s ease;
}
@keyframes barshelf-item-flash {
    0% { filter: brightness(1.5) saturate(1.25); }
    100% { filter: none; }
}
.barshelf--editing .barshelf__bottle::before {
    content: ""; position: absolute; inset: 6px 4px var(--plank-h) 4px;
    border: 2px dashed rgba(255,255,255,.18); border-radius: 12px;
    pointer-events: none; z-index: 0;
}
.barshelf__stand {
    position: absolute; left: 50%; bottom: calc(var(--plank-h) - 4px);
    width: 60%; height: 16px; transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(0,0,0,.50), transparent 72%);
    z-index: 1; pointer-events: none; filter: blur(1px);
    transition: width .22s, opacity .22s;
}
.barshelf__abstract-bottle { display: none; }
.barshelf__img {
    position: absolute; z-index: 2; left: 50%; bottom: var(--plank-h);
    transform: translateX(-50%);
    width: 80%;
    height: calc(var(--slot-h) - var(--plank-h) - var(--bottle-top));
    object-fit: contain; object-position: bottom center;
    filter: drop-shadow(0 6px 8px rgba(0,0,0,.35));
    transition: transform .26s cubic-bezier(.34,1.56,.64,1), filter .26s;
}
.barshelf__bottle:hover .barshelf__img {
    transform: translateX(-50%) translateY(-10px) scale(1.05);
    filter: drop-shadow(0 16px 16px rgba(0,0,0,.4));
    z-index: 5;
}
.barshelf__bottle:hover .barshelf__stand { width: 50%; opacity: .65; }

/* badge quantité posé au pied de la bouteille, sur la planche */
.barshelf__qty {
    position: absolute; bottom: calc(var(--plank-h) + 2px); right: 18px; z-index: 4;
    font-size: .68rem; font-weight: 800; padding: 1px 7px; border-radius: 999px;
    background: rgba(0,0,0,.66); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
    transition: transform .26s cubic-bezier(.34,1.56,.64,1);
}
.barshelf__bottle:hover .barshelf__qty { transform: translateY(-10px); }

/* ---- carte au survol ---- */
.barshelf__card {
    position: absolute; bottom: calc(var(--slot-h) - var(--plank-h) - 6px); left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 230px; z-index: 20; opacity: 0; pointer-events: none;
    display: flex; gap: 10px; padding: 10px; border-radius: 14px;
    background: rgba(22,18,28,.92); border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 18px 40px rgba(0,0,0,.5); backdrop-filter: blur(8px);
    transition: opacity .18s, transform .18s;
}
.barshelf__bottle:hover .barshelf__card { opacity: 1; transform: translateX(-50%) translateY(0); }
.barshelf__card-thumb {
    flex: 0 0 54px; width: 54px; height: 64px; border-radius: 8px;
    background: rgba(255,255,255,.06); display: flex; align-items: center; justify-content: center; padding: 5px;
}
.barshelf__card-thumb img { width: 100%; height: 100%; object-fit: contain; }
.barshelf__card-body { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.barshelf__card-name { font-weight: 800; color: #fff; line-height: 1.2; font-size: .92rem; margin-bottom: 5px; }
.barshelf__card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .8rem; color: rgba(255,255,255,.8); }
.barshelf__card-meta .fi { border-radius: 2px; }
.barshelf__card-rating { color: #ffce54; font-weight: 700; }
.barshelf__card::after {
    content: ""; position: absolute; bottom: -7px; left: 50%;
    transform: translateX(-50%) rotate(45deg); width: 12px; height: 12px;
    background: rgba(22,18,28,.92);
    border-right: 1px solid rgba(255,255,255,.14); border-bottom: 1px solid rgba(255,255,255,.14);
}

/* valance + comptoir communs */
.barshelf__scene::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 14px;
    border-radius: 20px 20px 0 0; z-index: 0; pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0));
}
.barshelf__scene::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30px;
    border-radius: 0 0 20px 20px; z-index: 0; pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,.38));
}

/* ============================================================
   MEUBLE 1 — BACKBAR BOIS
   ============================================================ */
.barshelf--wood .barshelf__scene {
    background:
        radial-gradient(120% 70% at 50% -8%, rgba(255,192,110,.18), transparent 60%),
        linear-gradient(180deg, #3a281a 0%, #2a1c12 55%, #1d130b 100%);
    box-shadow: inset 0 0 120px rgba(0,0,0,.60), inset 0 2px 0 rgba(255,210,150,.15), 0 22px 60px rgba(0,0,0,.45);
}
.barshelf--wood .barshelf__ambient {
    background: repeating-linear-gradient(90deg, rgba(0,0,0,.10) 0 1px, transparent 1px 48px);
}
.barshelf--wood .barshelf__rack {
    background-image:
        repeating-linear-gradient(to bottom,
            transparent 0, transparent calc(var(--slot-h) - var(--plank-h) - 4px),
            rgba(255,232,196,.70) calc(var(--slot-h) - var(--plank-h)),
            #875231 calc(var(--slot-h) - var(--plank-h) + 2px),
            #5d3a1f calc(var(--slot-h) - 5px),
            rgba(0,0,0,.5) calc(var(--slot-h) - 4px),
            rgba(0,0,0,0) var(--slot-h)),
        repeating-linear-gradient(90deg, rgba(255,255,255,.015) 0 3px, transparent 3px 9px);
}
.barshelf--wood .barshelf__scene::before { background: linear-gradient(180deg, rgba(255,198,120,.30), transparent); }

/* ============================================================
   MEUBLE 2 — MODERNE NOIR / VERRE
   ============================================================ */
.barshelf--modernDark .barshelf__scene {
    background:
        radial-gradient(100% 60% at 50% 0%, rgba(60,66,78,.5), transparent 65%),
        linear-gradient(180deg, #1a1c20 0%, #111316 60%, #0a0b0d 100%);
    box-shadow: inset 0 0 120px rgba(0,0,0,.7), 0 22px 60px rgba(0,0,0,.55);
}
.barshelf--modernDark .barshelf__ambient {
    background: linear-gradient(180deg, rgba(255,255,255,.04), transparent 30%);
}
/* étagères verre/métal fines */
.barshelf--modernDark .barshelf__rack {
    background-image: repeating-linear-gradient(to bottom,
        transparent 0, transparent calc(var(--slot-h) - var(--plank-h) - 3px),
        rgba(255,255,255,.55) calc(var(--slot-h) - var(--plank-h)),
        rgba(150,160,175,.85) calc(var(--slot-h) - var(--plank-h) + 1px),
        rgba(40,44,50,.95) calc(var(--slot-h) - var(--plank-h) + 4px),
        rgba(0,0,0,.85) calc(var(--slot-h) - 3px),
        rgba(0,0,0,0) var(--slot-h));
}
.barshelf--modernDark .barshelf__img {
    -webkit-box-reflect: below -2px linear-gradient(transparent 64%, rgba(255,255,255,.08));
}
.barshelf--modernDark .barshelf__scene::before { background: linear-gradient(180deg, rgba(255,255,255,.14), transparent); }

/* ============================================================
   MEUBLE 3 — VITRINE LUMINEUSE PREMIUM
   ============================================================ */
.barshelf--luminous .barshelf__scene {
    background:
        radial-gradient(90% 60% at 50% 0%, color-mix(in srgb, var(--bar-light) 30%, transparent), transparent 60%),
        linear-gradient(180deg, #20222b 0%, #16181f 60%, #101117 100%);
    box-shadow: inset 0 0 120px rgba(0,0,0,.55), 0 22px 60px rgba(0,0,0,.5);
}
.barshelf--luminous .barshelf__ambient {
    background: linear-gradient(180deg, color-mix(in srgb, var(--bar-light) 10%, transparent), transparent 40%);
}
/* tablettes de verre rétro-éclairées (lèvre LED couleur de la lumière) */
.barshelf--luminous .barshelf__rack {
    background-image: repeating-linear-gradient(to bottom,
        transparent 0, transparent calc(var(--slot-h) - var(--plank-h) - 6px),
        color-mix(in srgb, var(--bar-light) 65%, transparent) calc(var(--slot-h) - var(--plank-h) - 2px),
        rgba(255,255,255,.85) calc(var(--slot-h) - var(--plank-h)),
        rgba(120,130,150,.6) calc(var(--slot-h) - var(--plank-h) + 3px),
        rgba(20,22,30,.9) calc(var(--slot-h) - 4px),
        rgba(0,0,0,0) var(--slot-h));
}
.barshelf--luminous .barshelf__stand {
    background: radial-gradient(ellipse at center, color-mix(in srgb, var(--bar-light) 70%, transparent), transparent 70%);
}
.barshelf--luminous .barshelf__img {
    -webkit-box-reflect: below -2px linear-gradient(transparent 60%, rgba(255,255,255,.14));
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--bar-light) 35%, transparent)) drop-shadow(0 5px 8px rgba(0,0,0,.45));
}

/* ============================================================
   MEUBLE 4 — SPEAKEASY SOMBRE
   ============================================================ */
.barshelf--speakeasy .barshelf__scene {
    background:
        radial-gradient(90% 60% at 50% 0%, rgba(60,40,90,.5), transparent 65%),
        linear-gradient(180deg, #14101f 0%, #0a0812 60%, #06050b 100%);
    box-shadow: inset 0 0 130px rgba(0,0,0,.8), 0 22px 60px rgba(0,0,0,.6);
}
.barshelf--speakeasy .barshelf__ambient {
    background:
        radial-gradient(circle 6px at 18% 20%, color-mix(in srgb, var(--bar-light) 60%, transparent), transparent 60%),
        radial-gradient(circle 5px at 80% 26%, color-mix(in srgb, var(--bar-light) 50%, transparent), transparent 60%),
        radial-gradient(circle 4px at 62% 14%, rgba(255,255,255,.3), transparent 60%);
}
.barshelf--speakeasy .barshelf__rack {
    background-image: repeating-linear-gradient(to bottom,
        transparent 0, transparent calc(var(--slot-h) - var(--plank-h) - 2px),
        rgba(255,255,255,.45) calc(var(--slot-h) - var(--plank-h)),
        rgba(40,36,58,.95) calc(var(--slot-h) - var(--plank-h) + 2px),
        rgba(10,9,16,.98) calc(var(--slot-h) - 4px),
        rgba(0,0,0,0) var(--slot-h));
}
.barshelf--speakeasy .barshelf__stand {
    background: radial-gradient(ellipse at center, color-mix(in srgb, var(--bottle-glow) 75%, transparent), transparent 70%);
    height: 18px; filter: blur(3px);
}
.barshelf--speakeasy .barshelf__img {
    -webkit-box-reflect: below -2px linear-gradient(transparent 62%, rgba(255,255,255,.12));
    filter: drop-shadow(0 0 12px color-mix(in srgb, var(--bottle-glow) 45%, transparent)) drop-shadow(0 5px 8px rgba(0,0,0,.5));
}
.barshelf--speakeasy .barshelf__bottle:hover .barshelf__img {
    filter: drop-shadow(0 0 22px color-mix(in srgb, var(--bottle-glow) 75%, transparent)) drop-shadow(0 14px 16px rgba(0,0,0,.55));
}
.barshelf--speakeasy .barshelf__scene::before {
    height: 16px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--bar-light) 60%, transparent), rgba(120,80,230,.5), color-mix(in srgb, var(--bar-light) 50%, transparent));
    box-shadow: 0 6px 22px color-mix(in srgb, var(--bar-light) 40%, transparent);
}

/* ============================================================
   MEUBLE 5 — GALERIE BLANCHE
   ============================================================ */
.barshelf--gallery .barshelf__scene {
    background:
        radial-gradient(80% 50% at 50% 0%, color-mix(in srgb, var(--bar-light) 16%, transparent), transparent 60%),
        linear-gradient(180deg, #faf4fa 0%, #efe6f1 100%);
    box-shadow: inset 0 0 70px rgba(122,63,102,.07), 0 16px 44px rgba(122,63,102,.14);
}
.barshelf--gallery .barshelf__ambient {
    background: radial-gradient(60% 36% at 50% 0%, rgba(188,112,164,.12), transparent 70%);
}
.barshelf--gallery .barshelf__rack {
    background-image: repeating-linear-gradient(to bottom,
        transparent 0, transparent calc(var(--slot-h) - var(--plank-h) - 4px),
        rgba(255,255,255,.95) calc(var(--slot-h) - var(--plank-h)),
        rgba(214,206,224,.95) calc(var(--slot-h) - var(--plank-h) + 2px),
        rgba(178,166,196,.9) calc(var(--slot-h) - 5px),
        rgba(122,63,102,.18) calc(var(--slot-h) - 4px),
        rgba(0,0,0,0) var(--slot-h));
}
.barshelf--gallery .barshelf__stand { background: radial-gradient(ellipse at center, rgba(122,63,102,.30), transparent 70%); }
.barshelf--gallery .barshelf__img {
    -webkit-box-reflect: below -2px linear-gradient(transparent 60%, rgba(122,63,102,.16));
    filter: drop-shadow(0 6px 8px rgba(122,63,102,.26));
}
.barshelf--gallery .barshelf__light { mix-blend-mode: multiply; }
.barshelf--gallery .barshelf__card { background: rgba(255,255,255,.97); border-color: rgba(122,63,102,.18); box-shadow: 0 18px 40px rgba(122,63,102,.22); }
.barshelf--gallery .barshelf__card::after { background: rgba(255,255,255,.97); border-color: rgba(122,63,102,.18); }
.barshelf--gallery .barshelf__card-name { color: #2a2433; }
.barshelf--gallery .barshelf__card-meta { color: #6b6478; }
.barshelf--gallery .barshelf__card-rating { color: #b8860b; }
.barshelf--gallery .barshelf__card-thumb { background: rgba(122,63,102,.06); }
.barshelf--gallery .barshelf__scene::after { background: linear-gradient(180deg, transparent, rgba(122,63,102,.14)); }

/* ============================================================
   MEUBLE 6 — CAVE CASIER (casier à vin, lattis en X, rangées décalées)
   ============================================================ */
.barshelf--cellar .barshelf__scene {
    background:
        radial-gradient(110% 70% at 50% -10%, rgba(120,80,45,.16), transparent 60%),
        linear-gradient(180deg, #241813 0%, #190f0a 60%, #110a06 100%);
    box-shadow: inset 0 0 140px rgba(0,0,0,.75), 0 22px 60px rgba(0,0,0,.5);
}
/* lattis bois en X + planches horizontales par rangée */
.barshelf--cellar .barshelf__rack {
    background-image:
        repeating-linear-gradient(to bottom,
            transparent 0, transparent calc(var(--slot-h) - var(--plank-h) - 3px),
            rgba(60,38,20,.95) calc(var(--slot-h) - var(--plank-h)),
            rgba(30,18,10,.98) calc(var(--slot-h) - 4px),
            rgba(0,0,0,0) var(--slot-h));
    column-gap: 12px;
}
.barshelf--cellar .barshelf__bottle {
    margin: 8px 0 14px;
    height: calc(var(--slot-h) - 18px);
    border-radius: 14px;
    background:
        radial-gradient(80% 100% at 50% 35%, rgba(255,214,150,.08), transparent 62%),
        linear-gradient(180deg, rgba(35,22,13,.78), rgba(16,9,5,.9));
    box-shadow:
        inset 0 0 0 3px rgba(102,62,31,.95),
        inset 0 0 0 6px rgba(35,18,8,.86),
        inset 0 18px 28px rgba(255,184,95,.08),
        0 16px 24px rgba(0,0,0,.24);
}
.barshelf--cellar .barshelf__bottle::after {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 10px;
    pointer-events: none;
    z-index: 1;
    background:
        linear-gradient(45deg, transparent calc(50% - 2px), rgba(126,78,38,.82) calc(50% - 1px), rgba(126,78,38,.82) calc(50% + 1px), transparent calc(50% + 2px)),
        linear-gradient(-45deg, transparent calc(50% - 2px), rgba(126,78,38,.82) calc(50% - 1px), rgba(126,78,38,.82) calc(50% + 1px), transparent calc(50% + 2px));
    opacity: .72;
}
.barshelf--cellar.barshelf--editing .barshelf__bottle::before {
    inset: 10px 8px 10px;
    border-color: rgba(255,231,190,.26);
    z-index: 3;
}
.barshelf--cellar .barshelf__img {
    z-index: 2;
    width: 56%;
    bottom: 24px;
    filter: drop-shadow(0 7px 8px rgba(0,0,0,.58));
}
.barshelf--cellar .barshelf__stand {
    bottom: 20px;
    width: 46%;
    z-index: 2;
    background: radial-gradient(ellipse at center, rgba(0,0,0,.65), transparent 70%);
}
.barshelf--cellar .barshelf__qty { z-index: 4; bottom: 24px; }

/* ============================================================
   MEUBLE 7 — CAVE VOÛTÉE (pierre, rangées en arche)
   ============================================================ */
.barshelf--vault .barshelf__scene {
    background:
        radial-gradient(80% 55% at 50% -6%, color-mix(in srgb, var(--bar-light) 18%, transparent), transparent 60%),
        radial-gradient(60% 80% at 50% 120%, rgba(0,0,0,.5), transparent 60%),
        linear-gradient(180deg, #34322e 0%, #232220 55%, #181715 100%);
    box-shadow: inset 0 0 130px rgba(0,0,0,.7), 0 22px 60px rgba(0,0,0,.5);
}
/* texture pierre + tablettes claires */
.barshelf--vault .barshelf__ambient {
    background:
        repeating-linear-gradient(90deg, rgba(0,0,0,.10) 0 1px, transparent 1px 60px),
        repeating-linear-gradient(0deg, rgba(0,0,0,.08) 0 1px, transparent 1px 40px);
}
.barshelf--vault .barshelf__rack {
    background-image: repeating-linear-gradient(to bottom,
        transparent 0, transparent calc(var(--slot-h) - var(--plank-h) - 3px),
        rgba(210,205,196,.55) calc(var(--slot-h) - var(--plank-h)),
        rgba(120,116,108,.85) calc(var(--slot-h) - var(--plank-h) + 3px),
        rgba(30,28,26,.9) calc(var(--slot-h) - 4px),
        rgba(0,0,0,0) var(--slot-h));
}
.barshelf--vault .barshelf__scene::before {
    height: 60px;
    background: radial-gradient(80% 100% at 50% 0%, color-mix(in srgb, var(--bar-light) 30%, transparent), transparent 70%);
}

/* ============================================================
   MEUBLE 8 — ÉTABLI VRAC (bouteilles groupées, désalignées, profondeur)
   ============================================================ */
.barshelf--workbench .barshelf__scene {
    background:
        radial-gradient(120% 70% at 50% -8%, rgba(255,200,130,.14), transparent 60%),
        linear-gradient(180deg, #4a3420 0%, #38271a 55%, #271a10 100%);
    box-shadow: inset 0 0 120px rgba(0,0,0,.55), 0 22px 60px rgba(0,0,0,.45);
}
.barshelf--workbench .barshelf__ambient {
    background: repeating-linear-gradient(90deg, rgba(0,0,0,.07) 0 2px, transparent 2px 7px);
}
/* établi : grosse planche par rangée, bouteilles serrées qui se chevauchent */
.barshelf--workbench .barshelf__rack {
    column-gap: 0;
    background-image: repeating-linear-gradient(to bottom,
        transparent 0, transparent calc(var(--slot-h) - var(--plank-h) - 5px),
        rgba(255,220,170,.5) calc(var(--slot-h) - var(--plank-h)),
        #6b4426 calc(var(--slot-h) - var(--plank-h) + 2px),
        #44290f calc(var(--slot-h) - 5px),
        rgba(0,0,0,.5) calc(var(--slot-h) - 4px),
        rgba(0,0,0,0) var(--slot-h));
}
.barshelf--workbench .barshelf__img { width: 88%; filter: drop-shadow(0 7px 9px rgba(0,0,0,.45)); }

/* ============================================================
   MODE SOIRÉE — glow renforcé + pulsation douce
   ============================================================ */
.barshelf--party .barshelf__light { filter: saturate(1.3) brightness(1.15); animation: barshelf-pulse 4s ease-in-out infinite; }
.barshelf--party .barshelf__img { filter: drop-shadow(0 0 18px color-mix(in srgb, var(--bottle-glow) 55%, transparent)) drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
@keyframes barshelf-pulse {
    0%, 100% { opacity: .85; }
    50% { opacity: 1; }
}

/* ============================================================
   THEMES INSPIRES BARS REELS
   ============================================================ */
.barshelf--brickLed .barshelf__scene {
    background:
        radial-gradient(120% 55% at 50% 0%, color-mix(in srgb, var(--bar-light) 24%, transparent), transparent 64%),
        repeating-linear-gradient(0deg, rgba(255,255,255,.07) 0 2px, transparent 2px 42px),
        repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 2px, transparent 2px 86px),
        linear-gradient(180deg, #d6c7b2 0%, #a8947b 46%, #392b25 100%);
    box-shadow: inset 0 0 130px rgba(0,0,0,.38), 0 22px 60px rgba(0,0,0,.34);
}
.barshelf--brickLed .barshelf__ambient {
    background:
        linear-gradient(90deg, rgba(18,18,20,.7) 0 9px, transparent 9px 27%, rgba(18,18,20,.75) 27% calc(27% + 9px), transparent calc(27% + 9px) 73%, rgba(18,18,20,.75) 73% calc(73% + 9px), transparent calc(73% + 9px)),
        radial-gradient(80% 35% at 50% 10%, rgba(255,255,255,.4), transparent 68%);
}
.barshelf--brickLed .barshelf__rack {
    background-image: repeating-linear-gradient(to bottom,
        transparent 0, transparent calc(var(--slot-h) - var(--plank-h) - 10px),
        color-mix(in srgb, var(--bar-light) 58%, transparent) calc(var(--slot-h) - var(--plank-h) - 8px),
        #d3a86a calc(var(--slot-h) - var(--plank-h)),
        #7a4a22 calc(var(--slot-h) - 5px),
        rgba(0,0,0,.55) calc(var(--slot-h) - 4px),
        transparent var(--slot-h));
}
.barshelf--brickLed .barshelf__img {
    filter: drop-shadow(0 0 12px color-mix(in srgb, var(--bottle-glow) 42%, transparent)) drop-shadow(0 8px 9px rgba(0,0,0,.38));
}

.barshelf--ginCorner .barshelf__scene {
    background:
        linear-gradient(90deg, #090a0c 0 10%, transparent 10% 90%, #090a0c 90%),
        radial-gradient(90% 50% at 50% 5%, rgba(255,228,160,.22), transparent 65%),
        linear-gradient(180deg, #18191b 0%, #0c0d0f 100%);
    box-shadow: inset 0 0 150px rgba(0,0,0,.74), 0 24px 70px rgba(0,0,0,.5);
}
.barshelf--ginCorner .barshelf__ambient {
    background:
        repeating-linear-gradient(90deg, rgba(255,255,255,.15) 0 2px, transparent 2px 15%),
        linear-gradient(180deg, rgba(255,214,130,.12), transparent 42%);
}
.barshelf--ginCorner .barshelf__rack {
    background-image: repeating-linear-gradient(to bottom,
        transparent 0, transparent calc(var(--slot-h) - var(--plank-h) - 8px),
        rgba(255,236,190,.74) calc(var(--slot-h) - var(--plank-h) - 4px),
        rgba(255,255,255,.65) calc(var(--slot-h) - var(--plank-h)),
        #d7b55a calc(var(--slot-h) - var(--plank-h) + 3px),
        #050506 calc(var(--slot-h) - 4px),
        transparent var(--slot-h));
}
.barshelf--ginCorner .barshelf__scene::before {
    height: 22px;
    background: linear-gradient(90deg, #111, #d8b654, #111);
}
/* rack resserré au centre → libère les colonnes latérales pour le décor */
.barshelf--ginCorner .barshelf__rack { margin: 0 12%; }

/* ============================================================
   COUCHE DÉCOR (réutilisable) — activée par thème
   ============================================================ */
.barshelf__decor { display: none; position: absolute; inset: 0; border-radius: 20px; overflow: hidden; pointer-events: none; }
.barshelf--ginCorner .barshelf__decor { display: block; }

/* armoire vitrée centrale : cadre doré + meneaux verticaux + reflet verre */
.barshelf--ginCorner .barshelf__decor-cabinet {
    position: absolute; top: 26px; bottom: 30px; left: 12%; right: 12%; z-index: 3;
    border: 2px solid rgba(216,182,84,.55); border-radius: 6px;
    box-shadow: inset 0 0 70px rgba(255,220,140,.07), 0 0 26px rgba(0,0,0,.55);
    background:
        linear-gradient(105deg, rgba(255,255,255,.05) 0 18%, transparent 22% 78%, rgba(255,255,255,.04) 82%),
        repeating-linear-gradient(90deg, transparent 0 calc(100%/4 - 1px), rgba(216,182,84,.28) calc(100%/4 - 1px) calc(100%/4));
}
/* suspensions lumineuses */
.barshelf--ginCorner .barshelf__decor-lights {
    position: absolute; top: 0; left: 12%; right: 12%; height: 30px;
    display: flex; justify-content: space-around; z-index: 5;
}
.barshelf--ginCorner .barshelf__decor-lights span {
    width: 7px; height: 7px; margin-top: 16px; border-radius: 50%;
    background: radial-gradient(circle, #fff6d8, #ffcf6a);
    box-shadow: 0 0 16px 4px rgba(255,200,90,.6);
}
.barshelf--ginCorner .barshelf__decor-lights span::before {
    content: ""; position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
    width: 1px; height: 16px; background: rgba(255,220,140,.45);
}
/* plantes sur consoles latérales */
.barshelf--ginCorner .barshelf__decor-plant {
    position: absolute; bottom: 26px; font-size: 52px; z-index: 6;
    filter: drop-shadow(0 8px 12px rgba(0,0,0,.6));
}
.barshelf--ginCorner .barshelf__decor-plant--l { left: 1%; }
.barshelf--ginCorner .barshelf__decor-plant--r { right: 1%; }
/* consoles dorées sous les plantes */
.barshelf--ginCorner .barshelf__decor-plant::after {
    content: ""; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
    width: 46px; height: 5px; border-radius: 3px;
    background: linear-gradient(180deg, #e7c45f, #8a6f2a);
    box-shadow: 0 3px 8px rgba(0,0,0,.5);
}
/* comptoir bas en pierre/marbre */
.barshelf--ginCorner .barshelf__decor-counter {
    position: absolute; left: 0; right: 0; bottom: 0; height: 16px; z-index: 4;
    background: linear-gradient(180deg, rgba(120,122,130,.85), rgba(30,30,36,.95));
    border-top: 2px solid rgba(210,210,220,.45);
    box-shadow: 0 -6px 18px rgba(0,0,0,.5);
}

.barshelf--niches .barshelf__scene {
    padding-top: 74px;
    background:
        radial-gradient(40% 18% at 24% 6%, rgba(255,255,255,.5), transparent 70%),
        radial-gradient(50% 25% at 72% 5%, rgba(255,210,135,.33), transparent 72%),
        linear-gradient(180deg, #17120e 0%, #0c0907 100%);
    box-shadow: inset 0 0 130px rgba(0,0,0,.72), 0 22px 60px rgba(0,0,0,.45);
}
.barshelf--niches .barshelf__ambient {
    background:
        repeating-linear-gradient(90deg, rgba(184,107,42,.72) 0 4px, transparent 4px 8%, rgba(184,107,42,.55) 8% calc(8% + 3px), transparent calc(8% + 3px) 14%),
        radial-gradient(80% 36% at 50% 18%, rgba(255,167,74,.2), transparent 70%);
}
.barshelf--niches .barshelf__rack {
    column-gap: 14px;
    background-image: repeating-linear-gradient(to bottom,
        transparent 0, transparent calc(var(--slot-h) - var(--plank-h) - 4px),
        #b66b2a calc(var(--slot-h) - var(--plank-h)),
        #4c260d calc(var(--slot-h) - 4px),
        transparent var(--slot-h));
}
.barshelf--niches .barshelf__bottle:nth-child(5n + 1) { --layout-dy: -22px; }
.barshelf--niches .barshelf__bottle:nth-child(7n + 3) { --layout-dy: 18px; }
.barshelf--niches .barshelf__stand {
    background: radial-gradient(ellipse at center, color-mix(in srgb, var(--bottle-glow) 70%, rgba(0,0,0,.55)), transparent 72%);
}

.barshelf--neonMesh .barshelf__scene {
    background:
        radial-gradient(36% 28% at 20% 0%, rgba(255,56,166,.24), transparent 70%),
        radial-gradient(38% 30% at 82% 4%, rgba(86,176,255,.22), transparent 70%),
        repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 2px, transparent 2px 18px),
        repeating-linear-gradient(-45deg, rgba(255,255,255,.06) 0 2px, transparent 2px 18px),
        linear-gradient(180deg, #131018 0%, #08070b 100%);
    box-shadow: inset 0 0 140px rgba(0,0,0,.78), 0 22px 68px rgba(0,0,0,.56);
}
.barshelf--neonMesh .barshelf__ambient {
    background:
        linear-gradient(90deg, transparent 0 12%, rgba(255,54,162,.18) 12% 13%, transparent 13% 72%, rgba(255,198,46,.22) 72% 73%, transparent 73%),
        radial-gradient(70% 30% at 50% 0%, color-mix(in srgb, var(--bar-light) 18%, transparent), transparent 70%);
}
.barshelf--neonMesh .barshelf__rack {
    column-gap: 0;
    background-image: repeating-linear-gradient(to bottom,
        transparent 0, transparent calc(var(--slot-h) - var(--plank-h) - 5px),
        color-mix(in srgb, var(--bar-light) 80%, #fff) calc(var(--slot-h) - var(--plank-h) - 2px),
        rgba(255,255,255,.28) calc(var(--slot-h) - var(--plank-h)),
        rgba(0,0,0,.85) calc(var(--slot-h) - 3px),
        transparent var(--slot-h));
}
.barshelf--neonMesh .barshelf__img {
    filter: drop-shadow(0 0 16px color-mix(in srgb, var(--bottle-glow) 65%, transparent)) drop-shadow(0 8px 10px rgba(0,0,0,.5));
}

/* ============================================================
   MODE CHROMATIQUE (bouteilles abstraites colorisees)
   ============================================================ */
.barshelf--mode-chromatic {
    --slot-h: 196px;
}
.barshelf--mode-chromatic .barshelf__rack {
    row-gap: 10px;
}
.barshelf--mode-chromatic .barshelf__img,
.barshelf--mode-chromatic .barshelf__stand {
    display: none;
}
.barshelf--mode-chromatic .barshelf__bottle {
    transition: transform .28s cubic-bezier(.34,1.36,.64,1), filter .2s;
}
.barshelf--mode-chromatic .barshelf__bottle:hover {
    transform: translate(var(--layout-dx, 0), calc(var(--layout-dy, 0px) - 10px)) rotate(var(--layout-rot, 0deg)) scale(1.04);
    filter: saturate(1.12);
}
.barshelf--mode-chromatic .barshelf__abstract-bottle {
    display: block;
    position: absolute;
    left: 50%;
    bottom: 28px;
    width: 58px;
    height: 138px;
    transform: translateX(-50%) rotate(var(--abstract-rot, 0deg)) scale(var(--abstract-scale, 1));
    transform-origin: 50% 82%;
    border-radius: 18px 18px 13px 13px;
    z-index: 2;
    background:
        linear-gradient(115deg, rgba(255,255,255,.34), transparent 24%),
        linear-gradient(155deg, var(--bottle-main), var(--bottle-second) 58%, color-mix(in srgb, var(--bottle-main) 48%, #06070b));
    border: 2px solid rgba(255,255,255,.22);
    box-shadow:
        0 0 26px color-mix(in srgb, var(--bottle-main) 42%, transparent),
        0 12px 18px rgba(0,0,0,.42),
        inset 0 -18px 28px rgba(0,0,0,.28);
}
.barshelf__abstract-neck {
    position: absolute;
    left: 50%;
    bottom: calc(100% - 8px);
    width: 24px;
    height: 42px;
    transform: translateX(-50%);
    border-radius: 8px 8px 3px 3px;
    background:
        linear-gradient(110deg, rgba(255,255,255,.32), transparent 35%),
        linear-gradient(180deg, var(--bottle-second), var(--bottle-main));
    border: 2px solid rgba(255,255,255,.2);
    box-shadow: inset 0 -8px 12px rgba(0,0,0,.22);
}
.barshelf__abstract-neck::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -9px;
    width: 30px;
    height: 12px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bottle-second) 80%, #fff);
    box-shadow: 0 3px 8px rgba(0,0,0,.24);
}
.barshelf__abstract-label {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 40px;
    height: 42px;
    border-radius: 11px;
    background:
        radial-gradient(circle at 50% 50%, rgba(255,255,255,.9) 0 22%, transparent 23%),
        linear-gradient(135deg, rgba(255,255,255,.88), rgba(255,255,255,.42));
    mix-blend-mode: screen;
    opacity: .72;
}
.barshelf__abstract-shine {
    position: absolute;
    top: 16px;
    left: 12px;
    width: 8px;
    height: 78px;
    border-radius: 999px;
    background: rgba(255,255,255,.34);
    filter: blur(.3px);
}
.barshelf--view-caps {
    --slot-h: 154px;
}
.barshelf--view-caps .barshelf__rack {
    row-gap: 4px;
}
.barshelf--view-caps .barshelf__abstract-bottle {
    bottom: 42px;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    transform: translateX(-50%) rotate(var(--abstract-rot, 0deg)) scale(var(--abstract-scale, 1));
    background:
        radial-gradient(circle at 50% 50%, rgba(255,255,255,.9) 0 11%, transparent 12%),
        radial-gradient(circle at 42% 34%, rgba(255,255,255,.45), transparent 24%),
        radial-gradient(circle at center, var(--bottle-second) 0 36%, var(--bottle-main) 37% 62%, color-mix(in srgb, var(--bottle-main) 50%, #050509) 63% 100%);
    box-shadow:
        0 0 24px color-mix(in srgb, var(--bottle-main) 46%, transparent),
        0 14px 20px rgba(0,0,0,.38),
        inset 0 0 0 9px rgba(255,255,255,.12),
        inset 0 -16px 24px rgba(0,0,0,.35);
}
.barshelf--view-caps .barshelf__abstract-neck,
.barshelf--view-caps .barshelf__abstract-label,
.barshelf--view-caps .barshelf__abstract-shine {
    display: none;
}
.barshelf--view-caps .barshelf__qty {
    bottom: 24px;
}
.barshelf--view-tilted .barshelf__abstract-bottle {
    height: 128px;
    width: 68px;
    transform: translateX(-50%) perspective(150px) rotateX(18deg) rotateZ(var(--abstract-rot, 0deg)) scale(var(--abstract-scale, 1));
    border-radius: 24px 24px 16px 16px;
}
.barshelf--view-tilted .barshelf__abstract-bottle::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    top: -9px;
    height: 20px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 48%, rgba(255,255,255,.75), transparent 24%),
        linear-gradient(135deg, var(--bottle-second), var(--bottle-main));
    box-shadow: 0 4px 10px rgba(0,0,0,.24);
}
.barshelf--view-scatter .barshelf__rack {
    row-gap: 0;
}
.barshelf--view-scatter .barshelf__abstract-bottle {
    width: 62px;
    height: 132px;
    bottom: 36px;
}
.barshelf--view-scatter .barshelf__bottle:nth-child(3n) .barshelf__abstract-bottle {
    height: 126px;
    transform: translateX(-50%) rotate(calc(var(--abstract-rot, 0deg) + 76deg)) scale(var(--abstract-scale, 1));
}
.barshelf--view-scatter .barshelf__bottle:nth-child(5n) .barshelf__abstract-bottle {
    transform: translateX(-50%) rotate(calc(var(--abstract-rot, 0deg) - 82deg)) scale(var(--abstract-scale, 1));
}
.barshelf--arrange-color .barshelf__bottle,
.barshelf--arrange-country .barshelf__bottle,
.barshelf--arrange-rating .barshelf__bottle,
.barshelf--arrange-quantity .barshelf__bottle {
    cursor: default;
}
.barshelf--mode-chromatic .barshelf__qty {
    right: 50%;
    bottom: 18px;
    transform: translateX(50%);
}
.barshelf--mode-chromatic .barshelf__card {
    bottom: calc(var(--slot-h) - 16px);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1180px) {
    .barshelf--editing {
        display: block;
        max-width: 1180px;
    }
    .barshelf--editing .barshelf__editor {
        position: relative;
        top: auto;
        max-height: none;
        overflow: visible;
        margin-bottom: 1.1rem;
    }
    .barshelf--editing .barshelf__editor-row {
        flex-direction: row;
        align-items: flex-end;
    }
}
@media (max-width: 768px) {
    .barshelf { --slot-h: 206px; --cell-w: 112px; --bottle-top: 20px; }
    .barshelf__scene { padding: 80px 12px 22px; }
    .barshelf__card { width: 200px; }
    .barshelf__signature { font-size: 1.25rem; }
}
@media (max-width: 480px) {
    .barshelf { --slot-h: 182px; --col-gap: 8px; }
    .barshelf__edit-toggle { margin-left: 0; }
    /* on plafonne à 4 colonnes sur mobile, quel que soit le réglage */
    .barshelf__rack { grid-template-columns: repeat(min(var(--per-shelf, 7), 4), 1fr); }
}

/* ============================================================
   MODE TEMPLATE — image de bar réelle + bouteilles placées sur zones
   ============================================================ */
.bartpl {
    position: relative; width: 100%;
    aspect-ratio: var(--tpl-aspect, 1.777);
    background-color: #0c0d10;
    background-size: 100% 100%; background-position: center; background-repeat: no-repeat;
    border-radius: 16px; overflow: visible;
    box-shadow: 0 24px 70px rgba(0,0,0,.5);
}
/* teinte lumineuse appliquée SUR la photo (couleur + intensité du panneau Lumière) */
.bartpl::after {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: 16px;
    background:
        radial-gradient(70% 55% at 50% 0%, color-mix(in srgb, var(--bar-light) calc(var(--bar-light-strength) * 60%), transparent), transparent 70%),
        linear-gradient(180deg, color-mix(in srgb, var(--bar-light) calc(var(--bar-light-strength) * 24%), transparent), transparent 45%);
    mix-blend-mode: screen;
}
.barshelf--party .bartpl::after { filter: saturate(1.3) brightness(1.12); }
.bartpl__bottle {
    position: absolute; transform: translateX(-50%);
    display: flex; align-items: flex-end; justify-content: center;
}
.bartpl__bottle > img {
    height: 100%; width: auto; object-fit: contain; object-position: bottom center;
    filter: drop-shadow(0 5px 9px rgba(0,0,0,.55));
    transition: transform .25s cubic-bezier(.34,1.5,.64,1), filter .25s;
}
.bartpl__bottle:hover { z-index: 60; }
.bartpl__bottle:hover > img { transform: translateY(-8px) scale(1.07); filter: drop-shadow(0 16px 18px rgba(0,0,0,.6)); }

/* édition : drag libre des bouteilles */
.bartpl.is-editing .bartpl__bottle {
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
}
.bartpl.is-editing .bartpl__bottle:active,
.bartpl.is-editing .bartpl__bottle.is-dragging {
    cursor: grabbing;
}
.bartpl.is-editing .bartpl__bottle.is-dragging {
    z-index: 80;
}
.bartpl.is-editing .bartpl__bottle.is-dragging > img {
    transform: translateY(-10px) scale(1.08);
    filter: drop-shadow(0 20px 22px rgba(0,0,0,.65));
}
.bartpl__bottle.is-pinned > img { filter: drop-shadow(0 0 0 2px rgba(255,80,160,.7)) drop-shadow(0 5px 9px rgba(0,0,0,.55)); }
.bartpl__bottle.is-selected { z-index: 65; }
.bartpl__bottle.is-selected > img { filter: drop-shadow(0 0 0 3px rgba(255,80,160,.95)) drop-shadow(0 6px 12px rgba(0,0,0,.6)); }

/* panneau de contrôle de la bouteille sélectionnée (overlay à droite de l'image) */
.bartpl__sel {
    position: absolute; top: 12px; right: 12px; z-index: 90; width: 188px;
    background: rgba(20,18,26,.95); border: 1px solid rgba(255,255,255,.14);
    border-radius: 12px; padding: 10px; color: #fff; box-shadow: 0 14px 34px rgba(0,0,0,.5);
    backdrop-filter: blur(8px);
}
.bartpl__sel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bartpl__sel-head img { width: 48px; height: 66px; object-fit: contain; background: rgba(255,255,255,.06); border-radius: 6px; padding: 3px; }
.bartpl__sel-name { font-weight: 800; font-size: .82rem; line-height: 1.15; flex: 1; min-width: 0; }
.bartpl__sel-x { margin-left: auto; background: none; border: none; color: rgba(255,255,255,.6); cursor: pointer; font-size: .9rem; }
.bartpl__sel-pad {
    display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 26px);
    gap: 3px; justify-items: center; align-items: center; margin: 0 auto 8px; width: 100px;
}
.bartpl__sel-pad button {
    width: 30px; height: 26px; border: none; border-radius: 6px; cursor: pointer;
    background: rgba(255,255,255,.12); color: #fff; font-size: .7rem;
}
.bartpl__sel-pad button:hover { background: rgba(255,80,160,.85); }
.bartpl__sel-up { grid-column: 2; grid-row: 1; }
.bartpl__sel-left { grid-column: 1; grid-row: 2; }
.bartpl__sel-right { grid-column: 3; grid-row: 2; }
.bartpl__sel-down { grid-column: 2; grid-row: 3; }
.bartpl__sel-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.bartpl__sel-actions button {
    flex: 1; min-width: 0; padding: .35rem .2rem; border: none; border-radius: 7px; cursor: pointer;
    background: rgba(255,255,255,.12); color: #fff; font-size: .72rem; font-weight: 700;
}
.bartpl__sel-actions button:hover:not(:disabled) { background: rgba(255,80,160,.85); }
.bartpl__sel-actions button:disabled { opacity: .4; cursor: default; }
.bartpl__bctrl { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; z-index: 55; }
.bartpl__bctrl button {
    width: 19px; height: 19px; padding: 0; border: none; border-radius: 5px;
    background: rgba(200,80,185,.92); color: #fff; font-size: .72rem; line-height: 1; cursor: pointer;
}

.bartpl__ghost {
    position: absolute; bottom: 0; height: 100%; width: auto;
    object-fit: contain; object-position: bottom center;
    opacity: .5; pointer-events: none; filter: drop-shadow(0 3px 5px rgba(0,0,0,.4)) brightness(.88);
}
.bartpl__ghost.ghost-1 { transform: translateX(13px) scale(.95); }
.bartpl__ghost.ghost-2 { transform: translateX(-13px) scale(.9); }

.bartpl__qty {
    position: absolute; bottom: 2px; right: -8px; z-index: 5;
    font-size: .62rem; font-weight: 800; padding: 1px 6px; border-radius: 999px;
    background: rgba(0,0,0,.72); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
/* carte d'info repositionnée pour le mode template */
.bartpl__card { bottom: 104% !important; }
/* la carte d'info réapparaît au survol en mode template (sélecteur .bartpl__bottle) */
.bartpl__bottle:hover .bartpl__card { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
/* …mais PAS pendant l'édition (placement) : elle gênerait le drag */
.bartpl.is-editing .bartpl__bottle:hover .bartpl__card { opacity: 0 !important; pointer-events: none !important; }
.bartpl__card-link {
    display: inline-flex; align-items: center; gap: 5px; margin-top: 7px;
    font-size: .76rem; font-weight: 700; color: #ffce54; text-decoration: none;
}
.bartpl__card-link:hover { text-decoration: underline; }

/* overlay de calibrage des zones */
.bartpl__zone {
    position: absolute; z-index: 40; pointer-events: none; /* ne pas intercepter le drag */
    border: 2px dashed rgba(255,80,160,.95); background: rgba(255,80,160,.12); border-radius: 4px;
}
.bartpl__zone span {
    position: absolute; top: -18px; left: 0; font-size: .7rem; font-weight: 800;
    color: #ff66ad; background: rgba(0,0,0,.6); padding: 0 5px; border-radius: 4px;
}
.bartpl__calib-btn {
    position: absolute; top: 10px; right: 10px; z-index: 50;
    padding: .35rem .75rem; border-radius: 8px; border: none;
    background: rgba(255,80,160,.92); color: #fff; font-weight: 700; cursor: pointer; font-size: .82rem;
}

.bartpl__pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; font-weight: 700; }
/* pagination en overlay : toujours visible, ancrée en bas de l'image */
.bartpl__pager--overlay {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    z-index: 75; margin-top: 0; gap: .6rem; padding: .3rem .7rem;
    background: rgba(0,0,0,.55); border-radius: 999px; color: #fff; backdrop-filter: blur(6px);
}
.bartpl__pager--overlay .bartpl__pager-btn { background: rgba(255,255,255,.92); }
.bartpl__pager-btn {
    padding: .45rem .9rem; border-radius: 10px; border: 1px solid rgba(128,128,128,.3);
    background: rgba(255,255,255,.92); color: #333; cursor: pointer;
}
.bartpl__pager-btn:disabled { opacity: .4; cursor: default; }

/* panneau de calibrage */
.bartpl__calib {
    margin-top: 1rem; padding: 1rem 1.2rem; border-radius: 14px;
    background: rgba(255,255,255,.96); border: 1px solid rgba(255,80,160,.3);
    box-shadow: 0 12px 32px rgba(0,0,0,.18); color: #2a2433;
}
.bartpl__calib-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; font-size: .9rem; margin-bottom: .8rem; }
.bartpl__calib-add { margin-left: auto; padding: .35rem .7rem; border: none; border-radius: 8px; background: #c850b9; color: #fff; font-weight: 700; cursor: pointer; }
.bartpl__calib-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .35rem 0; border-top: 1px solid rgba(0,0,0,.06); }
.bartpl__calib-tag { font-weight: 800; color: #c850b9; min-width: 28px; }
.bartpl__calib-row label { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 600; }
.bartpl__calib-row input[type=range] { width: 110px; accent-color: #c850b9; }
.bartpl__calib-num { width: 52px; padding: .2rem .3rem; border: 1px solid rgba(0,0,0,.2); border-radius: 6px; }
.bartpl__calib-del { border: none; background: transparent; color: #b02a37; cursor: pointer; }
.bartpl__calib-export { margin-top: .7rem; font-size: .82rem; }
.bartpl__calib-export textarea { width: 100%; font-family: monospace; font-size: .78rem; border: 1px solid rgba(0,0,0,.2); border-radius: 8px; padding: .5rem; margin-top: .4rem; }

/* ============================================================
   MODE D'AFFICHAGE — CARTE COLLECTION (tuiles type carte à collectionner)
   ============================================================ */
.barshelf__caption { display: none; } /* visible uniquement en mode carte */

.barshelf--mode-card .barshelf__rack { background-image: none !important; row-gap: 18px; }
.barshelf--mode-card .barshelf__abstract-bottle,
.barshelf--mode-card .barshelf__ghost,
.barshelf--mode-card .barshelf__stand,
.barshelf--mode-card .barshelf__card { display: none !important; }
.barshelf--mode-card .barshelf__bottle {
    height: calc(var(--slot-h) + 24px);
    background: rgba(15,16,22,.55);
    backdrop-filter: blur(3px);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0,0,0,.3);
    overflow: hidden;
    color: #fff;
    transition: transform .2s ease, box-shadow .2s ease;
}
.barshelf--mode-card .barshelf__bottle:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 34px rgba(0,0,0,.4);
}
.barshelf--mode-card .barshelf__img {
    bottom: 48px;
    height: calc(var(--slot-h) - var(--plank-h) - var(--bottle-top) - 8px);
    width: 72%;
}
.barshelf--mode-card .barshelf__bottle:hover .barshelf__img { transform: translateX(-50%); } /* pas de saut */
.barshelf--mode-card .barshelf__caption {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    position: absolute; left: 0; right: 0; bottom: 9px; padding: 0 6px; z-index: 3;
}
.barshelf--mode-card .barshelf__caption-name {
    font-size: .76rem; font-weight: 800; text-align: center; line-height: 1.1; color: #fff;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.barshelf--mode-card .barshelf__caption-meta { display: flex; align-items: center; gap: 5px; font-size: .72rem; color: rgba(255,255,255,.82); }
.barshelf--mode-card .barshelf__caption-rate { color: #ffce54; font-weight: 700; }
.barshelf--mode-card .barshelf__qty { bottom: auto; top: 8px; right: 8px; }

/* ============================================================
   MODE D'AFFICHAGE — NÉON (bouteilles en contours lumineux)
   ============================================================ */
.barshelf--mode-neon .barshelf__img,
.barshelf--mode-neon .barshelf__ghost,
.barshelf--mode-neon .barshelf__stand { display: none; }
.barshelf--mode-neon .barshelf__abstract-bottle {
    display: block; position: absolute; left: 50%;
    bottom: calc(var(--plank-h) + 10px);
    width: 52px; height: 128px;
    transform: translateX(-50%);
    border-radius: 18px 18px 13px 13px;
    background: transparent;
    border: 2px solid color-mix(in srgb, var(--bottle-glow) 85%, #fff 15%);
    box-shadow:
        0 0 8px color-mix(in srgb, var(--bottle-glow) 85%, transparent),
        0 0 20px color-mix(in srgb, var(--bottle-glow) 60%, transparent),
        0 0 38px color-mix(in srgb, var(--bottle-glow) 40%, transparent),
        inset 0 0 12px color-mix(in srgb, var(--bottle-glow) 35%, transparent);
    z-index: 2;
    transition: filter .2s ease;
}
.barshelf--mode-neon .barshelf__bottle:hover .barshelf__abstract-bottle { filter: brightness(1.25); }
.barshelf--mode-neon .barshelf__abstract-neck {
    background: transparent;
    border: 2px solid color-mix(in srgb, var(--bottle-glow) 85%, #fff 15%);
    border-bottom: none;
    box-shadow: 0 0 10px color-mix(in srgb, var(--bottle-glow) 70%, transparent);
}
.barshelf--mode-neon .barshelf__abstract-neck::before { display: none; }
.barshelf--mode-neon .barshelf__abstract-label {
    background: color-mix(in srgb, var(--bottle-glow) 75%, transparent);
    box-shadow: 0 0 9px var(--bottle-glow);
    opacity: .8; border: none;
}
.barshelf--mode-neon .barshelf__abstract-shine { display: none; }
/* voile sombre pour faire ressortir le néon, quel que soit le meuble */
.barshelf--mode-neon .barshelf__ambient { background: rgba(4,4,8,.55) !important; }
