/* Pronunciation Challenge game specific styles */

/* Layout */
.pronunciation-section {
  padding: 2rem 0 1rem;
}

.pronunciation-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5rem;
  align-items: start;
  margin-top: 1rem;
}

/* ============================================================
   MICROPHONE SCENE
   ============================================================ */

.pronunciation-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.mic-scene {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 420px;
  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;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .mic-scene {
  background: linear-gradient(180deg, #1e3a5f 0%, #1f2937 100%);
  border-color: #374151;
}

.mic-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.mic-icon {
  font-size: 5rem;
  line-height: 1;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: drop-shadow(0 10px 20px rgba(37, 99, 235, 0.3));
}

.mic-scene.listening .mic-icon {
  animation: micPulse 1s ease-in-out infinite;
  filter: drop-shadow(0 10px 30px rgba(16, 185, 129, 0.5));
}

.mic-scene.recording .mic-icon {
  animation: micShake 0.5s ease-in-out infinite;
  filter: drop-shadow(0 10px 30px rgba(239, 68, 68, 0.5));
}

.mic-scene.success .mic-icon {
  animation: micCelebrate 0.6s ease-in-out 3;
  filter: drop-shadow(0 10px 30px rgba(16, 185, 129, 0.6));
}

.mic-scene.error .mic-icon {
  animation: micError 0.5s ease-in-out;
  filter: drop-shadow(0 10px 30px rgba(239, 68, 68, 0.5));
}

@keyframes micPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

@keyframes micShake {

  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-5deg);
  }

  75% {
    transform: rotate(5deg);
  }
}

@keyframes micCelebrate {

  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }

  25% {
    transform: scale(1.15) rotate(-8deg);
  }

  75% {
    transform: scale(1.15) rotate(8deg);
  }
}

@keyframes micError {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-10px);
  }

  75% {
    transform: translateX(10px);
  }
}

/* Sound waves */
.sound-waves {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mic-scene.listening .sound-waves,
.mic-scene.recording .sound-waves {
  opacity: 1;
}

.wave {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  opacity: 0;
  animation: waveExpand 2s ease-out infinite;
}

.mic-scene.recording .wave {
  border-color: var(--error-color);
}

.wave-1 {
  animation-delay: 0s;
}

.wave-2 {
  animation-delay: 0.4s;
}

.wave-3 {
  animation-delay: 0.8s;
}

.wave-4 {
  animation-delay: 1.2s;
}

.wave-5 {
  animation-delay: 1.6s;
}

@keyframes waveExpand {
  0% {
    width: 80px;
    height: 80px;
    opacity: 0.6;
  }

  100% {
    width: 250px;
    height: 250px;
    opacity: 0;
  }
}

/* Pulse ring */
.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--primary-color);
  opacity: 0;
  pointer-events: none;
}

.mic-scene.listening .pulse-ring {
  animation: ringPulse 1.5s ease-out infinite;
  opacity: 1;
}

.mic-scene.recording .pulse-ring {
  border-color: var(--error-color);
  animation: ringPulse 1s ease-out infinite;
  opacity: 1;
}

@keyframes ringPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.8;
  }

  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

/* Life hearts */
.pronunciation-life {
  display: flex;
  gap: 0.4rem;
  font-size: 1.4rem;
}

.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 */
.pronunciation-stats {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.pronunciation-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-secondary);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  min-width: 70px;
}

.pronunciation-stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pronunciation-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Meta info */
.pronunciation-meta {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.pronunciation-category,
.pronunciation-level {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.category-value,
.level-value {
  font-weight: 600;
  color: var(--primary-color);
}

/* Word display */
.pronunciation-word-container {
  text-align: center;
  margin: 1.5rem 0;
  min-height: 5rem;
}

.pronunciation-word {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.pronunciation-word.phrase {
  font-size: 1.8rem;
}

.pronunciation-word.revealed {
  animation: wordReveal 0.6s ease;
}

@keyframes wordReveal {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.pronunciation-translation {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Progress bar */
.pronunciation-progress {
  margin: 1rem 0;
  text-align: center;
}

.pronunciation-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.pronunciation-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.pronunciation-progress-fill.recording {
  background: linear-gradient(90deg, var(--error-color), #f97316);
  animation: progressPulse 1s ease-in-out infinite;
}

@keyframes progressPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.pronunciation-progress-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Result display */
.pronunciation-result {
  min-height: 4rem;
  text-align: center;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.result-score {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.25rem;
  transition: all 0.3s ease;
}

.result-score.excellent {
  color: var(--success-color);
  animation: scoreExcellent 0.6s ease;
}

.result-score.good {
  color: var(--warning-color);
  animation: scoreGood 0.6s ease;
}

.result-score.poor {
  color: var(--error-color);
  animation: scorePoor 0.6s ease;
}

@keyframes scoreExcellent {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes scoreGood {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes scorePoor {
  0% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }

  100% {
    transform: translateX(0);
  }
}

.result-feedback {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Hint */
.pronunciation-hint {
  text-align: center;
  min-height: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-style: italic;
}

/* Actions */
.pronunciation-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.pronunciation-actions .btn {
  flex: 1;
  min-width: 120px;
  justify-content: center;
}

.btn-record {
  background: linear-gradient(135deg, var(--success-color), #059669);
  color: white;
  font-weight: 700;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-record:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
}

.btn-record.recording {
  background: linear-gradient(135deg, var(--error-color), #dc2626);
  animation: btnRecordPulse 1s ease-in-out infinite;
}

.btn-record.recording:hover:not(:disabled) {
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4);
}

@keyframes btnRecordPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }
}

.btn-record:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.record-icon {
  font-size: 1.2rem;
  margin-right: 0.5rem;
}

.pronunciation-actions-secondary {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.pronunciation-actions-secondary .btn {
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

.btn-danger {
  color: var(--error-color);
  border-color: var(--error-color);
}

.btn-danger:hover {
  background: var(--error-color);
  color: white;
}

/* Feedback */
.pronunciation-feedback {
  text-align: center;
  min-height: 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.pronunciation-feedback.success {
  color: var(--success-color);
}

.pronunciation-feedback.error {
  color: var(--error-color);
}

.pronunciation-feedback.info {
  color: var(--primary-color);
}

/* Browser notice */
.browser-notice {
  display: none;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--warning-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  margin-top: 1.5rem;
  text-align: center;
  color: var(--text-primary);
}

.browser-notice.visible {
  display: block;
}

.browser-notice p {
  margin: 0;
  font-size: 0.95rem;
}

/* Info section */
.pronunciation-info {
  padding: 3rem 0;
}

/* Responsive */
@media (max-width: 900px) {
  .pronunciation-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .pronunciation-visual {
    order: -1;
  }

  .mic-scene {
    max-width: 260px;
    height: 360px;
  }

  .mic-icon {
    font-size: 4rem;
  }

  .pronunciation-word {
    font-size: 2rem;
  }

  .pronunciation-word.phrase {
    font-size: 1.5rem;
  }
}

@media (max-width: 600px) {
  .pronunciation-stats {
    gap: 0.5rem;
  }

  .pronunciation-stat {
    min-width: 60px;
    padding: 0.5rem 0.7rem;
  }

  .pronunciation-stat-value {
    font-size: 1.1rem;
  }

  .pronunciation-word {
    font-size: 1.6rem;
  }

  .pronunciation-word.phrase {
    font-size: 1.2rem;
  }

  .result-score {
    font-size: 2.5rem;
  }

  .pronunciation-actions {
    flex-direction: column;
  }

  .pronunciation-actions .btn {
    width: 100%;
  }

  .pronunciation-actions-secondary {
    flex-direction: column;
  }

  .pronunciation-actions-secondary .btn {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .pronunciation-word {
    font-size: 1.4rem;
  }

  .pronunciation-word.phrase {
    font-size: 1.1rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

  .mic-icon,
  .wave,
  .pulse-ring,
  .result-score,
  .btn-record,
  .life-heart {
    animation: none !important;
    transition: none !important;
  }
}