body {
  font-family: 'Nunito', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 20px;
  background: #f0f4f8; 
  background-image: radial-gradient(circle at 50% 0%, #ffffff 0%, #e2e8f0 100%);
  color: #2d3748;
  min-height: 100vh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background: white;
  border-radius: 24px; 
  box-shadow: 0 10px 40px rgba(0,0,0,0.05), 0 2px 10px rgba(0,0,0,0.02);
  padding: 30px;
}

h1 {
  text-align: center;
  margin-top: 0;
  color: #1a202c;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.info-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap; 
  gap: 12px;
  margin-bottom: 25px;
}

.badge {
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  flex: 1 1 auto;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

.phase-badge { background: #feebc8; color: #c05621; }
.config-badge { background: #e2e8f0; color: #4a5568; gap: 8px; white-space: nowrap; }
.score-badge { background: #c6f6d5; color: #22543d; }

select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  color: #2b6cb0;
  cursor: pointer;
  outline: none;
  padding: 0;
}

#feedback {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  min-height: 30px;
  margin-bottom: 20px;
  color: #4a5568;
  transition: color 0.2s;
}

.pop-anim {
  animation: pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.interactive-area {
  background: #f7fafc;
  border-radius: 16px;
  border: 2px dashed #e2e8f0; 
  padding: 20px;
  margin-bottom: 25px;
}

#staff {
  background: white;
  border-radius: 12px;
  min-height: 200px;
  margin-bottom: 30px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow: hidden;
}

#staff svg {
  display: block;
  width: 100%;
  max-width: 600px;
}

#keyboard-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 5px 0 15px 0;
}

#keyboard {
  position: relative;
  display: flex;
  background: #2d3748;
  border-top: 4px solid #1a202c;
  border-left: 4px solid #1a202c;
  border-right: 4px solid #1a202c;
  border-bottom: 12px solid #1a202c; 
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 420px; 
  height: 150px;
}

.key {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
}

.key.white {
  position: relative;
  flex: 1; 
  background: linear-gradient(to bottom, #ffffff 0%, #f7fafc 100%);
  color: #4a5568;
  border: 1px solid #cbd5e0;
  border-radius: 0 0 6px 6px;
  z-index: 1;
  box-shadow: inset 0 -4px 0 #e2e8f0; 
  transition: background 0.1s, box-shadow 0.1s;
}

.key.white:active {
  box-shadow: inset 0 0 0 #e2e8f0;
  background: #edf2f7;
}

.key.black {
  position: absolute;
  width: 8.5%; 
  height: 60%;
  background: linear-gradient(to bottom, #4a5568 0%, #1a202c 100%);
  color: #f7fafc;
  border-radius: 0 0 4px 4px;
  z-index: 2;
  box-shadow: inset 0 -4px 0 #1a202c, 0 4px 6px rgba(0,0,0,0.3);
  font-size: 11px;
  padding-bottom: 6px;
  text-align: center;
  line-height: 1.2;
}

.key.black:active {
  box-shadow: inset 0 0 0 #1a202c;
  background: #2d3748;
}

.key.hit-correct {
  background: #48bb78 !important;
  color: white !important;
  box-shadow: inset 0 -4px 0 #2f855a !important;
}

.key.hit-wrong {
  background: #f56565 !important;
  color: white !important;
  box-shadow: inset 0 -4px 0 #c53030 !important;
  animation: shake 0.3s;
}

.navigation-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
}

#next-btn, #prev-btn {
  flex: 1;
  max-width: 280px; /* Légèrement élargi pour le texte de progression */
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  border-radius: 50px;
  color: white;
  transform: translateY(0);
  transition: transform 0.1s, box-shadow 0.1s;
}

#next-btn { background: #4299e1; box-shadow: 0 5px 0 #2b6cb0; }
#next-btn:hover:not(:disabled) { background: #3182ce; }
#next-btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 0px 0 #2b6cb0; }

#prev-btn { background: #a0aec0; box-shadow: 0 5px 0 #718096; }
#prev-btn:hover:not(:disabled) { background: #718096; }
#prev-btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 0px 0 #718096; }

#next-btn:disabled, #prev-btn:disabled {
  background: #e2e8f0; box-shadow: 0 5px 0 #cbd5e0; color: #a0aec0; cursor: not-allowed; transform: translateY(0);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.note.highlight { fill: #ed64a6 !important; }
.note.highlight path, .note.highlight use { fill: #ed64a6 !important; }

@media (max-width: 600px) {
  body { padding: 10px; }
  .container { padding: 15px; border-radius: 16px; }
  .info-bar { flex-direction: column; gap: 8px; }
  .badge { padding: 10px; font-size: 14px; min-width: auto; border-radius: 12px; }
  .interactive-area { padding: 10px; border-radius: 12px; border-width: 1px; }
  #staff { min-height: 140px; padding: 10px; }
  
  #keyboard { height: 120px; border-bottom-width: 8px; }
  .key.white { font-size: 12px; }
  .key.black { font-size: 10px; padding-bottom: 4px; width: 9%; }
  
  .navigation-buttons { gap: 12px; }
  #next-btn, #prev-btn { font-size: 15px; padding: 12px; }
}