* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Arial', sans-serif;
}

.container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
}

h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    font-size: 1.1em;
    color: #555;
}

.score, .high-score {
    font-weight: bold;
}

#gameCanvas {
    border: 3px solid #333;
    background-color: #1a1a1a;
    display: block;
    margin: 20px auto;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.controls {
    margin-top: 20px;
}

#gameStatus {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.btn {
    padding: 12px 25px;
    margin: 5px;
    font-size: 1em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    color: white;
}

#startBtn {
    background-color: #4CAF50;
}

#startBtn:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

#resetBtn {
    background-color: #f44336;
}

#resetBtn:hover {
    background-color: #da190b;
    transform: scale(1.05);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Settings Button */
.btn-settings {
    background-color: #2196F3;
}

.btn-settings:hover {
    background-color: #0b7dda;
    transform: scale(1.05);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: white;
    padding: 0;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.control-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    gap: 10px;
}

.control-setting label {
    font-weight: bold;
    color: #333;
    flex: 1;
}

.control-btn {
    padding: 10px 15px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 150px;
    font-size: 0.9em;
}

.control-btn:hover {
    background-color: #5568d3;
}

.control-btn.listening {
    background-color: #ff9800;
    animation: pulse 0.6s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.key-display {
    background-color: #333;
    color: #00FF00;
    padding: 8px 12px;
    border-radius: 5px;
    font-weight: bold;
    font-family: monospace;
    min-width: 60px;
    text-align: center;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 2px solid #f0f0f0;
}

.btn-default {
    background-color: #9C27B0;
}

.btn-default:hover {
    background-color: #7B1FA2;
    transform: scale(1.05);
}

.btn-close {
    background-color: #4CAF50;
}

.btn-close:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

