:root {
    --bg: #0f1220;
    --panel: #151933;
    --panel-2: #1b2042;
    --text: #eef2ff;
    --muted: #a6b0d6;
    --accent: #7c5cff;
    --accent-2: #00d4ff;
    --good: #32d583;
    --bad: #ff6b6b;
    --plate: #e8ebf7;
}

* {
    box-sizing: border-box;
}
html, body {
    height: 100%;
}
body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial;
    background: radial-gradient(1200px 800px at 70% -10%, #1a1f40 0%, var(--bg) 55%);
    color: var(--text);
}
a {
    color: inherit;
}

.wrap {
    min-height: 100%;
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 16px;
    padding: 18px;
}
@media (max-width: 768px) {
    .wrap {
        grid-template-columns: 1fr;
        padding: 10px;
    }
    .left, .right {
        order: 2;
    }
    .center {
        order: 1;
    }
    .ing {
        font-size: 14px;
    }
}

.panel {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.panel h2 {
    margin: 0;
    font-size: 18px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    color: #dfe6ff;
}
.left .list {
    display: grid;
    gap: 10px;
    padding: 14px;
}
.ing {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    cursor: pointer;
    user-select: none;
    transition: transform .12s ease, background .12s ease;
}
.ing:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,.06);
}
.ing .swatch {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 2px solid rgba(0,0,0,.25);
    display: grid;
    place-items: center;
    font-size: 18px;
}
.ing .name {
    font-weight: 600;
    font-size: 14px;
}
.ing small {
    color: var(--muted);
}

.center {
    position: relative;
    display: grid;
    place-items: center;
    padding: 12px;
}
.stage {
    width: min(720px, 92vw);
    aspect-ratio: 16/10;
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: radial-gradient(70% 50% at 50% 35%, rgba(124,92,255,.15), transparent 60%), linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.00));
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 20px 60px rgba(0,0,0,.35);
}
.table {
    position: absolute;
    inset: auto 0 0 0;
    height: 40%;
    background: linear-gradient(180deg, #1b213f, #141935);
    box-shadow: 0 -8px 40px rgba(0,0,0,.35) inset;
}
.plate-area {
    position: absolute;
    left: 50%;
    bottom: 12%;
    transform: translateX(-50%);
    width: min(420px, 70%);
    height: min(320px, 50%);
    display: grid;
    place-items: end center;
    pointer-events: none;
}
.plate {
    width: 100%;
    height: 25%;
    background: radial-gradient(90% 80% at 50% 20%, #ffffff, #e9ecf9 40%, #d6dbef 70%, #c3c9e5 100%);
    border-radius: 1000px;
    box-shadow: 0 22px 40px rgba(0,0,0,.35), inset 0 2px 10px rgba(0,0,0,.1);
    border: 1px solid rgba(0,0,0,.15);
}
.dropzone {
    position: absolute;
    bottom: calc(16% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: min(420px, 70%);
    height: min(240px, 40%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: auto;
}

.stack {
    position: relative;
    width: 88%;
    height: 100%;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: flex-start;
    transform-origin: center bottom;
    transition: transform .25s ease;
}

.layer {
    position: relative;
    width: 100%;
    display: grid;
    place-items: center;
    transform-origin: center bottom;
    transition: transform .16s ease, filter .16s ease;
    margin-top: -24px; /* PREKRIVANJE ključna sprememba */
    z-index: 1;
}

.layer:first-child {
    margin-top: 0; /* Spodnja bombetka naj ostane brez zamika */
}

.layer.removable {
    cursor: pointer;
}
.layer:hover {
    filter: brightness(1.06);
}
.svg {
    width: 100%;
    max-width: 520px;
}
.hint {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(16% + 50% + 10px);
    font-size: 12px;
    color: var(--muted);
    background: rgba(0,0,0,.35);
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(6px);
}
.right .score {
    padding: 14px;
    display: grid;
    gap: 10px;
}
.score .big {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: .5px;
}
.meter {
    width: 100%;
    height: 12px;
    background: rgba(255,255,255,.07);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.10);
}
.meter > div {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .25s ease;
}
.tips {
    color: var(--muted);
    font-size: 13px;
}
.buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}
button {
    appearance: none;
    border: 0;
    background: linear-gradient(180deg, #2a3162, #1c2247);
    color: #e9edff;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: .2px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,.09);
    box-shadow: 0 8px 20px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.06);
}
button.secondary {
    background: transparent;
    border: 1px dashed rgba(255,255,255,.25);
    font-weight: 600;
}
.toast {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}
.toast.active {
    display: grid;
}
.toast .inner {
    width: min(680px, 96vw);
    background: linear-gradient(180deg, #1a2042, #141938);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 20px;
    padding: 22px;
    text-align: center;
    box-shadow: 0 40px 120px rgba(0,0,0,.6);
}
.toast .inner h3 {
    margin: 0 0 6px 0;
    font-size: 28px;
}
.toast .inner p {
    color: var(--muted);
    margin-top: 6px;
}
.toast button {
    margin-top: 12px;
}
.legend {
    padding: 10px 14px 16px;
    font-size: 12px;
    color: var(--muted);
}
.legend code {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    padding: 2px 6px;
    border-radius: 6px;
}
.svg-img {
    width: 200%;
    max-width: 500px;
    height: 40px;
    object-fit: contain;
    display: block;
    padding: 0;
    margin: 0;
    transform: scale(3);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

@media (max-width: 768px) {
    .stage {
        aspect-ratio: unset;
        height: 480px;
    }

    .dropzone {
        height: 65%;
    }

    .plate-area {
        height: 35%;
    }
}

.stack.shake {
    animation: shake 0.5s ease;
}

/* Razširjen center panel */
.panel.center {
    background: radial-gradient(circle at center, #2e235a, #1b133f);
    border: 2px solid #7c5cff;
    box-shadow: 0 0 30px rgba(124,92,255,0.4), inset 0 1px 0 rgba(255,255,255,.05);
}



