@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

#gameMessage {
    animation: fadeIn 0.3s forwards;
    font-size: 18px;
    text-shadow: 1px 1px 2px black;
}

#gameMessage.hide {
    animation: fadeOut 0.3s forwards;
}* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    line-height: 1.6;
    color: #333;
}

header {
    width: 100%;
    background-color: #4CAF50;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

main.game-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    max-width: 700px;
    width: 100%;
    margin-bottom: 2rem;
}

h1 {
    color: white;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.score-board {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
    background-color: #f8f8f8;
    border-radius: 5px;
    padding: 10px;
}

.difficulty-selector {
    margin-bottom: 15px;
    background-color: #f8f8f8;
    border-radius: 5px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.difficulty-selector label {
    font-weight: bold;
}

.difficulty-selector select {
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: white;
    cursor: pointer;
}

.difficulty-selector select:focus {
    outline: 2px solid #4CAF50;
    border-color: #4CAF50;
}

.game-area {
    margin: 0 auto;
    max-width: 100%;
}

canvas {
    background-color: #222;
    border-radius: 5px;
    margin-bottom: 15px;
    max-width: 100%;
    height: auto;
}

.controls {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

button {
    background-color: #4CAF50;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 10px 20px;
    transition: background-color 0.3s, transform 0.1s;
}

button:hover {
    background-color: #3e8e41;
}

button:focus {
    outline: 3px solid #8BC34A;
}

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

#resetBtn {
    background-color: #f44336;
}

#resetBtn:hover {
    background-color: #d32f2f;
}

.sound-control {
    margin-left: 15px;
    display: flex;
    align-items: center;
}

.sound-control input {
    margin-right: 5px;
    cursor: pointer;
}

.sound-control label {
    cursor: pointer;
}

.instructions {
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 15px;
    text-align: left;
    border-left: 4px solid #4CAF50;
}

.instructions h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 18px;
    text-align: center;
}

.instructions p {
    margin-bottom: 5px;
    color: #555;
    padding-left: 10px;
}

footer {
    margin-top: 1rem;
    text-align: center;
    padding: 1rem;
    color: #666;
    font-size: 0.9rem;
    width: 100%;
    background-color: #e0e0e0;
}

/* Media queries for responsiveness */
@media (max-width: 768px) {
    main.game-container {
        padding: 15px;
        margin: 0 10px 2rem;
    }
    
    canvas {
        width: 100%;
        height: auto;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .sound-control {
        margin-left: 0;
        margin-top: 10px;
    }
}