body 
{
    background-color: #121212; /* Latar belakang gelap untuk halaman game */
    font-family: 'Roboto', sans-serif; /* Pastikan font konsisten */
    overflow-x: hidden;
}

.back-to-home-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    background-color: rgba(0,0,0,0.5);
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 5px;
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    z-index: 10;
    transition: background-color 0.3s;
}
.back-to-home-btn:hover {
    background-color: rgba(0,0,0,0.8);
}

/* Style untuk tombol Beli Fitur */
.mahjong-controls button.buy-feature-btn {
    background: linear-gradient(to bottom, #8a2be2, #4b0082); /* Warna ungu */
    color: white;
    border: 2px solid #9370db;
    padding: 12px 20px; /* Samakan dengan tombol lain */
}
.mahjong-controls button.buy-feature-btn:hover:not(:disabled) {
    background: linear-gradient(to bottom, #9370db, #6a5acd);
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(138, 43, 226, 0.4);
}

/* Jackpot Display Styles */
.jackpot-display {
    background: linear-gradient(45deg, #FFD700, #FFA500, #FF6347);
    border: 3px solid #FFD700;
    border-radius: 15px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    animation: jackpot-glow 2s ease-in-out infinite alternate;
    position: relative;
    overflow: hidden;
}

.jackpot-display::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: jackpot-shine 3s linear infinite;
    pointer-events: none;
}

.jackpot-label {
    font-family: 'Orbitron', monospace;
    font-size: 16px;
    font-weight: bold;
    color: #8B0000;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
}

.jackpot-amount {
    font-family: 'Orbitron', monospace;
    font-size: 28px;
    font-weight: bold;
    color: #8B0000;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
    margin: 10px 0;
    animation: jackpot-pulse 1.5s ease-in-out infinite;
}

.jackpot-ticker {
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    color: #8B0000;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    animation: jackpot-blink 2s ease-in-out infinite;
}

@keyframes jackpot-glow {
    0% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6); }
    100% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.9), 0 0 40px rgba(255, 215, 0, 0.6); }
}

@keyframes jackpot-shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@keyframes jackpot-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes jackpot-blink {
    0%, 50% { opacity: 1; }
    25%, 75% { opacity: 0.7; }
}

/* Jackpot Win Animation */
.jackpot-win-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: jackpot-overlay-appear 0.5s ease-out;
}

.jackpot-win-content {
    text-align: center;
    color: #FFD700;
    animation: jackpot-win-bounce 1s ease-out;
}

.jackpot-win-title {
    font-family: 'Orbitron', monospace;
    font-size: 4rem;
    font-weight: bold;
    text-shadow: 0 0 20px #FFD700;
    margin-bottom: 20px;
    animation: jackpot-win-glow 2s ease-in-out infinite alternate;
}

.jackpot-win-amount {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    font-weight: bold;
    color: #00FF00;
    text-shadow: 0 0 15px #00FF00;
    margin-bottom: 30px;
}

.jackpot-win-message {
    font-size: 1.5rem;
    margin-bottom: 30px;
    animation: jackpot-win-pulse 1.5s ease-in-out infinite;
}

@keyframes jackpot-overlay-appear {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes jackpot-win-bounce {
    0% { transform: scale(0.3) rotate(-10deg); opacity: 0; }
    50% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes jackpot-win-glow {
    0% { text-shadow: 0 0 20px #FFD700, 0 0 30px #FFD700; }
    100% { text-shadow: 0 0 30px #FFD700, 0 0 40px #FFD700, 0 0 50px #FFD700; }
}

@keyframes jackpot-win-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}


/* --- Mahjong Slot Specific CSS --- */
.mahjong-slot-section {
    position: relative;
    width: 100%;
    min-height: 100vh; /* agar mengisi seluruh tinggi layar */
    background-image: url('images/slotgacor3.png');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    overflow: hidden;
}
.mahjong-slot-frame {
    position: relative;
    background: rgba(0, 0, 0, 0.7);
    border: 10px solid gold;
    border-image: linear-gradient(to bottom, gold 0%, #daa520 50%, goldenrod 100%) 1;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    width: fit-content;
    max-width: 90%;
}
.mahjong-title {
    font-size: 48px;
    color: #32cd32;
    font-weight: bold;
    text-shadow: 0 0 10px #000, 0 0 20px rgba(50, 205, 50, 0.7);
    margin-bottom: 20px;
    letter-spacing: 2px;
    font-family: 'Luckiest Guy', cursive;
}
.multiplier-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    padding: 10px 20px;
    border: 2px solid goldenrod;
}
.multiplier-item {
    font-size: 28px;
    font-weight: bold;
    color: #ccc;
    padding: 5px 15px;
    border-radius: 10px;
    background: #222;
    transition: all 0.3s;
    border: 1px solid #555;
}
.multiplier-item.active {
    color: white;
    background: #ff4500;
    border-color: yellow;
    box-shadow: 0 0 15px yellow;
    transform: scale(1.1);
}
.mahjong-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    background-color: #0a0a0a;
    border: 5px solid #333;
    border-radius: 10px;
    padding: 8px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    overflow: hidden; 
    min-height: calc(4 * (90px + 6px) + 16px);
    position: relative;
}
.mahjong-reel {
    display: flex;
    flex-direction: column;
    width: 100px;
    height: calc(4 * (90px + 6px));
    position: relative;
    overflow: hidden;
    border-radius: 5px;
}
.mahjong-reel-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    transition: transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.mahjong-tile {
    width: 90px;
    height: 90px;
    background-color: white;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 8px;
    border: 2px solid #ccc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    flex-shrink: 0; 
    margin: 3px auto;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out, background-color 0.2s; 
}
.mahjong-board.spinning .mahjong-tile {
    filter: blur(4px);
    transition: filter 0.2s linear;
}

.mahjong-tile.win-highlight {
    animation: glowingGold 1.5s infinite alternate;
}
@keyframes glowingGold {
    from { box-shadow: 0 0 15px gold, 0 0 5px orange; border-color: gold; }
    to { box-shadow: 0 0 25px #ffd700, 0 0 10px red; border-color: #ffc107; }
}
.mahjong-tile.exploding {
    animation: tileExplode 0.3s forwards;
}
@keyframes tileExplode {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(0); opacity: 0; }
}
.mahjong-tile.falling {
    transition: transform 0.5s cubic-bezier(0.5, 0, 0.75, 0.75);
}
.mahjong-info-panel {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 10px 0;
    margin-top: 10px;
}
.mahjong-info-item {
    background-color: #000;
    padding: 8px 15px;
    border-radius: 5px;
    border: 1px solid #555;
    color: #eee;
    font-size: 14px;
    flex: 1;
    margin: 0 5px;
    text-align: center;
}
.mahjong-info-item span {
    color: limegreen;
    font-weight: bold;
    font-size: 18px;
    display: block;
}
.mahjong-info-item label {
    display: block;
    color: #aaa;
    font-size: 12px;
}
.mahjong-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}
.mahjong-controls button {
    padding: 12px 25px;
    background: linear-gradient(to bottom, #ffdb58, #ffb300);
    color: #333;
    border: none;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease-out;
    font-size: 18px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
}
.mahjong-controls button.spin-btn {
    background: linear-gradient(to bottom, #4CAF50, #2E8B57);
    color: white;
    padding: 15px 35px;
    font-size: 22px;
    border: 2px solid #5cb85c;
}
.mahjong-controls button.spin-btn:hover:not(:disabled) {
    background: linear-gradient(to bottom, #5cb85c, #3e9860);
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.4);
}
.mahjong-controls button.auto-spin-btn, .mahjong-controls button.turbo-btn {
    background: linear-gradient(to bottom, #333, #111);
    color: gold;
    border: 2px solid gold;
}
.mahjong-controls button.auto-spin-btn.active {
    background: linear-gradient(to bottom, #dc3545, #bd2130);
    border-color: #ffc107;
    color: white;
}
.mahjong-controls button.turbo-btn.active {
    background: linear-gradient(to bottom, #007bff, #0056b3);
    border-color: #00BFFF;
    color: white;
}
.mahjong-controls button:hover:not(:disabled) {
    transform: translateY(-2px);
}
.mahjong-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
.bet-control {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #000;
    border: 1px solid #555;
    border-radius: 5px;
    padding: 5px;
}
.bet-control button {
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 3px;
    font-size: 16px;
    border: none;
    box-shadow: none;
}
.bet-control button:hover:not(:disabled) {
    background-color: #555;
    transform: none;
}
.mahjong-bet-input {
    width: 80px;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    background-color: #000;
    border: 1px solid #555;
    color: gold;
    padding: 8px;
    border-radius: 5px;
    -moz-appearance: textfield;
}
.mahjong-bet-input::-webkit-outer-spin-button,
.mahjong-bet-input::-webkit-inner-spin-button 
{
    -webkit-appearance: none;
    margin: 0;
}
#mahjong-result-message {
    margin-top: 15px;
    font-size: 24px;
    font-weight: bold;
    min-height: 35px; 
    color: lime;
    text-shadow: 0 0 5px lime, 0 0 10px rgba(0,255,0,0.5);
    text-align: center;
}
#mahjong-win-line-details {
    font-size: 16px;
    color: #ccc;
    margin-top: 5px;
    text-align: center;
    min-height: 20px;
}
.spin-history-container {
    margin-top: 20px;
    width: 100%;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 10px;
    border: 1px solid #444;
}
.spin-history-container h4 {
    text-align: center;
    color: #aaa;
    margin-bottom: 10px;
    font-weight: normal;
}
#spin-history-list {
    display: flex;
    justify-content: center;
    gap: 10px;
    list-style: none;
}
#spin-history-list li {
    background-color: #111;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    color: #ccc;
    border: 1px solid #555;
    min-width: 60px;
    text-align: center;
}
 #spin-history-list li.win {
    color: limegreen;
    border-color: limegreen;
}
@keyframes jackpotTextAnim {
    0% { opacity:0; transform: scale(0.5); }
    40% { opacity:1; transform: scale(1.2); }
    100% { opacity:1; transform: scale(1); }
}
#mahjong-jackpot-anim {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 9999;
    pointer-events: none;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.7);
}
#mahjong-jackpot-text {
    position: relative;
    font-size: 6vw;
    color: gold;
    text-shadow: 0 0 30px red, 0 0 10px gold;
    font-weight: bold;
    font-family: 'Luckiest Guy', cursive;
    animation: jackpotTextAnim 1.5s forwards;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    border: 3px solid gold;
}
.mahjong-reel-inner.spinning {
    filter: blur(3px);
    transition: filter 0.1s linear;
}
@media (max-width: 900px) {
    .mahjong-slot-frame { padding: 15px; }
    .mahjong-board {
        gap: 5px; padding: 5px;
        min-height: calc(4 * (70px + 5px) + 10px);
    }
    .mahjong-reel {
        width: 75px;
        height: calc(4 * (70px + 5px));
    }
    .mahjong-tile { width: 70px; height: 70px; margin: 2.5px auto; }
    .mahjong-title { font-size: 36px; }
    .multiplier-item { font-size: 20px; padding: 3px 10px; }
    .mahjong-controls button { padding: 10px 20px; font-size: 14px; }
    .mahjong-controls button.spin-btn { padding: 12px 25px; font-size: 18px; }
    .mahjong-info-item { padding: 6px 10px; font-size: 12px; }
    .mahjong-info-item span { font-size: 16px; }
    #mahjong-result-message { font-size: 18px; }
    #mahjong-win-line-details { font-size: 13px; }
    #mahjong-jackpot-text { font-size: 8vw; }
}
@media (max-width: 600px) {
    .mahjong-slot-section { padding: 20px 10px; min-height: 600px; }
    .mahjong-slot-frame { padding: 10px; border-width: 5px; border-radius: 10px; width: 100%; }
    .mahjong-title { font-size: 30px; margin-bottom: 15px; }
    .multiplier-bar { gap: 5px; padding: 5px 10px; border-width: 1px; }
    .multiplier-item { font-size: 16px; padding: 2px 8px; }
    .mahjong-board {
        gap: 4px; padding: 4px;
        min-height: calc(4 * (55px + 4px) + 8px);
    }
    .mahjong-reel {
        width: 60px;
        height: calc(4 * (55px + 4px));
    }
    .mahjong-tile { width: 55px; height: 55px; margin: 2px auto; }
    .mahjong-controls { gap: 10px; }
    .mahjong-controls .bet-control, .mahjong-controls .auto-spin-btn, .mahjong-controls .turbo-btn {
        order: 2;
    }
    .mahjong-controls .spin-btn { order: 1; width: 100%; padding: 12px 20px; font-size: 18px; }
    .mahjong-info-panel { flex-direction: column; gap: 10px; }
    .mahjong-info-item { margin: 0; }
    #mahjong-jackpot-text { font-size: 10vw; padding: 15px; }
}