/* Mlima Spin - Main Stylesheet */

:root {
    --primary: #e74c3c;
    --primary-dark: #c0392b;
    --secondary: #2ecc71;
    --accent: #f39c12;
    --dark: #2c3e50;
    --darker: #1a252f;
    --light: #ecf0f1;
    --gray: #95a5a6;
    --red: #e74c3c;
    --black: #34495e;
    --green: #27ae60;
    --gold: #f1c40f;
    --shadow: 0 4px 6px rgba(0,0,0,0.3);
    --radius: 8px;
}

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

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(0,0,0,0.3);
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.logo h1 {
    color: var(--gold);
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.tagline {
    color: var(--gray);
    font-size: 0.9rem;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.balance-display {
    background: rgba(0,0,0,0.4);
    padding: 10px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--gold);
}

.balance-label {
    color: var(--gray);
    font-size: 0.8rem;
}

.balance-amount {
    color: var(--gold);
    font-weight: bold;
    font-size: 1.2rem;
    margin-left: 10px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
}

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

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

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

.btn-secondary:hover {
    background: #27ae60;
}

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

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray);
    color: var(--gray);
}

.btn-outline:hover {
    border-color: var(--light);
    color: var(--light);
}

.btn-block {
    width: 100%;
    padding: 15px;
}

.btn-bet {
    background: linear-gradient(135deg, var(--gold) 0%, var(--accent) 100%);
    color: var(--dark);
    font-size: 1.2rem;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

.btn-bet:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.6);
}

.btn-bet:disabled {
    background: var(--gray);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Main Game Area */
.game-area {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Panels */
.betting-panel, .live-display, .history-panel {
    background: rgba(0,0,0,0.3);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.panel-header h2 {
    color: var(--gold);
}

.round-info {
    text-align: right;
}

.status-badge {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.status-badge.open {
    background: var(--secondary);
    color: white;
}

.status-badge.closed {
    background: var(--primary);
    color: white;
}

/* Betting Form */
.bet-amount {
    margin-bottom: 20px;
}

.bet-amount label {
    display: block;
    margin-bottom: 10px;
    color: var(--gray);
}

.amount-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.amount-input input {
    flex: 1;
    padding: 15px;
    font-size: 1.2rem;
    text-align: center;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    color: white;
}

.amount-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--dark);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

.quick-amounts {
    display: flex;
    gap: 10px;
}

.quick-amounts button {
    flex: 1;
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
    color: var(--light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.quick-amounts button:hover {
    background: var(--gold);
    color: var(--dark);
}

/* Bet Options */
.bet-options label {
    display: block;
    margin-bottom: 15px;
    color: var(--gray);
    font-weight: bold;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.option-group h3 {
    color: var(--accent);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

/* Numbers Grid */
.numbers-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.bet-btn {
    padding: 12px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    background: rgba(255,255,255,0.1);
    color: white;
}

.bet-btn:hover {
    transform: scale(1.05);
    border-color: var(--gold);
}

.bet-btn.selected {
    background: var(--gold);
    color: var(--dark);
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.5);
}

.bet-btn.number-0 {
    background: var(--green);
    grid-column: span 6;
}

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

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

.color-options, .parity-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Bet Summary */
.bet-summary {
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: var(--radius);
    margin: 20px 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.summary-row:last-child {
    margin-bottom: 0;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.win-amount {
    color: var(--gold);
    font-weight: bold;
}

/* Live Display */
.live-display {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.timer-section {
    background: rgba(0,0,0,0.4);
    padding: 30px;
    border-radius: var(--radius);
    border: 2px solid var(--primary);
}

.countdown {
    font-size: 4rem;
    font-weight: bold;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
}

.countdown.warning {
    color: var(--accent);
    animation: pulse 1s infinite;
}

.countdown.critical {
    color: var(--red);
    animation: pulse 0.5s infinite;
}

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

.timer-label {
    color: var(--gray);
    margin-top: 10px;
}

/* Wheel */
.wheel-section {
    position: relative;
}

.wheel-container {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 0 auto;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        var(--red) 0deg 10deg,
        var(--black) 10deg 20deg,
        var(--red) 20deg 30deg,
        var(--black) 30deg 40deg,
        var(--red) 40deg 50deg,
        var(--black) 50deg 60deg,
        var(--red) 60deg 70deg,
        var(--black) 70deg 80deg,
        var(--red) 80deg 90deg,
        var(--black) 90deg 100deg,
        var(--red) 100deg 110deg,
        var(--black) 110deg 120deg,
        var(--red) 120deg 130deg,
        var(--black) 130deg 140deg,
        var(--red) 140deg 150deg,
        var(--black) 150deg 160deg,
        var(--red) 160deg 170deg,
        var(--black) 170deg 180deg,
        var(--red) 180deg 190deg,
        var(--black) 190deg 200deg,
        var(--green) 200deg 210deg,
        var(--black) 210deg 220deg,
        var(--red) 220deg 230deg,
        var(--black) 230deg 240deg,
        var(--red) 240deg 250deg,
        var(--black) 250deg 260deg,
        var(--red) 260deg 270deg,
        var(--black) 270deg 280deg,
        var(--red) 280deg 290deg,
        var(--black) 290deg 300deg,
        var(--red) 300deg 310deg,
        var(--black) 310deg 320deg,
        var(--red) 320deg 330deg,
        var(--black) 330deg 340deg,
        var(--red) 340deg 350deg,
        var(--black) 350deg 360deg
    );
    box-shadow: 0 0 30px rgba(0,0,0,0.5), inset 0 0 20px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.wheel-inner {
    width: 80px;
    height: 80px;
    background: var(--dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--gold);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.wheel-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--gold);
}

.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: var(--gold);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 10;
}

.result-display {
    margin-top: 20px;
}

.last-result {
    font-size: 1.2rem;
    color: var(--gray);
}

#last-result {
    color: var(--gold);
    font-weight: bold;
}

/* Live Stats */
.live-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat-box {
    background: rgba(0,0,0,0.3);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.1);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--gold);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray);
}

/* History Panel */
.history-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    margin-bottom: 8px;
    border-radius: var(--radius);
    border-left: 4px solid transparent;
}

.history-item.red {
    border-left-color: var(--red);
}

.history-item.black {
    border-left-color: var(--gray);
}

.history-item.green {
    border-left-color: var(--green);
}

.history-round {
    font-weight: bold;
    color: var(--gray);
}

.history-result {
    font-weight: bold;
}

.history-result.red { color: var(--red); }
.history-result.black { color: var(--gray); }
.history-result.green { color: var(--green); }

/* My Bets */
.my-bets h3 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1rem;
}

.bet-item {
    background: rgba(255,255,255,0.05);
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    border-left: 4px solid var(--gray);
}

.bet-item.won {
    border-left-color: var(--secondary);
    background: rgba(46, 204, 113, 0.1);
}

.bet-item.lost {
    border-left-color: var(--primary);
    opacity: 0.7;
}

.bet-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.bet-round {
    color: var(--gray);
    font-size: 0.8rem;
}

.bet-status {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.bet-status.won { color: var(--secondary); }
.bet-status.lost { color: var(--primary); }

.bet-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.bet-selection {
    color: var(--light);
}

.bet-amount {
    color: var(--gold);
    font-weight: bold;
}

.bet-win {
    color: var(--secondary);
    font-weight: bold;
}

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

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--dark);
    padding: 30px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

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

.modal h2 {
    margin-bottom: 20px;
    color: var(--gold);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--gray);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    color: white;
    font-size: 1rem;
}

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

.form-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--gray);
}

.form-switch a {
    color: var(--accent);
    text-decoration: none;
}

.status-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: var(--radius);
    text-align: center;
    display: none;
}

.status-message.success {
    background: rgba(46, 204, 113, 0.2);
    color: var(--secondary);
    display: block;
}

.status-message.error {
    background: rgba(231, 76, 60, 0.2);
    color: var(--primary);
    display: block;
}

/* Login Prompt */
.login-prompt {
    text-align: center;
    padding: 40px 20px;
}

.login-prompt p {
    color: var(--gray);
    margin-bottom: 20px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--gray);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 20px;
}

.footer p {
    margin-bottom: 5px;
}

/* Responsive */
@media (max-width: 1024px) {
    .game-area {
        grid-template-columns: 1fr;
    }
    
    .live-display {
        order: -1;
    }
    
    .numbers-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 600px) {
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .countdown {
        font-size: 3rem;
    }
    
    .wheel-container {
        width: 200px;
        height: 200px;
    }
    
    .numbers-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.wheel.spinning {
    animation: spin 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}

::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--light);
}
.status-badge.open {
    background: #2ecc71;
    color: white;
}

.status-badge.warning {
    background: #f39c12;
    color: white;
    animation: pulse 1s infinite;
}

.status-badge.spinning {
    background: #e74c3c;
    color: white;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Wheel animation */
.wheel {
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}
/* Public game view styles */
.status-badge.open {
    background: #2ecc71;
    color: white;
}

.status-badge.warning {
    background: #f39c12;
    color: white;
    animation: pulse 1s infinite;
}

.status-badge.spinning {
    background: #e74c3c;
    color: white;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Login prompt styling */
.login-prompt {
    text-align: center;
    padding: 40px 20px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}

.login-prompt p {
    color: #95a5a6;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* Ensure game display is visible to all */
.live-display, .history-panel {
    opacity: 1 !important;
    pointer-events: auto !important;
}
/* ============================================
   WITHDRAWAL BUTTON & MODAL STYLES
   ============================================ */

/* Withdrawal Button - Orange/Yellow styling */
.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(230, 126, 34, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(230, 126, 34, 0.4);
}

.btn-warning:active {
    transform: translateY(0);
}

/* Withdrawal Modal specific styles */
#withdraw-modal .modal-content {
    border-top: 4px solid #f39c12;
}

#withdraw-modal h2 {
    color: #e67e22;
    margin-bottom: 10px;
}

#withdraw-modal h2::before {
    content: "💸 ";
}

/* Help text for min/max amounts */
.help-text {
    display: block;
    color: #7f8c8d;
    font-size: 0.85em;
    margin-top: 5px;
    font-style: italic;
}

/* Status message styles */
.status-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.status-message.pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    display: block;
}

/* Input validation styles */
#withdraw-form input:invalid {
    border-color: #e74c3c;
}

#withdraw-form input:valid {
    border-color: #27ae60;
}

/* Balance display update animation */
.balance-amount.updating {
    animation: balancePulse 0.5s ease;
}

@keyframes balancePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #e67e22; }
    100% { transform: scale(1); }
}

/* User section layout improvements */
.user-section {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.balance-display {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    margin-right: 10px;
}

.balance-label {
    color: #bdc3c7;
    font-size: 0.9em;
}

.balance-amount {
    color: #2ecc71;
    font-weight: 700;
    font-size: 1.1em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .user-section {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .balance-display {
        margin-right: 0;
        width: 100%;
        text-align: center;
    }
    
    .btn-warning,
    .btn-success,
    .btn-outline {
        width: 100%;
        padding: 12px;
    }
}

/* Loading state for withdrawal button */
.btn-warning:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Transaction history item styles for withdrawals */
.bet-item.withdrawal {
    border-left: 3px solid #f39c12;
}

.bet-item.withdrawal .bet-status {
    background: #f39c12;
    color: white;
}