/* ============================================
   HAND GESTURE RACING GAME - STYLES
   ============================================ */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background-color: #0a0a0a;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: white;
    user-select: none;
}

/* Main Game Container */
#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, #000022 0%, #001144 100%);
}

/* Game Canvas */
canvas#output_canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* UI Overlay Layer */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Score Display */
#score-display {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 32px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 30px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

/* Screen Overlays (Start/Game Over) */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    text-align: center;
    z-index: 100;
}

.screen.active {
    display: flex;
}

/* Headings */
h1 {
    font-size: 72px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #00ff88, #00aaff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

p {
    font-size: 24px;
    margin-bottom: 15px;
    color: #cccccc;
}

/* Buttons */
button {
    background: linear-gradient(135deg, #00cc66, #00aa55);
    color: white;
    border: none;
    padding: 20px 60px;
    font-size: 28px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 8px 25px rgba(0, 204, 102, 0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 20px;
}

button:hover {
    background: linear-gradient(135deg, #00dd77, #00bb66);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 204, 102, 0.6);
}

button:active {
    transform: translateY(0) scale(0.98);
}

button:disabled {
    background: #444;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Instructions Box */
.instructions {
    margin: 30px 0;
    padding: 25px 50px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
}

.instructions p {
    margin: 10px 0;
    font-size: 20px;
}

/* Hand Status Indicator */
#hand-status {
    font-weight: bold;
    color: #ffaa00;
    transition: color 0.3s;
}

/* Debug Overlay for Hand Tracking */
#debug-overlay {
    position: absolute;
    bottom: 20px;
    right: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
}

#gesture_canvas {
    display: block;
    transform: scaleX(-1);
    /* Mirror for natural feedback */
}

.debug-label {
    display: block;
    text-align: center;
    padding: 8px;
    font-size: 12px;
    color: #888;
    background: rgba(0, 0, 0, 0.5);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 48px;
    }

    p {
        font-size: 18px;
    }

    button {
        padding: 15px 40px;
        font-size: 20px;
    }

    #score-display {
        font-size: 24px;
        padding: 10px 20px;
    }

    #debug-overlay {
        bottom: 10px;
        right: 10px;
    }

    #gesture_canvas {
        width: 150px;
        height: 112px;
    }
}