:root {
    --primary: #ff6b35;
    --primary-dark: #e55a2b;
    --secondary: #2c3e50;
    --background: #1a1a2e;
    --surface: #16213e;
    --text: #ffffff;
    --text-muted: #a0a0a0;
    --success: #2ecc71;
    --error: #e74c3c;
    --warning: #f39c12;
    --gold: #ffd700;
    --red: #e74c3c;
    --black: #2c3e50;
    --green: #27ae60;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, var(--surface) 100%);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* Auth Screen */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.auth-box {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255,255,255,0.1);
}

.auth-box h2 {
    margin-bottom: 1rem;
    text-align: center;
}

.auth-box p {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Buttons */
button {
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}

.btn-secondary {
    padding: 10px 20px;
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
}

.btn-small {
    padding: 6px 12px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    font-size: 0.8rem;
}

.btn-warning {
    padding: 10px 20px;
    background: var(--warning);
    color: white;
    border: none;
    border-radius: 8px;
}

.btn-jackpot {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--gold) 0%, #ffaa00 100%);
    color: #1a1a2e;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
}

.btn-jackpot:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255,215,0,0.4);
}

.hidden {
    display: none !important;
}

.error {
    color: var(--error);
    margin-top: 1rem;
    text-align: center;
}

.info {
    color: var(--success);
    margin: 1rem 0;
    text-align: center;
}

/* Casino Screen Layout */
#casino-screen {
    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.balance {
    background: var(--primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
}

main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    padding: 2rem;
}

/* Game Navigation */
.game-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: rgba(255,255,255,0.05);
    padding: 0.5rem;
    border-radius: 12px;
}

.nav-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
}

.nav-btn:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}

.nav-btn.active {
    background: var(--primary);
    color: white;
}

/* Game Panels */
.games-container {
    background: rgba(255,255,255,0.03);
    border-radius: 16px;
    padding: 2rem;
    min-height: 500px;
}

.game-panel {
    display: none;
}

.game-panel.active {
    display: block;
}

.game-panel h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Roulette */
.roulette-wheel {
    text-align: center;
    margin-bottom: 2rem;
}

.result-display {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.betting-table {
    margin-bottom: 2rem;
}

.bet-row {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 4px;
}

.bet-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.bet-btn:hover {
    transform: scale(1.1);
}

.bet-btn.green {
    background: var(--green);
    color: white;
}

.bet-btn.red-bg {
    background: var(--red);
    color: white;
}

.bet-btn.black-bg {
    background: var(--black);
    color: white;
}

.bet-row.options .bet-btn {
    width: 80px;
}

.bet-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.bet-controls input {
    width: 120px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
    color: var(--text);
}

.current-bets {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    min-height: 50px;
}

/* Blackjack */
.blackjack-table {
    margin-bottom: 2rem;
}

.dealer-hand, .player-hand {
    margin-bottom: 2rem;
}

.dealer-hand h3, .player-hand h3 {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.cards {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 1rem;
}

.card {
    width: 80px;
    height: 120px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #1a1a2e;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.card.red {
    color: var(--red);
}

.card.back {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: transparent;
}

.total {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
}

.game-controls {
    text-align: center;
}

#action-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Slots */
.slots-machine {
    text-align: center;
    margin-bottom: 2rem;
}

.reels {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2rem;
}

.reel {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.1), 0 4px 20px rgba(0,0,0,0.3);
    border: 4px solid #ffd700;
}

.reel.spinning {
    animation: spin 0.1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(0); }
    100% { transform: translateY(-20px); }
}

.paytable {
    background: rgba(255,255,255,0.03);
    padding: 1rem;
    border-radius: 8px;
    display: inline-block;
}

.paytable h4 {
    margin-bottom: 0.5rem;
}

.paytable ul {
    list-style: none;
}

.paytable li {
    padding: 4px 0;
    color: var(--text-muted);
}

/* Jackpot */
.jackpot-display {
    text-align: center;
    margin-bottom: 2rem;
}

.jackpot-amount {
    font-size: 4rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(255,215,0,0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.jackpot-label {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.jackpot-info {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.jackpot-info p {
    margin: 0.5rem 0;
}

.last-winner {
    text-align: center;
    padding: 1rem;
    background: rgba(255,215,0,0.1);
    border-radius: 8px;
    margin-bottom: 2rem;
}

.last-winner h4 {
    color: var(--gold);
    margin-bottom: 0.5rem;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.withdrawal-box, .leaderboard-box {
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    padding: 1.5rem;
}

.withdrawal-box h3, .leaderboard-box h3 {
    margin-bottom: 1rem;
}

.leaderboard-box ul {
    list-style: none;
}

.leaderboard-box li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
}

.leaderboard-box li:last-child {
    border-bottom: none;
}

/* Result Display */
.result {
    text-align: center;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 8px;
    font-weight: 600;
}

.result.win {
    background: rgba(46,204,113,0.2);
    color: var(--success);
}

.result.lose {
    background: rgba(231,76,60,0.2);
    color: var(--error);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 1001;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: var(--success);
    color: white;
}

.notification.error {
    background: var(--error);
    color: white;
}

.notification.info {
    background: var(--secondary);
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    main {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .withdrawal-box, .leaderboard-box {
        flex: 1;
        min-width: 300px;
    }
}

@media (max-width: 600px) {
    .game-nav {
        flex-wrap: wrap;
    }
    
    .nav-btn {
        font-size: 0.9rem;
        padding: 10px 15px;
    }
    
    .jackpot-amount {
        font-size: 2.5rem;
    }
    
    .reel {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .card {
        width: 60px;
        height: 90px;
        font-size: 1.5rem;
    }
}
