/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-dark: #0f172a;
    --secondary-dark: #1e293b;
    --accent-gold: #fbbf24;
    --accent-gold-light: #fde68a;
    --green: #10b981;
    --red: #ef4444;
    --violet: #8b5cf6;
    --blue: #3b82f6;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 10px;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    background: var(--primary-dark);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
    border: 1px solid var(--border-color);
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: center;
    border-bottom: 2px solid var(--accent-gold);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-gold), #f59e0b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.username {
    font-weight: 600;
    font-size: 16px;
}

.user-level {
    font-size: 12px;
    color: var(--accent-gold);
    background: rgba(251, 191, 36, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 4px;
}

.balance-container {
    text-align: center;
}

.balance-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.balance-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 4px;
}

.balance-change {
    font-size: 14px;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    display: inline-block;
}

.game-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.period-info {
    margin-bottom: 8px;
}

.period-info .label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.period-info .value {
    font-family: monospace;
    font-size: 14px;
    color: var(--text-primary);
}

.timer-container {
    text-align: center;
}

.timer {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--danger), #dc2626);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin: 0 auto 4px;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    animation: pulse 1s infinite;
}

.timer-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Current Result */
.current-result {
    background: var(--card-bg);
    padding: 15px 20px;
    margin: 15px 20px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.result-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-display {
    display: flex;
    align-items: center;
    gap: 20px;
}

.result-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-gold), #f59e0b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: #000;
}

.result-color {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid white;
}

.result-type {
    flex: 1;
    text-align: right;
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-gold);
}

/* Betting Area */
.betting-area {
    padding: 0 20px;
}

.section-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 20px 0 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Color Bets */
.color-bets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.bet-option {
    background: var(--secondary-dark);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
}

.bet-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.bet-option.selected {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.3);
}

.bet-option.green.selected {
    border-color: var(--green);
}

.bet-option.red.selected {
    border-color: var(--red);
}

.bet-option.violet.selected {
    border-color: var(--violet);
}

.color-circle {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid white;
}

.green .color-circle {
    background: linear-gradient(135deg, var(--green), #059669);
}

.red .color-circle {
    background: linear-gradient(135deg, var(--red), #dc2626);
}

.violet .color-circle {
    background: linear-gradient(135deg, var(--violet), #7c3aed);
}

.bet-info {
    text-align: center;
}

.bet-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.bet-multiplier {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 4px;
}

.bet-chance {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Numbers Grid */
.numbers-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.num-btn {
    position: relative;
    aspect-ratio: 1;
    border-radius: 50%;
    border: none;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: visible;
}

.num-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.num-btn.selected {
    border: 3px solid var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.3);
}

.num-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Bet Amount Indicator */
.bet-amount-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, var(--accent-gold), #f59e0b);
    color: #000;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 40px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 2;
}

.num-amount-indicator {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, var(--accent-gold), #f59e0b);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 10px;
    min-width: 35px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 2;
}

/* Amount Control */
.amount-control {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.amount-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.amount-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: var(--secondary-dark);
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.amount-btn:hover {
    background: var(--accent-gold);
    color: #000;
}

#betAmount {
    flex: 1;
    height: 50px;
    background: var(--secondary-dark);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    outline: none;
}

#betAmount:focus {
    border-color: var(--accent-gold);
}

.quick-amounts {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.quick-amt {
    padding: 10px;
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.quick-amt:hover {
    background: var(--accent-gold);
    color: #000;
    border-color: var(--accent-gold);
}

/* Size Bets */
.size-bets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.size-option {
    background: var(--secondary-dark);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.size-option:hover {
    transform: translateY(-2px);
}

.size-option.selected {
    border-color: var(--accent-gold);
}

.size-option.big.selected {
    border-color: var(--success);
}

.size-option.small.selected {
    border-color: var(--blue);
}

.size-icon {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.big .size-icon {
    background: linear-gradient(135deg, var(--success), #059669);
}

.small .size-icon {
    background: linear-gradient(135deg, var(--blue), #1d4ed8);
}

.size-info {
    flex: 1;
}

.size-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.size-multiplier {
    font-size: 16px;
    color: var(--accent-gold);
    font-weight: 600;
}

/* Action Buttons - Changed to 3 columns */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.clear-btn {
    background: var(--secondary-dark);
    color: var(--text-primary);
}

.place-bet-btn {
    background: linear-gradient(135deg, var(--accent-gold), #f59e0b);
    color: #000;
}

.auto-btn {
    background: linear-gradient(135deg, var(--violet), #7c3aed);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Current Bet Info */
.current-bet-info {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.current-bet-info > div {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.current-bet-info > div:last-child {
    border-bottom: none;
}

/* History Panel */
.history-panel {
    background: var(--secondary-dark);
    padding: 20px;
    margin: 20px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.stats {
    display: flex;
    gap: 15px;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 16px;
    font-weight: 600;
}

.stat-value.profit {
    color: var(--success);
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
}

.history-period {
    font-family: monospace;
    color: var(--text-secondary);
}

.history-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.history-type {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Control Panel */
.control-panel {
    display: flex;
    justify-content: space-around;
    padding: 15px 20px;
    background: var(--secondary-dark);
    border-top: 1px solid var(--border-color);
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    padding: 8px;
    border-radius: 8px;
}

.control-btn:hover {
    color: var(--accent-gold);
    background: rgba(251, 191, 36, 0.1);
}

.control-btn i {
    font-size: 20px;
}

.control-btn span {
    font-size: 12px;
}

/* Warning Banner */
.warning-banner {
    background: linear-gradient(135deg, #991b1b, #dc2626);
    padding: 12px 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
}

/* Settings Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--primary-dark);
    padding: 30px;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    border: 2px solid var(--accent-gold);
}

.modal-content h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.setting-item input {
    width: 100%;
    padding: 12px;
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons .btn {
    flex: 1;
}

.cancel {
    background: var(--secondary-dark);
    color: var(--text-primary);
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    box-shadow: var(--shadow);
    transform: translateX(150%);
    transition: transform 0.3s;
    z-index: 1001;
    font-weight: 600;
}

.notification.show {
    transform: translateX(0);
}

/* Timer Warning */
.timer.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    animation: warning-pulse 0.5s infinite;
}

@keyframes warning-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Selection Animation */
.bet-option.selected .color-circle,
.size-option.selected .size-icon,
.num-btn.selected .num-content {
    animation: selection-pulse 2s infinite;
}

@keyframes selection-pulse {
    0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(251, 191, 36, 0); }
    100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}

/* Enhanced responsive styles */
@media (max-width: 480px) {
    .app-container {
        border-radius: 0;
    }
    
    .header {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 15px;
    }
    
    .user-info {
        justify-content: center;
    }
    
    .game-info {
        align-items: center;
    }
    
    .color-bets {
        grid-template-columns: 1fr;
    }
    
    .numbers-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .quick-amounts {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .bet-amount-indicator {
        font-size: 10px;
        padding: 2px 6px;
        min-width: 35px;
        top: -6px;
        right: -6px;
    }
    
    .num-amount-indicator {
        font-size: 9px;
        padding: 2px 4px;
        min-width: 30px;
        top: -5px;
        right: -5px;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-dark);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 3px;
}