body,
html {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden
}

.spin-page-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 80vh;
    background-color: rgb(0 0 0 / .1);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgb(0 0 0 / .2)
}

@media (min-width:1280px) {

    body,
    html {
        overflow: hidden
    }

    .spin-page-container {
        height: 100vh;
        width: 100%;
        max-width: 1200px
    }
}

.logo-section {
    width: 100%;
    text-align: center;
    order: 1;
    margin-bottom: -70px
}

.logo-container img {
    max-width: 320px;
    margin-bottom: 20px;
    border-radius: 10px;
    transition: transform 0.3s ease
}

.logo-container img:hover {
    transform: scale(1.05)
}

.running-text-container {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 25px;
    order: 1;
    box-shadow: 0 4px 10px rgb(0 0 0 / .2);
    border: 1px solid rgb(255 255 255 / .1)
}

.running-text-container marquee {
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgb(0 0 0 / .3)
}

.spin-machine-container {
    flex: 1;
    display: flex;
    justify-content: center;
    margin-top: 30px;
    align-items: center;
    height: 100%;
    order: 2;
    transition: transform 0.5s ease
}

.spin-machine-container:hover {
    transform: scale(1.02)
}

.spin-form-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    order: 3;
    margin-top: -10%
}

.spin-content {
    max-width: 400px;
    width: 100%;
    text-align: center
}

.ticket-heading {
    color: #fff;
    font-weight: 700;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgb(0 0 0 / .5);
    font-size: 1.3rem;
    letter-spacing: 1px
}

.form-container {
    background-color: rgb(0 0 0 / .4);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgb(0 0 0 / .3);
    backdrop-filter: blur(5px);
    border: 1px solid rgb(255 255 255 / .1)
}

.form-group {
    margin-bottom: 20px
}

.form-control {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid rgb(255 255 255 / .2);
    font-size: 16px;
    background-color: rgb(255 255 255 / .9);
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgb(0 0 0 / .1)
}

.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgb(0 51 160 / .3), inset 0 2px 5px rgb(0 0 0 / .1);
    border-color: #0033a0
}

.button-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px
}

.additional-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px
}

.btn {
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 8px rgb(0 0 0 / .2)
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgb(0 0 0 / .3)
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgb(0 0 0 / .2)
}

.btn-spin {
    background: linear-gradient(135deg, #ff3019 0%, #cf0404 100%);
    flex: 1;
    margin-right: 10px;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgb(0 0 0 / .5);
    border: 2px solid rgb(255 255 255 / .3);
    box-shadow: 0 5px 15px rgb(255 0 0 / .4), 0 0 10px rgb(255 0 0 / .2);
    position: relative;
    overflow: hidden;
    animation: pulse-spin 1.5s infinite, glow 2s infinite alternate;
    transform-style: preserve-3d;
    transition: all 0.4s cubic-bezier(.175, .885, .32, 1.275)
}

.btn-spin:hover {
    transform: translateY(-5px) scale(1.05);
    background: linear-gradient(135deg, #ff5e3a 0%, #ff0000 100%);
    box-shadow: 0 8px 25px rgb(255 0 0 / .6), 0 0 20px rgb(255 0 0 / .4);
    letter-spacing: 2px;
    color: wheat
}

.btn-spin:active {
    transform: translateY(2px) scale(.95);
    box-shadow: 0 2px 10px rgb(255 0 0 / .3)
}

.btn-spin:before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgb(255 255 255 / .1);
    transform: rotate(45deg);
    animation: shine 3s infinite;
    pointer-events: none
}

.btn-history {
    flex: 1;
    margin-left: 10px
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0 0 0 / .8)
}

.modal-content {
    margin: 5% auto;
    padding: 0;
    border: 1px solid #001a5c;
    border-radius: 10px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    color: #fff;
    animation: modalFadeIn 0.3s ease-in-out
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid #001a5c
}

.modal-header h2 {
    margin: 0;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700
}

.terms-content {
    line-height: 1.6;
    padding: 20px
}

.close {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.3s
}

.close:hover {
    color: #fc0
}

.result-modal,
.error-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    background-color: #202020;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgb(0 0 0 / .5);
    padding: 30px;
    text-align: center;
    width: 90%;
    max-width: 350px;
    display: none;
    color: white;
    animation: modalPopIn 0.4s cubic-bezier(.175, .885, .32, 1.275)
}

.result-content,
.error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center
}

#resultTitle {
    color: #f44336;
    font-size: 28px;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgb(0 0 0 / .1)
}

#prizeResult {
    margin: 15px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
    color: #ffffff
}

.result-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
    width: 100%
}

.close-button,
.csa-button {
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgb(0 0 0 / .2);
    text-decoration: none;
    display: inline-block;
    text-align: center
}

.csa-button {
    background: linear-gradient(135deg, #25D366, #128C7E);
    display: flex;
    align-items: center;
    justify-content: center
}

.csa-button i {
    margin-right: 8px;
    font-size: 18px
}

.close-button:hover,
.csa-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgb(0 0 0 / .3)
}

.close-button:active,
.csa-button:active {
    transform: translateY(1px)
}

.welcome-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    z-index: 2000;
    box-shadow: 0 10px 30px rgb(0 0 0 / .5);
    animation: popIn 0.5s cubic-bezier(.175, .885, .32, 1.275)
}

.welcome-content h2 {
    color: #fc0;
    font-size: 24px;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgb(0 0 0 / .5)
}

.welcome-content p {
    color: #fff;
    font-size: 16px;
    margin-bottom: 25px
}

.welcome-btn {
    color: #fff;
    border: none;
    padding: 12px 40px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgb(0 0 0 / .3)
}

.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(0 0 0 / .8);
    z-index: 1999;
    display: none
}

.history-table-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    border-radius: 5px
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    color: #fff
}

.history-table th,
.history-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgb(255 255 255 / .1)
}

.history-table th {
    background-color: rgb(0 0 0 / .3);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px
}

.history-table tr:hover {
    background-color: rgb(255 255 255 / .05)
}

.loading-data {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: rgb(255 255 255 / .7);
    animation: pulse-loading 1.5s infinite
}

@media (max-width:1280px) {
    .logo-section {
        margin-bottom: 0
    }
}

@media (max-width:768px) {
    .spin-page-container {
        flex-direction: column;
        min-height: auto;
        padding: 20px
    }

    .logo-section {
        order: 1;
        margin-bottom: 0
    }

    .running-text-container {
        order: 2
    }

    .spin-machine-container {
        order: 3;
        width: 100%;
        margin-bottom: 90px;
        margin-top: 50px;
    }

    .spin-form-container {
        order: 4;
        width: 100%;
        margin-top: 0
    }

    .ticket-heading {
        font-size: 1rem
    }
}

@media (max-width:480px) {

    .result-modal,
    .error-modal {
        width: 85%;
        padding: 20px
    }

    #resultTitle {
        font-size: 24px
    }

    .modal-content {
        width: 95%;
        margin: 10% auto
    }
}

@keyframes pulse-spin {
    0% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.05)
    }

    100% {
        transform: scale(1)
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 5px 15px rgb(255 0 0 / .4), 0 0 10px rgb(255 0 0 / .2)
    }

    100% {
        box-shadow: 0 5px 15px rgb(255 0 0 / .6), 0 0 20px rgb(255 0 0 / .5)
    }
}

@keyframes shine {
    0% {
        left: -100%;
        opacity: 0
    }

    20% {
        left: 100%;
        opacity: .5
    }

    100% {
        left: 100%;
        opacity: 0
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes modalPopIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.8)
    }

    70% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05)
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1)
    }
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes pulse-loading {
    0% {
        opacity: .6
    }

    50% {
        opacity: 1
    }

    100% {
        opacity: .6
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.8)
    }

    70% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05)
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1)
    }
}