* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  background: linear-gradient(180deg, #5c94fc 0%, #5c94fc 75%, #228B22 75%, #228B22 100%);
  min-height: 100vh;
  padding: 40px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  image-rendering: pixelated;
}

/* Effet de briques en arrière-plan */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 40px,
      rgba(0, 0, 0, 0.05) 40px,
      rgba(0, 0, 0, 0.05) 80px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 40px,
      rgba(0, 0, 0, 0.03) 40px,
      rgba(0, 0, 0, 0.03) 80px
    );
  pointer-events: none;
  z-index: 0;
}

/* Nuages Mario style (subtil) */
body::after {
  content: '';
  position: fixed;
  top: 10%;
  left: 5%;
  width: 80px;
  height: 50px;
  background: #FFF;
  border-radius: 50px;
  opacity: 0.7;
  animation: cloud-float-1 20s linear infinite;
  pointer-events: none;
  z-index: 0;
  box-shadow: 
    30px 10px 0 0 #FFF,
    60px 5px 0 -5px #FFF,
    90px 10px 0 0 #FFF;
}

@keyframes cloud-float-1 {
  0% {
    transform: translateX(-100px);
  }
  100% {
    transform: translateX(calc(100vw + 100px));
  }
}

/* Deuxième nuage */
.container::before {
  content: '';
  position: fixed;
  top: 25%;
  right: 10%;
  width: 60px;
  height: 40px;
  background: #FFF;
  border-radius: 40px;
  opacity: 0.6;
  animation: cloud-float-2 25s linear infinite;
  pointer-events: none;
  z-index: 0;
  box-shadow: 
    25px 8px 0 0 #FFF,
    50px 4px 0 -4px #FFF;
}

@keyframes cloud-float-2 {
  0% {
    transform: translateX(100px);
  }
  100% {
    transform: translateX(calc(-100vw - 100px));
  }
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.container {
  max-width: 900px;
  width: 100%;
  background: linear-gradient(180deg, 
    rgba(255, 255, 255, 0.95) 0%, 
    rgba(248, 200, 100, 0.95) 100%);
  border: 8px solid #000;
  border-radius: 16px;
  padding: 48px;
  box-shadow: 
    0 0 0 4px #FDB528,
    0 0 0 8px #000,
    8px 8px 0 8px rgba(0, 0, 0, 0.3),
    inset 0 4px 0 rgba(255, 255, 255, 0.5);
  position: relative;
  z-index: 1;
  image-rendering: pixelated;
}

/* Effet de bloc Question Mark */
.container::after {
  content: '?';
  position: absolute;
  top: -60px;
  right: 40px;
  width: 50px;
  height: 50px;
  background: linear-gradient(180deg, #FDB528 0%, #E8A615 100%);
  border: 4px solid #000;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  color: #000;
  box-shadow: 
    inset 0 4px 0 rgba(255, 255, 255, 0.4),
    4px 4px 0 rgba(0, 0, 0, 0.3);
  animation: question-block-bounce 0.5s ease-in-out infinite alternate;
}

@keyframes question-block-bounce {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-8px);
  }
}

.header {
  text-align: center;
  margin-bottom: 48px;
  position: relative;
  padding: 20px 0;
  overflow: visible;
}

h1 {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FFF;
  text-shadow: 
    4px 0 0 #E30000,
    -4px 0 0 #E30000,
    0 4px 0 #E30000,
    0 -4px 0 #E30000,
    4px 4px 0 #E30000,
    -4px -4px 0 #E30000,
    4px -4px 0 #E30000,
    -4px 4px 0 #E30000,
    6px 6px 0 #000;
  image-rendering: pixelated;
}

/* Effet de bloc de briques pour le fond du header */
.header {
  background: 
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 35px,
      rgba(0, 0, 0, 0.05) 35px,
      rgba(0, 0, 0, 0.05) 40px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 20px,
      rgba(0, 0, 0, 0.05) 20px,
      rgba(0, 0, 0, 0.05) 25px
    );
  border-radius: 12px;
  padding-bottom: 30px;
}

.subtitle {
  color: #000;
  font-size: 0.75rem;
  font-weight: 700;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.5);
  letter-spacing: 0.05em;
}

.badge {
  display: inline-block;
  padding: 8px 20px;
  background: linear-gradient(180deg, #E30000 0%, #A00000 100%);
  border: 4px solid #000;
  border-radius: 8px;
  color: #FFF;
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 12px;
  box-shadow: 
    inset 0 3px 0 rgba(255, 255, 255, 0.3),
    4px 4px 0 rgba(0, 0, 0, 0.3);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
  animation: badge-pulse 1.5s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Écran de démarrage */
.start-screen {
  text-align: center;
}

.start-screen h2 {
  color: #FFF;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 32px;
  text-shadow: 
    4px 0 0 #E30000,
    -4px 0 0 #E30000,
    0 4px 0 #E30000,
    0 -4px 0 #E30000,
    4px 4px 0 #000;
}

.genre-selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  max-width: 100%;
}

.genre-btn {
  background: linear-gradient(180deg, #00D800 0%, #009800 100%);
  border: 4px solid #000;
  color: #FFF;
  padding: 24px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s;
  position: relative;
  overflow: visible;
  text-shadow: 
    3px 0 0 #000,
    -3px 0 0 #000,
    0 3px 0 #000,
    0 -3px 0 #000,
    3px 3px 0 #000;
  box-shadow: 
    inset 0 4px 0 rgba(255, 255, 255, 0.3),
    4px 4px 0 rgba(0, 0, 0, 0.4);
  image-rendering: pixelated;
}


.genre-btn:hover {
  background: linear-gradient(180deg, #00F800 0%, #00C800 100%);
  transform: translateY(-4px);
  box-shadow: 
    inset 0 4px 0 rgba(255, 255, 255, 0.4),
    6px 6px 0 rgba(0, 0, 0, 0.4);
}

.genre-btn:active {
  transform: translateY(2px);
  box-shadow: 
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    2px 2px 0 rgba(0, 0, 0, 0.4);
}

/* Écran de jeu */
.game-screen {
  display: none;
}

.game-screen.active {
  display: block;
}

/* Bandeau des équipes */
.team-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(248, 200, 100, 0.9) 0%, rgba(255, 255, 255, 0.9) 100%);
  border: 5px solid #000;
  border-radius: 12px;
  box-shadow: 
    inset 0 4px 0 rgba(255, 255, 255, 0.4),
    5px 5px 0 rgba(0, 0, 0, 0.3);
}

.team-info {
  flex: 1;
  text-align: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.5);
  border: 3px solid #000;
  border-radius: 8px;
  transition: all 0.3s;
}

.team-info.active {
  background: linear-gradient(180deg, #00D800 0%, #009800 100%);
  transform: scale(1.05);
  box-shadow: 
    inset 0 3px 0 rgba(255, 255, 255, 0.3),
    0 0 20px rgba(0, 216, 0, 0.5);
}

.team-name {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #000;
  margin-bottom: 8px;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
}

.team-info.active .team-name {
  color: #FFF;
  text-shadow: 
    2px 0 0 #000,
    -2px 0 0 #000,
    0 2px 0 #000,
    0 -2px 0 #000;
}

.team-score {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #000;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.3);
}

.team-info.active .team-score {
  color: #FFF;
  text-shadow: 
    3px 0 0 #000,
    -3px 0 0 #000,
    0 3px 0 #000,
    0 -3px 0 #000;
}

.team-vs {
  font-size: 1.5rem;
  font-weight: 700;
  color: #E30000;
  text-shadow: 
    3px 0 0 #000,
    -3px 0 0 #000,
    0 3px 0 #000,
    0 -3px 0 #000;
}

.game-header {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: linear-gradient(180deg, #FDB528 0%, #E8A615 100%);
  border: 4px solid #000;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: visible;
  box-shadow: 
    inset 0 4px 0 rgba(255, 255, 255, 0.3),
    4px 4px 0 rgba(0, 0, 0, 0.3);
}


.stat-label {
  font-size: 0.7rem;
  color: #000;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #FFF;
  text-shadow: 
    3px 0 0 #000,
    -3px 0 0 #000,
    0 3px 0 #000,
    0 -3px 0 #000,
    3px 3px 0 #000,
    0 5px 0 rgba(0, 0, 0, 0.5);
}

.stat-value.warning {
  color: #E30000;
  animation: pulse-warning 0.5s infinite;
}

@keyframes pulse-warning {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Lecteur audio */
.audio-player {
  background: linear-gradient(180deg, rgba(248, 200, 100, 0.9) 0%, rgba(255, 255, 255, 0.9) 100%);
  border: 6px solid #000;
  padding: 40px;
  border-radius: 16px;
  text-align: center;
  margin-bottom: 32px;
  box-shadow: 
    inset 0 4px 0 rgba(255, 255, 255, 0.5),
    6px 6px 0 rgba(0, 0, 0, 0.3);
  position: relative;
}


.album-cover {
  width: 240px;
  height: 240px;
  margin: 0 auto 24px;
  border-radius: 8px;
  overflow: hidden;
  border: 6px solid #000;
  box-shadow: 
    inset 0 4px 0 rgba(255, 255, 255, 0.3),
    6px 6px 0 rgba(0, 0, 0, 0.4);
  position: relative;
  image-rendering: pixelated;
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.play-btn {
  background: linear-gradient(180deg, #E30000 0%, #A00000 100%);
  color: #fff;
  border: 4px solid #000;
  padding: 16px 48px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s;
  box-shadow: 
    inset 0 4px 0 rgba(255, 255, 255, 0.3),
    4px 4px 0 rgba(0, 0, 0, 0.4);
  margin-top: 16px;
  text-shadow: 
    2px 0 0 #000,
    -2px 0 0 #000,
    0 2px 0 #000,
    0 -2px 0 #000;
}


.play-btn:hover {
  background: linear-gradient(180deg, #FF2020 0%, #C00000 100%);
  transform: translateY(-2px);
  box-shadow: 
    inset 0 4px 0 rgba(255, 255, 255, 0.4),
    6px 6px 0 rgba(0, 0, 0, 0.4);
}

.play-btn:active {
  transform: translateY(2px);
  box-shadow: 
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    2px 2px 0 rgba(0, 0, 0, 0.4);
}

.player-hint {
  margin-top: 16px;
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
}

/* Zone de réponse */
.answer-zone {
  background: linear-gradient(180deg, rgba(248, 200, 100, 0.8) 0%, rgba(255, 255, 255, 0.8) 100%);
  border: 5px solid #000;
  padding: 32px;
  border-radius: 12px;
  margin-bottom: 24px;
  box-shadow: 
    inset 0 4px 0 rgba(255, 255, 255, 0.4),
    5px 5px 0 rgba(0, 0, 0, 0.3);
  position: relative;
}

.answer-zone h3 {
  color: #000;
  margin-bottom: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.5);
}

.answer-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 1rem;
  background: #FFF;
  border: 4px solid #000;
  border-radius: 8px;
  color: #000;
  margin-bottom: 16px;
  transition: all 0.1s;
  font-family: 'Press Start 2P', monospace;
  font-weight: 700;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.answer-input::placeholder {
  color: rgba(0, 0, 0, 0.3);
  font-size: 0.7rem;
}

.answer-input:focus {
  outline: none;
  border-color: #FDB528;
  background: #FFFEF0;
  box-shadow: 
    inset 2px 2px 0 rgba(0, 0, 0, 0.1),
    0 0 0 4px rgba(253, 181, 40, 0.3);
}

.submit-btn {
  background: linear-gradient(180deg, #00D800 0%, #009800 100%);
  color: #fff;
  border: 4px solid #000;
  padding: 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: all 0.1s;
  box-shadow: 
    inset 0 4px 0 rgba(255, 255, 255, 0.3),
    4px 4px 0 rgba(0, 0, 0, 0.4);
  text-shadow: 
    2px 0 0 #000,
    -2px 0 0 #000,
    0 2px 0 #000,
    0 -2px 0 #000;
}

.submit-btn:hover {
  background: linear-gradient(180deg, #00F800 0%, #00C800 100%);
  transform: translateY(-2px);
  box-shadow: 
    inset 0 4px 0 rgba(255, 255, 255, 0.4),
    6px 6px 0 rgba(0, 0, 0, 0.4);
}

.submit-btn:active {
  transform: translateY(2px);
  box-shadow: 
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    2px 2px 0 rgba(0, 0, 0, 0.4);
}

.skip-btn {
  background: linear-gradient(180deg, #888 0%, #555 100%);
  border: 4px solid #000;
  color: #FFF;
  padding: 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
  width: 100%;
  transition: all 0.1s;
  box-shadow: 
    inset 0 4px 0 rgba(255, 255, 255, 0.2),
    4px 4px 0 rgba(0, 0, 0, 0.3);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.skip-btn:hover {
  background: linear-gradient(180deg, #999 0%, #666 100%);
  transform: translateY(-2px);
  box-shadow: 
    inset 0 4px 0 rgba(255, 255, 255, 0.3),
    6px 6px 0 rgba(0, 0, 0, 0.3);
}

/* Feedback */
.feedback {
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  text-align: center;
  font-size: 1.125rem;
  font-weight: 600;
  display: none;
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.feedback.show {
  display: block;
}

.feedback.correct {
  background: linear-gradient(180deg, #00D800 0%, #009800 100%);
  border: 5px solid #000;
  color: #FFF;
  box-shadow: 
    inset 0 4px 0 rgba(255, 255, 255, 0.3),
    5px 5px 0 rgba(0, 0, 0, 0.4);
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  text-shadow: 
    3px 0 0 #000,
    -3px 0 0 #000,
    0 3px 0 #000,
    0 -3px 0 #000;
}

.feedback.wrong {
  background: linear-gradient(180deg, #E30000 0%, #A00000 100%);
  border: 5px solid #000;
  color: #FFF;
  box-shadow: 
    inset 0 4px 0 rgba(255, 255, 255, 0.3),
    5px 5px 0 rgba(0, 0, 0, 0.4);
  text-shadow: 
    3px 0 0 #000,
    -3px 0 0 #000,
    0 3px 0 #000,
    0 -3px 0 #000;
}

/* Écran de fin */
.end-screen {
  display: none;
  text-align: center;
  position: relative;
}

.end-screen.active {
  display: block;
  animation: fadeIn 0.8s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.end-screen h2 {
  color: #FFF;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  text-shadow: 
    4px 0 0 #E30000,
    -4px 0 0 #E30000,
    0 4px 0 #E30000,
    0 -4px 0 #E30000,
    4px 4px 0 #000;
}

.final-score {
  font-size: 5rem;
  font-weight: 700;
  color: #FDB528;
  text-shadow: 
    5px 0 0 #000,
    -5px 0 0 #000,
    0 5px 0 #000,
    0 -5px 0 #000,
    5px 5px 0 #000,
    0 8px 0 rgba(0, 0, 0, 0.5);
  margin: 32px 0;
  animation: score-bounce 1s ease-in-out infinite;
  position: relative;
}

@keyframes score-bounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.message {
  font-size: 0.9rem;
  color: #000;
  margin-bottom: 40px;
  font-weight: 700;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.5);
}

.restart-btn {
  background: linear-gradient(180deg, #0080F8 0%, #0050C0 100%);
  color: #fff;
  border: 4px solid #000;
  padding: 18px 56px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s;
  box-shadow: 
    inset 0 4px 0 rgba(255, 255, 255, 0.3),
    5px 5px 0 rgba(0, 0, 0, 0.4);
  text-shadow: 
    3px 0 0 #000,
    -3px 0 0 #000,
    0 3px 0 #000,
    0 -3px 0 #000;
}

.restart-btn:hover {
  background: linear-gradient(180deg, #00A0FF 0%, #0070E0 100%);
  transform: translateY(-3px);
  box-shadow: 
    inset 0 4px 0 rgba(255, 255, 255, 0.4),
    7px 7px 0 rgba(0, 0, 0, 0.4);
}

.restart-btn:active {
  transform: translateY(1px);
  box-shadow: 
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    3px 3px 0 rgba(0, 0, 0, 0.4);
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  display: none;
}

.loading.show {
  display: block;
}

.spinner {
  border: 5px solid #000;
  border-top: 5px solid #FDB528;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
  box-shadow: inset 0 0 0 3px #FFF;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading p {
  color: #000;
  font-size: 0.8rem;
  font-weight: 700;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
  .container {
    padding: 32px 24px;
  }

  h1 {
    font-size: 1.8rem;
    letter-spacing: 0.03em;
  }

  .container::after {
    right: 20px;
    top: -40px;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .team-banner {
    flex-direction: column;
    gap: 10px;
    padding: 15px;
  }

  .team-vs {
    font-size: 1.2rem;
  }

  .team-name {
    font-size: 0.7rem;
  }

  .team-score {
    font-size: 1.2rem;
  }

  .team-mode-btn {
    font-size: 0.6rem !important;
    padding: 8px 16px !important;
  }

  .game-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .genre-selection {
    grid-template-columns: 1fr;
  }

  .album-cover {
    width: 200px;
    height: 200px;
  }

  .answer-input {
    font-size: 0.8rem;
  }

  .answer-input::placeholder {
    font-size: 0.6rem;
  }
}