@font-face {
    font-family: 'IRANSansWeb';
    src: url('../../fonts/iransans/IRANSansWeb(FaNum).woff2') format('woff2'), url('../../fonts/iransans/IRANSansWeb(FaNum).woff') format('woff');
    font-weight: normal;
    font-display: swap;
}


:root {
    --navy: #0a1628;
    --gold: #f5c518;
    --gold-2: #ffd84d;
    --white: #ffffff;
    --muted: rgba(255,255,255,0.55);
    --phone-w: 390px;
    --phone-h: 844px;
    --ease: cubic-bezier(.22,.9,.3,1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    font-family: "IRANSansWeb",system-ui,sans-serif;
    background: #070b14;
    color: var(--white);
    overflow: hidden;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    background: radial-gradient(ellipse 80% 50% at 50% 0%,#1a2744 0%,transparent 60%),#070b14;
}
/* Phone Frame */
.app-shell {
    width: min(100vw,var(--phone-w));
    height: min(100dvh,var(--phone-h));
    max-height: 100dvh;
    position: relative;
    overflow: hidden;
    background: var(--navy);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.06),0 30px 80px rgba(0,0,0,0.55);
}

@media(min-width:420px) {
    .app-shell {
        border-radius: 28px;
        height: min(92dvh,var(--phone-h));
    }
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(0.985);
    transition: opacity .45s var(--ease), transform .45s var(--ease);
    overflow: hidden;
}

    .screen.active {
        opacity: 1;
        pointer-events: auto;
        transform: none;
        z-index: 2;
    }
/* Top bar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 5px;
    position: relative;
    z-index: 5;
    flex-shrink: 0;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.05);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: .2s var(--ease);
    backdrop-filter: blur(8px);
}

    .icon-btn:active {
        transform: scale(0.94);
        background: rgba(255,255,255,0.1);
    }

    .icon-btn svg {
        width: 18px;
        height: 18px;
    }

.logo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.logo-text {
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 1.5px;
    color: #fff;
    line-height: 1;
}

.logo-tag {
    font-size: 9px;
    color: var(--gold);
    font-style: italic;
    font-weight: 500;
}
/* Buttons */
.btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .18s var(--ease), box-shadow .18s;
    user-select: none;
}

    .btn:active {
        transform: scale(0.97);
    }

.btn-primary {
    background: linear-gradient(180deg,var(--gold-2),var(--gold));
    color: #1a1400;
    box-shadow: 0 8px 24px rgba(245,197,24,0.28);
}

.btn-ghost {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.22);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
}
/* ===== Welcome ===== */
#screen-welcome {
    background: url(../../bockstein/img/bg.jpg?ver=1.6.0.0) center top / cover no-repeat;
    background-size: cover;
    background-position: center -40px;
}

    #screen-welcome::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
    }

.welcome-content {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 8px 22px 22px;
}

.welcome-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding-top: 8px;
}

.welcome-title {
    font-size: clamp(40px,9.2vw,38px);
    font-weight: 800;
    line-height: 1.45;
    color: var(--gold);
    text-shadow: 0 2px 20px rgba(0,0,0,0.45);
}

    .welcome-title .spark {
        display: inline-block;
        animation: twinkle 2s ease-in-out infinite;
    }

.welcome-icon {
    margin: 14px 0 8px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1.5px solid rgba(245,197,24,0.45);
    display: grid;
    place-items: center;
    color: var(--gold);
    background: rgba(245,197,24,0.08);
    animation: softPulse 2.8s ease-in-out infinite;
}

    .welcome-icon svg {
        width: 22px;
        height: 22px;
    }

.welcome-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.78);
    line-height: 1.8;
    max-width: 280px;
}

.welcome-form {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 6px;
}

.field {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 14px;
    height: 52px;
    padding: 0 14px;
    transition: border-color .2s, background .2s, box-shadow .2s;
    backdrop-filter: blur(10px);
}

    .field:focus-within {
        border-color: rgba(245,197,24,0.55);
        background: rgba(255,255,255,0.09);
        box-shadow: 0 0 0 3px rgba(245,197,24,0.1);
    }

    .field .field-icon {
        width: 22px;
        height: 22px;
        color: rgba(255,255,255,0.45);
        flex-shrink: 0;
        margin-left: 10px;
    }

    .field input {
        flex: 1;
        background: transparent;
        border: none;
        outline: none;
        color: #fff;
        font-family: inherit;
        font-size: 14px;
        text-align: right;
        direction: rtl;
    }

        .field input::placeholder {
            color: rgba(255,255,255,0.38);
        }

        .field input[type="tel"] {
            letter-spacing: 0.5px;
            direction: ltr;
            text-align: right;
        }

.start-btn {
    height: 54px;
    font-size: 16px;
    margin-top: 6px;
    width: 100%;
}

    .start-btn svg {
        width: 18px;
        height: 18px;
    }

.step-indicator {
    text-align: center;
    margin-top: 14px;
    color: rgba(255,255,255,0.45);
    font-size: 12px;
}

.dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

    .dots span {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: rgba(255,255,255,0.2);
        transition: .25s;
    }

        .dots span.on {
            background: var(--gold);
            box-shadow: 0 0 10px rgba(245,197,24,0.55);
            width: 18px;
            border-radius: 999px;
        }
/* ===== Game ===== */
#screen-game {
    background: #05225e;
}

    #screen-game .topbar h1 {
        color: #fff;
    }

    #screen-game .game-scroll {
        padding-top: 5px;
    }

.game-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 14px 18px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

    .game-scroll::-webkit-scrollbar {
        display: none;
    }
/* ===== GAME STAGE (scattered layout) ===== */
.game-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    --ing-size: 74px;
}

.game-cta {
    flex-shrink: 0;
    padding: 4px 20px calc(26px + env(safe-area-inset-bottom, 0px));
    display: flex;
    justify-content: center;
}

    .game-cta .btn-result-main {
        width: 100%;
        max-width: 258px;
        height: 58px;
        font-size: 19px;
        font-weight: 800;
        border-radius: 999px;
    }

@media (max-height:720px) {
    .game-stage {
        --ing-size: 64px;
    }

        .game-stage .ing-icon-btn .ing-icon-label {
            font-size: 12px;
        }
}
/* ===== CUP AREA ===== */
.cup-hero-area {
    position: absolute;
    left: 60.5%;
    top: 50%;
    width: 60%;
    transform: translate(-50%,-50%);
    z-index: 2;
}

.cup-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 611 / 587;
}

.cup-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 4;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Glow */
.cup-glow {
    position: absolute;
    top: 10%;
    left: -25%;
    right: -25%;
    bottom: 0;
    border-radius: 50%;
    z-index: 0;
    opacity: 0;
    transition: opacity 1s, background 1s;
    filter: blur(35px);
    pointer-events: none;
}

    .cup-glow.active {
        opacity: 0.3;
    }
/* Steam */
.steam-area {
    position: absolute;
    left: 63.5%;
    top: -6px;
    transform: translateX(-50%);
    z-index: 6;
    width: 80px;
    height: 50px;
    opacity: 0;
    transition: opacity 0.6s;
    pointer-events: none;
}

    .steam-area.on {
        opacity: 1;
    }

.steam-line {
    position: absolute;
    bottom: 0;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(to top,rgba(255,255,255,0.22),transparent);
    filter: blur(2px);
    animation: steamFloat var(--dur,2.5s) ease-in-out infinite;
    animation-delay: var(--delay,0s);
}

@keyframes steamFloat {
    0% {
        transform: translateY(0) scaleX(1) rotate(0deg);
        opacity: 0;
    }

    15% {
        opacity: 0.5;
    }

    50% {
        transform: translateY(-25px) scaleX(1.8) rotate(var(--rot,5deg));
        opacity: 0.3;
    }

    100% {
        transform: translateY(-50px) scaleX(2.5) rotate(var(--rot2,-10deg));
        opacity: 0;
    }
}

.cup-scene {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.cup-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 4;
    pointer-events: none;
    user-select: none;
}

.liquid-clip {
    position: absolute;
    left: 28.4%;
    right: 1.9%;
    top: 1px;
    bottom: 1px;
    border-radius: 2% 2% 9% 9% / 1% 1% 9% 9%;
    overflow: hidden;
    z-index: 2;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.liquid-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 0%;
    transition: height 0.9s var(--ease);
    display: flex;
    flex-direction: column-reverse;
}

.liquid-layer {
    width: 100%;
    min-height: 0;
    transition: height 0.75s var(--ease), opacity 0.4s;
    position: relative;
}

    .liquid-layer::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        height: 3px;
        background: linear-gradient(180deg,rgba(255,255,255,0.18),transparent);
        opacity: 0.5;
    }

.layer-milk {
    background: #ffffff;
    box-shadow: inset 0 -2px 8px rgba(200,180,130,0.15);
}

.layer-creamer {
    background: linear-gradient(180deg, #fff9e8 0%, #f4e4be 35%, #e8d29f 72%, #d9bd79 100%);
    box-shadow: inset 0 3px 8px rgba(255,255,255,0.35), inset 0 -3px 8px rgba(175,135,65,0.2);
}

.layer-water {
    background: linear-gradient(180deg, rgba(150,230,255,0.72) 0%, rgba(73,173,215,0.68) 48%, rgba(31,116,166,0.72) 100%);
    box-shadow: inset 0 3px 9px rgba(255,255,255,0.25), inset 0 -4px 10px rgba(0,70,120,0.18);
}

.layer-coffee {
    background: linear-gradient(180deg, rgba(255,220,160,0.12) 0%, transparent 20%), linear-gradient(180deg, #8b5e3c 0%, #6b4226 25%, #4a2c17 55%, #3a1f0e 80%, #2d1608 100%);
    box-shadow: inset 0 -2px 6px rgba(0,0,0,0.2);
}

/* Cocoa now follows the sugar-style granular look, using brown grains instead of a photo texture. */
.layer-cocoa {
    background: radial-gradient(circle 1px at 84% 17%, rgba(93,45,19,.94) 50%, transparent 51%), radial-gradient(circle 1px at 34% 31%, rgba(123,67,34,.92) 50%, transparent 51%), radial-gradient(circle 2px at 89% 97%, rgba(74,34,14,.88) 50%, transparent 51%), radial-gradient(circle 1px at 57% 7%, rgba(146,83,45,.9) 50%, transparent 51%), radial-gradient(circle 2px at 32% 67%, rgba(82,39,17,.9) 50%, transparent 51%), radial-gradient(circle 2px at 28% 94%, rgba(129,71,37,.92) 50%, transparent 51%), radial-gradient(circle 1.5px at 56% 31%, rgba(106,54,25,.94) 50%, transparent 51%), radial-gradient(circle 2px at 3% 23%, rgba(70,31,12,.9) 50%, transparent 51%), radial-gradient(circle 1px at 38% 22%, rgba(154,91,50,.9) 50%, transparent 51%), radial-gradient(circle 1px at 46% 16%, rgba(97,47,20,.92) 50%, transparent 51%), radial-gradient(circle 2px at 48% 47%, rgba(133,73,38,.88) 50%, transparent 51%), radial-gradient(circle 1.5px at 8% 96%, rgba(85,40,16,.9) 50%, transparent 51%), radial-gradient(circle 2px at 51% 13%, rgba(142,80,43,.9) 50%, transparent 51%), radial-gradient(circle 2.5px at 83% 82%, rgba(76,34,13,.9) 50%, transparent 51%), radial-gradient(circle 1px at 27% 93%, rgba(117,61,29,.9) 50%, transparent 51%), radial-gradient(circle 1px at 32% 40%, rgba(165,99,55,.9) 50%, transparent 51%), radial-gradient(circle 1.5px at 15% 51%, rgba(91,43,18,.92) 50%, transparent 51%), radial-gradient(circle 1.5px at 49% 23%, rgba(136,76,39,.9) 50%, transparent 51%), radial-gradient(circle 2px at 88% 37%, rgba(68,29,11,.92) 50%, transparent 51%), radial-gradient(circle 2px at 85% 12%, rgba(151,88,48,.9) 50%, transparent 51%), radial-gradient(circle 1px at 71% 96%, rgba(101,50,23,.9) 50%, transparent 51%), radial-gradient(circle 2px at 51% 37%, rgba(124,66,32,.92) 50%, transparent 51%), radial-gradient(circle 1.5px at 31% 90%, rgba(73,32,12,.9) 50%, transparent 51%), radial-gradient(circle 2.5px at 10% 32%, rgba(145,82,44,.9) 50%, transparent 51%), radial-gradient(circle 1.5px at 43% 54%, rgba(94,44,18,.9) 50%, transparent 51%), radial-gradient(circle 1.5px at 75% 94%, rgba(130,71,36,.9) 50%, transparent 51%), radial-gradient(circle 2px at 66% 53%, rgba(78,36,14,.92) 50%, transparent 51%), radial-gradient(circle 1px at 36% 20%, rgba(158,94,52,.9) 50%, transparent 51%), radial-gradient(circle 2px at 71% 36%, rgba(108,56,27,.92) 50%, transparent 51%), radial-gradient(circle 1.5px at 77% 54%, rgba(140,78,41,.9) 50%, transparent 51%), radial-gradient(circle 1.5px at 20% 68%, rgba(80,37,15,.9) 50%, transparent 51%), radial-gradient(circle 1px at 9% 17%, rgba(132,72,37,.92) 50%, transparent 51%), radial-gradient(circle 2px at 90% 57%, rgba(72,31,12,.9) 50%, transparent 51%), radial-gradient(circle 1.5px at 51% 79%, rgba(150,86,46,.9) 50%, transparent 51%), radial-gradient(circle 2px at 73% 4%, rgba(97,47,20,.92) 50%, transparent 51%), radial-gradient(circle 2.5px at 90% 71%, rgba(121,64,31,.9) 50%, transparent 51%), radial-gradient(circle 1px at 85% 46%, rgba(67,29,11,.92) 50%, transparent 51%), radial-gradient(circle 1px at 23% 61%, rgba(163,97,54,.9) 50%, transparent 51%), radial-gradient(circle 2px at 95% 36%, rgba(88,41,17,.92) 50%, transparent 51%), radial-gradient(circle 2.5px at 67% 16%, rgba(137,76,40,.9) 50%, transparent 51%), radial-gradient(circle 2px at 84% 67%, rgba(75,33,13,.9) 50%, transparent 51%), radial-gradient(circle 2px at 50% 23%, rgba(151,87,47,.9) 50%, transparent 51%), radial-gradient(circle 2px at 70% 3%, rgba(104,52,24,.92) 50%, transparent 51%), radial-gradient(circle 1.5px at 5% 17%, rgba(126,68,34,.9) 50%, transparent 51%), radial-gradient(circle 1px at 42% 33%, rgba(78,35,14,.92) 50%, transparent 51%), radial-gradient(circle 1px at 75% 13%, rgba(146,83,44,.9) 50%, transparent 51%), radial-gradient(circle 2.5px at 11% 71%, rgba(92,43,18,.9) 50%, transparent 51%), radial-gradient(circle 2px at 87% 63%, rgba(130,70,35,.9) 50%, transparent 51%), radial-gradient(circle 1.5px at 70% 80%, rgba(69,30,11,.92) 50%, transparent 51%), radial-gradient(circle 2px at 72% 96%, rgba(157,93,51,.9) 50%, transparent 51%), radial-gradient(circle 2px at 42% 54%, rgba(109,56,27,.92) 50%, transparent 51%), radial-gradient(circle 1.5px at 59% 69%, rgba(83,38,15,.9) 50%, transparent 51%), linear-gradient(180deg, #9a6038 0%, #754421 32%, #563018 67%, #351a0b 100%);
    box-shadow: inset 0 3px 7px rgba(218,153,95,.2), inset 0 -4px 8px rgba(0,0,0,.34);
    overflow: hidden;
}

    .layer-cocoa::before {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(circle 1.5px at 14% 22%, rgba(61,26,9,.8) 50%, transparent 52%), radial-gradient(circle 1px at 42% 72%, rgba(173,103,57,.75) 50%, transparent 52%), radial-gradient(circle 2px at 68% 38%, rgba(78,33,12,.75) 50%, transparent 52%), radial-gradient(circle 1.5px at 88% 74%, rgba(154,88,45,.78) 50%, transparent 52%);
        background-size: 19px 19px, 23px 23px, 29px 29px, 31px 31px;
        opacity: .9;
        pointer-events: none;
    }

    .layer-cocoa::after {
        content: "";
        display: block;
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        height: 4px;
        background: linear-gradient(180deg, rgba(196,126,75,.35), transparent);
        opacity: .8;
        pointer-events: none;
    }

.layer-sugar {
    background: radial-gradient(circle 1px at 84% 17%, rgba(255,255,255,0.7) 50%, transparent 51%), radial-gradient(circle 1px at 34% 31%, rgba(255,255,255,0.69) 50%, transparent 51%), radial-gradient(circle 2px at 89% 97%, rgba(255,255,255,0.43) 50%, transparent 51%), radial-gradient(circle 1px at 57% 7%, rgba(255,255,255,0.44) 50%, transparent 51%), radial-gradient(circle 2px at 32% 67%, rgba(255,255,255,0.41) 50%, transparent 51%), radial-gradient(circle 2px at 28% 94%, rgba(255,255,255,0.68) 50%, transparent 51%), radial-gradient(circle 1.5px at 56% 31%, rgba(255,255,255,0.64) 50%, transparent 51%), radial-gradient(circle 2px at 3% 23%, rgba(255,255,255,0.57) 50%, transparent 51%), radial-gradient(circle 1px at 38% 22%, rgba(255,255,255,0.78) 50%, transparent 51%), radial-gradient(circle 1px at 46% 16%, rgba(255,255,255,0.55) 50%, transparent 51%), radial-gradient(circle 2px at 48% 47%, rgba(255,255,255,0.51) 50%, transparent 51%), radial-gradient(circle 1.5px at 8% 96%, rgba(255,255,255,0.61) 50%, transparent 51%), radial-gradient(circle 2px at 51% 13%, rgba(255,255,255,0.52) 50%, transparent 51%), radial-gradient(circle 2.5px at 83% 82%, rgba(255,255,255,0.54) 50%, transparent 51%), radial-gradient(circle 1px at 27% 93%, rgba(255,255,255,0.42) 50%, transparent 51%), radial-gradient(circle 1px at 32% 40%, rgba(255,255,255,0.74) 50%, transparent 51%), radial-gradient(circle 1.5px at 15% 51%, rgba(255,255,255,0.58) 50%, transparent 51%), radial-gradient(circle 1.5px at 49% 23%, rgba(255,255,255,0.54) 50%, transparent 51%), radial-gradient(circle 2px at 88% 37%, rgba(255,255,255,0.77) 50%, transparent 51%), radial-gradient(circle 2px at 85% 12%, rgba(255,255,255,0.65) 50%, transparent 51%), radial-gradient(circle 1px at 71% 96%, rgba(255,255,255,0.47) 50%, transparent 51%), radial-gradient(circle 2px at 51% 37%, rgba(255,255,255,0.68) 50%, transparent 51%), radial-gradient(circle 1.5px at 31% 90%, rgba(255,255,255,0.74) 50%, transparent 51%), radial-gradient(circle 2.5px at 10% 32%, rgba(255,255,255,0.41) 50%, transparent 51%), radial-gradient(circle 1.5px at 43% 54%, rgba(255,255,255,0.43) 50%, transparent 51%), radial-gradient(circle 1.5px at 75% 94%, rgba(255,255,255,0.49) 50%, transparent 51%), radial-gradient(circle 2px at 66% 53%, rgba(255,255,255,0.58) 50%, transparent 51%), radial-gradient(circle 1px at 36% 20%, rgba(255,255,255,0.7) 50%, transparent 51%), radial-gradient(circle 2px at 71% 36%, rgba(255,255,255,0.63) 50%, transparent 51%), radial-gradient(circle 1.5px at 77% 54%, rgba(255,255,255,0.49) 50%, transparent 51%), radial-gradient(circle 1.5px at 20% 68%, rgba(255,255,255,0.44) 50%, transparent 51%), radial-gradient(circle 1px at 9% 17%, rgba(255,255,255,0.65) 50%, transparent 51%), radial-gradient(circle 2px at 90% 57%, rgba(255,255,255,0.43) 50%, transparent 51%), radial-gradient(circle 1.5px at 51% 79%, rgba(255,255,255,0.61) 50%, transparent 51%), radial-gradient(circle 2px at 73% 4%, rgba(255,255,255,0.69) 50%, transparent 51%), radial-gradient(circle 2.5px at 90% 71%, rgba(255,255,255,0.51) 50%, transparent 51%), radial-gradient(circle 1px at 85% 46%, rgba(255,255,255,0.52) 50%, transparent 51%), radial-gradient(circle 1px at 23% 61%, rgba(255,255,255,0.78) 50%, transparent 51%), radial-gradient(circle 2px at 95% 36%, rgba(255,255,255,0.7) 50%, transparent 51%), radial-gradient(circle 2.5px at 67% 16%, rgba(255,255,255,0.65) 50%, transparent 51%), radial-gradient(circle 2px at 84% 67%, rgba(255,255,255,0.48) 50%, transparent 51%), radial-gradient(circle 2px at 50% 23%, rgba(255,255,255,0.78) 50%, transparent 51%), radial-gradient(circle 2px at 70% 3%, rgba(255,255,255,0.53) 50%, transparent 51%), radial-gradient(circle 1.5px at 5% 17%, rgba(255,255,255,0.75) 50%, transparent 51%), radial-gradient(circle 1px at 42% 33%, rgba(255,255,255,0.5) 50%, transparent 51%), radial-gradient(circle 1px at 75% 13%, rgba(255,255,255,0.69) 50%, transparent 51%), radial-gradient(circle 2.5px at 11% 71%, rgba(255,255,255,0.45) 50%, transparent 51%), radial-gradient(circle 2px at 87% 63%, rgba(255,255,255,0.47) 50%, transparent 51%), radial-gradient(circle 1.5px at 70% 80%, rgba(255,255,255,0.79) 50%, transparent 51%), radial-gradient(circle 2px at 72% 96%, rgba(255,255,255,0.48) 50%, transparent 51%), radial-gradient(circle 2px at 42% 54%, rgba(255,255,255,0.66) 50%, transparent 51%), radial-gradient(circle 1.5px at 59% 69%, rgba(255,255,255,0.45) 50%, transparent 51%), radial-gradient(circle 1.5px at 31% 11%, rgba(255,255,255,0.41) 50%, transparent 51%), radial-gradient(circle 2px at 73% 32%, rgba(255,255,255,0.49) 50%, transparent 51%), radial-gradient(circle 2px at 12% 93%, rgba(255,255,255,0.42) 50%, transparent 51%), radial-gradient(circle 2.5px at 11% 7%, rgba(255,255,255,0.53) 50%, transparent 51%), radial-gradient(circle 1.5px at 68% 33%, rgba(255,255,255,0.67) 50%, transparent 51%), radial-gradient(circle 1px at 30% 72%, rgba(255,255,255,0.69) 50%, transparent 51%), radial-gradient(circle 1.5px at 76% 76%, rgba(255,255,255,0.5) 50%, transparent 51%), radial-gradient(circle 1px at 63% 55%, rgba(255,255,255,0.44) 50%, transparent 51%), linear-gradient(180deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 100%);
    box-shadow: inset 0 0 12px rgba(255,255,255,0.12);
}

/* Milk foam: airy, irregular and full of visible bubbles. */
.layer-foam {
    background-color: #fffaf0;
    background-image: radial-gradient(circle 7px at 12% 24%, rgba(255,255,255,.98) 0 56%, rgba(217,203,178,.7) 59% 65%, transparent 69%), radial-gradient(circle 5px at 36% 62%, rgba(255,255,255,.96) 0 55%, rgba(220,207,183,.65) 59% 66%, transparent 70%), radial-gradient(circle 9px at 62% 28%, rgba(255,255,255,.98) 0 58%, rgba(213,198,171,.66) 61% 67%, transparent 71%), radial-gradient(circle 6px at 86% 68%, rgba(255,255,255,.96) 0 56%, rgba(221,209,189,.62) 60% 66%, transparent 70%), radial-gradient(circle 3px at 72% 82%, rgba(255,255,255,.92) 0 52%, rgba(205,190,165,.55) 58% 65%, transparent 70%), linear-gradient(180deg, #fffef9 0%, #fffaf0 35%, #f3ead8 72%, #e7d9be 100%);
    background-size: 54px 44px, 46px 38px, 66px 52px, 58px 46px, 34px 30px, 100% 100%;
    background-position: 0 0, 10px 8px, 3px 5px, 18px 12px, 5px 2px, 0 0;
    border-top: 1px solid rgba(255,255,255,.78);
    box-shadow: inset 0 4px 9px rgba(255,255,255,.9), inset 0 -5px 10px rgba(204,188,157,.28);
    overflow: visible;
    animation: foamTextureDrift 5s ease-in-out infinite alternate;
}

    .layer-foam::before {
        content: "";
        position: absolute;
        inset: -2px 0 0;
        background: url("img/foam(1).png") center / 125px auto repeat;
        opacity: .22;
        mix-blend-mode: screen;
        filter: brightness(1.06) contrast(1.08);
        pointer-events: none;
    }

    .layer-foam::after {
        content: "";
        display: block;
        position: absolute;
        left: -5px;
        right: -5px;
        top: -11px;
        height: 22px;
        background: radial-gradient(ellipse 18px 12px at 5% 100%, #fffdf7 0 72%, transparent 74%), radial-gradient(ellipse 23px 15px at 25% 100%, #fffaf0 0 73%, transparent 75%), radial-gradient(ellipse 17px 12px at 46% 100%, #fffefa 0 72%, transparent 74%), radial-gradient(ellipse 25px 16px at 68% 100%, #fff9ed 0 73%, transparent 75%), radial-gradient(ellipse 19px 13px at 91% 100%, #fffdf8 0 72%, transparent 74%);
        filter: drop-shadow(0 2px 2px rgba(210,195,166,.22));
        pointer-events: none;
    }

@keyframes foamTextureDrift {
    from {
        background-position: 0 0, 10px 8px, 3px 5px, 18px 12px, 5px 2px, 0 0;
    }

    to {
        background-position: 8px 5px, 3px 2px, 10px 9px, 12px 5px, 1px 7px, 0 0;
    }
}
/* Wave */
.wave-wrap {
    position: absolute;
    left: -2px;
    right: -2px;
    height: 12px;
    z-index: 5;
    bottom: 0%;
    transition: bottom 0.9s var(--ease), opacity 0.4s;
    opacity: 0;
    pointer-events: none;
}

    .wave-wrap.show {
        opacity: 1;
    }

.wave-svg {
    position: absolute;
    left: 0;
    top: 0;
    width: 200%;
    height: 100%;
    animation: waveScroll 3s linear infinite;
}

.wave-svg-back {
    position: absolute;
    left: 0;
    top: 2px;
    width: 200%;
    height: 100%;
    animation: waveScroll 4s linear infinite reverse;
    opacity: 0.35;
}

@keyframes waveScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}
/* Bubbles */
.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,rgba(255,255,255,0.3),rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.08);
    pointer-events: none;
    z-index: 6;
    animation: bubbleUp var(--dur,2s) ease-in forwards;
}

@keyframes bubbleUp {
    0% {
        opacity: 0.6;
        transform: translateY(0) scale(1);
    }

    80% {
        opacity: 0.3;
    }

    100% {
        opacity: 0;
        transform: translateY(var(--rise,-50px)) scale(0.4);
    }
}
/* ===== Ingredient Selector (scattered around the mug) ===== */
.ing-selector {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

.ing-icons-row {
    position: absolute;
    inset: 0;
}

.ing-icon-btn {
    position: absolute;
    width: var(--ing-size);
    height: var(--ing-size);
    margin: 0;
    border: 0;
    border-radius: 50%;
    background: var(--gold);
    transform: translate(-50%,-50%);
    cursor: pointer;
    pointer-events: auto;
    display: block;
    overflow: visible;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: 0 8px 22px rgba(0,0,0,.28);
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), filter .35s var(--ease);
}

    .ing-icon-btn::before,
    .ing-icon-btn::after {
        content: none;
    }

    .ing-icon-btn img {
        position: absolute;
        left: 50%;
        top: 50%;
        width: 60%;
        height: 60%;
        object-fit: contain;
        transform: translate(-50%,-50%);
        transition: transform .35s var(--ease);
        z-index: 1;
        pointer-events: none;
    }

    .ing-icon-btn[data-key="cocoa"] img,
    .ing-icon-btn[data-key="foam"] img,
    .ing-icon-btn[data-key="creamer"] img,
    .ing-icon-btn[data-key="water"] img {
        width: 66%;
        height: 66%;
    }

    .ing-icon-btn .ing-icon-label {
        position: absolute;
        top: calc(100% + 7px);
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap;
        font-size: 14px;
        font-weight: 700;
        line-height: 1;
        color: #fff;
        text-shadow: 0 2px 6px rgba(0,0,0,.35);
        transition: color .3s;
        pointer-events: none;
    }

    .ing-icon-btn:not(.selected) {
        filter: brightness(.97);
        opacity: .95;
    }

    .ing-icon-btn.selected {
        transform: translate(-50%,-50%) scale(1.09);
        background: #acacac;
    }

        .ing-icon-btn.selected img {
            transform: translate(-50%,-50%) scale(1.06);
        }

        .ing-icon-btn.selected .ing-icon-label {
            color: var(--gold);
        }

    .ing-icon-btn:active {
        transform: translate(-50%,-50%) scale(.93);
    }
    /* --- positions (mirrors the reference layout) --- */
    .ing-icon-btn[data-key="cocoa"] {
        left: 79.8%;
        top: 11.5%;
    }

    .ing-icon-btn[data-key="sugar"] {
        left: 51.5%;
        top: 14%;
    }

    .ing-icon-btn[data-key="coffee"] {
        left: 25.5%;
        top: 26.5%;
    }

    .ing-icon-btn[data-key="milk"] {
        left: 17%;
        top: 48%;
    }

    .ing-icon-btn[data-key="water"] {
        left: 24%;
        top: 71%;
    }

    .ing-icon-btn[data-key="creamer"] {
        left: 51.5%;
        top: 84%;
    }

    .ing-icon-btn[data-key="foam"] {
        left: 78.5%;
        top: 86%;
    }
    /* Check mark */
    .ing-icon-btn .ing-check-mark {
        position: absolute;
        top: -2px;
        right: -2px;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: none;
        place-items: center;
        z-index: 3;
        background: #fff;
        color: #05225e;
        box-shadow: 0 3px 10px rgba(0,0,0,.3);
        animation: checkPop .35s var(--ease);
    }

    .ing-icon-btn.selected .ing-check-mark {
        display: grid;
    }

    .ing-icon-btn .ing-check-mark svg {
        width: 13px;
        height: 13px;
    }

@keyframes checkPop {
    0% {
        transform: scale(0) rotate(-45deg);
    }

    60% {
        transform: scale(1.2) rotate(5deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

.ing-hint {
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 12px;
    line-height: 1.7;
}

    .ing-hint .count {
        color: var(--gold);
        font-weight: 800;
    }

.ingredients-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}
/* ===== Result card ===== */
.result-card {
    margin-top: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 14px;
    position: relative;
    overflow: hidden;
}

    .result-card::before {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(ellipse 80% 60% at 20% 0%,rgba(245,197,24,0.06),transparent 60%);
        pointer-events: none;
    }

.result-title {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

    .result-title .spark {
        color: var(--gold);
    }

.result-body {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px;
    align-items: center;
}

.result-img-wrap {
    width: 80px;
    height: 88px;
    border-radius: 12px;
    background: rgba(0,0,0,0.2);
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
}

    .result-img-wrap img {
        max-width: 90%;
        max-height: 90%;
        object-fit: contain;
        transition: transform .45s var(--ease), opacity .35s;
        opacity: 0.3;
        filter: grayscale(0.3);
        transform: scale(0.9);
    }

    .result-img-wrap.matched img {
        opacity: 1;
        filter: none;
        transform: scale(1);
        animation: productPop .55s var(--ease);
    }

.result-info h3 {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 3px;
}

.match-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--gold);
    background: rgba(245,197,24,0.12);
    border: 1px solid rgba(245,197,24,0.25);
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: 5px;
    font-weight: 600;
}

.result-info p {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.7;
}

.result-placeholder {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.8;
}

.action-row {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 10px;
    margin-top: 12px;
}

    .action-row .btn {
        height: 46px;
        font-size: 13px;
    }

        .action-row .btn svg {
            width: 16px;
            height: 16px;
        }
/* Products */
.products-section {
    margin-top: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 18px;
    padding: 12px 8px 14px;
}

    .products-section h3 {
        text-align: center;
        font-size: 13px;
        font-weight: 700;
        margin-bottom: 10px;
        color: rgba(255,255,255,0.85);
    }

.carousel-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}

.carousel-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.05);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: .15s;
}

    .carousel-btn svg {
        width: 14px;
        height: 14px;
    }

.carousel-track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 4px 2px 8px;
    flex: 1;
    scrollbar-width: none;
}

    .carousel-track::-webkit-scrollbar {
        display: none;
    }

.prod-thumb {
    flex: 0 0 60px;
    width: 60px;
    height: 72px;
    border-radius: 12px;
    background: rgba(0,0,0,0.25);
    border: 1.5px solid rgba(255,255,255,0.08);
    scroll-snap-align: center;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: border-color .25s, transform .25s, box-shadow .25s;
    overflow: hidden;
    position: relative;
}

    .prod-thumb img {
        max-width: 88%;
        max-height: 88%;
        object-fit: contain;
        transition: transform .3s;
    }

    .prod-thumb:hover {
        transform: translateY(-2px);
    }

    .prod-thumb.active {
        border-color: var(--gold);
        box-shadow: 0 0 16px rgba(245,197,24,0.25);
    }

        .prod-thumb.active img {
            transform: scale(1.05);
        }

    .prod-thumb .check {
        position: absolute;
        top: 3px;
        left: 3px;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: var(--gold);
        color: #1a1400;
        font-size: 9px;
        display: none;
        place-items: center;
        font-weight: 800;
    }

    .prod-thumb.active .check {
        display: grid;
    }
/* ===== Result Screen ===== */
#screen-result {
    background: linear-gradient(180deg,#08122a,#0a1630 50%,#07101f);
    z-index: 10;
}

.result-full {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 22px 24px;
    overflow-y: auto;
    text-align: center;
}

    .result-full .big-title {
        font-size: 20px;
        font-weight: 800;
        margin: 8px 0 4px;
    }

        .result-full .big-title span {
            color: var(--gold);
        }

    .result-full .user-line {
        font-size: 13px;
        color: var(--muted);
        margin-bottom: 16px;
    }

.result-hero-img {
    width: min(200px,55vw);
    height: min(220px,32vh);
    display: grid;
    place-items: center;
    margin: 8px auto 16px;
    animation: productPop .6s var(--ease);
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.45));
}

    .result-hero-img img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

.result-full h2 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 6px;
}

.result-full .desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.8;
    max-width: 300px;
    margin-bottom: 18px;
}

.match-score {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(245,197,24,0.1);
    border: 1px solid rgba(245,197,24,0.28);
    border-radius: 999px;
    padding: 8px 16px;
    margin-bottom: 18px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gold);
}

.recipe-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 22px;
}

.pill {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .pill b {
        color: var(--gold);
        font-weight: 700;
    }

.result-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

    .result-actions .btn {
        height: 50px;
        width: 100%;
        font-size: 15px;
    }
/* Toast */
.toast {
    position: absolute;
    top: 122px;
    left: 48%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 25, 45, 0.95);
    border: 1px solid rgba(245, 197, 24, 0.35);
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: .35s var(--ease);
    z-index: 999999999;
    white-space: nowrap;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

    .toast.show {
        opacity: 1 !important;
        transform: translateX(-50%) translateY(0);
    }
/* Sparkles */
.sparkle-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 20;
}

.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0;
    animation: sparkFly 1.2s var(--ease) forwards;
}

@keyframes productPop {
    0% {
        transform: scale(0.85);
        opacity: 0;
    }

    60% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes softPulse {
    0%,100% {
        box-shadow: 0 0 0 0 rgba(245,197,24,0.15);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(245,197,24,0);
    }
}

@keyframes twinkle {
    0%,100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.85);
    }
}

@keyframes sparkFly {
    0% {
        opacity: 1;
        transform: translate(0,0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx),var(--dy)) scale(0);
    }
}
/* ===== Popup Modal ===== */
.popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 100;
    display: none;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(4px);
}

    .popup-overlay.show {
        display: flex;
    }

.popup-sheet {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0f1f3a, #0a1628);
    border-radius: 20px 20px 0 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 16px 24px;
    scrollbar-width: none;
    animation: slideUp .35s var(--ease);
}

    .popup-sheet::-webkit-scrollbar {
        display: none;
    }

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.popup-handle {
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,0.2);
    margin: 0 auto 14px;
}

.popup-close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 16px;
    z-index: 5;
}

.popup-result-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    text-align: center;
}

.popup-result-img {
    border-radius: 16px;
    display: grid;
    place-items: center;
    overflow: hidden;
}

    .popup-result-img img {
        max-width: 92%;
        max-height: 92%;
        object-fit: contain;
    }

.popup-result-info h3 {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 3px;
}

.popup-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.popup-pill {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 10px;
    color: rgba(255,255,255,0.8);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

    .popup-pill b {
        color: var(--gold);
        font-weight: 700;
    }

.popup-section-title {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    margin: 14px 0 8px;
    text-align: center;
}

.popup-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

    .popup-actions .btn {
        flex: 1;
        height: 44px;
        font-size: 13px;
    }

        .popup-actions .btn svg {
            width: 16px;
            height: 16px;
        }

.popup-car-item {
    transition: transform .25s, opacity .25s;
    opacity: 0.5;
}

    .popup-car-item.active {
        opacity: 1;
    }

        .popup-car-item.active > div {
            border-color: var(--gold) !important;
            box-shadow: 0 0 14px rgba(245,197,24,0.25);
        }

    .popup-car-item:active {
        transform: scale(0.95);
    }
/* ===== Fail Card Popup ===== */
.popup-fail-backdrop {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(5, 15, 35, 0.6);
    backdrop-filter: blur(3px);
    animation: fadeIn .3s var(--ease);
}

    .popup-fail-backdrop.show {
        display: flex;
    }

.fail-note-card {
    position: relative;
    background: #fff2d2;
    border-radius: 18px;
    padding: 48px 24px 28px;
    max-width: 280px;
    width: 80%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.45);
    animation: noteSlideUp .4s var(--ease);
}

.fail-note-cup-icon {
    position: absolute;
    top: -40px;
    left: calc(50% - -21px);
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    z-index: 2;
    margin: 0 auto;
}

    .fail-note-cup-icon img {
        width: 80px;
        height: 80px;
        object-fit: contain;
    }

.fail-note-card p {
    font-size: 14px;
    color: #3a2a1a;
    line-height: 2.1;
    font-weight: 600;
    margin-bottom: 20px;
    margin-top: 8px;
}

.btn-rebuild {
    background: #3cb5a0;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 6px 18px rgba(60,181,160,0.3);
}

    .btn-rebuild:active {
        transform: scale(0.95);
    }

@keyframes noteSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===== Success Full Screen ===== */
.popup-success-backdrop {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #0f1f3a 0%, #0a1628 50%, #07101f 100%);
    padding: 20px;
    animation: fadeIn .4s var(--ease);
    background: url(../../bockstein/img/bg2.jpg?ver=1.6.0.0) center top / cover no-repeat;
    background-size: cover;
    background-position: center -40px;
}

    .popup-success-backdrop.show {
        display: flex;
    }

.success-back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 5;
}

.success-product-area {
    position: relative;
    width: min(220px, 60vw);
    height: min(300px, 45vh);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

    .success-product-area .prod-img {
        max-width: 100%;
        max-height: 85%;
        object-fit: contain;
        filter: drop-shadow(0 20px 40px rgba(0,0,0,0.5));
        animation: floatProduct 3s ease-in-out infinite;
    }

@keyframes floatProduct {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateY(-12px) rotate(-5deg);
    }
}

.success-product-area .golden-cup {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(180deg, var(--gold-2), var(--gold));
    border-radius: 50%;
    display: grid;
    place-items: center;
    box-shadow: 0 10px 30px rgba(245,197,24,0.3);
}

    .success-product-area .golden-cup img {
        width: 40px;
        height: 40px;
        object-fit: contain;
    }

.success-title {
    font-size: clamp(24px, 7vw, 32px);
    font-weight: 800;
    color: #fff;
    margin-bottom: 40px;
    text-align: center;
    animation: titleReveal .6s .2s var(--ease) both;
}

@keyframes titleReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-return-home {
    background: linear-gradient(180deg, var(--gold-2), var(--gold));
    color: #1a1400;
    border: none;
    border-radius: 999px;
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 8px 24px rgba(245,197,24,0.3);
    transition: transform .2s;
    animation: titleReveal .6s .4s var(--ease) both;
}

    .btn-return-home:active {
        transform: scale(0.95);
    }
/* ===== Confetti ===== */
.confetti-piece {
    position: absolute;
    width: 8px;
    height: 14px;
    border-radius: 2px;
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    animation: confettiFall var(--dur, 2.5s) ease-out forwards;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    25% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.3);
    }
}

.confetti-pop {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 999;
    animation: confettiPop .8s ease-out forwards;
}

@keyframes confettiPop {
    0% {
        opacity: 1;
        transform: translate(0,0) scale(0);
    }

    40% {
        opacity: 1;
        transform: translate(var(--dx), var(--dy)) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx2), var(--dy2)) scale(0);
    }
}
/* ===== Custom Result Buttons ===== */
.btn-result-main {
    background: #fdb913;
    color: #05215e;
    box-shadow: 0 6px 20px rgba(245,197,24,0.35), inset 0 1px 0 rgba(255,255,255,0.3);
    font-size: 15px;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

    .btn-result-main::before {
        content: "";
        position: absolute;
        top: -50%;
        left: -60%;
        width: 40%;
        height: 200%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
        transform: rotate(25deg);
        animation: btnShine 3s ease-in-out infinite;
    }

    .btn-result-main:active {
        box-shadow: 0 3px 12px rgba(245,197,24,0.4);
    }

@keyframes btnShine {
    0% {
        left: -60%;
    }

    50% {
        left: 120%;
    }

    100% {
        left: 120%;
    }
}

/* ===== Fail Result ===== */
.fail-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 50px 24px 30px;
    gap: 0;
    position: relative;
}

    .fail-container::before {
        content: "";
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 200px;
        height: 200px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255,80,80,0.06), transparent 70%);
        filter: blur(20px);
        pointer-events: none;
    }

.fail-icon-wrap {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255,80,80,0.08), rgba(255,80,80,0.02));
    border: 2px solid rgba(255,80,80,0.2);
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    position: relative;
    animation: failPulse 2.5s ease-in-out infinite;
}

    .fail-icon-wrap::before {
        content: "";
        position: absolute;
        inset: -8px;
        border-radius: 50%;
        border: 1px solid rgba(255,80,80,0.08);
        animation: failRing 2.5s ease-in-out infinite;
    }

    .fail-icon-wrap svg {
        width: 40px;
        height: 40px;
        color: rgba(255,100,100,0.7);
        animation: failShake .6s .3s var(--ease) both;
    }

@keyframes failShake {
    0%, 100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px) rotate(-3deg);
    }

    40% {
        transform: translateX(6px) rotate(3deg);
    }

    60% {
        transform: translateX(-4px) rotate(-2deg);
    }

    80% {
        transform: translateX(4px) rotate(2deg);
    }
}

@keyframes failPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255,80,80,0.15);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(255,80,80,0);
    }
}

@keyframes failRing {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.15);
        opacity: 0;
    }
}

.fail-title {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
}

.fail-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.9;
    max-width: 260px;
    margin-bottom: 28px;
}

.btn-retry {
    background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.05));
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    font-size: 14px;
    height: 48px;
    padding: 0 32px;
    backdrop-filter: blur(6px);
    transition: all .25s var(--ease);
}

    .btn-retry:hover, .btn-retry:active {
        background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
        border-color: rgba(255,255,255,0.35);
        box-shadow: 0 6px 24px rgba(0,0,0,0.3);
    }

    .btn-retry svg {
        width: 16px;
        height: 16px;
        transition: transform .4s var(--ease);
    }

    .btn-retry:active svg {
        transform: rotate(-360deg);
    }

    .btn-retry:active {
        transform: scale(0.96);
    }

.img-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    text-align: center;
    padding: 4px;
}

input:-internal-autofill-selected {
    appearance: menulist-button;
    background-image: none !important;
    background-color: transparent !important;
}

/* ===== OTP ===== */
#screen-otp {
    background: url(../../bockstein/img/bg.jpg?ver=1.6.0.0) center top / cover no-repeat;
    background-size: cover;
    background-position: center -40px;
}
