:root {
  --fg: #ffffff;
  --muted: rgba(255,255,255,0.7);
  --accent: #7cc7ff;
  --accent-2: #9b8cff;
  --glass: rgba(255, 255, 255, 0.10);
  --glass-strong: rgba(255, 255, 255, 0.10);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,0.3);
}

* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--fg);
  background: linear-gradient(135deg, #111827 0%, #000000 50%, #111827 100%);
}

#app { max-width: 900px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; height: 100%; padding-top: 16px; }

.setup-screen { min-height: 100vh; display: grid; place-items: center; }
.center-wrap { width: 100%; max-width: 460px; }
.setup-card { padding: 16px; }
.setup-head { text-align: center; margin-bottom: 10px; }
.setup-head h1 { margin: 8px 0 6px; font-size: 24px; }
.setup-head p { margin: 0; color: var(--muted); font-size: 13px; }
.setup-body { display: grid; gap: 10px; }
.setup-body textarea { height: 180px; resize: vertical; }
.setup-body button.primary { width: 100%; }
.search-grid { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 8px; }

/* Visible OR separator between manual paste and search */
.or-separator {
  position: relative;
  text-align: center;
  color: var(--muted);
  margin: 6px 0 2px;
}
.or-separator::before,
.or-separator::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: rgba(255,255,255,0.25);
}
.or-separator::before { left: 0; }
.or-separator::after { right: 0; }
.or-separator span { background: transparent; padding: 0 8px; }

.practice-screen { display: flex; flex-direction: column; height: 100%; }
.practice-screen.hidden { display: none; }
.hidden { display: none !important; }
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.topbar h2 { text-align: center; margin: 0; font-size: 18px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18); color: var(--fg); justify-self: start; }
.chip.text-only { background: transparent; border: none; padding: 8px 0; }
.chip:last-child { justify-self: end; }
.icon { opacity: 0.9; }

.progress { margin-top: 2px; }
.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.bar { height: 6px; background: rgba(255,255,255,0.20); border-radius: 999px; overflow: hidden; }
#bar-inner { height: 100%; width: 0%; background: #ffffff; box-shadow: 0 0 12px rgba(255,255,255,0.35) inset; }

.glass {
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px) saturate(120%);
}

.controls { padding: 12px; }
input, textarea {
  width: 100%;
  color: var(--fg);
  background: var(--glass-strong);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 12px;
  padding: 12px 12px;
  outline: none;
  font-family: inherit;
}
input::placeholder, textarea::placeholder { color: rgba(255,255,255,0.5); }

button {
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
}
button.primary {
  background: rgba(255,255,255,0.20);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.20);
}
button.primary:hover {
  background: rgba(255,255,255,0.30);
}
button.secondary {
  background: rgba(255,255,255,0.12);
  color: var(--fg);
  border: 1px solid rgba(255,255,255,0.20);
}
button:disabled { opacity: 0.5; cursor: not-allowed; }

.viewer { padding: 12px; display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; position: relative; }
.lyrics-view {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  border-radius: 12px;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.lyrics-view::before, .lyrics-view::after {
  content: "";
  position: sticky;
  left: 0; right: 0;
  height: 36px;
  pointer-events: none;
  z-index: 1;
}
.lyrics-view::before {
  top: 0;
  }
.lyrics-view::after {
  bottom: 0;
  }
.lyrics-line {
  line-height: 1.6;
  padding: 6px 6px;
  color: rgba(255,255,255,0.70);
  margin-bottom: 4px;
  transition: all 0.3s ease;
}
.lyrics-line.current {
  color: #ffffff;
  font-weight: 700;
}


#bar-inner.completed { 
  background: #22c55e; 
  box-shadow: 0 0 12px rgba(34,197,94,0.35) inset; 
}

.controls { display: grid; gap: 10px; position: sticky; bottom: 0; background: transparent; backdrop-filter: none; padding: 10px 0; border-radius: 12px; border: none; }

.app-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 0 20px; }
.app-footer.hidden { display: none; }
.app-footer a { color: var(--accent); text-decoration: none; }

@media (min-width: 720px) {
  .lyrics-view { max-height: 58vh; }
}

/* Hide scrollbars in lyrics viewer for a cleaner, app-like feel */
.lyrics-view { scrollbar-width: none; }
.lyrics-view::-webkit-scrollbar { display: none; }


