:root {
    --bg-dark: #0f111a;
    --panel-bg: #1a1d2d;
    --accent-cyan: #00f3ff;
    --accent-pink: #ff0055;
    --accent-gold: #ffd700;
    --text-main: #ffffff;
    --text-muted: #8b8e99;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.game-wrapper {
    width: 100%;
    max-width: 1200px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.back-btn {
    position: fixed;
    top: 10px;
    left: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    z-index: 100;
}
.back-btn:hover { color: white; }

.history-bar {
    background-color: var(--panel-bg);
    border-radius: 8px;
    padding: 8px 15px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    height: 30px;
    align-items: center;
}
.history-item {
    font-size: 0.85rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    white-space: nowrap;
}
.history-item.low { color: #3b82f6; }
.history-item.mid { color: #a855f7; }
.history-item.high { color: #ec4899; }
.history-item.mega { color: #ffd700; text-shadow: 0 0 5px #ffd700; }

.main-layout {
    display: flex;
    gap: 15px;
    height: 600px;
}

/* Control Panel */
.control-panel {
    width: 300px;
    background-color: var(--panel-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.balance-box {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.input-group label, .setting-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bet-input-row {
    display: flex;
    background: #0f1014;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #333;
    margin-bottom: 10px;
}
.bet-input-row button {
    background: #2a2c36;
    border: none;
    color: white;
    width: 40px;
    cursor: pointer;
    font-size: 1.2rem;
}
.bet-input-row input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    outline: none;
}

.quick-bets {
    display: flex;
    gap: 5px;
}
.quick-bets button, .toggle-group button {
    flex: 1;
    background: #2a2c36;
    border: none;
    color: var(--text-muted);
    padding: 8px 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.2s;
}
.quick-bets button:hover, .toggle-group button:hover { background: #3a3c46; color: white; }

.toggle-group {
    display: flex;
    gap: 5px;
}
.toggle-group button.active {
    background: var(--accent-cyan);
    color: #000;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

.action-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s;
    margin-top: auto;
}

.drop-btn {
    background: linear-gradient(135deg, var(--accent-pink), #ff00aa);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 0, 85, 0.4);
}
.drop-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255, 0, 85, 0.6); }
.drop-btn:disabled { background: #333; color: #666; box-shadow: none; cursor: not-allowed; transform: none; }

.message {
    text-align: center;
    font-weight: bold;
    min-height: 1.2em;
    font-size: 0.9rem;
}
.message.win { color: var(--accent-gold); text-shadow: 0 0 10px var(--accent-gold); }
.message.lose { color: var(--text-muted); }

/* Game Stage */
.stage-container {
    flex: 1;
    background-color: var(--panel-bg);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}