/* css/style.css - Real Slot Reel Roll Animation + Lightning Canvas + Celah Slot Kilat Scatter */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
}

html, body {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: fixed;
    background: radial-gradient(circle, #2b1055, #7597de, #1f1c2c);
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
}

.slot-container {
    width: 100%;
    max-width: 420px;
    background: transparent;
    border: 3px solid #ffcc00;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.5), inset 0 0 15px rgba(255, 100, 0, 0.4);
}

/* Judul Game Emas Menyala */
.game-title, h2, .title, .game-name {
    color: #ffd700 !important;
    text-shadow: 0 0 10px #ffd700, 0 0 20px #ff9500, 0 0 30px #ff6600 !important;
    font-weight: bold !important;
}

/* Styling Teks Berjalan Pemenang */
.winner-ticker {
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #ffcc00;
    border-radius: 20px;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
    padding: 5px 10px;
    margin-bottom: 10px;
    box-shadow: inset 0 0 8px rgba(255, 204, 0, 0.4);
}

.ticker-content {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: bold;
    color: #00ffcc;
    text-shadow: 0 0 5px rgba(0, 255, 204, 0.6);
    animation: tickerScroll 20s linear infinite;
}

@keyframes tickerScroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.slot-header {
    text-align: center;
    margin-bottom: 12px;
}

.slot-header h2 {
    font-size: 1.3rem;
    color: #ff3366;
    text-shadow: 0 0 10px #ff3366, 0 0 20px #ffcc00;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.wallet-box {
    background: linear-gradient(to right, #0f2027, #203a43, #2c5364);
    padding: 8px 18px;
    border-radius: 30px;
    display: inline-block;
    font-size: 0.95rem;
    font-weight: bold;
    border: 2px solid #00ffcc;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
}

#wallet-balance {
    color: #00ffcc;
    margin-left: 5px;
    text-shadow: 0 0 5px rgba(0, 255, 204, 0.8);
}

.win-banner {
    text-align: center;
    font-size: 1rem;
    font-weight: bold;
    color: #00ffcc;
    text-shadow: 0 0 10px #00ffcc;
    min-height: 22px;
    margin-bottom: 8px;
}

/* Kotak Utama Grid Slot 5x5 */
.slot-grid {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    background: rgba(10, 10, 25, 0.95);
    padding: 8px;
    border-radius: 12px;
    border: 3px solid #ffcc00;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 204, 0, 0.3);
    margin-bottom: 5px;
    height: 335px;
    overflow: hidden;
    position: relative;
}

/* Setiap Kolom (Reel) */
.slot-reel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    position: relative;
    will-change: transform;
    transition: transform 1.2s cubic-bezier(0.15, 0.85, 0.25, 1.02);
}

/* Tampilan Kotak Simbol Individual */
.slot-cell {
    background: linear-gradient(145deg, #2a2a40, #1a1a2e);
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.7rem;
    border-radius: 8px;
    border: 2px solid #3a3a60;
    box-shadow: 0 4px 6px rgba(0,0,0,0.4);
    flex-shrink: 0;
    position: relative; /* Diperlukan agar efek ledakan menempel tepat di kotak */
    overflow: visible;  /* Agar ledakan mekar keluar kotak */
}

/* Efek Kotak Menang Menyala */
.slot-cell.win-effect {
    border-color: #00ffcc;
    background: linear-gradient(145deg, #005f73, #0a9396);
    box-shadow: 0 0 15px #00ffcc, inset 0 0 10px #ffffff;
    transform: scale(1.08);
    animation: pulseWin 0.5s infinite alternate;
}

@keyframes pulseWin {
    0% { transform: scale(1.02); filter: brightness(1); }
    100% { transform: scale(1.12); filter: brightness(1.3); }
}

/* ============================================================
   ⚡ PANEL KONTROL & TARUHAN
   ============================================================ */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 4px;
    transform: scale(0.72);
    transform-origin: center top;
    margin-bottom: -45px;
}

.bet-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.bet-selector button {
    background: linear-gradient(to bottom, #3a3a60, #1a1a2e);
    color: #ffcc00;
    border: 2px solid #ffcc00;
    padding: 6px 0;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.bet-selector button.active {
    background: #00ffcc !important;
    color: #000000 !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 12px #00ffcc, inset 0 0 4px rgba(0,0,0,0.5);
    transform: scale(1.04);
}

/* Tombol Spin & Auto */
.action-buttons {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 8px;
    align-items: center;
}

.spin-btn {
    background: linear-gradient(to bottom, #ff0055, #ffcc00);
    color: #ffffff;
    border: 2px solid #ffffff;
    padding: 10px 0;
    font-size: 1rem;
    font-weight: 900;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 0, 85, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
    width: 100%;
}

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

.auto-btn {
    background: linear-gradient(to bottom, #00c6ff, #0072ff);
    color: #ffffff;
    border: 2px solid #ffffff;
    padding: 10px 0;
    font-size: 0.9rem;
    font-weight: 900;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 114, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
    width: 100%;
}

.auto-btn.active {
    background: linear-gradient(to bottom, #ff416c, #ff4b2b) !important;
    box-shadow: 0 0 15px #ff416c;
    animation: pulseAuto 0.6s infinite alternate;
}

@keyframes pulseAuto {
    0% { transform: scale(1); filter: brightness(1); }
    100% { transform: scale(1.05); filter: brightness(1.2); }
}

/* Flash Grid Scatter */
.slot-grid.scatter-flash {
    animation: scatterFlashAnim 0.8s ease-out;
}

@keyframes scatterFlashAnim {
    0% { 
        box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8), 0 0 25px #ffcc00; 
        border-color: #ffcc00; 
        background: rgba(20, 10, 0, 0.95); 
    }
    50% { 
        box-shadow: inset 0 0 40px #ffffff, 0 0 80px #ff0000; 
        border-color: #ff0000; 
        background: rgba(100, 0, 0, 1); 
        transform: scale(1.02); 
    }
    100% { 
        box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8), 0 0 15px #ffcc00; 
        border-color: #ffcc00; 
        background: rgba(10, 10, 25, 0.95); 
        transform: scale(1); 
    }
}

/* Styling Sel Scatter (⚡) */
.slot-cell.cell-scatter {
    color: #ffe600;
    text-shadow: 0 0 10px #ffcc00, 0 0 20px #ff0000;
    font-weight: 900;
    animation: pulseScatter 1s infinite alternate;
    border-color: #ffcc00;
}

@keyframes pulseScatter {
    from { transform: scale(1); filter: brightness(1); }
    to { transform: scale(1.1); filter: brightness(1.5); }
}

/* ============================================================
   💥 EFEK LEDAKAN KHUSUS ICON SCATTER (ZEUS STYLE)
   ============================================================ */

/* Ring Emas Mekar saat Ledakan */
.slot-cell.scatter-blast::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 15px;
    height: 15px;
    background: radial-gradient(circle, #ffffff 0%, #ffe600 40%, rgba(255, 100, 0, 0) 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.1);
    animation: blastRing 0.5s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    pointer-events: none;
    z-index: 10;
}

/* Kilatan Petir Biru/Putih saat Ledakan */
.slot-cell.scatter-blast::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 234, 255, 0.9) 0%, rgba(255, 255, 255, 0.8) 30%, transparent 70%);
    transform: translate(-50%, -50%) scale(0.3);
    animation: blastFlash 0.4s ease-out forwards;
    pointer-events: none;
    z-index: 11;
}

/* Animasi Membesar (Pop) pada Simbol Scatter saat Meledak */
.slot-cell.scatter-blast {
    animation: scatterIconPop 0.45s ease-out forwards !important;
    z-index: 12 !important;
}

@keyframes blastRing {
    0% {
        transform: translate(-50%, -50%) scale(0.1);
        opacity: 1;
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 20px #ffea00);
    }
    100% {
        transform: translate(-50%, -50%) scale(3.5);
        opacity: 0;
    }
}

@keyframes blastFlash {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.2);
        opacity: 0;
    }
}

@keyframes scatterIconPop {
    0% {
        transform: scale(0.8);
        filter: brightness(1);
    }
    40% {
        transform: scale(1.4);
        filter: brightness(3) drop-shadow(0 0 20px #ffffff) drop-shadow(0 0 35px #ffcc00);
        border-color: #ffffff !important;
    }
    100% {
        transform: scale(1);
        filter: brightness(1.2) drop-shadow(0 0 10px #ffcc00);
        border-color: #ffcc00 !important;
    }
}

/* ============================================================
   ⚡ ANIMASI KILAT DI CELAH-CELAH REEL (SCATTER / FREE SPIN MODE)
   ============================================================ */

.slot-reel.scatter-lightning {
    position: relative;
    border-left: 2px solid rgba(0, 204, 255, 0.8) !important;
    border-right: 2px solid rgba(0, 204, 255, 0.8) !important;
    animation: gapLightningStrike 0.3s infinite alternate ease-in-out;
}

.slot-reel.scatter-lightning::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -3px;
    width: 6px;
    height: 200%;
    background: linear-gradient(180deg, transparent, #ffffff, #00ccff, #ffffff, transparent);
    box-shadow: 0 0 15px #00ccff, 0 0 25px #87CEFA;
    opacity: 0.9;
    animation: lightningFlashFlow 0.4s infinite linear;
    pointer-events: none;
    z-index: 10;
}

@keyframes gapLightningStrike {
    0% {
        box-shadow: 0 0 5px #00ccff, inset 0 0 5px #00ccff;
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 0 20px #ffffff, 0 0 35px #00ccff, inset 0 0 15px #00ccff;
        filter: brightness(1.5);
    }
    100% {
        box-shadow: 0 0 10px #00ccff, inset 0 0 8px #00ccff;
        filter: brightness(1.1);
    }
}

@keyframes lightningFlashFlow {
    0% { transform: translateY(-30%) scaleX(1); opacity: 0.3; }
    25% { transform: translateY(0%) scaleX(1.8); opacity: 1; }
    50% { transform: translateY(30%) scaleX(0.8); opacity: 0.5; }
    75% { transform: translateY(60%) scaleX(2); opacity: 1; }
    100% { transform: translateY(100%) scaleX(1); opacity: 0.2; }
}

/* ============================================================
   ⚡ EFEK PETIR MENYAMBAR ICON / SCATTER
   ============================================================ */

#lightning-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

.symbol-struck {
    animation: strikeGlow 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
    z-index: 100 !important;
    position: relative;
}

@keyframes strikeGlow {
    0% { 
        transform: scale(1); 
        filter: brightness(1) drop-shadow(0 0 0px #00ccff); 
    }
    30% { 
        transform: scale(1.35) rotate(-8deg); 
        filter: brightness(3) drop-shadow(0 0 30px #87CEFA) drop-shadow(0 0 50px #00ccff); 
        border-color: #00ccff !important;
        background: radial-gradient(circle, rgba(135,206,250,0.8) 0%, rgba(0,100,255,0.4) 100%) !important;
    }
    60% { 
        transform: scale(1.15) rotate(4deg); 
        filter: brightness(2) drop-shadow(0 0 20px #ffd700); 
    }
    100% { 
        transform: scale(1); 
        filter: brightness(1.2) drop-shadow(0 0 10px #ffd700); 
        border-color: #ffd700 !important;
    }
}

.symbol-struck::after {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(0,204,255,0.6) 40%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: blastPulse 0.5s ease-out forwards;
}

@keyframes blastPulse {
    0% { transform: scale(0.2); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}
