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

body {
    font-family: 'Comic Sans MS', 'Arial Rounded MT Bold', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 10px;
    overflow: hidden;
}

#game-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#header {
    text-align: center;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 15px;
    border-radius: 15px;
    color: white;
}

#header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

#score-board {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.2em;
    font-weight: bold;
}

#game-canvas {
    border: 4px solid #333;
    border-radius: 10px;
    background: #87CEEB;
    display: block;
    width: 100%;
    max-width: 800px;
    height: 500px;
    margin: 0 auto;
    touch-action: none;
}

#game-messages {
    text-align: center;
    min-height: 40px;
    font-size: 1.3em;
    font-weight: bold;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

#game-messages.good {
    background: #4caf50;
    color: white;
}

#game-messages.bad {
    background: #f44336;
    color: white;
}

#game-messages.warning {
    background: #ff9800;
    color: white;
}

#controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 15px;
}

.control-row {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.blinker-btn {
    padding: 15px 25px;
    font-size: 1.1em;
    font-weight: bold;
    border: 3px solid #333;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.blinker-btn:active {
    transform: scale(0.95);
}

.blinker-btn.active {
    background: #ffc107;
    animation: blink 0.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.dpad-middle {
    display: flex;
    gap: 80px;
}

.dpad-btn {
    width: 70px;
    height: 70px;
    font-size: 2em;
    border: 3px solid #333;
    border-radius: 15px;
    background: #4CAF50;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dpad-btn:active {
    transform: scale(0.9);
    background: #45a049;
}

#instructions {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 15px;
    border: 3px solid #2196f3;
}

#instructions h3 {
    color: #1976d2;
    margin-bottom: 10px;
    font-size: 1.3em;
}

#instructions ul {
    list-style: none;
    padding-left: 0;
}

#instructions li {
    padding: 5px 0;
    font-size: 1em;
    color: #333;
}

@media (max-width: 768px) {
    #header h1 {
        font-size: 1.8em;
    }
    
    #score-board {
        font-size: 1em;
        gap: 15px;
    }
    
    #game-canvas {
        height: 400px;
    }
    
    .blinker-btn {
        padding: 12px 15px;
        font-size: 0.9em;
    }
    
    .dpad-btn {
        width: 60px;
        height: 60px;
        font-size: 1.5em;
    }
    
    .dpad-middle {
        gap: 60px;
    }
    
    #instructions {
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    #game-container {
        padding: 10px;
    }
    
    #header h1 {
        font-size: 1.5em;
    }
    
    #game-canvas {
        height: 350px;
    }
    
    .dpad-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2em;
    }
    
    .dpad-middle {
        gap: 40px;
    }
}
