:root {
  --bg: #fff8f2;
  --card: #ffffff;
  --ink: #071025;
  --muted: #64728a;
  --line: #dfe6ef;
  --line-strong: #cad4e1;
  --blue: #8fb1ff;
  --blue-2: #6ba9ee;
  --pink: #dc8fc8;
  --champagne: #d9b36c;
  --champagne-soft: #f4efe3;
  --black: #050505;
  --panel: #f7faff;
  --shadow: 0 18px 52px rgba(8, 18, 38, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 15%, rgba(217, 179, 108, 0.17), transparent 28rem),
    radial-gradient(circle at 90% 0%, rgba(143, 177, 255, 0.18), transparent 22rem),
    var(--bg);
}
button, select, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
.page-shell {
  width: min(100%, 860px);
  margin: 24px auto 56px;
  padding: 0 18px;
}
.app-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 26px;
}
.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 28px;
}
.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
h1 {
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1;
  margin: 0;
  letter-spacing: -0.05em;
}
.hero p {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}
.badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #9eddeb;
  color: #15738b;
  background: #e8fbff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.feedback {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(8, 18, 38, 0.05);
  font-weight: 750;
  white-space: nowrap;
}
.form-section { margin: 20px 0; }
.field-label {
  display: block;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 10px;
}
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 136px;
  border: 2px dashed var(--line-strong);
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(240, 250, 255, 0.55), rgba(255,255,255, 0.9));
  text-align: center;
  padding: 20px;
  transition: 0.18s ease;
}
.drop-zone:hover, .drop-zone.is-dragging {
  border-color: #9db8ee;
  background: #f7fbff;
}
.drop-zone input { display: none; }
.drop-icon {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #1e2b45;
  font-size: 24px;
  background: white;
}
.drop-zone small { color: var(--muted); }
.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}
.field-block select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: #0a1124;
  padding: 0 12px;
}
.lyrics-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.lyrics-header span {
  color: var(--muted);
  font-size: 13px;
}
#lyricsInput, #transcriptOutput {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 14px;
  color: #0d1730;
  background: #fff;
  line-height: 1.45;
}
#transcriptOutput { min-height: 300px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 20px 0;
}
.primary, .secondary {
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  font-weight: 850;
  box-shadow: 0 12px 24px rgba(99, 132, 220, 0.2);
}
.primary {
  color: #fff;
  background: linear-gradient(135deg, #8eb1ff, #a4b6ff);
}
.secondary {
  color: #18264a;
  background: #eaf1ff;
}
.status-panel {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  margin: 20px 0;
}
.status-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}
.status-line strong { color: var(--ink); }
.progress-track {
  height: 6px;
  background: #edf2f9;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}
#progressFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #90b4ff, #d895c9);
  transition: width 0.2s ease;
}
.preview-card {
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.preview-top {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  padding: 14px 16px 10px;
  font-size: 13px;
}
.preview-top strong { color: var(--ink); font-size: 15px; }
.subtitle-stage {
  min-height: 230px;
  margin: 0 16px;
  border-radius: 10px 10px 0 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(145deg, rgba(19, 65, 101, 0.95), rgba(34, 30, 86, 0.96) 45%, rgba(80, 32, 71, 0.94)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 3px);
}
.subtitle-box {
  width: min(88%, 650px);
  min-height: 100px;
  border-radius: 12px;
  padding: 22px 30px;
  text-align: center;
  background: rgba(11, 15, 27, 0.42);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 50px rgba(0,0,0,0.24);
}
.prev-line, .next-line {
  min-height: 18px;
  color: rgba(244,239,227,0.43);
  font-weight: 700;
  font-size: 14px;
}
.active-line {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.28em;
  color: var(--champagne-soft);
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.04em;
  text-shadow:
    0 2px 0 var(--black),
    0 0 18px rgba(5,5,5,0.75);
}
.active-word {
  color: var(--champagne);
  text-shadow:
    0 2px 0 var(--black),
    0 0 24px rgba(217,179,108,0.72),
    0 0 40px rgba(143,177,255,0.32);
}
.player-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 0 16px 16px;
  padding: 12px 14px;
  background: #4a4a4a;
  color: #fff;
}
.player-bar button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: white;
  font-weight: 900;
}
#seekBar { width: 100%; accent-color: #77c9f2; }
#timeDisplay { font-size: 13px; white-space: nowrap; }
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: white;
}
.panel-head span { color: var(--muted); font-size: 12px; }
.cue-list {
  max-height: 340px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px;
}
.cue-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  color: #1c2944;
  font-size: 13px;
  user-select: none;
}
.cue-row:hover { background: #edf4ff; }
.cue-row.is-active { background: #fff1ce; }
.cue-time { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted); }
.export-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.download {
  border: 0;
  color: #fff;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 850;
}
.download.pink { background: linear-gradient(135deg, #b885f4, #e092bd); }
.download.blue { background: linear-gradient(135deg, #83cae5, #9a99f4); }
.download.grey { background: #8793a8; }
@media (max-width: 720px) {
  .page-shell { margin-top: 12px; padding: 0 10px; }
  .app-card { padding: 18px; }
  .hero, .grid-two, .results-grid { grid-template-columns: 1fr; display: grid; }
  .hero { gap: 12px; }
  .feedback { justify-self: start; }
  .subtitle-stage { margin: 0; }
  .player-bar { margin-left: 0; margin-right: 0; }
  .subtitle-box { width: 94%; padding: 18px; }
}
.status-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}
.status-meta span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.progress-hint {
  margin-top: 10px;
  color: #40506c;
  font-size: 12px;
  line-height: 1.35;
}
@media (max-width: 720px) {
  .status-meta { grid-template-columns: 1fr; }
}
