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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 600px;
    width: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

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

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Game Container */
.game-container {
    padding: 30px;
}

/* Score Board */
.score-board {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.score-label {
    display: block;
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 5px;
}

.score-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
}

/* Game Canvas */
#gameCanvas {
    display: block;
    margin: 0 auto 20px;
    border: 3px solid #667eea;
    border-radius: 10px;
    background: #f8f9fa;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.6);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-pause {
    background: #ffc107;
    color: #212529;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

.btn-pause:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.6);
}

.btn-pause:active {
    transform: translateY(0);
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.control-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    padding: 0;
}

.control-btn svg {
    width: 30px;
    height: 30px;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.control-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

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

/* Instructions */
.instructions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.instructions h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
}

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

.instructions li {
    padding: 8px 0;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
}

.instructions li:last-child {
    border-bottom: none;
}

.instructions strong {
    color: #667eea;
    font-weight: bold;
}

/* Footer */
footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-size: 0.9em;
    border-top: 1px solid #dee2e6;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .subtitle {
        font-size: 1em;
    }

    #gameCanvas {
        width: 100%;
        height: auto;
        max-width: 400px;
    }

    .score-value {
        font-size: 1.5em;
    }

    .btn {
        padding: 10px 20px;
        font-size: 1em;
    }

    /* Show mobile controls on tablets and phones */
    .mobile-controls {
        display: flex;
        flex-direction: column;
    }

    .control-btn {
        width: 50px;
        height: 50px;
    }

    .control-btn svg {
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 0.9em;
    }

    .game-container {
        padding: 20px;
    }

    .score-board {
        padding: 10px;
    }

    .score-value {
        font-size: 1.3em;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.9em;
    }

    .control-btn {
        width: 45px;
        height: 45px;
    }

    .control-btn svg {
        width: 22px;
        height: 22px;
    }

    .instructions {
        padding: 15px;
    }

    .instructions h3 {
        font-size: 1.1em;
    }

    .instructions li {
        font-size: 0.9em;
        padding: 6px 0;
    }
}

/* Game Over Overlay */
.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: none;
}

.game-over h2 {
    color: #dc3545;
    margin-bottom: 15px;
    font-size: 2em;
}

.game-over p {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.2em;
}

/* Touch feedback */
.control-btn {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.control-btn:active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}
