/* Listening Match game specific styles */

/* Layout */
.listening_match-section {
  padding: 2rem 0 1rem;
}

.listening_match-layout {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 2.5rem;
  align-items: start;
  margin-top: 1rem;
}

/* Audio scene */
.listening_match-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.audio-scene {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 340px;
  background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 100%);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transition: background 0.3s ease;
}

[data-theme="dark"] .audio-scene {
  background: linear-gradient(180deg, #1e3a5f 0%, #1f2937 100%);
  border-color: #374151;
}

/* Audio waves */
.audio-waves {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding-bottom: 40px;
  opacity: 0.15;
  pointer-events: none;
}

.wave {
  display: block;
  width: 6px;
  background: var(--primary-color);
  border-radius: 3px;
  animation: wavePulse 1.5s ease-in-out infinite;
  height: 20px;
}

.wave-1 {
  animation-delay: 0s;
  height: 30px;
}

.wave-2 {
  animation-delay: 0.15s;
  height: 50px;
}

.wave-3 {
  animation-delay: 0.3s;
  height: 70px;
}

.wave-4 {
  animation-delay: 0.45s;
  height: 50px;
}

.wave-5 {
  animation-delay: 0.6s;
  height: 30px;
}

@keyframes wavePulse {

  0%,
  100% {
    transform: scaleY(0.5);
    opacity: 0.4;
  }

  50% {
    transform: scaleY(1.5);
    opacity: 1;
  }
}

/* Audio icon */
.audio-icon {
  font-size: 4rem;
  line-height: 1;
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
  animation: speakerFloat 3s ease-in-out infinite;
}

.audio-icon.playing {
  animation: speakerPulse 0.6s ease-in-out infinite;
}

@keyframes speakerFloat {

  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }

  50% {
    transform: translateY(-10px) rotate(2deg);
  }
}

@keyframes speakerPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }
}

.audio-speaker {
  font-size: 1.5rem;
  position: absolute;
  bottom: 30px;
  right: 30px;
  z-index: 2;
  opacity: 0.6;
}

/* Life hearts */
.listening_match-life {
  display: flex;
  gap: 0.5rem;
  font-size: 1.6rem;
}

.life-heart {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.life-heart.lost {
  opacity: 0.2;
  transform: scale(0.8);
  filter: grayscale(1);
}

/* Stats */
.listening_match-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.listening_match-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-secondary);
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.listening_match-stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.listening_match-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Level */
.listening_match-level {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.level-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.level-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  min-width: 1rem;
}

.level-total {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.level-value.level-bump {
  animation: levelBump 0.5s ease;
}

@keyframes levelBump {
  0% {
    transform: scale(1);
    color: var(--primary-color);
  }

  40% {
    transform: scale(1.5);
    color: var(--success-color);
  }

  100% {
    transform: scale(1);
    color: var(--primary-color);
  }
}

.level-progress {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.level-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 4px;
  transition: width 0.4s ease;
  width: 0%;
}

/* Play area */
.listening_match-play-area {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.btn-play {
  flex: 2;
  font-size: 1.1rem;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-play:active {
  transform: scale(0.97);
}

.btn-play-slow {
  flex: 1;
  font-size: 0.95rem;
  padding: 0.9rem 0.75rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.play-icon {
  font-size: 1.2rem;
}

/* Question counter */
.listening_match-question-counter {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* Timer */
.listening_match-timer {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.listening_match-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success-color), var(--primary-color));
  border-radius: 3px;
  transition: width 1s linear, background 0.3s ease;
  width: 100%;
}

.listening_match-timer-fill.warning {
  background: linear-gradient(90deg, var(--warning-color), var(--error-color));
}

/* Options */
.listening_match-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.listening_match-options.options-3 {
  grid-template-columns: 1fr;
}

.listening_match-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.listening_match-option:hover:not(:disabled) {
  border-color: var(--primary-color);
  background: var(--bg-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.listening_match-option:active:not(:disabled) {
  transform: translateY(0);
}

.listening_match-option:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.listening_match-option.correct {
  border-color: var(--success-color);
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  animation: optionCorrect 0.5s ease;
}

.listening_match-option.wrong {
  border-color: var(--error-color);
  background: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
  animation: optionWrong 0.5s ease;
}

@keyframes optionCorrect {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes optionWrong {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-6px);
  }

  40% {
    transform: translateX(6px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}

.option-emoji {
  font-size: 1.6rem;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.option-text {
  flex: 1;
}

/* Feedback */
.listening_match-feedback {
  text-align: center;
  min-height: 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.listening_match-feedback.success {
  color: var(--success-color);
}

.listening_match-feedback.error {
  color: var(--error-color);
}

.listening_match-feedback.info {
  color: var(--primary-color);
}

/* Actions */
.listening_match-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.listening_match-actions .btn {
  flex: 1;
  min-width: 100px;
  justify-content: center;
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
}

/* Info section */
.listening_match-info {
  padding: 3rem 0;
}

/* Responsive */
@media (max-width: 900px) {
  .listening_match-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .listening_match-visual {
    order: -1;
  }

  .audio-scene {
    max-width: 260px;
    height: 280px;
  }

  .audio-icon {
    font-size: 3rem;
  }

  .listening_match-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .listening_match-options {
    grid-template-columns: 1fr;
  }

  .listening_match-option {
    min-height: 60px;
    font-size: 0.95rem;
  }

  .listening_match-actions {
    flex-direction: column;
  }

  .listening_match-actions .btn {
    width: 100%;
  }

  .listening_match-stat {
    padding: 0.5rem 0.3rem;
  }

  .listening_match-stat-value {
    font-size: 1.1rem;
  }

  .listening_match-stat-label {
    font-size: 0.6rem;
  }

  .listening_match-play-area {
    flex-direction: column;
  }

  .btn-play-slow {
    flex: 1;
  }

  .listening_match-level {
    flex-wrap: wrap;
  }

  .audio-scene {
    max-width: 220px;
    height: 240px;
  }

  .audio-icon {
    font-size: 2.5rem;
  }
}

@media (max-width: 380px) {
  .listening_match-stats {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.4rem;
  }

  .listening_match-option {
    min-height: 55px;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
  }

  .option-emoji {
    font-size: 1.3rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

  .wave,
  .audio-icon,
  .listening_match-option.correct,
  .listening_match-option.wrong,
  .level-value.level-bump {
    animation: none !important;
    transition: none !important;
  }
}

/* Dark theme adjustments */
[data-theme="dark"] .listening_match-option.correct {
  background: rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .listening_match-option.wrong {
  background: rgba(239, 68, 68, 0.15);
}