* {
    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;
    overflow-x: hidden;
}

/* Écrans */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    text-align: center;
}

h1 {
    color: #333;
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    color: #666;
    font-size: 1.2em;
    margin-bottom: 30px;
}

/* Input pseudo */
.pseudo-input-group {
    margin: 30px 0;
    text-align: left;
}

.pseudo-input-group label {
    display: block;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.pseudo-input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.1em;
    transition: border-color 0.3s ease;
}

.pseudo-input-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* Boutons */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.3em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    font-weight: bold;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

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

/* Instructions */
.instructions {
    margin-top: 40px;
    text-align: left;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.instructions h3 {
    color: #333;
    margin-bottom: 15px;
}

.instructions ul {
    list-style-position: inside;
    color: #555;
    line-height: 1.8;
}

.instructions .green {
    color: #28a745;
    font-weight: bold;
}

.instructions .red {
    color: #dc3545;
    font-weight: bold;
}

/* HUD */
.hud {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 30px;
    border-radius: 15px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 20px;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-item .label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.hud-item .value {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
}

.chord-display .chord-name {
    color: #667eea;
    font-size: 1.8em;
}

/* Zone note (affichage note sur 10) */
.hud-item.note-display .value {
    color: #28a745;
}

/* Feedback */
.feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 30px 50px;
    border-radius: 15px;
    font-size: 2em;
    font-weight: bold;
    z-index: 1000;
    animation: fadeInOut 1.5s ease;
}

.feedback.hidden {
    display: none;
}

.feedback.correct {
    background: rgba(40, 167, 69, 0.95);
}

.feedback.wrong {
    background: rgba(220, 53, 69, 0.95);
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20%, 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Zone de question */
.question-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 30px 0;
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 15px;
}

.question-zone.hidden {
    display: none;
}

.question-timer {
    position: relative;
    margin-bottom: 20px;
}

.timer-circle {
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 8;
}

.timer-progress {
    fill: none;
    stroke: #667eea;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
}

.question-text {
    font-size: 1.3em;
    color: #333;
    font-weight: 500;
}

/* Zone de correction */
.correction-zone {
    background: rgba(255, 193, 7, 0.95);
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
}

.correction-zone.hidden {
    display: none;
}

.correction-text {
    font-size: 1.3em;
    color: #333;
    font-weight: bold;
}

/* Container pour clavier + boutons */
.game-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 30px auto;
    max-width: 1200px;
    position: relative;
    min-height: 250px; /* Hauteur fixe pour éviter les sauts */
}

/* Boutons de réponse - de part et d'autre du clavier */
.answer-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 140px; /* Largeur fixe pour éviter les sauts */
}

.answer-buttons.hidden {
    visibility: hidden; /* Au lieu de display:none pour garder l'espace */
    pointer-events: none;
}

.btn-answer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 25px 35px;
    border: none;
    border-radius: 15px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    min-width: 140px;
}

.btn-answer:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.btn-answer:active {
    transform: translateY(-1px);
}

.btn-answer:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-wrong {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.btn-correct {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
}

.btn-icon {
    font-size: 2em;
}

.btn-text {
    font-weight: bold;
}

/* Piano */
.piano {
    display: flex;
    justify-content: center;
    position: relative;
    height: 200px;
    min-width: 600px;
    background: #222;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.piano-key {
    position: relative;
    cursor: pointer;
    transition: all 0.1s ease;
    border: 1px solid #000;
}

.white-key {
    width: 45px;
    height: 180px;
    background: linear-gradient(to bottom, #fff 0%, #f5f5f5 100%);
    border-radius: 0 0 5px 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.white-key:hover {
    background: linear-gradient(to bottom, #f0f0f0 0%, #e5e5e5 100%);
}

.white-key.active {
    background: linear-gradient(to bottom, #667eea 0%, #764ba2 100%);
    transform: translateY(2px);
}

.black-key {
    position: absolute;
    width: 30px;
    height: 110px;
    background: linear-gradient(to bottom, #222 0%, #000 100%);
    border-radius: 0 0 3px 3px;
    z-index: 2;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
}

.black-key:hover {
    background: linear-gradient(to bottom, #333 0%, #111 100%);
}

.black-key.active {
    background: linear-gradient(to bottom, #667eea 0%, #764ba2 100%);
    transform: translateY(2px);
}

.black-key.hidden {
    display: none;
}

.key-label {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8em;
    color: #999;
    pointer-events: none;
}

.white-key .key-label {
    color: #666;
}

.black-key .key-label {
    color: #999;
    bottom: 5px;
}

/* Info accompagnement */
.accompaniment-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
}

.instrument-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #667eea;
}

#waveform {
    border-radius: 5px;
    background: #f0f0f0;
}

/* Statistiques finales */
.final-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.stat {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-label {
    color: #666;
    font-size: 1em;
}

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

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

    .game-area {
        flex-direction: column;
        gap: 20px;
        min-height: auto;
    }

    .answer-buttons {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
    }

    .piano {
        transform: scale(0.7);
        margin: 10px auto;
    }

    .hud {
        flex-direction: column;
        gap: 10px;
    }

    .final-stats {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 0.5s ease-in-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}
