* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    touch-action: manipulation;
    height: -webkit-fill-available;
}

body {
    background: #000000;
    align-items: center;
    justify-content: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    position: relative;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

.container {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 550px;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.background {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 550px;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    align-items: center;
    justify-content: center;
}

.background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.main-content {
    width: 100%;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
}

.logo {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 550px;
}

.logo-img {
    width: 100%;
    max-width: 250px;
    left: 50%;
}

.text-img {
    width: 100%;
    max-width: 450px;
    height: 100%;
}

.money-img {
    top: 80%;
    left: 30%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 300px;
    position: absolute;
    z-index: 99;
}

.frame {
    position: absolute;
    top: 58%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 450px;
    height: 100%;
}

.frame img {
    width: 100%;
    max-width: 550px;
    height: 100%;
    object-fit: contain;
}


.point-machine {
    position: absolute;
    top: 54%;
    left: 68%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 550px;
    z-index: 30;
}

.point-machine img {
    width: 100%;
    max-width: 320px;
    height: 100%;
    object-fit: contain;

}

.button {
    position: absolute;
    top: 93%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
}

.button img {
    width: 100%;
    max-width: 540px;
    height: auto;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.button img:hover {
    transform: scale(1.05);
}

.button img:active {
    transform: scale(0.95);
}

/* Improve touch targets for mobile */
.button {
    min-height: 44px;
    min-width: 44px;
}

/* Bottom Golden Button */
.bottom-button {
    position: absolute;
    bottom: 2%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.golden-btn {
    background: linear-gradient(180deg,
            #fbbf24 0%,
            #f59e0b 20%,
            #d97706 50%,
            #b45309 80%,
            #92400e 100%);
    border: 4px solid #78350f;
    border-radius: 50px;
    padding: 16px 70px;
    font-size: 28px;
    font-weight: bold;
    color: #ffffff;
    cursor: pointer;
    box-shadow:
        0 8px 20px rgba(217, 119, 6, 0.6),
        inset 0 2px 8px rgba(255, 255, 255, 0.3),
        inset 0 -4px 12px rgba(120, 53, 15, 0.4);
    text-shadow:
        0 3px 6px rgba(0, 0, 0, 0.8),
        0 0 15px rgba(0, 0, 0, 0.6),
        0 -1px 2px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.golden-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.4) 0%,
            transparent 100%);
    border-radius: 50px 50px 0 0;
    pointer-events: none;
}

.golden-btn:hover {
    transform: scale(1.05);
    box-shadow:
        0 10px 30px rgba(217, 119, 6, 0.8),
        inset 0 2px 8px rgba(255, 255, 255, 0.4),
        inset 0 -4px 12px rgba(120, 53, 15, 0.5);
}

.golden-btn:active {
    transform: scale(0.95);
    box-shadow:
        0 4px 15px rgba(217, 119, 6, 0.6),
        inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.numbers {
    position: absolute;
    top: 53%;
    left: 48%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 500px;
    z-index: 29;
}

/* Each reel column */
.reel-column {
    width: 90px;
    height: 150px;
    overflow: hidden;
    position: relative;
    background: transparent;
    border-radius: 5px;
    transform: scale(1);
    will-change: filter;
}

/* The strip of symbols that scrolls */
.reel-strip {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    width: 90%;
    transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Each symbol image */
.symbol-img {
    width: 100%;
    height: 55px;
    object-fit: contain;
    padding: 3px;
    flex-shrink: 0;
    transform: scale(1);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Show 3 visible symbols (3 rows) */
.reel-column::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    border-radius: 5px;
}

/* Middle row highlight line - winning line */
.numbers::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -2%;
    right: -2%;
    transform: translateY(-50%);
    height: 58px;

    border-left: none;
    border-right: none;
    pointer-events: none;
    z-index: 10;

}

/* Spinning animation for reel strips - smooth and constant speed */
.reel-strip.spinning {
    animation: reelSpin 0.08s linear infinite;
}

@keyframes reelSpin {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(55px) scale(1);
    }
}

/* Add subtle blur effect during spin - very minimal */
.reel-column.spinning {
    filter: blur(0.5px);
}

.reel-column:not(.spinning) {
    filter: blur(0);
    transition: filter 0.3s ease-out;
}

/* Smooth stop effect - minimal bounce */
@keyframes stopBounce {
    0% {
        transform: translateY(0) scale(1);
    }

    60% {
        transform: translateY(-3px) scale(1);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

/* Lose Message Popup */
.lose-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;

}

.lose-popup.show {
    display: flex;
}

.lose-content {
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 450px;
    position: relative;
}

.lose-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.lose-message {
    margin-bottom: -25px;
}

.lose-message img {
    max-width: 100%;
    height: auto;
    animation: zoomInOut 2s ease-in-out infinite;
}

.retry-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-top: 50px;
    z-index: 10;
    min-height: 44px;
    min-width: 44px;
    -webkit-tap-highlight-color: transparent;
}

.retry-button img {
    max-width: 300px;
    height: auto;
    animation: zoomInOut 2s ease-in-out infinite;
    user-select: none;
    -webkit-user-select: none;
}

/* Win Message Popup */
.win-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.win-popup.show {
    display: flex;
}

.win-content {
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 500px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.win-message {
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.win-message img {
    max-width: 100%;
    height: auto;
    animation: zoomInOut 2s ease-in-out infinite;
}

.win-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin-top: -50px;
    position: relative;
    z-index: 2;
    width: 400px;

}

.win-button {
    margin-top: 50px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    min-height: 44px;
    min-width: 44px;
    -webkit-tap-highlight-color: transparent;
}

.win-button img {
    max-width: 300px;
    height: auto;
    animation: zoomInOut 2s ease-in-out infinite;
    user-select: none;
    -webkit-user-select: none;
}

@keyframes zoomInOut {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@media (max-width: 670px) {

    .logo {
        position: absolute;
        top: 15%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        max-width: 550px;
    }

    .logo-img {
        width: 100%;
        max-width: 250px;
        left: 50%;
    }

    .text-img {
        width: 100%;
        max-width: 450px;
        height: 100%;
    }

    .money-img {
        top: 80%;
        left: 30%;
        transform: translate(-50%, -50%);
        width: 100%;
        max-width: 300px;
        position: absolute;
        z-index: 99;
    }



    .point-machine {
        left: 68%;
        top: 52%;
    }

    .button {
        top: 95%;
        width: 100%;
        max-width: 300px;
    }

    .button img {
        max-width: 450px;
    }

    .golden-btn {
        padding: 14px 60px;
        font-size: 24px;
    }

    .numbers {
        left: 48%;
        max-width: 450px;
        gap: 6px;
    }

    .reel-column {
        width: 85px;
        height: 155px;
    }

    .symbol-img {
        height: 52px;
    }

    .lose-content {
        max-width: 350px;
        padding: 20px;
    }

    .win-content {
        max-width: 400px;
        padding: 20px;
    }

    .win-buttons {
        flex-direction: row;
        gap: 35px;
        margin-top: -70px;
    }

    .win-button img {
        max-width: 120px;
    }
}

@media (max-width: 470px) {
    .logo {
        position: absolute;
        top: 15%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        max-width: 450px;
    }

    .logo-img {
        width: 100%;
        max-width: 200px;
        left: 50%;
    }

    .text-img {
        width: 100%;
        max-width: 350px;
        height: 100%;
    }

    .money-img {
        top: 80%;
        left: 30%;
        transform: translate(-50%, -50%);
        width: 100%;
        max-width: 200px;
        position: absolute;
        z-index: 99;
    }

    .frame {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        max-width: 400px;
        height: 100%;
    }

    .frame img {
        width: 100%;
        max-width: 550px;
        height: 100%;
        object-fit: contain;
    }



    .point-machine {
        left: 46%;
        top: 48%;
        max-width: 280px;
    }

    .button {
        top: 90%;
        width: 100%;
        max-width: 280px;
    }

    .button img {
        max-width: 280px;
    }

    .golden-btn {
        padding: 12px 50px;
        font-size: 22px;
    }

    .numbers {
        top: 48%;
        left: 48%;
        max-width: 300px;
        gap: 5px;
    }

    .reel-column {
        width: 75px;
        height: 140px;
    }

    .symbol-img {
        height: 48px;
    }

    .lose-content {
        max-width: 400px;
        padding: 15px;
    }

    .win-content {
        max-width: 400px;
        padding: 15px;
    }

    .win-buttons {
        flex-direction: row;
        gap: 35px;
        margin-top: -65px;
    }

    .win-button img {
        max-width: 200px;
    }

    .retry-button img {
        max-width: 200px;
    }
}

@media (max-width: 430px) {
    .logo {
        position: absolute;
        top: 15%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        max-width: 450px;
    }

    .logo-img {
        width: 100%;
        max-width: 200px;
        left: 50%;
    }

    .text-img {
        width: 100%;
        max-width: 350px;
        height: 100%;
    }

    .money-img {
        top: 80%;
        left: 30%;
        transform: translate(-50%, -50%);
        width: 100%;
        max-width: 200px;
        position: absolute;
        z-index: 99;
    }

    .frame {
        position: absolute;
        top: 56%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        max-width: 400px;
        height: 100%;
    }

    .frame img {
        width: 100%;
        max-width: 500px;
        height: 100%;
        object-fit: contain;
    }


    .point-machine {
        left: 46%;
        top: 50%;
        max-width: 270px;
    }

    .button {
        top: 92%;
        width: 100%;
        max-width: 250px;
    }

    .button img {
        max-width: 280px;
    }

    .golden-btn {
        padding: 12px 50px;
        font-size: 22px;
    }

    .numbers {
        top: 50%;
        left: 48%;
        max-width: 300px;
        gap: 5px;
    }

    .reel-column {
        width: 75px;
        height: 140px;
    }

    .symbol-img {
        height: 48px;
    }

    .lose-content {
        top: 5%;
        max-width: 400px;
        padding: 15px;
    }

    .win-content {
        top: 5%;
        max-width: 400px;
        padding: 15px;
    }

    .win-buttons {
        flex-direction: row;
        gap: 35px;
        margin-top: -65px;
    }

    .win-button img {
        max-width: 200px;
    }

    .retry-button img {
        max-width: 200px;
    }
}

@media (max-width: 415px) {
    .logo {
        position: absolute;
        top: 15%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        max-width: 450px;
    }

    .logo-img {
        width: 100%;
        max-width: 200px;
        left: 50%;
    }

    .text-img {
        width: 100%;
        max-width: 350px;
        height: 100%;
    }

    .money-img {
        top: 80%;
        left: 30%;
        transform: translate(-50%, -50%);
        width: 100%;
        max-width: 200px;
        position: absolute;
        z-index: 99;
    }

    .frame {
        position: absolute;
        top: 57%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        max-width: 400px;
        height: 100%;
    }

    .frame img {
        width: 100%;
        max-width: 500px;
        height: 100%;
        object-fit: contain;
    }


    .point-machine {
        left: 46%;
        top: 52%;
        max-width: 260px;
    }

    .button {
        top: 92%;
        width: 100%;
        max-width: 250px;
    }

    .button img {
        max-width: 280px;
    }

    .golden-btn {
        padding: 12px 50px;
        font-size: 22px;
    }

    .numbers {
        top: 51%;
        left: 48%;
        max-width: 300px;
        gap: 5px;
    }

    .reel-column {
        width: 75px;
        height: 130px;
    }

    .symbol-img {
        height: 48px;
    }

    .lose-content {
        top: 5%;
        max-width: 400px;
        padding: 15px;
    }

    .win-content {
        top: 5%;
        max-width: 400px;
        padding: 15px;
    }

    .win-buttons {
        flex-direction: row;
        gap: 35px;
        margin-top: -65px;
    }

    .win-button img {
        max-width: 200px;
    }

    .retry-button img {
        max-width: 200px;
    }
}

@media (max-width: 400px) {
    .logo {
        position: absolute;
        top: 15%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        max-width: 450px;
    }

    .logo-img {
        width: 100%;
        max-width: 200px;
        left: 50%;
    }

    .text-img {
        width: 100%;
        max-width: 350px;
        height: 100%;
    }

    .money-img {
        top: 80%;
        left: 30%;
        transform: translate(-50%, -50%);
        width: 100%;
        max-width: 200px;
        position: absolute;
        z-index: 99;
    }

    .frame {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        max-width: 400px;
        height: 100%;
    }

    .frame img {
        width: 100%;
        max-width: 550px;
        height: 100%;
        object-fit: contain;
    }



    .point-machine {
        left: 46%;
        top: 48%;
        max-width: 280px;
    }

    .button {
        top: 90%;
        width: 100%;
        max-width: 280px;
    }

    .button img {
        max-width: 280px;
    }

    .golden-btn {
        padding: 12px 50px;
        font-size: 22px;
    }

    .numbers {
        top: 48%;
        left: 48%;
        max-width: 300px;
        gap: 5px;
    }

    .reel-column {
        width: 75px;
        height: 140px;
    }

    .symbol-img {
        height: 48px;
    }

    .lose-content {
        max-width: 400px;
        padding: 15px;
    }

    .win-content {
        max-width: 400px;
        padding: 15px;
    }

    .win-buttons {
        flex-direction: row;
        gap: 35px;
        margin-top: -65px;
    }

    .win-button img {
        max-width: 200px;
    }

    .retry-button img {
        max-width: 200px;
    }
}

@media (max-width: 395px) {
    .logo {
        position: absolute;
        top: 15%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        max-width: 350px;
    }

    .logo-img {
        width: 100%;
        max-width: 150px;
        left: 50%;
    }

    .text-img {
        width: 100%;
        max-width: 300px;
        height: 100%;
    }

    .money-img {
        top: 80%;
        left: 30%;
        transform: translate(-50%, -50%);
        width: 100%;
        max-width: 150px;
        position: absolute;
        z-index: 99;
    }

    .frame {
        position: absolute;
        top: 55%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        max-width: 350px;
        height: 100%;
    }

    .frame img {
        width: 100%;
        max-width: 500px;
        height: 100%;
        object-fit: contain;
    }


    .point-machine {
        left: 47%;
        top: 50%;
        max-width: 245px;
    }

    .button {
        top: 90%;
        width: 100%;
        max-width: 230px;
    }

    .button img {
        max-width: 280px;
    }

    .golden-btn {
        padding: 12px 50px;
        font-size: 22px;
    }

    .numbers {
        top: 49%;
        left: 48%;
        max-width: 190px;
        gap: 5px;
    }

    .reel-column {
        width: 75px;
        height: 120px;
    }

    .symbol-img {
        height: 40px;
    }

    .lose-content {
        max-width: 400px;
        padding: 15px;
    }

    .win-content {
        max-width: 400px;
        padding: 15px;
    }

    .win-buttons {
        flex-direction: row;
        gap: 35px;
        margin-top: -65px;
    }

    .win-button img {
        max-width: 200px;
    }

    .retry-button img {
        max-width: 200px;
    }
}

@media (max-width: 360px) {
    .logo {
        position: absolute;
        top: 15%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        max-width: 400px;
    }

    .logo-img {
        width: 100%;
        max-width: 150px;
        left: 50%;
    }

    .text-img {
        width: 100%;
        max-width: 230px;
        height: 100%;
    }

    .money-img {
        top: 80%;
        left: 40%;
        transform: translate(-50%, -50%);
        width: 100%;
        max-width: 100px;
        position: absolute;
        z-index: 99;
    }

    .frame {
        position: absolute;
        top: 55%;
        left: 52%;
        transform: translate(-50%, -50%);
        width: 100%;
        max-width: 400px;
        height: 100%;
    }

    .frame img {
        width: 100%;
        max-width: 340px;
        height: 100%;
        object-fit: contain;
    }


    .point-machine {
        left: 46%;
        top: 49%;
        max-width: 230px;
    }

    .button {
        top: 92%;
        width: 100%;
        max-width: 230px;
    }

    .button img {
        max-width: 250px;
    }

    .golden-btn {
        padding: 12px 50px;
        font-size: 22px;
    }

    .numbers {
        top: 48%;
        left: 45%;
        max-width: 250px;
        gap: 5px;
    }

    .reel-column {
        width: 70px;
        height: 110px;
    }

    .symbol-img {
        height: 38px;
    }

    /* GLOBAL CSS - This is the problem */
    @keyframes reelSpin {
        0% {
            transform: translateY(0) scale(1);
        }

        100% {
            transform: translateY(38px) scale(1);
            /* <-- **STILL 55px** */
        }
    }

    .lose-content {
        top: 10%;
        max-width: 400px;
        padding: 15px;
    }

    .win-content {
        top: 10%;
        max-width: 400px;
        padding: 15px;
    }

    .win-buttons {
        flex-direction: row;
        gap: 35px;
        margin-top: -65px;
    }

    .win-button img {
        max-width: 200px;
    }

    .retry-button img {
        max-width: 200px;
    }
}