:root {
    --bg-primary: #0a0a2a;
    --bg-secondary: #15153b;
    --bg-tertiary: #1e1e4a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0d0;
    --text-accent: #4a76a8;
    --accent: #4a76a8;
    --accent-hover: #5a86b8;
    --success: #00ff88;
    --success-dark: #00cc66;
    --danger: #ff5555;
    --danger-dark: #cc4444;
    --warning: #ffaa00;
    --border: #2a2a5a;
    --border-light: #3a3a6a;
    --shadow: rgba(0, 0, 0, 0.5);
    --gradient: linear-gradient(135deg, #4a76a8, #2a4a78);
    --gradient-dark: linear-gradient(135deg, #2a4a78, #1a2a48);
    --gradient-success: linear-gradient(135deg, #00ff88, #00cc66);
    --gradient-danger: linear-gradient(135deg, #ff5555, #cc4444);
}

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

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

.app {
    max-width: 400px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
}

.app::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(74, 118, 168, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(42, 74, 120, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Header */
.header {
    background: var(--bg-secondary);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.balance-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.balance {
    font-size: 1.3em;
    font-weight: bold;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

#userName {
    font-size: 0.8em;
    color: var(--text-secondary);
}

.mode {
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
}

.mode.demo {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.mode.real {
    background: var(--gradient-success);
    color: white;
}

.logo {
    font-size: 1.1em;
    font-weight: bold;
    letter-spacing: 1.5px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.menu-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.menu-btn:hover {
    background: var(--accent);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 2px solid var(--border);
    transition: left 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--text-primary);
}

.sidebar-items {
    padding: 10px 0;
}

.sidebar-item {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.sidebar-item:hover {
    background: var(--bg-tertiary);
}

.sidebar-item.active {
    background: var(--bg-tertiary);
    border-left-color: var(--accent);
}

.sidebar-item .icon {
    margin-right: 12px;
    font-size: 1.2em;
}

/* Main Content */
.main {
    padding: 20px;
    min-height: calc(100vh - 120px);
    position: relative;
    z-index: 1;
}

.section {
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.section.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    text-align: center;
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 1.8em;
    margin-bottom: 8px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Dashboard */
.welcome-banner {
    background: var(--gradient);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    text-align: center;
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-light);
}

.stat-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.section-block {
    margin-bottom: 30px;
}

.section-block h2 {
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Quick Games */
.quick-games {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 15px 0;
}

.quick-game {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--border);
}

.quick-game:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.quick-game .game-emoji {
    font-size: 2em;
    margin-bottom: 8px;
}

.quick-game .game-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.quick-game .game-bet {
    color: var(--text-secondary);
    font-size: 0.8em;
}

.quick-games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.quick-game-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--border);
}

.quick-game-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}

.quick-game-card .game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.quick-game-card .game-emoji {
    font-size: 2.5em;
}

.quick-game-card .game-multiplier {
    background: var(--gradient-success);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
}

.quick-game-card .game-name {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 5px;
}

.quick-game-card .game-desc {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 10px;
}

.quick-game-card .quick-bet {
    background: var(--bg-tertiary);
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
}

/* Activity List */
.activity-list {
    margin-top: 15px;
}

.activity-item {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--border);
}

.activity-item.win {
    border-left-color: var(--success);
}

.activity-item.lose {
    border-left-color: var(--danger);
}

.activity-game {
    display: flex;
    align-items: center;
    gap: 8px;
}

.activity-result {
    font-weight: 600;
}

.activity-time {
    color: var(--text-secondary);
    font-size: 0.8em;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

.game-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.game-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.game-name {
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 5px;
}

.game-desc {
    font-size: 0.8em;
    color: var(--text-secondary);
}

/* Mode Switch */
.mode-switch {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 4px;
    margin: 20px 0;
}

.mode-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.mode-btn.active {
    background: var(--gradient);
    color: white;
}

/* Profile */
.profile-info {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.info-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

/* Payments */
.payment-section {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.deposit-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.method-btn {
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.method-btn:hover {
    border-color: var(--accent);
}

.method-icon {
    font-size: 2em;
    margin-bottom: 8px;
}

.method-name {
    font-size: 0.9em;
    font-weight: 600;
}

.withdraw-info {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.transactions-list {
    margin-top: 15px;
}

.transaction-item {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 4px solid var(--accent);
}

.transaction-type {
    font-weight: 600;
    margin-bottom: 5px;
}

.transaction-amount {
    font-size: 1.1em;
    font-weight: bold;
}

.transaction-amount.positive {
    color: var(--success);
}

.transaction-amount.negative {
    color: var(--danger);
}

/* NFT */
.nft-gifts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.nft-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nft-card:hover {
    border-color: var(--warning);
    transform: translateY(-2px);
}

.nft-icon {
    font-size: 2em;
    margin-bottom: 8px;
}

.nft-name {
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 4px;
}

.nft-desc {
    font-size: 0.8em;
    color: var(--text-secondary);
}

.nft-stats {
    margin-top: 30px;
}

.nft-list {
    margin-top: 15px;
}

.inventory-item {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.inventory-item .nft-icon {
    font-size: 2em;
    margin: 0;
}

.nft-info {
    flex: 1;
}

.nft-value {
    color: var(--success);
    font-weight: 600;
}

/* Leaderboard */
.leaderboard-tabs {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 4px;
    margin: 20px 0;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--gradient);
    color: white;
}

.leaderboard-list {
    margin-top: 20px;
}

.leaderboard-item {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.leaderboard-item.top-1 {
    background: linear-gradient(135deg, var(--bg-secondary), #2a4a78);
    border: 2px solid gold;
}

.leaderboard-item.top-2 {
    background: linear-gradient(135deg, var(--bg-secondary), #3a5a88);
    border: 2px solid silver;
}

.leaderboard-item.top-3 {
    background: linear-gradient(135deg, var(--bg-secondary), #4a6a98);
    border: 2px solid #cd7f32;
}

.leaderboard-item .rank {
    font-weight: bold;
    width: 30px;
    text-align: center;
}

.leaderboard-item .player-info {
    flex: 1;
}

.leaderboard-item .player-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.leaderboard-item .player-stats {
    color: var(--text-secondary);
    font-size: 0.8em;
}

.leaderboard-item .player-score {
    font-weight: bold;
    font-size: 1.1em;
}

/* Promo */
.promo-section {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.active-promos {
    margin-top: 20px;
}

.promo-item {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 4px solid var(--success);
}

/* Support */
.support-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.support-card {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--border);
}

.support-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}

.support-card .support-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.support-card .support-title {
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
    transition: all 0.3s ease;
    font-size: 1em;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-small {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-small:hover {
    background: var(--accent);
}

/* Forms */
.input {
    width: 100%;
    padding: 15px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1em;
    transition: all 0.3s ease;
}

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

/* Bet Buttons */
.bet-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 15px 0;
}

.bet-btn {
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.bet-btn:hover {
    border-color: var(--accent);
    background: var(--accent);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 42, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-secondary);
    margin: 5% auto;
    padding: 25px;
    border-radius: 20px;
    width: 90%;
    max-width: 350px;
    border: 2px solid var(--border-light);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    max-height: 80vh;
    overflow-y: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

.modal-title {
    font-size: 1.3em;
    font-weight: 600;
}

.close {
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 10px 0;
}

/* Game Specific Styles */
.game-area {
    padding: 20px 0;
    text-align: center;
}

.coin {
    width: 120px;
    height: 120px;
    font-size: 4em;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    border-radius: 50%;
    margin: 0 auto 30px;
    cursor: pointer;
    transition: transform 0.6s ease;
}

.coin.flipping {
    animation: flip 0.6s ease;
}

@keyframes flip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
    100% { transform: rotateY(360deg); }
}

.choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.choice-btn {
    padding: 20px;
    font-size: 1.2em;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 15px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.choice-btn:hover {
    border-color: var(--accent);
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 42, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    display: none;
}

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

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border);
    border-top: 5px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-primary);
    font-size: 1.1em;
}

/* Alert Container */
.alert-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4000;
    pointer-events: none;
}

.alert {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 2px solid var(--accent);
    box-shadow: 0 5px 15px var(--shadow);
    animation: slideDown 0.3s ease;
}

.alert.success {
    border-color: var(--success);
}

.alert.error {
    border-color: var(--danger);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Responsive */
@media (max-width: 480px) {
    .sidebar {
        width: 280px;
        left: -280px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-games-grid {
        grid-template-columns: 1fr;
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .support-options {
        grid-template-columns: 1fr;
    }
    
    .deposit-methods {
        grid-template-columns: 1fr;
    }
    
    .nft-gifts {
        grid-template-columns: 1fr;
    }
}