/* ═══════════════════════════════════════════════════
   Vocalização Guiada – style.css
   Design: vibrante, moderno, gamificado
═══════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --c-bg: #080a10;
  --c-surface: rgba(18, 22, 33, 0.65);
  --c-surface2: rgba(30, 36, 52, 0.75);
  --c-border: rgba(255, 255, 255, 0.09);
  --c-border-glow: rgba(124, 58, 237, 0.25);
  --c-text: #f1f5f9;
  --c-muted: #94a3b8;
  --c-primary: #8b5cf6;
  --c-primary2: #d946ef;
  --c-accent: #06b6d4;
  --c-accent2: #38bdf8;
  --c-green: #10b981;
  --c-yellow: #f59e0b;
  --c-red: #f43f5e;
  --c-orange: #f97316;
  --c-vowel: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
  --c-syllable: linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
  --c-fricative: linear-gradient(135deg, #f97316 0%, #f59e0b 100%);
  --c-game: linear-gradient(135deg, #eab308 0%, #ef4444 100%);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 36px;
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-lg: 0 12px 48px 0 rgba(0, 0, 0, 0.6);
  --ff: 'Nunito', sans-serif;
  --ff-display: 'Baloo 2', sans-serif;
  --transition: 0.3s cubic-bezier(.25, .8, .25, 1);
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #0f172a 0%, #020617 100%);
  font-family: var(--ff);
  color: var(--c-text);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ── Screens ──────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.screen.active {
  display: flex;
  animation: fadeIn 0.4s ease;
}

/* ── Auth System (Login/Register) ── */
.auth-container {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #090d16 0%, #110e2e 50%, #05070c 100%);
  position: relative;
  overflow: hidden;
}

.auth-container::before {
  content: '';
  position: absolute;
  width: 150%;
  height: 150%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, transparent 65%);
  top: -25%;
  left: -25%;
  animation: bgRotate 25s linear infinite;
}

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

  to {
    transform: rotate(360deg);
  }
}

/* Ondas de Voz Fluidas */
.voice-waves-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.wave {
  position: absolute;
  border: 2px solid transparent;
  border-radius: 43% 40% 45% 40%;
  animation: waveMotion 10s infinite linear;
}

.wave-1 {
  width: 320px;
  height: 320px;
  border-color: rgba(6, 182, 212, 0.12);
  animation-duration: 12s;
  box-shadow: 0 0 50px rgba(6, 182, 212, 0.05);
}

.wave-2 {
  width: 480px;
  height: 480px;
  border-color: rgba(124, 58, 237, 0.1);
  animation-duration: 18s;
  animation-direction: reverse;
  box-shadow: 0 0 70px rgba(124, 58, 237, 0.03);
}

.wave-3 {
  width: 640px;
  height: 640px;
  border-color: rgba(168, 85, 247, 0.06);
  animation-duration: 24s;
  box-shadow: 0 0 90px rgba(168, 85, 247, 0.02);
}

.wave-4 {
  width: 800px;
  height: 800px;
  border-color: rgba(56, 189, 248, 0.04);
  animation-duration: 30s;
  animation-direction: reverse;
}

@keyframes waveMotion {
  0% {
    transform: rotate(0deg) scale(0.95);
    border-radius: 43% 40% 45% 40%;
  }

  50% {
    transform: rotate(180deg) scale(1.05);
    border-radius: 40% 45% 40% 43%;
  }

  100% {
    transform: rotate(360deg) scale(0.95);
    border-radius: 43% 40% 45% 40%;
  }
}

/* Equalizador de Voz Rítmico */
.vocal-eq {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  margin: 4px 0 -8px 0;
}

.vocal-eq .bar {
  width: 4px;
  height: 100%;
  background: linear-gradient(to top, var(--c-primary) 0%, var(--c-accent) 100%);
  border-radius: 4px;
  animation: eqBounce 1.4s ease-in-out infinite;
  transform-origin: bottom;
}

.vocal-eq .bar:nth-child(1) {
  height: 14px;
  animation-delay: 0.1s;
}

.vocal-eq .bar:nth-child(2) {
  height: 26px;
  animation-delay: 0.3s;
}

.vocal-eq .bar:nth-child(3) {
  height: 18px;
  animation-delay: 0.5s;
}

.vocal-eq .bar:nth-child(4) {
  height: 30px;
  animation-delay: 0.2s;
}

.vocal-eq .bar:nth-child(5) {
  height: 20px;
  animation-delay: 0.4s;
}

.vocal-eq .bar:nth-child(6) {
  height: 24px;
  animation-delay: 0.6s;
}

.vocal-eq .bar:nth-child(7) {
  height: 16px;
  animation-delay: 0.15s;
}

@keyframes eqBounce {

  0%,
  100% {
    transform: scaleY(0.3);
  }

  50% {
    transform: scaleY(1);
  }
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--c-surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--c-border);
  border-top: 3px solid var(--c-accent);
  /* Linha neon premium */
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 40px rgba(6, 182, 212, 0.08);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transition: all var(--transition);
}

.auth-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  border-top-color: var(--c-accent2);
  box-shadow: var(--shadow-lg),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 50px rgba(6, 182, 212, 0.2);
  transform: translateY(-2px);
}

.auth-title {
  font-family: var(--ff-display);
  font-size: 2.2rem;
  font-weight: 800;
  text-align: center;
  color: white;
  margin: 0;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.auth-title span {
  color: var(--c-accent);
}

.auth-subtitle {
  font-size: 0.95rem;
  color: var(--c-muted);
  text-align: center;
  margin-top: -10px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text);
  opacity: 0.8;
}

.input-group input,
.auth-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: white;
  font-size: 1rem;
  transition: all 0.3s ease;
  width: 100%;
}

.auth-select option {
  background: #1e1b4b;
  color: white;
}

.input-group input:focus,
.auth-select:focus {
  outline: none;
  border-color: var(--c-accent);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.15);
}

.auth-btn {
  margin-top: 10px;
  padding: 14px !important;
  font-size: 1rem !important;
}

.auth-footer {
  text-align: center;
  font-size: 0.9rem;
  color: var(--c-muted);
}

.btn-link {
  background: none;
  border: none;
  color: var(--c-accent);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
}

.btn-link:hover {
  text-decoration: underline;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════
   HOME SCREEN
═══════════════════════════════════════════════ */
#screen-home {
  align-items: center;
  justify-content: center;
  background: var(--c-bg);
}

.bg-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.3;
  z-index: -1;
  transform: scale(1.1);
  transition: opacity 1s ease;
}

#bg-img-home {
  background-image: url('imagens/fundo1.jpg');
}

.bg-img-alt {
  background-image: url('imagens/fundo2.jpg') !important;
}

.home-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  animation: floatBubble 12s ease-in-out infinite;
}

.b1 {
  width: 320px;
  height: 320px;
  background: var(--c-primary);
  top: -80px;
  left: -60px;
  animation-delay: 0s;
}

.b2 {
  width: 200px;
  height: 200px;
  background: var(--c-accent);
  top: 40%;
  right: -50px;
  animation-delay: 3s;
}

.b3 {
  width: 260px;
  height: 260px;
  background: var(--c-primary2);
  bottom: -100px;
  left: 30%;
  animation-delay: 6s;
}

.b4 {
  width: 140px;
  height: 140px;
  background: var(--c-accent2);
  top: 20%;
  left: 55%;
  animation-delay: 1.5s;
}

.b5 {
  width: 180px;
  height: 180px;
  background: var(--c-green);
  bottom: 10%;
  right: 15%;
  animation-delay: 4.5s;
}

@keyframes floatBubble {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-30px) scale(1.05);
  }
}

.home-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  width: 100%;
  max-width: 900px;
  padding: 40px 24px;
}

.home-logo {
  text-align: center;
}

.logo-emoji {
  font-size: 64px;
  display: block;
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1)
  }

  50% {
    transform: scale(1.08)
  }
}

.logo-title {
  font-family: var(--ff-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, var(--c-primary2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-title .accent {
  background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.logo-sub {
  color: var(--c-muted);
  margin-top: 8px;
  font-size: 1rem;
}

.mode-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.mode-card {
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all var(--transition);
  min-width: 200px;
  flex: 1;
  max-width: 260px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.mode-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124, 58, 237, .15) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
}

.mode-card:hover {
  border-color: var(--c-primary2);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(168, 85, 247, .2);
}

.mode-card:hover::before {
  opacity: 1;
}

.mode-icon {
  font-size: 2.5rem;
}

.mode-label {
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-text);
}

.mode-desc {
  font-size: 0.8rem;
  color: var(--c-muted);
  text-align: center;
}

.home-footer {
  color: var(--c-muted);
  font-size: 0.82rem;
}

/* ── Seletor de Dificuldade ── */
.difficulty-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-top: 10px;
}

.difficulty-label {
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-text);
  opacity: 0.9;
}

.difficulty-cards {
  display: flex;
  gap: 12px;
  justify-content: center;
  width: 100%;
}

.diff-card {
  background: var(--c-surface2);
  border: 2px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all var(--transition);
  flex: 1;
  max-width: 160px;
  color: var(--c-text);
}

.diff-card:hover {
  border-color: var(--c-muted);
  transform: translateY(-2px);
}

.diff-card.diff-active {
  border-color: var(--c-accent);
  background: rgba(6, 182, 212, 0.1);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.diff-card.diff-active .diff-name {
  color: var(--c-accent);
}

.diff-icon {
  font-size: 1.4rem;
}

.diff-name {
  font-weight: 800;
  font-size: 0.95rem;
}

.diff-desc {
  font-size: 0.7rem;
  color: var(--c-muted);
  text-align: center;
}

/* ═══════════════════════════════════════════════
   TRAIL SCREEN
═══════════════════════════════════════════════ */
#screen-trail {
  background: var(--c-bg);
}

.trail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px 10px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
  gap: 16px;
}

.trail-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.trail-mode-badge {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary2));
  color: white;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}

#trail-stars {
  font-size: 0.9rem;
  color: var(--c-yellow);
  font-weight: 700;
}

.trail-difficulty-badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--c-border);
  color: var(--c-muted);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.btn-sample-record {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  margin-left: 10px;
}

.btn-sample-record:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: translateY(-1px);
}

.btn-sample-record.recording {
  background: #ef4444;
  color: white;
  animation: rec-pulse 1.5s infinite;
}

@keyframes rec-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.trail-progress-wrap {
  flex: 1;
  max-width: 200px;
  height: 8px;
  background: var(--c-border);
  border-radius: 4px;
  overflow: hidden;
}

.trail-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--c-green), var(--c-accent));
  border-radius: 4px;
  transition: width 0.6s ease;
  width: 0%;
}

.trail-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
}

.trail-title {
  font-family: var(--ff-display);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 16px;
  text-align: center;
  background: linear-gradient(135deg, var(--c-text), var(--c-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.trail-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.trail-block {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.block-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.vowel-block {
  background: linear-gradient(135deg, rgba(124, 58, 237, .2), rgba(124, 58, 237, .05));
  border-bottom: 1px solid rgba(124, 58, 237, .3);
}

.syllable-block {
  background: linear-gradient(135deg, rgba(8, 145, 178, .2), rgba(8, 145, 178, .05));
  border-bottom: 1px solid rgba(8, 145, 178, .3);
}

.fricative-block {
  background: linear-gradient(135deg, rgba(20, 184, 166, .2), rgba(20, 184, 166, .05));
  border-bottom: 1px solid rgba(20, 184, 166, .3);
}

.game-block {
  background: linear-gradient(135deg, rgba(217, 119, 6, .2), rgba(217, 119, 6, .05));
  border-bottom: 1px solid rgba(217, 119, 6, .3);
}

.block-icon {
  font-size: 1.5rem;
}

.trail-units {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
}

.unit-btn {
  background: var(--c-surface2);
  border: 2px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all var(--transition);
  min-width: 140px;
  color: var(--c-text);
  font-family: var(--ff);
  font-size: 0.95rem;
  font-weight: 700;
  position: relative;
}

.unit-btn:hover:not(:disabled) {
  border-color: var(--c-primary2);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(168, 85, 247, .25);
}

.unit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.unit-btn.completed {
  border-color: var(--c-green);
  background: rgba(34, 197, 94, .08);
}

.unit-icon {
  font-size: 1.5rem;
}

.unit-text {
  flex: 1;
  text-align: left;
}

.unit-lock {
  color: var(--c-muted);
  margin-left: auto;
}

.unit-stars {
  color: var(--c-yellow);
  font-size: 0.8rem;
}

.game-btn {
  min-width: 200px;
}

/* ═══════════════════════════════════════════════
   LEARN SCREEN
═══════════════════════════════════════════════ */
#screen-learn {
  background: radial-gradient(ellipse at 60% 0%, rgba(124, 58, 237, .12), transparent 60%), var(--c-bg);
}

.learn-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}

.learn-header h2 {
  font-family: var(--ff-display);
  font-size: 1.4rem;
  font-weight: 800;
}

.learn-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}

.learn-card {
  background: var(--c-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 760px;
  width: 100%;
  box-shadow: var(--shadow-lg),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 40px rgba(139, 92, 246, 0.05);
  transition: all var(--transition);
}

.learn-card:hover {
  box-shadow: var(--shadow-lg),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 50px rgba(139, 92, 246, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
}

.learn-phoneme-display {
  font-family: var(--ff-display);
  font-size: clamp(5rem, 12vw, 8rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--c-primary2), var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  animation: glow 3s ease-in-out infinite;
}

@keyframes glow {

  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, .4));
  }

  50% {
    filter: drop-shadow(0 0 24px rgba(168, 85, 247, .7));
  }
}

.learn-info-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 20px;
  width: 100%;
}

.learn-mouth-box,
.learn-formant-box,
.learn-libras-box {
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mouth-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 140px;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.mouth-visual img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.learn-label {
  font-size: 0.78rem;
  color: var(--c-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.formant-tag {
  background: linear-gradient(135deg, rgba(124, 58, 237, .2), rgba(124, 58, 237, .1));
  border: 1px solid rgba(124, 58, 237, .4);
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  width: 100%;
  text-align: center;
  color: var(--c-primary2);
}

.learn-skill {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-accent);
}

.learn-objective {
  font-size: 0.85rem;
  color: var(--c-muted);
  text-align: center;
}

.libras-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 120px;
}

.libras-visual img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#learn-libras-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#libras-img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.libras-visual span {
  font-size: 3.5rem;
}

/* ═══════════════════════════════════════════════
   TRAIN SCREEN
═══════════════════════════════════════════════ */
#screen-train {
  background: radial-gradient(ellipse at 30% 10%, rgba(6, 182, 212, .08), transparent 50%), var(--c-bg);
}

.train-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}

.train-header h2 {
  font-family: var(--ff-display);
  font-size: 1.4rem;
  font-weight: 800;
}

.train-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  overflow: auto;
}

.target-feedback-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  margin: 15px auto 25px auto;
  max-width: 420px;
  width: 100%;
  border-radius: var(--radius-xl);
  background: var(--c-surface-glass);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-md);
  overflow: visible;
}

.feedback-aura {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
  opacity: 0;
  transition: width 0.1s ease-out, height 0.1s ease-out, opacity 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  z-index: 1;
  pointer-events: none;
}

.train-target-display {
  position: relative;
  z-index: 10;
  font-family: var(--ff-display);
  font-size: clamp(5rem, 16vw, 11rem);
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  line-height: 1;
  transition: transform 0.2s ease;
  max-width: 100%;
  text-align: center;
}

.train-target-display.word-display {
  font-size: clamp(2.6rem, 6vw, 4.5rem) !important;
  letter-spacing: 2px;
}

.coach-suggestion {
  margin-top: -20px;
  margin-bottom: 20px;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 1.1rem;
  text-align: center;
  transition: all 0.3s ease;
  z-index: 11;
  max-width: 90%;
}

/* ── VU Meter de Score ── */
.score-vu-container {
  position: absolute;
  right: calc(100% + 40px); /* LEDs do lado de fora, à esquerda */
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  z-index: 15;
}

.score-vu-meter {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 6px;
  border: 1px solid var(--c-border);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.vu-segment {
  width: 18px;
  height: 5px;
  border-radius: 2px;
  background: #1a1a1a;
  transition: background 0.1s ease, box-shadow 0.1s ease;
}

/* Cores dos segmentos acesos */
.vu-segment.lit-low {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.vu-segment.lit-mid {
  background: #eab308;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.6);
}

.vu-segment.lit-high {
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.8);
}

.vu-segment.lit-peak {
  background: #4ade80;
  box-shadow: 0 0 15px rgba(74, 222, 128, 1);
  animation: flash 0.5s infinite;
}

.score-vu-label {
  display: none;
}

@keyframes flash {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.coach-suggestion.idle {
  background: rgba(255, 255, 255, 0.05);
  color: var(--c-muted);
}

.coach-suggestion.warning {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.coach-suggestion.active {
  background: rgba(234, 179, 8, 0.15);
  color: #fde047;
  box-shadow: 0 0 15px rgba(234, 179, 8, 0.3);
}

.coach-suggestion.success {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

.formant-map-wrap {
  position: relative;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

#formant-map,
#test-formant-map {
  display: block;
  max-width: 100%;
  height: auto;
}

.formant-map-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.fml-x {
  position: absolute;
  bottom: 4px;
  right: 10px;
  font-size: 0.72rem;
  color: var(--c-muted);
}

.fml-y {
  position: absolute;
  top: 10px;
  left: 4px;
  font-size: 0.72rem;
  color: var(--c-muted);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.train-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}



@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.analysis-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.spectrogram-wrap {
  flex: 1;
}

#spectrogram-canvas {
  width: 100%;
  height: 180px;
  background: #000;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.resonance-stats {
  width: 180px;
}

.spectral-balance {
  display: flex;
  gap: 16px;
  height: 120px;
  justify-content: center;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.spectral-band {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.band-bar {
  width: 14px;
  height: 80px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.band-fill {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 0%;
  transition: height 0.1s ease-out;
}

#band-low .band-fill {
  background: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

#band-mid .band-fill {
  background: #eab308;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.5);
}

#band-high .band-fill {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.band-label {
  font-size: 0.6rem;
  color: var(--c-muted);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.clinical-panel {
  width: 100%;
  max-width: 900px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 30px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: slideDown 0.3s ease-out;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.train-main-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
  width: 100%;
  max-width: 1200px;
  align-items: stretch;
  margin-bottom: 10px;
}

.feedback-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-xl);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.2);
  position: relative;
}

.analytics-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  justify-content: center;
}

.train-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.technical-dashboard {
  width: 100%;
}

.desktop-tech-row {
  display: flex;
  flex-direction: row;
  gap: 14px;
  width: 100%;
  align-items: stretch;
  flex-wrap: wrap;
}

.desktop-tech-row .vu-meters-grid {
  flex: 2.2;
  min-width: 300px;
}

.desktop-tech-row .train-stats-row {
  flex: 1.5;
  min-width: 240px;
  display: flex;
  flex-direction: row;
  gap: 10px;
  justify-content: space-between;
  align-items: stretch;
}

.desktop-tech-row .train-stats-row .feedback-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

@media (max-width: 900px) {
  .desktop-tech-row {
    flex-direction: column;
  }

  .desktop-tech-row .train-stats-row {
    width: 100%;
    margin-top: 10px;
  }

  .train-main-grid {
    grid-template-columns: 1fr;
  }

  .feedback-section {
    padding: 20px;
  }
}

/* ────────────────────────────────────────────────
   KID MODE STYLES
   ──────────────────────────────────────────────── */
.kid-mascot {
  position: absolute;
  font-size: 8rem;
  z-index: 12;
  pointer-events: none;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.4));
  transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.kid-mascot.active {
  filter: drop-shadow(0 0 30px rgba(255, 234, 0, 0.8));
}

@keyframes mascotJump {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-40px) scale(1.1);
  }
}

.magic-bar-container {
  width: 80%;
  max-width: 400px;
  height: 28px;
  background: rgba(0, 0, 0, 0.4);
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  margin: 0 auto 15px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.magic-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b);
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
  transition: width 0.3s ease-out;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.kid-stars-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
}

.kid-star {
  font-size: 2.5rem;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
  animation: starPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes starPop {
  0% {
    transform: scale(0) rotate(-45deg);
    opacity: 0;
  }

  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

/* Vocal Map 2D */
.vocal-map {
  width: 320px;
  height: 240px;
  background: rgba(15, 23, 42, 0.4);
  background-image:
    radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.05) 1px, transparent 0);
  background-size: 20px 20px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  margin: 0 auto 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.map-home {
  position: absolute;
  font-size: 3rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  filter: drop-shadow(0 0 15px var(--c-green));
  transition: transform 0.3s ease;
}

.map-home.target-hit {
  transform: scale(1.3);
  filter: drop-shadow(0 0 25px var(--c-green));
}

.map-mascot {
  position: absolute;
  font-size: 3.5rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: left 0.15s ease-out, top 0.15s ease-out, transform 0.1s;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.map-hint-text {
  position: absolute;
  bottom: 8px;
  left: 0;
  width: 100%;
  font-size: 0.65rem;
  color: var(--c-muted);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.05em;
}

/* Kid Status Banner */
.kid-status-banner {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  margin: 0 auto 15px;
  display: inline-block;
  font-weight: 900;
  font-size: 1.2rem;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  animation: pulseKid 1.5s infinite;
}

.kid-status-banner.ready {
  background: #3b82f6;
  border-color: #60a5fa;
}

.kid-status-banner.action {
  background: #ef4444;
  border-color: #f87171;
  animation: shakeKid 0.3s infinite;
}

.kid-status-banner.feedback {
  background: #10b981;
  border-color: #34d399;
}

@keyframes pulseKid {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@keyframes shakeKid {

  0%,
  100% {
    transform: rotate(0);
  }

  25% {
    transform: rotate(-2deg);
  }

  75% {
    transform: rotate(2deg);
  }
}

@media (max-width: 600px) {
  .train-stats-row {
    flex-direction: column;
    align-items: stretch;
  }
}

.vu-meters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 800px;
}

@media (max-width: 768px) {
  .vu-meters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.vu-meter {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.vu-label {
  font-size: 0.75rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
}

.vu-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
}

.vu-dial-container {
  position: relative;
  width: 100px;
  height: 50px;
  margin-top: 4px;
}

.vu-scale {
  width: 100px;
  height: 50px;
  background: rgba(255, 255, 255, 0.03);
  border-top-left-radius: 50px;
  border-top-right-radius: 50px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--c-border);
  border-bottom: none;
}

.vu-target-band {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 100px;
  height: 100px;
  margin-left: -50px;
  border-radius: 50%;
  background: conic-gradient(from 270deg, transparent 0deg, var(--c-green) 0deg, var(--c-green) 0deg, transparent 0deg);
  opacity: 0.3;
  transition: background 0.3s ease;
}

.vu-target-tick {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 2px;
  height: 50px;
  transform-origin: bottom center;
  background: linear-gradient(to bottom, #fff 0%, #fff 20%, transparent 20%);
  transform: translateX(-50%) rotate(-90deg);
  z-index: 1;
  transition: transform 0.3s ease;
}

/* Furo central para parecer um arco */
.vu-scale::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 76px;
  height: 38px;
  margin-left: -38px;
  background: var(--c-surface);
  border-top-left-radius: 38px;
  border-top-right-radius: 38px;
  border-bottom: none;
}

.vu-needle {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 4px;
  height: 44px;
  background: var(--c-accent);
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(-90deg);
  /* -90deg = 0%, 0deg = 50%, 90deg = 100% */
  border-radius: 2px;
  transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 2;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.8);
}

.vu-needle::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: -2px;
  width: 8px;
  height: 8px;
  background: var(--c-text);
  border-radius: 50%;
}

.feedback-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 12px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 100px;
}

.fb-label {
  font-size: 0.75rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.fb-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--c-accent);
}

.fb-value.big {
  font-size: 2rem;
  color: var(--c-green);
}

.score-card {
  border-color: rgba(34, 197, 94, .3);
  background: rgba(34, 197, 94, .05);
}

.train-score-bar-wrap {
  width: 100%;
  max-width: 500px;
  height: 14px;
  background: var(--c-border);
  border-radius: 7px;
  overflow: hidden;
}

.train-score-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  border-radius: 7px;
  transition: width 0.3s ease;
  width: 0%;
}

.train-btn-row {
  display: flex;
  gap: 16px;
}

/* ═══════════════════════════════════════════════
   TEST SCREEN
═══════════════════════════════════════════════ */
#screen-test {
  background: radial-gradient(ellipse at 70% 20%, rgba(217, 119, 6, .08), transparent 50%), var(--c-bg);
}

.test-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}

.test-header h2 {
  font-family: var(--ff-display);
  font-size: 1.4rem;
}

.test-timer-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.timer-ring {
  width: 56px;
  height: 56px;
  transform: rotate(-90deg);
}

.timer-bg {
  fill: none;
  stroke: var(--c-border);
  stroke-width: 4;
}

.timer-fg {
  fill: none;
  stroke: var(--c-orange);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 163.4;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.timer-count {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: var(--c-orange);
}

.test-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  overflow: auto;
}

.test-target-big {
  position: relative;
  z-index: 10;
  font-family: var(--ff-display);
  font-size: clamp(6rem, 20vw, 14rem);
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  line-height: 1;
  transition: transform 0.2s ease;
}

.test-instruction {
  color: var(--c-muted);
  font-size: 0.95rem;
  text-align: center;
}

.test-progress-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.test-progress-dot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--c-border);
  border: 3px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.4s;
}

.test-progress-dot.hit {
  background: var(--c-green);
  border-color: var(--c-green);
  animation: dotBounce .4s ease;
}

@keyframes dotBounce {

  0%,
  100% {
    transform: scale(1)
  }

  50% {
    transform: scale(1.3)
  }
}

.test-formant-map-wrap {
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.test-score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.test-score-label {
  font-size: 0.8rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.test-score-val {
  font-family: var(--ff-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--c-green);
}

/* ═══════════════════════════════════════════════
   RESULT SCREEN
═══════════════════════════════════════════════ */
#screen-result {
  background: radial-gradient(ellipse, rgba(34, 197, 94, .12) 0%, var(--c-bg) 70%);
  align-items: center;
  justify-content: center;
}

.result-content {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xl);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(34, 197, 94, .15);
  text-align: center;
}

.result-stars {
  font-size: 3rem;
  letter-spacing: 8px;
  animation: starFloat 1.5s ease;
}

@keyframes starFloat {
  0% {
    transform: scale(0) rotate(-20deg);
    opacity: 0
  }

  60% {
    transform: scale(1.2)
  }

  100% {
    transform: scale(1);
    opacity: 1
  }
}

.result-title {
  font-family: var(--ff-display);
  font-size: 2rem;
  font-weight: 800;
}

.result-score-big {
  font-family: var(--ff-display);
  font-size: 4rem;
  font-weight: 800;
  color: var(--c-green);
}

.result-msg {
  color: var(--c-muted);
  font-size: 1rem;
}

.result-btn-row {
  display: flex;
  gap: 16px;
}

/* ═══════════════════════════════════════════════
   MINI-GAME SCREEN
═══════════════════════════════════════════════ */
#screen-minigame {
  background: radial-gradient(ellipse at 50% 100%, rgba(124, 58, 237, .15), transparent 60%), var(--c-bg);
}

.minigame-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}

.minigame-header h2 {
  font-family: var(--ff-display);
  font-size: 1.4rem;
}

.minigame-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
  overflow: hidden;
}

#minigame-canvas {
  border-radius: var(--radius-md);
  max-width: 100%;
  max-height: 50vh;
  border: 1px solid var(--c-border);
}

.minigame-bar-wrap {
  width: 100%;
  max-width: 600px;
  height: 18px;
  background: var(--c-border);
  border-radius: 9px;
  overflow: hidden;
}

.minigame-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  border-radius: 9px;
  transition: width 0.2s ease;
  width: 0%;
}

.minigame-phoneme-display {
  font-family: var(--ff-display);
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--c-primary2), var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═══════════════════════════════════════════════
   FINAL GAME SCREEN
═══════════════════════════════════════════════ */
#screen-finalgame {
  background: radial-gradient(ellipse at 10% 90%, rgba(217, 119, 6, .12), transparent 50%), var(--c-bg);
}

.finalgame-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}

.finalgame-header h2 {
  font-family: var(--ff-display);
  font-size: 1.4rem;
}

.finalgame-score {
  font-family: var(--ff-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--c-yellow);
}

.finalgame-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px;
  overflow: hidden;
}

#finalgame-canvas {
  border-radius: var(--radius-md);
  max-width: 100%;
  max-height: 55vh;
  border: 1px solid var(--c-border);
}

.finalgame-status {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.finalgame-target-badge {
  background: linear-gradient(135deg, var(--c-yellow), var(--c-orange));
  color: #000;
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 800;
  padding: 6px 20px;
  border-radius: 20px;
}

#finalgame-instruction {
  color: var(--c-muted);
  font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn-primary {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary2));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 28px;
  font-family: var(--ff);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(124, 58, 237, .4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, .5);
}

.btn-primary.large {
  padding: 16px 40px;
  font-size: 1.1rem;
}

.btn-secondary {
  background: var(--c-surface2);
  color: var(--c-text);
  border: 2px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 12px 28px;
  font-family: var(--ff);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  border-color: var(--c-muted);
  transform: translateY(-2px);
}

.btn-back {
  background: transparent;
  color: var(--c-muted);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: var(--ff);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-back:hover {
  color: var(--c-text);
  border-color: var(--c-muted);
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--c-border);
  border-radius: 50%;
  background: var(--c-surface2);
  color: var(--c-text);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.icon-btn:hover {
  border-color: var(--c-accent);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.22);
  transform: translateY(-1px);
}

.mic-settings-toggle.active {
  border-color: var(--c-green);
  color: var(--c-green);
  background: rgba(16, 185, 129, 0.12);
}

/* ── Mic badge ─────────────────────────────────── */
.mic-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all var(--transition);
  border: 1.5px solid transparent;
}

.mic-badge.inactive {
  background: var(--c-surface2);
  border-color: var(--c-border);
  color: var(--c-muted);
}

.mic-badge.active {
  background: rgba(34, 197, 94, .15);
  border-color: var(--c-green);
  color: var(--c-green);
  animation: micPulse 1.5s ease-in-out infinite;
}

@keyframes micPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .4)
  }

  50% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0)
  }
}

.mic-settings-panel {
  position: fixed;
  top: 74px;
  right: 20px;
  z-index: 10050;
  width: min(360px, calc(100vw - 24px));
  padding: 14px;
  display: none;
  flex-direction: column;
  gap: 12px;
  background: rgba(18, 22, 33, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.mic-settings-panel.open {
  display: flex;
  animation: slideDown 0.18s ease;
}

.mic-settings-head,
.mic-settings-meta,
.mic-sensitivity-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mic-settings-head {
  justify-content: space-between;
}

.mic-settings-title {
  font-family: var(--ff-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: white;
}

.mic-sensitivity-row span {
  color: var(--c-muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.mic-sensitivity-row input[type="range"] {
  flex: 1;
  accent-color: var(--c-green);
}

.mic-settings-meta {
  justify-content: space-between;
  flex-wrap: wrap;
}

#mic-sensitivity-label {
  color: var(--c-green);
  font-weight: 900;
  font-size: 0.92rem;
}

.mic-live-level {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#mic-live-level-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--c-green), var(--c-yellow), var(--c-red));
  transition: width 0.08s linear;
}

/* ── Toast ─────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 12px 28px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--c-text);
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s cubic-bezier(.4, 0, .2, 1), opacity 0.4s;
  opacity: 0;
  z-index: 9999;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: var(--c-green);
  color: var(--c-green);
}

.toast.error {
  border-color: var(--c-red);
  color: var(--c-red);
}

/* ── Modais ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeInModal 0.3s ease;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  background: var(--c-surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow-lg),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 40px rgba(139, 92, 246, 0.12);
}

.modal-title {
  font-family: var(--ff-display);
  font-size: 1.8rem;
  color: white;
  margin-bottom: 8px;
}

.modal-subtitle {
  color: var(--c-muted);
  font-size: 1rem;
  margin-bottom: 32px;
}

.modal-diff-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.diff-option-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.diff-option-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--c-accent);
  transform: translateX(10px);
}

.diff-option-card .diff-icon {
  font-size: 2rem;
}

.diff-option-card .diff-name {
  display: block;
  font-weight: 800;
  font-size: 1.1rem;
  color: white;
}

.diff-option-card .diff-desc {
  font-size: 0.85rem;
  color: var(--c-muted);
}

@keyframes fadeInModal {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── Category Trail ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 10px 24px 20px;
  max-width: 1020px;
  margin: 0 auto;
  width: 100%;
}


.category-card {
  background: var(--c-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.category-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
}

.vowel-card::after {
  background: var(--c-vowel);
}

.syllable-card::after {
  background: var(--c-syllable);
}

.fricative-card::after {
  background: var(--c-fricative);
}

.game-card::after {
  background: var(--c-game);
}

.warmup-card::after {
  background: #f97316;
  /* Laranja vibrante para aquecimento */
}

.word-card::after {
  background: #8b5cf6;
  /* Violeta para palavras */
}

.category-card:hover {
  transform: translateY(-2px) scale(1.01);
  background: var(--c-surface2);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-lg), 0 8px 20px rgba(0, 0, 0, 0.4);
}

.cat-icon {
  font-size: 2.5rem;
  background: rgba(255, 255, 255, 0.05);
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.cat-info {
  flex: 1;
}

.cat-name {
  display: block;
  font-family: var(--ff-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: white;
}

.cat-count {
  font-size: 0.85rem;
  color: var(--c-muted);
  font-weight: 600;
}

.cat-arrow {
  font-size: 1.5rem;
  color: var(--c-muted);
  transition: transform 0.3s ease;
}

.category-card:hover .cat-arrow {
  transform: translateX(5px);
  color: var(--c-accent);
}

/* ── Unit Selection Modal ── */
.unit-selection-card {
  max-width: 800px !important;
  width: 90% !important;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
}

.modal-header {
  padding: 20px 30px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.modal-header h2 {
  font-family: var(--ff-display);
  font-size: 1.6rem;
  margin: 0;
}

.btn-close {
  background: none;
  border: none;
  color: var(--c-muted);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

.btn-close:hover {
  color: white;
}

.modal-units-grid {
  padding: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 20px;
  overflow-y: auto;
}

/* Reuso de estilos de botões de unidade para o grid */
.modal-units-grid .unit-btn {
  width: 100%;
  margin: 0;
}

/* ── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--c-accent);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* ── Fonoaudiólogo ── */
.fono-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}

.fono-user-info h2 {
  margin: 0;
  font-family: var(--ff-display);
}

.fono-code-badge {
  font-size: 0.9rem;
  color: var(--c-accent);
  font-weight: bold;
  background: rgba(124, 58, 237, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  margin-top: 5px;
  display: inline-block;
}

.fono-body {
  padding: 40px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  height: calc(100vh - 80px);
}

.fono-action-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.fono-action-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.fono-action-card:hover {
  transform: translateY(-5px);
  border-color: var(--c-accent);
  box-shadow: var(--shadow-lg);
}

.fono-action-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.fono-action-title {
  font-family: var(--ff-display);
  font-size: 1.5rem;
  color: white;
  margin-bottom: 10px;
}

.fono-action-desc {
  color: var(--c-muted);
}

.split-view {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 30px;
  height: 100%;
  padding-bottom: 40px;
}

.patients-list {
  background: var(--c-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  padding: 20px;
}

.patient-item {
  padding: 15px;
  border: 1px solid transparent;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  transition: all var(--transition);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.patient-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--c-accent);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.15);
  transform: translateX(4px);
}

.patient-item h4 {
  margin: 0 0 5px 0;
  color: white;
}

.patient-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--c-muted);
}

.patient-details {
  background: var(--c-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 30px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.empty-state {
  text-align: center;
  color: var(--c-muted);
  margin-top: 50px;
  font-style: italic;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.report-table th,
.report-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.9rem;
}

.report-table th {
  color: var(--c-muted);
  font-weight: 600;
}

.report-table td {
  color: white;
}

.audio-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.audio-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
}

.audio-item audio {
  height: 30px;
}

/* ── Util ──────────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ==========================================================================
   MELHORIAS ESTÉTICAS E INTERATIVAS ADICIONADAS (ANTIGRAVITY)
   ========================================================================== */

/* Seletor de Mascote */
.mascot-opt {
  outline: none;
}

.mascot-opt:hover {
  transform: scale(1.15);
  background: rgba(255, 255, 255, 0.1) !important;
}

.mascot-opt:active {
  transform: scale(0.95);
}

/* Password Wrapper button highlight */
.password-wrapper button:hover {
  color: white !important;
  transform: scale(1.1);
}

.password-wrapper button:active {
  transform: scale(0.9);
}

/* Patente Vocal Card Glow animations */
@keyframes rankGlow {

  0%,
  100% {
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
  }

  50% {
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.6);
  }
}

.vocal-rank-card {
  animation: rankGlow 6s infinite ease-in-out;
  transition: all 0.3s ease;
}

.vocal-rank-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25) !important;
}

/* Animações e micro-interações do mascote de treino */
@keyframes bounceMascot {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1) translateY(-10px);
  }
}

.kid-mascot {
  animation: bounceMascot 3s infinite ease-in-out;
  transition: all 0.3s ease;
}

/* Glow nos VU meters */
.vu-needle {
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
  transition: transform 0.15s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Efeito de hover nos botões de guias vocais */
#btn-audio-guide:hover {
  transform: scale(1.05) translateY(-1px);
  background: rgba(6, 182, 212, 0.2) !important;
  box-shadow: 0 0 18px var(--c-secondary-glow) !important;
}

#btn-audio-guide:active {
  transform: scale(0.98);
}

/* ─── Rastreador de Sílabas de Palavras ─── */
@keyframes sylPulse {

  0%,
  100% {
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
  }

  50% {
    box-shadow: 0 0 22px rgba(6, 182, 212, 0.85), 0 0 40px rgba(6, 182, 212, 0.25);
  }
}

@keyframes sylScored {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.18);
  }

  100% {
    transform: scale(1);
  }
}

/* ==========================================================================
   MOBILE RESPONSIVENESS AND OPTIMIZATIONS (ANTIGRAVITY)
   ========================================================================== */
@media (max-width: 768px) {

  /* Ajustes Globais Mobile */
  html,
  body {
    height: 100%;
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  .screen {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: none;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .screen.active {
    display: flex !important;
  }

  .trail-body,
  .learn-body,
  .train-body,
  .fono-body,
  .test-body,
  .minigame-body,
  .finalgame-body,
  .leveling-body {
    flex: 1 !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    padding: 12px 10px !important;
  }

  .trail-body,
  .learn-body,
  .train-body,
  .fono-body,
  .test-body,
  .minigame-body,
  .finalgame-body {
    padding: 16px 12px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  /* Headers (Trail, Learn, Train, Test, Minigames) */
  .trail-header,
  .learn-header,
  .train-header,
  .test-header,
  .minigame-header,
  .finalgame-header {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
  }

  .trail-info {
    flex-wrap: wrap;
    gap: 6px;
  }

  .trail-progress-wrap {
    width: 100%;
    max-width: 100%;
    margin-top: 4px;
    order: 10;
    /* Put progress bar below */
  }

  .train-header h2,
  .learn-header h2,
  .test-header h2,
  .minigame-header h2,
  .finalgame-header h2 {
    font-size: 1.15rem;
  }

  .train-header-right {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
  }

  .mic-settings-panel {
    top: 66px;
    left: 12px;
    right: 12px;
    width: auto;
  }

  .mic-settings-meta .btn-sm {
    padding: 6px 10px !important;
    font-size: 0.72rem !important;
  }

  .mic-badge {
    padding: 4px 10px;
    font-size: 0.75rem;
  }

  /* Auth Screens (Login / Register) */
  .auth-card {
    padding: 24px 16px;
    margin: 20px;
    width: calc(100% - 40px);
    max-width: 360px;
  }

  .auth-title {
    font-size: 1.8rem;
  }

  .mascot-selector-grid {
    gap: 6px !important;
  }

  .mascot-opt {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.5rem !important;
  }

  /* Home Screen / Difficulty Selector */
  .home-content {
    padding: 20px 16px;
    gap: 24px;
  }

  .logo-emoji {
    font-size: 48px;
  }

  .difficulty-cards {
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .diff-card {
    width: 100% !important;
    max-width: 280px !important;
    padding: 10px 12px !important;
  }

  /* Trail Screen (Trilha) & Categories */
  .vocal-rank-card {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 12px !important;
    padding: 12px 16px !important;
    margin: 10px auto 15px auto !important;
    width: calc(100% - 24px) !important;
  }

  .rank-badge-container {
    width: 60px !important;
    height: 60px !important;
    font-size: 2.2rem !important;
  }

  .rank-info {
    text-align: center !important;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .category-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 10px 12px !important;
  }

  .category-card {
    padding: 16px !important;
  }

  .cat-icon {
    width: 56px !important;
    height: 56px !important;
    font-size: 2rem !important;
  }

  .cat-name {
    font-size: 1.15rem !important;
  }

  /* Units Selection Modal */
  .modal-card {
    padding: 20px 16px !important;
    width: 100% !important;
  }

  .modal-units-grid {
    padding: 16px !important;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) !important;
    gap: 10px !important;
  }

  .unit-btn {
    padding: 10px 12px !important;
    font-size: 0.85rem !important;
    min-width: unset !important;
  }

  /* Learn Screen (Aprender) */
  .learn-card {
    padding: 20px 16px !important;
    gap: 16px !important;
  }

  .learn-phoneme-display {
    font-size: 4.5rem !important;
  }

  .learn-info-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .learn-mouth-box,
  .learn-formant-box,
  .learn-libras-box {
    padding: 12px !important;
    width: 100% !important;
  }

  .mouth-visual {
    height: 110px !important;
  }

  .libras-visual {
    height: 100px !important;
  }

  #libras-img {
    max-height: 80px !important;
  }

  #mouth-biphasic-mode .mouth-visual {
    height: 80px !important;
  }

  #libras-dual-mode .libras-visual {
    height: 70px !important;
  }

  .btn-primary.large {
    padding: 12px 24px !important;
    font-size: 1rem !important;
    width: 100% !important;
  }

  /* Training Screen (Treino) */
  .train-main-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .target-feedback-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px 16px 65px;
    margin: 10px auto;
    max-width: 320px;
    width: 100%;
    border-radius: var(--radius-xl);
    background: var(--c-surface-glass);
    border: 1px solid var(--c-border);
    box-shadow: var(--shadow-md);
  }

  .score-vu-container {
    position: absolute;
    left: -25px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    z-index: 15;
  }

  .train-target-display {
    font-size: clamp(5rem, 16vw, 10rem) !important;
  }

  .kid-mascot {
    font-size: 6rem !important;
  }

  .coach-suggestion {
    font-size: 0.95rem !important;
    padding: 8px 16px !important;
    margin-top: -10px !important;
    margin-bottom: 15px !important;
  }

  .vu-meters-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .vu-meter {
    padding: 8px !important;
  }

  .vu-dial-container,
  .vu-scale {
    width: 80px !important;
    height: 40px !important;
  }

  .vu-scale::after {
    width: 60px !important;
    height: 30px !important;
    margin-left: -30px !important;
  }

  .vu-target-band {
    width: 80px !important;
    height: 80px !important;
    margin-left: -40px !important;
  }

  .vu-needle {
    height: 34px !important;
  }

  .train-stats-row {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .feedback-card {
    flex: 1 !important;
    min-width: 90px !important;
    padding: 8px 12px !important;
  }

  .train-score-bar-wrap {
    margin-top: 10px !important;
  }

  .train-btn-row {
    width: 100% !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .train-btn-row button {
    width: 100% !important;
  }

  /* Result Screen */
  .result-content {
    padding: 24px 16px !important;
    width: 95% !important;
  }

  .result-stars {
    font-size: 2.2rem !important;
  }

  .result-score-big {
    font-size: 3rem !important;
  }

  .result-btn-row {
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .result-btn-row button {
    width: 100% !important;
  }

  /* Clinician (Fonoaudiólogo) dashboard */
  .fono-header {
    padding: 12px 16px !important;
    flex-wrap: wrap;
    gap: 8px;
  }

  .fono-body {
    padding: 16px 12px !important;
    height: calc(100vh - 70px) !important;
  }

  .fono-action-cards {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .fono-action-card {
    padding: 20px 12px !important;
  }

  .fono-action-icon {
    font-size: 2.5rem !important;
    margin-bottom: 10px !important;
  }

  .fono-action-title {
    font-size: 1.2rem !important;
  }

  .split-view {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    height: auto !important;
    overflow-y: auto !important;
  }

  .patients-list {
    max-height: 200px !important;
  }

  .patient-details {
    padding: 16px !important;
  }

  .report-table th,
  .report-table td {
    padding: 8px 4px !important;
    font-size: 0.8rem !important;
  }

  /* Fix for Mobile Microphone Footer - Make it Sticky and Prominent */
  .train-footer {
    position: sticky !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: rgba(15, 23, 42, 0.96) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    padding: 12px 16px !important;
    margin-top: auto !important;
    z-index: 100 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 -6px 25px rgba(0, 0, 0, 0.5) !important;
  }

  #btn-start-mic {
    font-size: 1.15rem !important;
    padding: 14px 20px !important;
    font-weight: 800 !important;
    box-shadow: 0 0 20px var(--c-primary-glow) !important;
  }
}

/* ==========================================================================
   CARDS DE CONSOANTES AMPLIADOS (LETRA + DESENHO GRANDE LADO A LADO)
   ========================================================================== */
.consonants-grid-large {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  max-height: 70vh;
  overflow-y: auto;
}

@media (max-width: 600px) {
  .consonants-grid-large {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
  }
}

.consonant-card-big {
  background: var(--c-surface-glass);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 14px 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.consonant-card-big:hover,
.consonant-card-big:active {
  transform: translateY(-3px) scale(1.04);
  border-color: var(--c-primary);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(6, 182, 212, 0.3));
  box-shadow: 0 8px 25px var(--c-primary-glow);
}

.consonant-letter-large {
  font-family: 'Baloo 2', sans-serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: white;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.consonant-drawing-large {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

/* ==========================================================================
   TEMAS DINÂMICOS DE APARÊNCIA E CORES
   ========================================================================== */

/* 1. MODO DIA / CLARO */
body[data-theme="light"] {
  --c-bg: #f8fafc;
  --c-surface: #ffffff;
  --c-surface-glass: #ffffff;
  --c-text: #0f172a;
  --c-muted: #475569;
  --c-border: #cbd5e1;
  --c-primary: #6d28d9;
  --c-secondary: #0284c7;
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

body[data-theme="light"] .screen {
  background: #f8fafc !important;
  color: #0f172a !important;
}

body[data-theme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(8px) !important;
}

body[data-theme="light"] .auth-card,
body[data-theme="light"] .modal-card,
body[data-theme="light"] .trail-header,
body[data-theme="light"] .learn-header,
body[data-theme="light"] .train-header,
body[data-theme="light"] .test-header,
body[data-theme="light"] .learn-card,
body[data-theme="light"] .vocal-rank-card,
body[data-theme="light"] .category-card,
body[data-theme="light"] .diff-option-card,
body[data-theme="light"] .unit-btn,
body[data-theme="light"] .consonant-card-big,
body[data-theme="light"] .settings-section,
body[data-theme="light"] .patient-card,
body[data-theme="light"] .strophe-card {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08) !important;
}

/* Forçar cor escura em todos os títulos, parágrafos, spans e labels no Tema Claro */
body[data-theme="light"] h1,
body[data-theme="light"] h2,
body[data-theme="light"] h3,
body[data-theme="light"] h4,
body[data-theme="light"] h5,
body[data-theme="light"] h6,
body[data-theme="light"] p,
body[data-theme="light"] span:not(.btn-primary *):not(.badge-success *):not(.trail-difficulty-badge),
body[data-theme="light"] label,
body[data-theme="light"] div:not(.btn-primary *),
body[data-theme="light"] .modal-title,
body[data-theme="light"] .modal-subtitle,
body[data-theme="light"] .unit-text,
body[data-theme="light"] .cat-name,
body[data-theme="light"] .diff-name,
body[data-theme="light"] .consonant-letter-large,
body[data-theme="light"] .train-target-display,
body[data-theme="light"] .learn-phoneme-display,
body[data-theme="light"] .logo-title {
  color: #0f172a !important;
}

body[data-theme="light"] .modal-subtitle,
body[data-theme="light"] .diff-desc,
body[data-theme="light"] .cat-count,
body[data-theme="light"] .auth-subtitle,
body[data-theme="light"] .learn-label,
body[data-theme="light"] .vu-label {
  color: #475569 !important;
}

body[data-theme="light"] input,
body[data-theme="light"] select {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

body[data-theme="light"] .btn-secondary {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

body[data-theme="light"] .theme-opt-btn {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

body[data-theme="light"] .profile-opt-card {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

/* 2. WINDOWS CLÁSSICO / SLATE */
body[data-theme="windows"] {
  --c-bg: #1e293b;
  --c-surface: #334155;
  --c-surface-glass: rgba(51, 65, 85, 0.9);
  --c-text: #f8fafc;
  --c-muted: #94a3b8;
  --c-border: #475569;
  --c-primary: #2563eb;
  background: #0f172a;
  color: #f8fafc;
}

body[data-theme="windows"] .screen {
  background: #1e293b;
  color: #f8fafc;
}

body[data-theme="windows"] .auth-card,
body[data-theme="windows"] .modal-card,
body[data-theme="windows"] .trail-header,
body[data-theme="windows"] .learn-header,
body[data-theme="windows"] .train-header,
body[data-theme="windows"] .vocal-rank-card {
  background: #334155 !important;
  border-color: #475569 !important;
}

/* 3. ALTO CONTRASTE */
body[data-theme="high-contrast"] {
  --c-bg: #000000;
  --c-surface: #000000;
  --c-surface-glass: #000000;
  --c-text: #ffff00;
  --c-muted: #ffffff;
  --c-border: #ffff00;
  --c-primary: #ffff00;
  background: #000000;
  color: #ffff00;
}

body[data-theme="high-contrast"] .screen,
body[data-theme="high-contrast"] .modal-card,
body[data-theme="high-contrast"] .auth-card,
body[data-theme="high-contrast"] .trail-header,
body[data-theme="high-contrast"] .learn-card,
body[data-theme="high-contrast"] .vocal-rank-card {
  background: #000000 !important;
  border: 3px solid #ffff00 !important;
  color: #ffff00 !important;
}

body[data-theme="high-contrast"] h1,
body[data-theme="high-contrast"] h2,
body[data-theme="high-contrast"] h3,
body[data-theme="high-contrast"] h4,
body[data-theme="high-contrast"] span,
body[data-theme="high-contrast"] p,
body[data-theme="high-contrast"] label,
body[data-theme="high-contrast"] button,
body[data-theme="high-contrast"] .consonant-letter-large {
  color: #ffff00 !important;
}

body[data-theme="high-contrast"] button {
  border: 2px solid #ffff00 !important;
}


/* ═══════════════════════════════════════════════════
   AJUSTES EXCLUSIVOS PARA TELAS DE CELULAR (RESPONSIVIDADE)
   ═══════════════════════════════════════════════════ */
@media (max-width: 600px) {

  /* Telas e Containers Gerais */
  .auth-card {
    padding: 20px 15px;
    width: 92%;
  }

  .auth-title {
    font-size: 1.8rem;
  }

  /* Seção de Treino e Layout Principal */
  .train-main-grid {
    display: flex;
    flex-direction: column;
    /* Joga os dados para baixo da área visual */
    gap: 15px;
    padding: 10px;
  }

  /* Componentes de Feedback e Círculo do Alvo */
  .target-feedback-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px 16px 65px;
    margin: 10px auto;
    max-width: 320px;
    width: 100%;
    border-radius: var(--radius-xl);
    background: var(--c-surface-glass);
    border: 1px solid var(--c-border);
    box-shadow: var(--shadow-md);
  }

  .train-target-display,
  .test-target-big {
    font-size: 4rem !important;
    /* Diminui a letra gigante do fonema central */
  }

  .kid-mascot {
    font-size: 3.5rem !important;
  }

  /* Grade de VU Meters Técnicos (F1, F2, Pitch, Volume) */
  .vu-meters-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    /* Força 2x2 em vez de 4 em linha ou quebrado */
    gap: 10px;
  }

  .vu-dial-container {
    transform: scale(0.9);
    /* Ajusta o tamanho dos ponteiros de arco */
  }

  /* Painel Aprendizado (Mouth, Libras, Info) */
  .learn-info-grid {
    display: flex;
    flex-direction: column;
    /* Coloca as caixas de Libras e Boca em lista vertical */
    gap: 12px;
  }

  .learn-phoneme-display {
    font-size: 3.5rem;
  }

  /* Rodapés, Botões e Status */
  .train-btn-row {
    flex-direction: column;
    /* Botões empilhados */
    gap: 8px;
    width: 100%;
  }

  .btn-primary.large,
  .auth-btn {
    padding: 12px 16px;
    font-size: 1rem;
  }

  .coach-suggestion {
    font-size: 0.85rem;
    padding: 10px;
    margin: 5px 0;
  }
}


/* ── Layout Compacto Otimizado para Telas de Treino / Teste em Celular ── */
.train-main-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  margin-bottom: 6px !important;
}

/* Peak Hold LED no Score VU Meter */
.vu-segment.peak-hold {
  background: #facc15 !important;
  box-shadow: 0 0 8px #facc15 !important;
}

/* ── Mobile Layout Fine-Tuning: Header em linha única & LEDs de Precisão ── */
@media (max-width: 768px) {
  .train-header,
  .test-header,
  .learn-header,
  .trail-header {
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 6px 10px !important;
    gap: 6px !important;
  }

  .train-header-right {
    width: auto !important;
    margin-top: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .feedback-section {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px !important;
    width: 100% !important;
  }

  /* Caixa do A reduzida no celular */
  .target-feedback-wrapper {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px !important;
    margin: 10px auto !important;
    width: 100% !important;
    max-width: 200px !important; /* Tamanho reduzido da caixa para compensar no celular */
    min-height: 120px !important;
    grid-column: auto !important;
    overflow: visible !important;
  }

  /* Barra de LEDs externa à esquerda (lado de fora) no Mobile */
  .score-vu-container {
    position: absolute !important;
    right: calc(100% + 16px) !important;
    left: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    grid-column: auto !important;
    grid-row: auto !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
  }

  .score-vu-meter {
    gap: 1.5px !important;
    padding: 2px !important;
  }

  .vu-segment {
    width: 12px !important;
    height: 3px !important;
  }

  .score-vu-label {
    display: none !important;
  }

  /* Letra A com tamanho ajustado para a caixa menor do celular */
  .train-target-display,
  .test-target-big {
    font-size: clamp(4.5rem, 16vw, 6rem) !important;
    line-height: 1 !important;
  }

  .coach-suggestion {
    grid-column: auto !important;
    margin-top: 4px !important;
    margin-bottom: 4px !important;
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
    line-height: 1.1 !important;
    width: 100% !important;
    min-height: auto !important;
  }
}

.biphasic-vu-container {
  position: absolute;
  right: calc(100% + 20px);
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 12px;
  z-index: 15;
}

.biphasic-vu-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.biphasic-vu-bar-wrapper {
  width: 14px;
  height: 140px;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.biphasic-vu-bar {
  width: 100%;
  height: 0%;
  transition: height 0.15s ease-out;
  border-radius: 6px;
}

.biphasic-vu-bar.cons-bar {
  background: linear-gradient(0deg, var(--c-accent) 0%, var(--c-accent2) 100%);
  box-shadow: 0 0 10px var(--c-accent);
}

.biphasic-vu-bar.vow-bar {
  background: linear-gradient(0deg, var(--c-primary) 0%, var(--c-primary2) 100%);
  box-shadow: 0 0 10px var(--c-primary);
}

.biphasic-vu-val {
  font-size: 0.65rem;
  font-weight: 800;
  color: white;
  margin-top: 2px;
}

.biphasic-vu-label {
  font-size: 0.55rem;
  font-weight: 800;
  color: var(--c-muted);
  letter-spacing: 0.05em;
}

/* Mobile Overrides para Biphasic Container */
@media (max-width: 768px) {
  .biphasic-vu-container {
    right: calc(100% + 8px) !important;
    top: 5px !important;
    transform: none !important;
    gap: 8px;
  }
  .biphasic-vu-bar-wrapper {
    height: 120px;
    width: 12px;
  }
  .biphasic-vu-val {
    font-size: 0.55rem;
  }
  .biphasic-vu-label {
    font-size: 0.5rem;
  }
}

.biphasic-vu-peak {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 10;
  transition: bottom 0.1s ease-out, opacity 0.3s ease;
  opacity: 0;
}

.biphasic-vu-peak.cons-peak {
  background: #facc15; /* Cor amarela do pico */
  box-shadow: 0 0 8px #facc15;
}

.biphasic-vu-peak.vow-peak {
  background: #38bdf8; /* Azul claro para vogal */
  box-shadow: 0 0 8px #38bdf8;
}

/* ═══════════════════════════════════════════════════ */
/* MÓDULO DE FRASES (SIMPLY PIANO STYLE) & RELATÓRIOS */
/* ═══════════════════════════════════════════════════ */
.phrase-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 900px;
  margin: 20px auto;
}

.phrase-level-card {
  background: var(--c-surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.phrase-level-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--c-primary);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 20px var(--c-primary-glow);
}

.phrase-level-icon {
  font-size: 3rem;
  line-height: 1;
}

.phrase-level-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.phrase-level-desc {
  font-size: 0.85rem;
  color: var(--c-muted);
}

/* Display Interativo de Sílabas ("Simply Piano" Style) */
.phrase-syllables-track {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  padding: 25px 20px;
  background: rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  margin: 20px 0;
  min-height: 140px;
}

.phrase-syllable-pill {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.25s ease;
  position: relative;
  user-select: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.syl-score-badge {
  font-size: 0.72rem;
  font-weight: 800;
  margin-top: 4px;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 8px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.9);
}

.phrase-syllable-pill.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #fbbf24;
  color: #ffffff;
  transform: scale(1.18);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.8), 0 0 40px rgba(217, 119, 6, 0.5);
  animation: pulseActiveSyllable 1.2s infinite alternate ease-in-out;
  z-index: 5;
}

@keyframes pulseActiveSyllable {
  0% { transform: scale(1.15); box-shadow: 0 0 15px rgba(245, 158, 11, 0.6); }
  100% { transform: scale(1.25); box-shadow: 0 0 30px rgba(251, 191, 36, 0.9), 0 0 50px rgba(245, 158, 11, 0.7); }
}

.phrase-syllable-pill.completed {
  background: linear-gradient(135deg, #15803d, #22c55e) !important;
  border-color: #86efac !important;
  color: #ffffff !important;
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.7), inset 0 0 10px rgba(255, 255, 255, 0.3) !important;
}

.phrase-syllable-pill.error-flash {
  animation: flashErrorSyllable 0.4s ease;
}

@keyframes flashErrorSyllable {
  0%, 100% { border-color: rgba(255, 255, 255, 0.12); }
  50% { border-color: #ef4444; background: rgba(239, 68, 68, 0.3); }
}

/* Painel de Feedback e Dicas em Tempo Real */
.phrase-feedback-card {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 30px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #38bdf8;
  text-align: center;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
}

/* ── MODO LEITURA CONTÍNUA (DITADO / ASR) ── */
.phrase-words-track {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  padding: 25px 20px;
  background: rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--radius-lg);
  margin: 20px 0;
  min-height: 140px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 0 30px rgba(168, 85, 247, 0.05);
}

.phrase-word-pill {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.65);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  user-select: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.phrase-word-pill.matched {
  background: linear-gradient(135deg, #15803d, #22c55e) !important;
  border-color: #86efac !important;
  color: #ffffff !important;
  transform: scale(1.06);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.7), inset 0 0 10px rgba(255, 255, 255, 0.3) !important;
}

.phrase-word-pill.active {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  border-color: #c084fc;
  color: #ffffff;
  transform: scale(1.12);
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.8);
  animation: pulseActiveWord 1.2s infinite alternate ease-in-out;
}

@keyframes pulseActiveWord {
  0% { transform: scale(1.08); box-shadow: 0 0 15px rgba(168, 85, 247, 0.6); }
  100% { transform: scale(1.16); box-shadow: 0 0 30px rgba(192, 132, 252, 0.9); }
}

.phrase-transcript-card {
  width: 100%;
  max-width: 600px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
}

.phrase-transcript-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #c084fc;
  font-weight: 700;
  margin-bottom: 8px;
}

.phrase-live-transcript {
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  color: #f8fafc;
  line-height: 1.4;
  min-height: 28px;
  font-style: italic;
}

/* Modal de Relatório de Atividades do Praticante */
.report-tabs-header {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.report-tab-btn {
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--c-border);
  color: var(--c-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.report-tab-btn.active {
  background: linear-gradient(135deg, var(--c-primary), var(--c-secondary));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 15px var(--c-primary-glow);
}

.student-report-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.student-report-stat-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.student-report-stat-val {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: #fbbf24;
  margin-top: 4px;
}

.student-report-stat-label {
  font-size: 0.78rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.weak-syllable-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.95rem;
}

/* ── MODO IMPRESSÃO DE LAUDO / RELATÓRIO CLÍNICO ── */
@media print {
  body * {
    visibility: hidden;
  }
  #modal-clinical-report, #modal-clinical-report * {
    visibility: visible;
  }
  #modal-clinical-report {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: #ffffff !important;
    color: #000000 !important;
  }
  .no-print {
    display: none !important;
  }
  .print-report-card {
    background: #ffffff !important;
    color: #000000 !important;
    border: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  #report-print-content {
    background: #ffffff !important;
    color: #000000 !important;
    border: none !important;
  }
}
