/* =========================================================
   ELITSLOTS - KNIFE GAME
   STABLE VERSION
========================================================= */


/* =========================================================
   PAGE
========================================================= */

.knife-game-page {
    width: 100%;
    min-height: calc(100vh - 150px);

    padding: 28px 24px 50px;

    box-sizing: border-box;

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(91, 48, 160, 0.10),
            transparent 55%
        ),
        #090b10;
}


.knife-game {
    width: min(1450px, 100%);
    margin: 0 auto;

    box-sizing: border-box;
}


/* =========================================================
   MAIN GAME SCENE
========================================================= */

.knife-scene {
    position: relative;

    width: 100%;

    overflow: hidden;

    box-sizing: border-box;

    border-radius: 14px;

    background: #080a0d;

    border: 1px solid rgba(255, 255, 255, 0.08);

    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.60);
}


/* =========================================================
   BACKGROUND IMAGE
========================================================= */

.knife-scene-image {
    display: block;

    width: 100%;
    height: auto;

    max-width: 100%;

    object-fit: contain;

    user-select: none;

    -webkit-user-drag: none;
}


/* =========================================================
   RESULT TEXT
========================================================= */

.knife-scene .game-result {

    position: absolute;

    left: 50%;
    top: 48%;

    transform:
        translate(-50%, -50%)
        scale(0.70);

    opacity: 0;

    pointer-events: none;

    z-index: 50;

    font-size: clamp(40px, 6vw, 90px);

    font-weight: 1000;

    line-height: 1;

    letter-spacing: 5px;

    white-space: nowrap;

    text-shadow:
        0 0 15px currentColor,
        0 0 35px currentColor,
        0 0 70px currentColor;
}


.knife-scene .miss-result {
    color: #ff3838;
}


.knife-scene .hit-result {
    color: #ffd85a;
}


/* =========================================================
   MISS
========================================================= */

.knife-scene.miss .miss-result {

    animation:
        knifeResultMiss
        2.1s
        ease
        forwards;
}


.knife-scene.miss .knife-scene-image {

    animation:
        knifeSceneMiss
        1.1s
        ease-in-out;
}


/* =========================================================
   HIT
========================================================= */

.knife-scene.hit .hit-result {

    animation:
        knifeResultHit
        3s
        ease
        forwards;
}


/*
    IMPORTANT:

    Skrzynka NIE jest przesuwana.
    Jest cały czas w tym samym miejscu.
*/

.knife-scene.hit .animated-crate {

    animation:
        crateAppear
        3.5s
        ease
        forwards;
}


.knife-scene.hit .crate-lid {

    animation:
        crateOpen
        3.5s
        ease
        forwards;
}


.knife-scene.hit .crate-glow {

    animation:
        crateGlow
        3.5s
        ease
        forwards;
}


.knife-scene.hit .crate-light {

    animation:
        crateLight
        3.5s
        ease
        forwards;
}


.knife-scene.hit .won-knife {

    animation:
        knifeReveal
        3.5s
        cubic-bezier(
            0.2,
            0.8,
            0.2,
            1
        )
        forwards;
}


/* =========================================================
   CRATE
========================================================= */

.knife-scene .animated-crate {

    position: absolute;

    /*
        ŚRODEK SCENY
    */

    left: 50%;
    bottom: 4%;

    width: 210px;
    height: 150px;

    margin: 0;

    opacity: 0;

    /*
        WAŻNE:
        tylko centrowanie.
        Brak przesuwania poza ekran.
    */

    transform:
        translateX(-50%)
        scale(0.88);

    transform-origin:
        center bottom;

    pointer-events: none;

    z-index: 30;

    box-sizing: border-box;

    filter:
        drop-shadow(
            0 18px 22px rgba(0, 0, 0, 0.85)
        );
}


/* =========================================================
   BLACK CRATE BODY
========================================================= */

.knife-scene .crate-body {

    position: absolute;

    left: 0;
    bottom: 0;

    width: 210px;
    height: 105px;

    box-sizing: border-box;

    border:
        4px solid #15171a;

    border-radius: 5px;

    background:
        linear-gradient(
            145deg,
            #272a2e 0%,
            #111315 45%,
            #050607 100%
        );

    box-shadow:

        inset 0 0 0 2px
        rgba(255, 255, 255, 0.05),

        inset 0 -18px 30px
        rgba(0, 0, 0, 0.75),

        0 8px 20px
        rgba(0, 0, 0, 0.7);
}


/* =========================================================
   METAL / BLACK CRATE STRAPS
========================================================= */

.knife-scene .crate-body::before,
.knife-scene .crate-body::after {

    content: "";

    position: absolute;

    top: 0;
    bottom: 0;

    width: 9px;

    background:
        linear-gradient(
            90deg,
            #070809,
            #3b3f43,
            #090a0b
        );

    box-shadow:
        inset 0 0 3px
        rgba(255, 255, 255, 0.08);
}


.knife-scene .crate-body::before {
    left: 25px;
}


.knife-scene .crate-body::after {
    right: 25px;
}


/* =========================================================
   CRATE EMBLEM
========================================================= */

.knife-scene .crate-emblem {

    position: absolute;

    left: 50%;
    top: 50%;

    width: 48px;
    height: 48px;

    transform:
        translate(-50%, -50%);

    display: flex;

    align-items: center;
    justify-content: center;

    box-sizing: border-box;

    border:
        2px solid #777d83;

    border-radius: 50%;

    background:
        rgba(0, 0, 0, 0.35);

    color: #aeb4b9;

    font-size: 23px;

    text-shadow:
        0 0 8px
        rgba(255, 255, 255, 0.15);
}


/* =========================================================
   CRATE INSIDE
========================================================= */

.knife-scene .crate-inside {

    position: absolute;

    left: 8px;
    bottom: 17px;

    width: 194px;
    height: 88px;

    box-sizing: border-box;

    overflow: hidden;

    border-radius: 3px;

    background:
        linear-gradient(
            180deg,
            #080808,
            #020202
        );

    z-index: 10;
}


/* =========================================================
   CRATE LID
========================================================= */

.knife-scene .crate-light {

    position: absolute;

    left: 50%;
    bottom: 48px;

    width: 120px;
    height: 90px;

    transform:
        translateX(-50%)
        scale(0.15);

    opacity: 0;

    border-radius: 50%;

    /*
        Brak jednolitego żółtego koła.
        Tylko miękkie światło.
    */

    background:
        radial-gradient(
            ellipse at center,
            rgba(255, 238, 150, 0.75) 0%,
            rgba(255, 210, 70, 0.38) 25%,
            rgba(255, 175, 20, 0.14) 48%,
            transparent 72%
        );

    filter:
        blur(12px);

    box-shadow:
        0 0 45px
        rgba(255, 205, 65, 0.45),

        0 0 90px
        rgba(255, 170, 20, 0.25);

    z-index: 20;

    pointer-events: none;
}


/* =========================================================
   GOLD LIGHT
========================================================= */

.knife-scene .crate-light {

    position: absolute;

    left: 50%;
    bottom: 48px;

    width: 55px;
    height: 55px;

    transform:
        translateX(-50%)
        scale(0.15);

    opacity: 0;

    border-radius: 50%;

    background:
        #ffe36b;

    box-shadow:

        0 0 20px
        #ffe36b,

        0 0 50px
        #ffc52e,

        0 0 100px
        #ff9d00,

        0 0 150px
        rgba(255, 180, 30, 0.65);

    z-index: 20;
}


/* =========================================================
   GOLD AURA
========================================================= */

.knife-scene .crate-glow {

    position: absolute;

    left: 50%;
    bottom: 25px;

    width: 270px;
    height: 230px;

    transform:
        translateX(-50%)
        scale(0.15);

    opacity: 0;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(255, 225, 100, 0.95) 0%,
            rgba(255, 185, 35, 0.50) 25%,
            rgba(255, 145, 0, 0.20) 45%,
            transparent 72%
        );

    filter:
        blur(18px);

    pointer-events: none;

    z-index: 8;
}


/* =========================================================
   WON KNIFE
========================================================= */

.knife-scene .won-knife-image {

    position: absolute;

    left: 50%;
    top: 50%;

    width: 145px;
    height: 90px;

    transform: translate(-50%, -50%);

    object-fit: contain;

    display: none;

    user-select: none;

    -webkit-user-drag: none;

    filter: drop-shadow(0 0 10px rgba(255, 215, 90, 0.75));
}

.knife-scene .won-knife-name {

    position: absolute;

    left: 50%;
    top: calc(50% + 50px);

    transform: translateX(-50%);

    width: 280px;

    color: #ffe58a;

    font-size: 11px;
    font-weight: 900;

    text-align: center;

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;

    text-shadow: 0 0 8px rgba(0,0,0,.9);
}

.knife-scene .won-knife {

    position: absolute;

    left: 50%;
    top: 50%;

    width: 145px;
    height: 42px;

    transform:
        translate(-50%, 35px)
        rotate(-8deg)
        scale(0.25);

    opacity: 0;

    z-index: 25;

    filter:
        drop-shadow(
            0 0 8px
            rgba(255, 215, 90, 0.7)
        );
}


/* =========================================================
   KNIFE BLADE
========================================================= */

.knife-scene .won-knife-blade {

    position: absolute;

    left: 0;
    top: 7px;

    width: 92px;
    height: 25px;

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #c9ced1 35%,
            #858a8e 60%,
            #414448
        );

    clip-path:
        polygon(
            0 50%,
            88% 0,
            100% 50%,
            88% 100%
        );

    filter:
        drop-shadow(
            0 0 5px
            rgba(255, 255, 255, 0.45)
        );
}


/* =========================================================
   KNIFE GUARD
========================================================= */

.knife-scene .won-knife-guard {

    position: absolute;

    left: 88px;
    top: 4px;

    width: 8px;
    height: 34px;

    border-radius: 3px;

    background:
        linear-gradient(
            90deg,
            #101010,
            #777,
            #101010
        );
}


/* =========================================================
   KNIFE HANDLE
========================================================= */

.knife-scene .won-knife-handle {

    position: absolute;

    left: 96px;
    top: 10px;

    width: 45px;
    height: 20px;

    border-radius:
        4px 12px 12px 4px;

    background:
        linear-gradient(
            180deg,
            #292929,
            #080808
        );

    box-shadow:

        inset 0 2px 2px
        rgba(255, 255, 255, 0.08),

        inset 0 -2px 3px
        rgba(0, 0, 0, 0.8);
}


/* =========================================================
   RESULT MISS
========================================================= */

@keyframes knifeResultMiss {

    0% {

        opacity: 0;

        transform:
            translate(-50%, -50%)
            scale(0.70);
    }

    18% {

        opacity: 1;

        transform:
            translate(-50%, -50%)
            scale(1.02);
    }

    70% {

        opacity: 1;

        transform:
            translate(-50%, -50%)
            scale(1);
    }

    100% {

        opacity: 0;

        transform:
            translate(-50%, -50%)
            scale(1.08);
    }
}


/* =========================================================
   MISS SCENE SHAKE
========================================================= */

@keyframes knifeSceneMiss {

    0% {
        transform: translateX(0);
    }

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

    40% {
        transform: translateX(4px);
    }

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

    80% {
        transform: translateX(3px);
    }

    100% {
        transform: translateX(0);
    }
}


/* =========================================================
   RESULT HIT
========================================================= */

@keyframes knifeResultHit {

    0% {

        opacity: 0;

        transform:
            translate(-50%, -50%)
            scale(0.55);
    }

    18% {

        opacity: 1;

        transform:
            translate(-50%, -50%)
            scale(1.08);
    }

    32% {

        opacity: 1;

        transform:
            translate(-50%, -50%)
            scale(1);
    }

    72% {

        opacity: 1;
    }

    100% {

        opacity: 0;

        transform:
            translate(-50%, -50%)
            scale(1.10);
    }
}


/* =========================================================
   CRATE APPEAR
   NO MOVEMENT
========================================================= */

@keyframes crateAppear {

    0% {

        opacity: 0;

        transform:
            translateX(-50%)
            scale(0.88);
    }

    15% {

        opacity: 1;

        transform:
            translateX(-50%)
            scale(0.96);
    }

    28% {

        opacity: 1;

        transform:
            translateX(-50%)
            scale(1);
    }

    80% {

        opacity: 1;

        transform:
            translateX(-50%)
            scale(1);
    }

    100% {

        opacity: 0;

        transform:
            translateX(-50%)
            scale(0.94);
    }
}


/* =========================================================
   CRATE OPEN
========================================================= */

@keyframes crateOpen {

    0%,
    40% {

        transform:
            perspective(350px)
            rotateX(0deg);
    }

    48% {

        transform:
            perspective(350px)
            rotateX(-15deg);
    }

    58% {

        transform:
            perspective(350px)
            rotateX(-75deg);
    }

    85% {

        transform:
            perspective(350px)
            rotateX(-75deg);
    }

    100% {

        transform:
            perspective(350px)
            rotateX(-75deg);
    }
}


/* =========================================================
   GOLD AURA
========================================================= */

@keyframes crateGlow {

    0%,
    45% {

        opacity: 0;

        transform:
            translateX(-50%)
            scale(0.15);
    }

    58% {

        opacity: 0.45;

        transform:
            translateX(-50%)
            scale(0.65);
    }

    70% {

        opacity: 1;

        transform:
            translateX(-50%)
            scale(1.05);
    }

    82% {

        opacity: 0.75;

        transform:
            translateX(-50%)
            scale(1.15);
    }

    94% {

        opacity: 0.35;

        transform:
            translateX(-50%)
            scale(1.05);
    }

    100% {

        opacity: 0;

        transform:
            translateX(-50%)
            scale(1.15);
    }
}


/* =========================================================
   GOLD CORE
========================================================= */

@keyframes crateLight {

    0%,
    48% {

        opacity: 0;

        transform:
            translateX(-50%)
            scale(0.15);
    }

    60% {

        opacity: 0.75;

        transform:
            translateX(-50%)
            scale(0.75);
    }

    70% {

        opacity: 1;

        transform:
            translateX(-50%)
            scale(1.05);
    }

    82% {

        opacity: 0.9;

        transform:
            translateX(-50%)
            scale(1.25);
    }

    100% {

        opacity: 0;

        transform:
            translateX(-50%)
            scale(1.45);
    }
}


/* =========================================================
   KNIFE REVEAL
========================================================= */

@keyframes knifeReveal {

    0%,
    54% {

        opacity: 0;

        transform:
            translate(-50%, 35px)
            rotate(-8deg)
            scale(0.25);
    }

    64% {

        opacity: 1;

        transform:
            translate(-50%, -50%)
            rotate(-8deg)
            scale(0.72);
    }

    76% {

        opacity: 1;

        transform:
            translate(-50%, -50%)
            rotate(-8deg)
            scale(1.06);
    }

    88% {

        opacity: 1;

        transform:
            translate(-50%, -50%)
            rotate(-8deg)
            scale(1);
    }

    100% {

        opacity: 0;

        transform:
            translate(-50%, -50%)
            rotate(-8deg)
            scale(1);
    }
}


/* =========================================================
   CONTROLS
========================================================= */

.knife-controls {

    width: 100%;

    margin-top: 18px;

    padding: 18px;

    box-sizing: border-box;

    display: flex;

    align-items: center;

    gap: 18px;

    flex-wrap: wrap;

    background:
        #11151c;

    border:
        1px solid
        rgba(255, 255, 255, 0.08);

    border-radius: 12px;
}


/* =========================================================
   STAKE BOX
========================================================= */

.stake-box {

    display: flex;

    align-items: center;

    gap: 15px;
}


.stake-title {

    color: #898d97;

    font-size: 11px;

    font-weight: 900;

    letter-spacing: 2px;
}


.stake-options {

    display: flex;

    gap: 8px;
}


.stake-btn {

    min-width: 80px;

    padding: 11px 15px;

    box-sizing: border-box;

    border:
        1px solid
        #303542;

    border-radius: 7px;

    background:
        #1a1f28;

    color:
        #c9ccd4;

    font-weight: 800;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}


.stake-btn:hover {

    transform:
        translateY(-1px);
}


.stake-btn:hover,
.stake-btn.active {

    background:
        #7542ff;

    border-color:
        #7542ff;

    color:
        #ffffff;
}


/* =========================================================
   BUY TICKET
========================================================= */

.buy-ticket-btn {

    margin-left: auto;

    min-width: 210px;

    padding: 12px 24px;

    box-sizing: border-box;

    border:
        1px solid
        #b57b1f;

    border-radius: 8px;

    background:
        linear-gradient(
            180deg,
            #d99b35,
            #8c5813
        );

    color:
        #ffffff;

    font-size: 15px;

    font-weight: 1000;

    cursor: pointer;

    box-shadow:
        0 0 18px
        rgba(217, 155, 53, 0.18);

    transition:
        0.2s ease;
}


.buy-ticket-btn:hover {

    transform:
        translateY(-2px);

    box-shadow:
        0 0 28px
        rgba(217, 155, 53, 0.35);
}


.buy-ticket-btn:active {

    transform:
        translateY(0);
}


.buy-ticket-btn:disabled {

    opacity: 0.5;

    cursor: not-allowed;

    transform: none;

    box-shadow: none;
}


.buy-ticket-btn small {

    display: block;

    margin-top: 3px;

    font-size: 12px;

    opacity: 0.8;
}


/* =========================================================
   STATUS
========================================================= */

.knife-status {

    width: 100%;

    color:
        rgba(255, 255, 255, 0.45);

    font-size: 12px;

    text-align: center;
}


/* =========================================================
   RESPONSIBLE PLAY
========================================================= */

.responsible-note {

    margin-top: 12px;

    text-align: center;

    color:
        rgba(255, 255, 255, 0.35);

    font-size: 11px;
}


.responsible-note i {

    margin-right: 5px;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 750px) {

    .knife-game-page {

        padding:
            15px
            10px
            35px;
    }


    .stake-box {

        width: 100%;

        flex-direction:
            column;

        align-items:
            flex-start;
    }


    .stake-options {

        width: 100%;
    }


    .stake-btn {

        flex: 1;

        min-width: 0;
    }


    .buy-ticket-btn {

        width: 100%;

        margin-left: 0;
    }


    .knife-scene .animated-crate {

        width: 170px;
        height: 125px;

        left: 50%;

        bottom: 4%;
    }


    .knife-scene .crate-body {

        width: 170px;
        height: 88px;
    }


    .knife-scene .crate-lid {

        width: 176px;
        height: 32px;

        bottom: 82px;
    }


    .knife-scene .crate-inside {

        width: 154px;
        height: 73px;
    }


    .knife-scene .won-knife {

        transform:
            translate(-50%, 35px)
            rotate(-8deg)
            scale(0.28);
    }
}
/* =========================================================
   CENTERED KNIFE REWARD CARD
   Final HIT result is revealed in the middle of the scene.
========================================================= */

.knife-scene .hit-result {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(430px, 78%);
    min-height: 300px;
    box-sizing: border-box;
    padding: 24px 28px 22px;
    transform: translate(-50%, -50%) scale(.72);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 80;
    color: #ffd85a;
    font-size: initial;
    letter-spacing: normal;
    white-space: normal;
    text-shadow: none;
    pointer-events: none;
}

.knife-scene.hit .hit-result {
    animation: knifeCenteredReward 3.8s ease forwards;
}

.hit-card {
    width: 100%;
    box-sizing: border-box;
    padding: 20px 22px 18px;
    border: 1px solid rgba(255, 215, 90, .55);
    border-radius: 16px;
    background:
        radial-gradient(circle at 50% 25%, rgba(255, 210, 70, .18), transparent 45%),
        linear-gradient(180deg, rgba(23, 20, 12, .97), rgba(8, 9, 12, .98));
    box-shadow:
        0 0 35px rgba(255, 193, 45, .28),
        0 25px 70px rgba(0,0,0,.72),
        inset 0 0 30px rgba(255,215,90,.06);
    text-align: center;
}

.hit-card-title {
    margin-bottom: 8px;
    color: #ffe58a;
    font-size: 18px;
    font-weight: 1000;
    letter-spacing: 4px;
}

.hit-knife-image {
    display: block;
    width: min(280px, 100%);
    height: 145px;
    margin: 2px auto 8px;
    object-fit: contain;
    filter: drop-shadow(0 0 14px rgba(255, 215, 90, .55));
    user-select: none;
    -webkit-user-drag: none;
}

.hit-knife-name {
    color: #fff;
    font-size: clamp(15px, 1.8vw, 21px);
    line-height: 1.25;
    font-weight: 1000;
    text-shadow: 0 0 10px rgba(255,255,255,.15);
}

.hit-knife-value {
    margin-top: 9px;
    color: #ffd85a;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 2px;
}

@keyframes knifeCenteredReward {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.60);
    }
    42% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.60);
    }
    58% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.04);
    }
    68% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    88% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.04);
    }
}

@media (max-width: 750px) {
    .knife-scene .hit-result {
        width: min(360px, 86%);
        min-height: 250px;
        padding: 16px;
    }

    .hit-card {
        padding: 15px 14px;
    }

    .hit-knife-image {
        height: 105px;
    }
}
