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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    overflow: hidden;
    touch-action: none;
}

#game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* HUD Styling */
#hud {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.hud-item {
    text-align: center;
}

.hud-label {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.hud-value {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

.hud-value-large {
    font-size: 48px;
    font-weight: bold;
    color: #FF6B35;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
}

.win-value {
    color: #4ECDC4;
}

.multiplier-display {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    padding: 15px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
}

/* Canvas */
#game-canvas {
    flex: 1;
    width: 100%;
    background: linear-gradient(to bottom, #87CEEB 0%, #E0F6FF 50%, #90EE90 100%);
    display: block;
}

/* Controls */
#controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

#bet-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

#bet-amount {
    padding: 10px 15px;
    font-size: 16px;
    border: 2px solid #4ECDC4;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 120px;
}

.btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 150px;
    touch-action: manipulation;
}

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

.btn-primary {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.6);
}

.btn-success {
    background: linear-gradient(135deg, #F7931E 0%, #FF6B35 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.6);
}

/* Stats */
#stats {
    position: absolute;
    top: 100px;
    left: 20px;
    background: rgba(0, 0, 0, 0.6);
    padding: 15px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    z-index: 5;
}

.stat-item {
    margin: 5px 0;
    font-size: 14px;
}

/* History */
#history {
    position: absolute;
    top: 100px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    padding: 15px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    z-index: 5;
    max-width: 300px;
}

.history-label {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 10px;
}

#history-items {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.history-item {
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
}

.history-item.win {
    background: rgba(78, 205, 196, 0.3);
    color: #4ECDC4;
    border: 1px solid #4ECDC4;
}

.history-item.loss {
    background: rgba(255, 107, 53, 0.3);
    color: #FF6B35;
    border: 1px solid #FF6B35;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #hud {
        padding: 10px;
    }

    .hud-value {
        font-size: 18px;
    }

    .hud-value-large {
        font-size: 36px;
    }

    #controls {
        flex-wrap: wrap;
        padding: 15px;
    }

    .btn {
        min-width: 120px;
        padding: 10px 20px;
        font-size: 14px;
    }

    #stats, #history {
        font-size: 12px;
        padding: 10px;
    }
}

/* Minimum touch target size for mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Extra small screens - prioritize visibility of controls */
@media (max-width: 480px) {
    #hud {
        padding: 5px 10px;
        gap: 8px;
    }

    .hud-item {
        padding: 5px 10px;
    }

    .hud-label {
        font-size: 9px;
        margin-bottom: 2px;
    }

    .hud-value {
        font-size: 14px;
    }

    .hud-value-large {
        font-size: 24px;
    }

    .multiplier-display {
        padding: 8px 20px;
    }

    #controls {
        padding: 8px;
        gap: 8px;
    }

    #bet-controls {
        gap: 5px;
    }

    #bet-amount {
        width: 80px;
        padding: 8px 10px;
        font-size: 14px;
    }

    .btn {
        min-width: 80px;
        padding: 8px 12px;
        font-size: 12px;
        min-height: 40px;
    }

    #stats, #history {
        padding: 5px;
        font-size: 10px;
        max-height: 60px;
        overflow-y: auto;
    }

    .stat-item, .history-item {
        padding: 3px 6px;
        font-size: 10px;
    }

    /* Ensure canvas doesn't take too much space */
    #game-canvas {
        min-height: 200px;
        max-height: 40vh;
    }
}

/* Portrait orientation on mobile - stack controls vertically if needed */
@media (max-width: 380px) {
    #controls {
        flex-direction: column;
        padding: 5px;
        gap: 5px;
    }

    #bet-controls {
        width: 100%;
        justify-content: center;
    }

    .btn {
        width: 100%;
        max-width: 200px;
    }
}
