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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}

.game-container {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 1200px;
    width: 100%;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.info-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-item .label {
    font-weight: bold;
    color: #4ecdc4;
    margin-right: 5px;
}

.game-area {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

#gameCanvas {
    border: 3px solid #4ecdc4;
    border-radius: 15px;
    background: #2c3e50;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.controls {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 250px;
}

.control-group h3 {
    color: #4ecdc4;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.control-group p {
    margin-bottom: 8px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.mobile-controls {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 3px solid #4ecdc4;
    margin-top: 10px;
    font-weight: bold;
}

.editor-btn {
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.editor-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.load-track-btn {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.load-track-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.score-panel {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.score-panel h3 {
    color: #4ecdc4;
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: center;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.score-item .label {
    font-weight: bold;
    color: #f39c12;
    font-size: 0.9rem;
}

.score-item span:last-child {
    font-weight: bold;
    color: #2ecc71;
    font-size: 1.1rem;
}

.difficulty-panel {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.difficulty-panel h3 {
    color: #4ecdc4;
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: center;
}

.difficulty-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.difficulty-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.easy-btn {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
    color: white;
}

.easy-btn:hover, .easy-btn.active {
    background: linear-gradient(45deg, #27ae60, #229954);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(46, 204, 113, 0.3);
}

.hard-btn {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
}

.hard-btn:hover, .hard-btn.active {
    background: linear-gradient(45deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.difficulty-info {
    text-align: center;
    font-size: 0.8rem;
    color: #bdc3c7;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.boost-meter {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.boost-label {
    font-weight: bold;
    color: #ff6b6b;
    margin-bottom: 10px;
}

.boost-bar {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.boost-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ff8e53);
    width: 100%;
    transition: width 0.3s ease;
    border-radius: 8px;
}

.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.overlay-content {
    background: rgba(0, 0, 0, 0.9);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid #4ecdc4;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.overlay-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #4ecdc4;
}

.overlay-content p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.restart-btn {
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.3);
}

.hidden {
    display: none !important;
}

/* Mobile Touch Controllers */
.mobile-controllers {
    display: none; /* Hidden by default, shown only on mobile */
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 20px;
    pointer-events: none; /* Allow touches to pass through to game */
}

.gesture-area {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    pointer-events: auto; /* Re-enable pointer events for this element */
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.gesture-area.active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.4);
}

.left-gesture {
    background: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.4);
}

.left-gesture.active {
    background: rgba(46, 204, 113, 0.4);
}

.right-gesture {
    background: rgba(52, 152, 219, 0.2);
    border-color: rgba(52, 152, 219, 0.4);
}

.right-gesture.active {
    background: rgba(52, 152, 219, 0.4);
}

.gesture-indicator {
    font-size: 20px;
    color: white;
    opacity: 0.8;
    pointer-events: none;
}

.boost-controller {
    position: absolute;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
}

.control-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.control-btn:active,
.control-btn.active {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0.95);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.boost-btn {
    background: rgba(255, 107, 107, 0.3);
    border-color: rgba(255, 107, 107, 0.5);
    width: 80px;
    height: 80px;
    font-size: 28px;
}

.boost-btn:active,
.boost-btn.active {
    background: rgba(255, 107, 107, 0.6);
}

/* Responsive design */
@media (max-width: 768px) {
    .game-container {
        padding: 15px;
        margin: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .game-info {
        gap: 15px;
    }
    
    .info-item {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 400px;
        height: auto;
    }
    
    .controls {
        min-width: 200px;
    }
    
    /* Show mobile controllers on mobile devices */
    .mobile-controllers {
        display: flex;
    }
    
    /* Hide mobile controls text on mobile since we have actual buttons */
    .mobile-controls {
        display: none;
    }
} 