* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --gold: #FFD700;
    --gold-dark: #B8860B;
    --gold-light: #FFF8DC;
    --bronze: #CD7F32;
    --brown-dark: #1a1207;
    --brown-medium: #3D2914;
    --stone: #8B7355;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Cinzel', serif;
    background: linear-gradient(180deg, #1a1207 0%, #0d0804 100%);
    color: var(--gold-light);
}

/* Coin Background Animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.coin {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at 30% 30%, #FFD700, #B8860B);
    border-radius: 50%;
    opacity: 0.4;
    animation: fall linear infinite;
}

.c1 { left: 5%; animation-duration: 12s; animation-delay: 0s; }
.c2 { left: 15%; animation-duration: 15s; animation-delay: 2s; }
.c3 { left: 30%; animation-duration: 10s; animation-delay: 1s; }
.c4 { left: 50%; animation-duration: 14s; animation-delay: 3s; }
.c5 { left: 65%; animation-duration: 11s; animation-delay: 2s; }
.c6 { left: 75%; animation-duration: 13s; animation-delay: 4s; }
.c7 { left: 85%; animation-duration: 16s; animation-delay: 1s; }
.c8 { left: 95%; animation-duration: 12s; animation-delay: 3s; }

@keyframes fall {
    0% { transform: translateY(-30px) rotate(0deg); opacity: 0; }
    10% { opacity: 0.4; }
    90% { opacity: 0.4; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Register Section */
.register-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    background: linear-gradient(180deg, #1a1207 0%, #0d0804 100%);
}

.register-box {
    background: linear-gradient(145deg, var(--brown-medium) 0%, var(--brown-dark) 100%);
    border: 3px solid var(--gold);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.3);
}

.temple-icon {
    margin-bottom: 15px;
}

.temple-icon svg {
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.5));
}

.register-box h1 {
    font-family: 'MedievalSharp', cursive;
    font-size: 28px;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    margin-bottom: 5px;
}

.register-box h2 {
    font-size: 14px;
    color: var(--bronze);
    letter-spacing: 2px;
    margin-bottom: 25px;
}

.register-box input {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-family: 'Cinzel', serif;
    border: 2px solid var(--gold-dark);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: var(--gold-light);
    margin-bottom: 15px;
    text-align: center;
}

.register-box input::placeholder { color: var(--stone); }
.register-box input:focus { outline: none; border-color: var(--gold); }

.gold-btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    background: linear-gradient(145deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--brown-dark);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

.bonus-text {
    margin-top: 15px;
    color: var(--gold);
    font-size: 13px;
}

/* Game Container */
#gameContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(180deg, var(--brown-medium) 0%, var(--brown-dark) 100%);
    border-bottom: 2px solid var(--gold-dark);
    flex-shrink: 0;
}

.logo {
    font-family: 'MedievalSharp', cursive;
    font-size: 14px;
    color: var(--gold);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--gold-dark);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 14px;
    cursor: pointer;
}

.balance-box {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--gold-dark);
    border-radius: 6px;
    padding: 5px 10px;
}

.coin-svg { width: 16px; height: 16px; }

#tokenBalance {
    font-size: 14px;
    font-weight: bold;
    color: var(--gold);
}

.topup-btn {
    background: var(--gold);
    color: var(--brown-dark);
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
}

/* Game Area - Takes up most of the screen */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow: hidden;
    min-height: 0;
}

/* Daily Bonus */
.daily-bonus {
    background: linear-gradient(90deg, var(--brown-medium), #4a3520, var(--brown-medium));
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    flex-shrink: 0;
}

.daily-bonus button {
    background: var(--gold);
    color: var(--brown-dark);
    border: none;
    padding: 5px 12px;
    border-radius: 5px;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
}

/* Jackpot Bar */
.jackpot-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.1), transparent);
    margin-bottom: 8px;
    flex-shrink: 0;
}

.jp-label {
    font-size: 11px;
    color: var(--bronze);
    letter-spacing: 2px;
}

.jp-amount {
    font-family: 'MedievalSharp', cursive;
    font-size: 24px;
    color: var(--gold);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

/* Slot Machine - Main focus */
.slot-machine {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.machine-frame {
    flex: 1;
    background: linear-gradient(145deg, #8B6914 0%, #5D4E37 30%, #8B6914 50%, #5D4E37 70%, #8B6914 100%);
    border-radius: 15px;
    padding: 10px;
    border: 3px solid var(--gold);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 2px 10px rgba(255, 255, 255, 0.1);
    display: flex;
}

.reels-window {
    flex: 1;
    background: linear-gradient(180deg, #0a0705 0%, #1a1207 50%, #0a0705 100%);
    border-radius: 10px;
    padding: 8px;
    border: 2px solid #5D4E37;
    box-shadow: inset 0 5px 30px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.reels-container {
    display: flex;
    gap: 4px;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: stretch;
}

.reel-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 20%;
}

.symbol-cell {
    flex: 1;
    background: linear-gradient(145deg, #2d1f0f 0%, #1a1207 100%);
    border-radius: 8px;
    border: 2px solid #5D4E37;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5%;
    min-height: 0;
}

.symbol-cell svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

.symbol-cell.spinning svg {
    animation: spin-blur 0.08s linear infinite;
}

.symbol-cell.winning {
    animation: win-glow 0.4s ease-in-out infinite;
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

@keyframes spin-blur {
    0% { opacity: 0.3; transform: translateY(-30%) scale(0.8); }
    50% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0.3; transform: translateY(30%) scale(0.8); }
}

@keyframes win-glow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 30px rgba(255, 215, 0, 1); }
}

/* Win Display */
.win-display {
    padding: 10px;
    margin-top: 8px;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-dark));
    border-radius: 8px;
    text-align: center;
    flex-shrink: 0;
}

#winAmount {
    font-family: 'MedievalSharp', cursive;
    font-size: 18px;
    font-weight: bold;
    color: var(--brown-dark);
}

/* Spin Controls */
.spin-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    gap: 10px;
    flex-shrink: 0;
}

.bet-info {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bet-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bet-btn {
    width: 28px;
    height: 28px;
    background: linear-gradient(145deg, var(--gold-dark) 0%, #8B6914 100%);
    border: none;
    border-radius: 5px;
    color: var(--brown-dark);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.bet-value {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 40px;
}

.bet-label {
    font-size: 8px;
    color: var(--stone);
    letter-spacing: 1px;
}

#betAmount, #linesCount, #totalBet {
    font-size: 14px;
    font-weight: bold;
    color: var(--gold);
}

.total-bet {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0,0,0,0.3);
    padding: 4px 10px;
    border-radius: 5px;
    border: 1px solid var(--gold-dark);
}

/* Spin Button */
.spin-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--gold) 0%, var(--gold-dark) 100%);
    border: 3px solid #fff;
    cursor: pointer;
    box-shadow: 0 5px 25px rgba(255, 215, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.spin-btn:disabled {
    background: #666;
    border-color: #888;
    box-shadow: none;
}

.spin-text {
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: bold;
    color: var(--brown-dark);
}

.quick-options {
    display: flex;
    gap: 6px;
    align-items: center;
}

.toggle-opt {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    color: var(--stone);
    cursor: pointer;
}

.toggle-opt input {
    width: 14px;
    height: 14px;
    accent-color: var(--gold);
}

.max-btn {
    background: var(--bronze);
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 5px;
    font-family: 'Cinzel', serif;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
}

/* Info Toggle */
.info-toggle {
    padding: 5px;
    text-align: center;
    flex-shrink: 0;
}

.info-toggle button {
    background: none;
    border: none;
    color: var(--stone);
    font-size: 11px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
}

/* Info Section (collapsible) */
.info-section {
    background: var(--brown-medium);
    padding: 15px;
    border-top: 1px solid var(--gold-dark);
    overflow-y: auto;
    max-height: 200px;
}

.paytable h3 {
    text-align: center;
    font-size: 12px;
    color: var(--gold);
    margin-bottom: 10px;
}

.paytable-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.pay-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 5px;
    border-radius: 5px;
    border: 1px solid var(--gold-dark);
}

.pay-item svg {
    width: 30px;
    height: 30px;
    margin-bottom: 3px;
}

.pay-item span {
    font-size: 9px;
    color: var(--gold);
    font-weight: bold;
}

footer {
    text-align: center;
    padding: 10px;
    font-size: 11px;
}

footer a {
    color: var(--bronze);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 15px;
}

.modal-content {
    background: linear-gradient(145deg, var(--brown-medium) 0%, var(--brown-dark) 100%);
    border: 2px solid var(--gold);
    border-radius: 15px;
    padding: 20px;
    max-width: 350px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-content h2 {
    text-align: center;
    color: var(--gold);
    font-family: 'MedievalSharp', cursive;
    font-size: 20px;
    margin-bottom: 15px;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--stone);
    font-size: 18px;
    cursor: pointer;
}

/* Packages */
.packages {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.package {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--gold-dark);
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    position: relative;
}

.package:hover {
    border-color: var(--gold);
}

.pkg-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #E74C3C;
    color: #fff;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 8px;
    font-weight: bold;
}

.package.best .pkg-badge {
    background: #2ECC71;
}

.pkg-amount {
    font-size: 16px;
    font-weight: bold;
    color: var(--gold);
}

.pkg-price {
    font-size: 11px;
    color: var(--stone);
}

/* Leaderboard */
.leaderboard-list {
    max-height: 300px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 6px;
    border: 1px solid var(--gold-dark);
}

.leaderboard-item.top-3 {
    border-color: var(--gold);
}

.rank {
    font-size: 18px;
    min-width: 30px;
    text-align: center;
}

.player-info { flex: 1; }

.player-name {
    font-weight: bold;
    color: var(--gold-light);
    font-size: 13px;
}

.player-tokens {
    font-size: 11px;
    color: var(--gold);
}

/* Desktop Styles */
@media (min-width: 768px) {
    .game-area {
        max-width: 800px;
        margin: 0 auto;
        padding: 20px;
    }
    
    .jp-amount {
        font-size: 36px;
    }
    
    .spin-btn {
        width: 100px;
        height: 100px;
    }
    
    .spin-text {
        font-size: 16px;
    }
    
    .bet-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    #betAmount, #linesCount, #totalBet {
        font-size: 18px;
    }
    
    .bet-label {
        font-size: 10px;
    }
    
    .toggle-opt {
        font-size: 12px;
    }
    
    .toggle-opt input {
        width: 18px;
        height: 18px;
    }
    
    .max-btn {
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .paytable-grid {
        grid-template-columns: repeat(9, 1fr);
    }
    
    .pay-item svg {
        width: 45px;
        height: 45px;
    }
    
    .pay-item span {
        font-size: 11px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .bet-info {
        gap: 4px;
    }
    
    .bet-btn {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
    
    .bet-value {
        min-width: 30px;
    }
    
    #betAmount, #linesCount, #totalBet {
        font-size: 12px;
    }
    
    .spin-btn {
        width: 60px;
        height: 60px;
    }
    
    .spin-text {
        font-size: 10px;
    }
    
    .quick-options {
        gap: 4px;
    }
    
    .toggle-opt span {
        display: none;
    }
    
    .max-btn {
        padding: 5px 8px;
        font-size: 9px;
    }
}
