﻿:root {
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color-scheme: dark;
    --pink: rgb(100, 0, 48);
    --pink-border: rgba(255,79,163,0.35);
    --pink-border-strong: rgba(255,79,163,0.65);
    --text: #ffffff;
    --muted: rgba(255,255,255,0.65);
    --bg: #0b0d12;
    --glass: rgba(255,255,255,0.06);
    --glass2: rgba(255,79,163,0.08);
    --card: rgba(255,79,163,0.12);
    --panel: rgba(0,0,0,0.16);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(1000px 700px at 15% -10%, rgba(255,79,163,0.35), transparent 60%), radial-gradient(1000px 700px at 100% 0%, rgba(255,20,147,0.25), transparent 55%), linear-gradient(180deg, var(--bg), var(--bg));
    color: var(--text);
}

.wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 14px;
    padding-bottom: 110px; /* spazio per bottom bar */
}

/* ===== TOP BAR ===== */
.top {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.topLeft {
    display: flex;
    justify-content: flex-start;
}

.topCenter {
    display: flex;
    justify-content: center;
}

.topRight {
    display: flex;
    justify-content: flex-end;
}

.topTitle {
    text-align: center;
    line-height: 1.05;
}

.topTitleA {
    font-weight: 1000;
    letter-spacing: 0.8px;
}

.topTitleB {
    font-size: 12px;
    color: rgba(255,255,255,0.65);
    font-weight: 800;
}

/* reset bigger + left */
.resetBtn {
    height: 48px;
    padding: 0 16px;
    border-radius: 18px;
    border: 1px solid rgba(255,79,163,0.40);
    background: rgba(0,0,0,0.18);
    color: rgba(255,255,255,0.92);
    font-weight: 1000;
    cursor: pointer;
}

    .resetBtn:hover {
        background: rgba(255,79,163,0.10);
    }

/* ===== BUTTONS ===== */
.btn {
    height: 42px;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid var(--pink-border);
    background: linear-gradient(180deg, rgba(255,79,163,0.35), rgba(255,79,163,0.15));
    color: var(--text);
    cursor: pointer;
    font-weight: 900;
    letter-spacing: 1px;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

    .btn:hover {
        background: linear-gradient(180deg, rgba(255,79,163,0.55), rgba(255,79,163,0.25));
    }

    .btn.ghost {
        background: transparent;
    }

    .btn.primary {
        background: linear-gradient(180deg, rgba(255,79,163,0.92), rgba(255,45,149,0.75));
        border-color: var(--pink-border-strong);
        box-shadow: 0 16px 40px rgba(255,79,163,0.45);
    }

        .btn.primary:hover {
            transform: translateY(-1px) scale(1.02);
            box-shadow: 0 22px 50px rgba(255,79,163,0.60);
        }

.iconBtn {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    border: 1px solid rgba(255,79,163,0.35);
    background: rgba(0,0,0,0.18);
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    font-weight: 1000;
    font-size: 18px;
}

    .iconBtn:hover {
        background: rgba(0,0,0,0.28);
    }

/* ===== CARD / EMPTY ===== */
.card {
    margin-top: 14px;
    border-radius: 22px;
    border: 1px solid var(--pink-border);
    background: var(--card);
    padding: 14px;
}

.empty {
    padding: 14px;
    border-radius: 16px;
    border: 1px dashed var(--pink-border);
    color: var(--muted);
    background: rgba(0,0,0,0.10);
}

.checkTitle {
    font-weight: 1000;
    margin: 4px 2px 10px;
    color: rgba(255,255,255,0.85);
}

/* ===== BAR ROW ===== */
.barRow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.barBtn {
    height: 56px;
    border-radius: 18px;
    border: 1px solid rgba(255,79,163,0.28);
    background: var(--panel);
    color: rgba(255,255,255,0.92);
    font-weight: 1000;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

    .barBtn:hover {
        transform: translateY(-1px);
        background: rgba(255,79,163,0.10);
        box-shadow: 0 18px 40px rgba(255,79,163,0.18);
    }

    .barBtn.active {
        border-color: rgba(255,79,163,0.65);
        background: rgba(255,79,163,0.12);
        box-shadow: 0 18px 45px rgba(255,79,163,0.22);
    }

/* ===== DROPDOWN ===== */
.dropdownRow {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.dropdownLabel {
    font-weight: 1000;
    color: rgba(255,255,255,0.75);
    letter-spacing: 0.6px;
}

.dropdown {
    height: 56px;
    border-radius: 18px;
    border: 1px solid rgba(255,79,163,0.35);
    background: rgba(0,0,0,0.22);
    color: rgba(255,255,255,0.92);
    font-weight: 900;
    outline: none;
    padding: 0 14px;
}

    .dropdown:focus {
        border-color: rgba(255,79,163,0.75);
        box-shadow: 0 0 0 4px rgba(255,79,163,0.18);
    }

    .dropdown option {
        background: #0b0d12;
        color: white;
    }

/* ===== FRIDGE SHELL ===== */
.fridge {
    margin-top: 14px;
    border-radius: 34px;
    border: 1px solid rgba(255,79,163,0.35);
    background: linear-gradient(180deg, var(--glass), var(--glass2));
    box-shadow: 0 26px 80px rgba(0,0,0,0.45), 0 18px 50px rgba(255,79,163,0.18);
    position: relative;
    overflow: hidden;
}

    .fridge::after {
        content: "";
        position: absolute;
        right: 14px;
        top: 22px;
        width: 10px;
        height: 120px;
        border-radius: 10px;
        background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(0,0,0,0.18));
        border: 1px solid rgba(255,255,255,0.08);
        opacity: 0.8;
    }

.fridgeInner {
    padding: 12px 12px 14px;
    display: grid;
    gap: 12px;
}

/* ===== SHELVES ===== */
.shelf {
    border-radius: 22px;
    border: 1px solid rgba(255,79,163,0.26);
    background: rgba(0,0,0,0.14);
    padding: 10px;
}

.shelfHeader {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.shelfTitle {
    font-weight: 1000;
    font-size: 13px;
    color: rgba(255,255,255,0.85);
}

.shelfHint {
    font-size: 12px;
    color: rgba(255,255,255,0.45);
}

/* ===== GRID ROWS ===== */
.rowFit {
    --cols: 6;
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    gap: 6px;
}

/* ===== TILES ===== */
.miniTile {
    position: relative;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    display: grid;
    grid-template-rows: 1fr auto;
    min-height: 112px;
    border-radius: 14px;
    overflow: hidden;
    transition: transform 150ms ease, box-shadow 150ms ease, min-height 180ms ease;
}

    .miniTile.on {
        box-shadow: 0 10px 22px rgba(255,79,163,0.18);
    }

.miniImg {
    width: 100%;
    height: 100%;
    max-height: 88px;
    display: block;
    object-fit: contain;
    transform: scale(1.06);
    filter: drop-shadow(0 14px 18px rgba(0,0,0,0.35));
    user-select: none;
    -webkit-user-drag: none;
}

.miniFallback {
    width: 100%;
    height: 88px;
    display: grid;
    place-items: center;
    font-size: 22px;
    opacity: 0.9;
    border-radius: 14px;
    background: rgba(0,0,0,0.12);
}

.miniName {
    margin-top: 2px;
    padding: 0 2px 6px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.1;
    color: rgba(255,255,255,0.85);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

@media (min-width: 420px) {
    .miniName {
        font-size: 11px;
    }
}

.miniQty {
    position: absolute;
    right: 6px;
    bottom: 22px;
    min-width: 26px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    border: 1px solid rgba(255,79,163,0.35);
    background: rgba(0,0,0,0.60);
    backdrop-filter: blur(6px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 1000;
    font-size: 12px;
    color: rgba(255,255,255,0.92);
}

/* active tile enlarges bottle */
.miniTile.active {
    min-height: 160px;
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(255,79,163,0.22);
    z-index: 2;
}

    .miniTile.active .miniImg {
        max-height: none;
        transform: scale(1.08);
    }

    .miniTile.active .miniName {
        display: none;
    }

    .miniTile.active .miniQty {
        bottom: 8px;
    }

/* ===== MODAL ===== */

.modalOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(8px);
    display: grid;
    place-items: center;
    z-index: 9998;
    padding: 14px;
}

.modalSheet {
    position: relative;
    bottom: auto;
    width: min(560px, 100%);
    border-radius: 26px;
    border: 1px solid rgba(255,79,163,0.35);
    background: linear-gradient( 180deg, rgba(255,255,255,0.09), rgba(255,79,163,0.10) );
    box-shadow: 0 26px 90px rgba(0,0,0,0.55);
    padding: 14px;
    animation: sheetPop 180ms ease-out;
}

@keyframes sheetPop {
    from {
        transform: translateY(14px) scale(0.98);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modalTop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.modalTitle {
    font-weight: 1000;
    font-size: 16px;
}

    .modalTitle h2 {
        margin: 0;
        font-size: 18px;
    }

.modalThumb {
    margin: 12px auto 6px;
    height: 140px;
    width: 100%;
    max-width: 260px;
    border-radius: 20px;
    border: 1px solid rgba(255,79,163,0.22);
    background: rgba(0,0,0,0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.modalThumbImg {
    max-height: 120px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transform: none;
    filter: drop-shadow(0 14px 18px rgba(0,0,0,0.35));
    user-select: none;
    -webkit-user-drag: none;
}

.modalThumbFallback {
    font-size: 36px;
    opacity: 0.9;
}

.modalControls {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 12px;
    align-items: center;
}

.step {
    height: 48px;
    border-radius: 18px;
    border: 1px solid var(--pink-border);
    background: linear-gradient(180deg, rgba(255,79,163,0.45), rgba(255,20,147,0.25));
    color: white;
    font-size: 24px;
    font-weight: 1000;
    cursor: pointer;
    transition: transform 140ms ease, background 140ms ease;
}

    .step:hover {
        background: linear-gradient(180deg, rgba(255,79,163,0.65), rgba(255,20,147,0.35));
        transform: translateY(-1px);
    }

.bigStep {
    height: 62px;
    border-radius: 22px;
    font-size: 28px;
}

.qtyInput {
    height: 62px;
    border-radius: 22px;
    border: 1px solid rgba(255,79,163,0.45);
    background: rgba(0,0,0,0.25);
    color: var(--text);
    font-size: 22px;
    font-weight: 1000;
    text-align: center;
    outline: none;
}

    .qtyInput:focus {
        border-color: rgba(255,79,163,0.75);
        box-shadow: 0 0 0 4px rgba(255,79,163,0.18);
    }

/* ===== FINAL LIST ===== */
.finalTop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.checkList {
    display: grid;
    gap: 10px;
}

.checkRow {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255,79,163,0.28);
    background: rgba(0,0,0,0.16);
}

    .checkRow input {
        width: 20px;
        height: 20px;
        accent-color: #ff4fa3;
    }

.checkThumb {
    width: 52px;
    height: 72px;
    border-radius: 14px;
    border: 1px solid rgba(255,79,163,0.22);
    background: rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
    padding: 6px;
}

.checkThumbImg {
    max-height: 60px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transform: none;
    filter: drop-shadow(0 8px 12px rgba(0,0,0,0.25));
    user-select: none;
    -webkit-user-drag: none;
}

.checkThumbFallback {
    font-size: 22px;
    opacity: 0.9;
}

.checkText {
    flex: 1;
}

.checkName {
    font-weight: 1000;
    letter-spacing: -0.2px;
}

.checkRow.done {
    opacity: 0.85;
}

    .checkRow.done .checkName {
        text-decoration: line-through;
        color: rgba(255,255,255,0.55);
    }

/* ===== FIXED BOTTOM ACTION BAR ===== */
.fixedBottomBar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9997;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 10px;
    gap: 10px;
    background: linear-gradient(180deg, rgba(0,0,0,0.00), rgba(0,0,0,0.45));
    backdrop-filter: blur(12px);
}

.fixedBtn {
    height: 64px;
    border-radius: 22px;
    font-size: 18px;
    font-weight: 1000;
    letter-spacing: 0.6px;
    border: 1px solid var(--pink-border);
    background: rgba(0,0,0,0.12);
    color: white;
    cursor: pointer;
}

    .fixedBtn.ghost {
        background: rgba(0,0,0,0.12);
    }

    .fixedBtn.primary {
        background: linear-gradient(180deg, rgba(255,79,163,0.92), rgba(255,45,149,0.75));
        border-color: var(--pink-border-strong);
        box-shadow: 0 16px 40px rgba(255,79,163,0.45);
    }

/* ===== RESET CONFIRM ===== */
.confirmOverlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0,0,0,0.70);
    backdrop-filter: blur(10px);
    display: grid;
    place-items: center;
    padding: 16px;
}

.confirmCard {
    width: 100%;
    max-width: 420px;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.65);
    box-shadow: 0 26px 80px rgba(0,0,0,0.55);
    padding: 16px;
}

.confirmTitle {
    font-weight: 1000;
    font-size: 16px;
    margin-bottom: 6px;
}

.confirmText {
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    margin-bottom: 14px;
    line-height: 1.4;
}

.confirmActions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ===== PARTICLES ===== */
.particleLayer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

.particle {
    position: absolute;
    transform: translate(-50%, -50%);
    will-change: transform, opacity;
}

    .particle.glitter {
        border-radius: 2px;
        background: conic-gradient(from 0deg, #ffffff, #ff4fa3, #ffd1ec, #ff2d95, #ffffff);
        filter: drop-shadow(0 10px 18px rgba(255,79,163,0.35));
        animation: glitterPop var(--life) ease-out forwards;
    }

    .particle.devil::before {
        content: "😈";
    }

    .particle.devil {
        filter: drop-shadow(0 10px 18px rgba(255,45,149,0.35));
        animation: devilPop var(--life) ease-out forwards;
    }

    .particle.firework::before {
        content: "🎆";
    }

    .particle.firework {
        filter: drop-shadow(0 12px 24px rgba(255,79,163,0.45));
        animation: fireworkPop var(--life) ease-out forwards;
    }

@keyframes glitterPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.4) rotate(0deg);
    }

    10% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2) rotate(20deg);
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.2) rotate(var(--rot));
    }
}

@keyframes devilPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.4);
    }

    12% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.25);
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.6) rotate(var(--rot));
    }
}

@keyframes fireworkPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.6);
    }

    10% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(2.2);
    }

    60% {
        opacity: 0.9;
        transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.4) rotate(var(--rot));
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.8) rotate(var(--rot));
    }
}
