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

body {
    font-family: 'Space Grotesk', sans-serif;
    background: linear-gradient(135deg, #0d1b2a 0%, #1b263b 50%, #0d1b2a 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

#game-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 10px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 15px 0;
}

.title-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.ball-icon {
    animation: bounce 0.6s ease-in-out infinite alternate;
    font-size: 1.2rem;
}

.ball-icon:last-child {
    animation-delay: 0.3s;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    font-weight: 900;
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 50%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    letter-spacing: 3px;
}

#main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#canvas {
    display: block;
    margin: 0 auto;
    border-radius: 12px;
    background: linear-gradient(180deg, #0d1b2a 0%, #1b263b 100%);
    box-shadow: 
        0 0 30px rgba(0, 150, 255, 0.1),
        inset 0 0 60px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

#controls {
    background: rgba(27, 38, 59, 0.8);
    border-radius: 16px;
    padding: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-bar {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffd700;
}

.path-display {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    min-height: 45px;
}

.path-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    display: block;
    margin-bottom: 6px;
}

#path-arrows {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.path-arrow {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.path-arrow.revealed {
    color: #00e676;
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
}

.bet-section {
    margin-bottom: 15px;
}

.bet-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    display: block;
    margin-bottom: 8px;
}

.bet-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bet-btn {
    flex: 1;
    min-width: 45px;
    padding: 10px 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    border-radius: 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bet-btn:hover {
    border-color: rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.1);
}

.bet-btn.active {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 140, 0, 0.3));
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.drop-button {
    width: 100%;
    padding: 18px 30px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #9c27b0, #e91e63);
    color: #fff;
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 4px 20px rgba(156, 39, 176, 0.4);
}

.drop-button:hover:not(.disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 25px rgba(156, 39, 176, 0.5);
}

.drop-button:active:not(.disabled) {
    transform: scale(0.98);
}

.drop-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.settings-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.setting {
    display: flex;
    align-items: center;
    gap: 6px;
}

.setting label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.setting select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
}

.ball-colors {
    display: flex;
    gap: 5px;
}

.color-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.color-btn.active {
    border-color: #fff;
    box-shadow: 0 0 10px currentColor;
}

.reset-button {
    margin-left: auto;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 0, 0, 0.2);
    color: #ff5252;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-button:hover {
    background: rgba(255, 0, 0, 0.3);
    border-color: #ff5252;
}

#history-panel {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.history-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    display: block;
    margin-bottom: 8px;
}

#history-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.history-mult {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
}

.history-win {
    color: #00e676;
    margin-left: auto;
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: auto;
}

footer a {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s ease;
}

footer a:hover {
    color: rgba(255, 255, 255, 0.7);
}

#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1000;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@media (max-width: 480px) {
    #controls {
        padding: 12px;
    }
    
    .bet-btn {
        padding: 8px 6px;
        font-size: 0.8rem;
    }
    
    .drop-button {
        padding: 14px 20px;
        font-size: 1rem;
    }
    
    .settings-row {
        gap: 8px;
    }
    
    .setting select {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
}