/* Initial Root Element */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&family=Poppins:wght@200;400;500;600;700;800;900&display=swap');

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #000;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
}

* {
    font-family: 'Poppins', sans-serif;
}

/* Undian: background */
.bg-undian {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("../../assets/images/bg-semargres.png") center center no-repeat;
    background-size: cover;
}

/* Stage tetap 1280x768 (5:3), di-skalakan agar muat di layar */
.stage {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1280px;
    height: 768px;
    transform: translate(-50%, -50%) scale(var(--stage-scale, 1));
    transform-origin: center center;
    z-index: 2;
}

/* Kepala stage: logo + hadiah */
.stage-head {
    position: absolute;
    top: 36px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
}

.logo-undian {
    width: 300px;
    height: auto;
}

.hadiah-undian {
    margin: 24px 0 0 0;
    font-size: 44px;
    font-weight: 800;
    text-align: center;
}

/* Kontainer kotak pemenang */
.winner-area {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.winner-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

/* 3, 4, 5 pemenang: dua baris */
.winner-3 .winner-area,
.winner-4 .winner-area,
.winner-5 .winner-area {
    flex-direction: column;
    gap: 26px;
}

/* Kotak pemenang */
.input-roulette {
    position: relative;
    border-radius: 14px;
    border: 2px solid #8E8E8E;
    background: rgba(251, 250, 249, 0.20);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.input-roulette:before {
    content: attr(data-placeholder);
    opacity: 0.85;
}

.input-roulette > div {
    max-width: 100%;
    min-width: 0;
}

.pemenang-merchant {
    display: block;
    max-width: 100%;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pemenang-nama {
    display: block;
    max-width: 100%;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 1 pemenang */
.winner-1 .winner-area { top: 400px; }
.winner-1 .input-roulette {
    width: 740px;
    height: 145px;
    font-size: 42px;
}
.winner-1 .pemenang-merchant { font-size: 29px; }
.winner-1 .pemenang-nama { font-size: 41px; }

/* 2 pemenang */
.winner-2 .winner-area { top: 410px; }
.winner-2 .input-roulette {
    width: 500px;
    height: 135px;
    font-size: 37px;
}
.winner-2 .pemenang-merchant { font-size: 26px; }
.winner-2 .pemenang-nama { font-size: 36px; }

/* 3 pemenang (2 baris: 2 atas, 1 bawah) */
.winner-3 .winner-area { top: 360px; }
.winner-3 .input-roulette {
    width: 380px;
    height: 115px;
    font-size: 32px;
}
.winner-3 .pemenang-merchant { font-size: 22px; }
.winner-3 .pemenang-nama { font-size: 30px; }

/* 4 pemenang */
.winner-4 .winner-area { top: 350px; }
.winner-4 .input-roulette {
    width: 440px;
    height: 110px;
    font-size: 29px;
}
.winner-4 .pemenang-merchant { font-size: 20px; }
.winner-4 .pemenang-nama { font-size: 27px; }

/* 5 pemenang (lebar kotak disamakan dengan case 3) */
.winner-5 .winner-area { top: 355px; }
.winner-5 .input-roulette {
    width: 380px;
    height: 105px;
    font-size: 26px;
}
.winner-5 .pemenang-merchant { font-size: 19px; }
.winner-5 .pemenang-nama { font-size: 24px; }

/* Sesi kosong */
#sesi-kosong {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: auto;
}

/* Loading overlay saat ganti sesi */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99998;
    display: none;
    align-items: center;
    justify-content: center;
    background: url("../../assets/images/bg-semargres.png") center center no-repeat;
    background-size: cover;
}

#loading-overlay.show {
    display: flex;
}

.loading-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.55);
    padding: 30px 44px;
    border-radius: 14px;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 5px solid rgba(255, 255, 255, 0.25);
    border-top-color: #f15a29;
    border-radius: 50%;
    animation: loading-spin 0.9s linear infinite;
}

.loading-text {
    color: #fff;
    font-size: 20px;
    letter-spacing: 1px;
}

@keyframes loading-spin {
    to { transform: rotate(360deg); }
}
