/* ===================================================================
   Meiword Voice Check (Interactive Speech & Pronunciation Practice)
   Editorial Premium UI, Zero Emoji, Responsive & Accessible
   =================================================================== */

:root {
  --vc-indigo: #4f46e5;
  --vc-indigo-dark: #3730a3;
  --vc-indigo-light: #eef2ff;
  --vc-forest: #1e1b4b;
  --vc-success: #059669;
  --vc-success-light: #ecfdf5;
  --vc-success-border: #a7f3d0;
  --vc-warning: #b45309;
  --vc-warning-light: #fffbeb;
  --vc-warning-border: #fde68a;
  --vc-danger: #e11d48;
  --vc-danger-light: #fff1f2;
  --vc-danger-border: #fecdd3;
  --vc-card-bg: #ffffff;
  --vc-border: #e2e8f0;
  --vc-ink: #0f172a;
  --vc-slate: #334155;
  --vc-muted: #64748b;
  --vc-surface: #f8fafc;
  --vc-radius-lg: 20px;
  --vc-radius-md: 12px;
  --vc-radius-sm: 8px;
  --vc-shadow-card: 0 10px 30px -4px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
}

.vc-card {
  background: var(--vc-card-bg);
  border: 1px solid var(--vc-border);
  border-radius: var(--vc-radius-lg);
  padding: 26px 24px;
  box-shadow: var(--vc-shadow-card);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--vc-ink);
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

/* Category & Preset Selector */
.vc-presets-nav {
  margin-bottom: 20px;
}

.vc-presets-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--vc-muted);
  margin-bottom: 8px;
  display: block;
}

.vc-presets-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.vc-presets-bar::-webkit-scrollbar {
  height: 4px;
}
.vc-presets-bar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.vc-preset-chip {
  background: var(--vc-surface);
  border: 1px solid var(--vc-border);
  color: var(--vc-slate);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.vc-preset-chip svg {
  width: 14px;
  height: 14px;
}

.vc-preset-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--vc-ink);
}

.vc-preset-chip.active {
  background: var(--vc-forest);
  border-color: var(--vc-forest);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(30, 27, 75, 0.15);
}

/* Custom Input Field */
.vc-custom-input-box {
  margin-bottom: 16px;
  display: none;
}
.vc-custom-input-box.open {
  display: block;
}

.vc-custom-input-box input {
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--vc-radius-md);
  border: 1.5px solid #cbd5e1;
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
  color: var(--vc-ink);
  transition: border-color 0.15s ease;
}

.vc-custom-input-box input:focus {
  outline: none;
  border-color: var(--vc-indigo);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Target Sentence Card */
.vc-target-box {
  background: #fcfcfd;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 20px;
  position: relative;
  transition: all 0.2s ease;
}

.vc-target-box.is-recording {
  border-color: #fda4af;
  background: #fffafa;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1);
}

.vc-target-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.vc-target-badge {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--vc-indigo);
  background: var(--vc-indigo-light);
  padding: 3px 8px;
  border-radius: 6px;
}

.vc-target-length {
  font-size: 0.74rem;
  color: var(--vc-muted);
  font-weight: 500;
}

.vc-target-text {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--vc-forest);
  margin: 0;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.vc-target-meaning {
  margin: 8px 0 0;
  font-size: 0.92rem;
  color: var(--vc-muted);
  line-height: 1.45;
}

/* Controls Area */
.vc-controls-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.vc-audio-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--vc-radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.16s ease;
  user-select: none;
}

.vc-btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.vc-btn-secondary {
  background: #ffffff;
  color: var(--vc-slate);
  border: 1px solid var(--vc-border);
}

.vc-btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--vc-ink);
}

.vc-btn-speed {
  padding: 11px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--vc-muted);
  min-width: 90px;
}

/* Record Button */
.vc-btn-record {
  background: var(--vc-indigo);
  color: #ffffff;
  font-weight: 700;
  padding: 12px 24px;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.28);
}

.vc-btn-record:hover {
  background: var(--vc-indigo-dark);
}

.vc-btn-record.is-recording {
  background: var(--vc-danger);
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.35);
  animation: vc-pulse 1.3s infinite ease-in-out;
}

@keyframes vc-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Equalizer Bars when Recording */
.vc-equalizer {
  display: none;
  align-items: center;
  gap: 3px;
  height: 20px;
  margin-right: 6px;
}

.vc-equalizer.active {
  display: inline-flex;
}

.vc-eq-bar {
  width: 3px;
  background: #ffffff;
  border-radius: 999px;
  animation: vc-eq 0.9s ease-in-out infinite;
}

.vc-eq-bar:nth-child(1) { height: 6px; animation-delay: 0.1s; }
.vc-eq-bar:nth-child(2) { height: 16px; animation-delay: 0.25s; }
.vc-eq-bar:nth-child(3) { height: 20px; animation-delay: 0.4s; }
.vc-eq-bar:nth-child(4) { height: 12px; animation-delay: 0.15s; }
.vc-eq-bar:nth-child(5) { height: 8px; animation-delay: 0.3s; }

@keyframes vc-eq {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

/* Live Recording Status Bar */
.vc-status-bar {
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--vc-surface);
  border: 1px solid var(--vc-border);
  font-size: 0.84rem;
  color: var(--vc-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.vc-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.vc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
}

.vc-dot.recording {
  background: var(--vc-danger);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.25);
  animation: vc-blink 1s infinite;
}

@keyframes vc-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Evaluation & Result Panel */
.vc-result-panel {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--vc-border);
  animation: vc-fade 0.28s ease;
}

@keyframes vc-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.vc-score-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--vc-surface);
  border: 1px solid var(--vc-border);
  border-radius: var(--vc-radius-md);
  padding: 16px 20px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.vc-score-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.vc-score-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  font-family: 'Bricolage Grotesque', sans-serif;
  flex-shrink: 0;
}

.vc-score-circle.high {
  background: var(--vc-success-light);
  color: var(--vc-success);
  border: 2px solid var(--vc-success-border);
}

.vc-score-circle.medium {
  background: var(--vc-warning-light);
  color: var(--vc-warning);
  border: 2px solid var(--vc-warning-border);
}

.vc-score-circle.low {
  background: var(--vc-danger-light);
  color: var(--vc-danger);
  border: 2px solid var(--vc-danger-border);
}

.vc-score-details h4 {
  margin: 0;
  font-size: 0.98rem;
  color: var(--vc-forest);
}

.vc-score-details p {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--vc-muted);
}

.vc-score-actions {
  display: flex;
  gap: 8px;
}

/* Word Pills & Legend */
.vc-breakdown-wrap {
  margin-bottom: 18px;
}

.vc-breakdown-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.75rem;
  color: var(--vc-muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.vc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.vc-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.vc-legend-dot.match { background: var(--vc-success); }
.vc-legend-dot.close { background: var(--vc-warning); }
.vc-legend-dot.missed { background: var(--vc-danger); }

.vc-words-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vc-word-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--vc-radius-sm);
  font-size: 0.96rem;
  font-weight: 600;
  background: #ffffff;
  border: 1.5px solid var(--vc-border);
  transition: transform 0.15s ease;
}

.vc-word-pill.match {
  background: var(--vc-success-light);
  color: #065f46;
  border-color: var(--vc-success-border);
}

.vc-word-pill.close {
  background: var(--vc-warning-light);
  color: #92400e;
  border-color: var(--vc-warning-border);
}

.vc-word-pill.missed {
  background: var(--vc-danger-light);
  color: #9f1239;
  border-color: var(--vc-danger-border);
}

.vc-pill-svg {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vc-pill-svg svg {
  width: 12px;
  height: 12px;
}

/* Transcribed Speech Box */
.vc-transcript-box {
  background: #f8fafc;
  border-left: 3px solid var(--vc-indigo);
  border-radius: 0 10px 10px 0;
  padding: 12px 16px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.vc-transcript-header {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--vc-muted);
  margin-bottom: 4px;
}

.vc-transcript-content {
  color: var(--vc-slate);
  font-style: italic;
  font-size: 0.94rem;
}

/* Guidance Advice Box */
.vc-advice-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--vc-radius-md);
  font-size: 0.88rem;
  line-height: 1.55;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.vc-advice-box.medium {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.vc-advice-box.low {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.vc-advice-box svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Unsupported Browser Notice */
.vc-fallback-box {
  padding: 16px 18px;
  border-radius: var(--vc-radius-md);
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.88rem;
  line-height: 1.55;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
}

.vc-fallback-box svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}
