:root {
  --bg-base: #192130;
  --bg-surface: rgba(30, 40, 58, 0.68);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-hover: rgba(255, 255, 255, 0.11);
  --border-subtle: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.20);
  --text-primary: #f1f5f9;
  --text-secondary: #a8b7cc;
  --text-muted: #72839b;
  --accent: #60c5f8;
  --accent-dim: rgba(96, 197, 248, 0.18);
  --accent-border: rgba(96, 197, 248, 0.44);
  --danger: #fb7185;
  --danger-bg: rgba(251, 113, 133, 0.16);
  --success: #34d399;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg-base);
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden {
  display: none !important;
}

/* Soft twilight slate-blue liquid-glass ambient backdrop */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(70% 52% at 50% 0%, rgba(96, 197, 248, 0.16) 0%, transparent 72%),
    radial-gradient(50% 45% at 85% 92%, rgba(129, 140, 248, 0.12) 0%, transparent 76%),
    linear-gradient(180deg, #1f293d 0%, #192130 55%, #161d2b 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font-family: inherit;
  color: inherit;
}

/* Header Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 58px;
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  background: rgba(25, 33, 48, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
  transition: opacity 0.15s ease;
}

.brand:hover {
  opacity: 0.88;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.nav-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.09);
}

.nav-link.active svg {
  color: var(--accent);
}

.nav-divider {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: var(--border-subtle);
}

.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-icon-btn:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
}

/* Origin Warning Banner */
.origin-banner {
  max-width: 1232px;
  margin: 12px auto 0;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: #fde68a;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.origin-banner-btn {
  padding: 5px 12px;
  border-radius: 7px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fef3c7;
  font-weight: 600;
  white-space: nowrap;
}

/* Shared Liquid-Glass Buttons & Chips */
.glass-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.03) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 4px 12px rgba(6, 10, 20, 0.22);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  color: var(--text-primary);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.14s ease, box-shadow 0.16s ease;
}

.glass-btn:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.glass-btn:active {
  transform: translateY(0) scale(0.98);
}

.glass-btn.primary {
  background: linear-gradient(180deg, rgba(94, 194, 247, 0.24) 0%, rgba(94, 194, 247, 0.10) 100%);
  border-color: rgba(125, 211, 252, 0.42);
  box-shadow: inset 0 1px 0 rgba(186, 230, 253, 0.28), 0 6px 16px rgba(14, 116, 144, 0.20);
  color: #f0f9ff;
}

.glass-btn.primary:hover {
  background: linear-gradient(180deg, rgba(94, 194, 247, 0.32) 0%, rgba(94, 194, 247, 0.15) 100%);
  border-color: rgba(125, 211, 252, 0.62);
}

.glass-btn.subtle {
  color: var(--text-secondary);
}

.glass-btn.subtle:hover {
  color: var(--text-primary);
}

.text-btn {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

/* Browse Pages Container */
.page-view {
  padding: 24px 0 52px;
}

.page-view.practice-page {
  padding: 14px 0 20px;
}

.page-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

.toolbar-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 0.81rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04));
}

.filter-chip.active {
  background: linear-gradient(180deg, rgba(94, 194, 247, 0.24), rgba(94, 194, 247, 0.10));
  border-color: rgba(125, 211, 252, 0.45);
  box-shadow: inset 0 1px 0 rgba(186, 230, 253, 0.25);
  color: #f0f9ff;
}

.toolbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 10px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  min-width: 240px;
  color: var(--text-secondary);
}

.toolbar-search input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.84rem;
  color: var(--text-primary);
}

.toolbar-search input::placeholder {
  color: var(--text-muted);
}

/* Ranked 4-Column Track Grid */
.ranked-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px 20px;
}

.track-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  group: true;
  cursor: pointer;
}

.track-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #131926;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.track-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.28s ease;
}

.track-card:hover .track-thumb {
  transform: scale(1.03);
}

.thumb-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(9, 13, 21, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e2e8f0;
  text-transform: uppercase;
}

.thumb-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(9, 13, 21, 0.80);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: #f8fafc;
}

.thumb-hover-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(9, 13, 21, 0.34);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.track-card:hover .thumb-hover-play {
  opacity: 1;
}

.thumb-play-circle {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.track-meta-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.track-rank {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  color: #475569;
  letter-spacing: -0.04em;
  flex-shrink: 0;
  padding-top: 2px;
}

.track-info {
  min-width: 0;
  flex: 1;
}

.track-title {
  margin: 0;
  font-size: 0.91rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  margin: 3px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-icon-action {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.card-icon-action:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.card-icon-action.active {
  color: #f43f5e;
}

.card-yt-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.card-yt-actions .glass-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.77rem;
}

/* Browse Page (/browse) & Menu Hub (/menu) */
.browse-hero-panel,
.menu-summary-card {
  padding: 20px 24px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(34, 45, 65, 0.72) 0%, rgba(25, 34, 50, 0.68) 100%);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 32px rgba(8, 12, 22, 0.25);
  margin-bottom: 24px;
}

.browse-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.browse-hero-top h1,
.menu-card-copy h1 {
  margin: 0 0 4px;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.browse-hero-top p,
.menu-card-copy p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.browse-hint-pill {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 0.76rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.browse-search-form {
  display: flex;
  gap: 10px;
}

.browse-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 44px;
  border-radius: 11px;
  background: rgba(13, 18, 28, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: var(--text-secondary);
}

.browse-input-wrap:focus-within {
  border-color: var(--accent-border);
}

.browse-input-wrap input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.91rem;
  color: var(--text-primary);
}

.browse-shelves {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.menu-summary-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.menu-stats-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.menu-stat-pill {
  display: flex;
  flex-direction: column;
  padding: 6px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  min-width: 72px;
}

.menu-stat-pill strong {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-primary);
}

/* Tap-to-Sync Studio */
.studio-panel {
  margin-top: 28px;
  padding: 24px;
  border-radius: 16px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
}

.studio-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.studio-header h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.studio-header p {
  margin: 0;
  font-size: 0.83rem;
  color: var(--text-secondary);
}

.studio-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 24px;
}

.studio-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.field-group input,
.field-group textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(8, 12, 20, 0.6);
  color: var(--text-primary);
  outline: none;
  font-size: 0.86rem;
}

.field-group textarea {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  resize: vertical;
}

.field-group input:focus,
.field-group textarea:focus {
  border-color: var(--accent-border);
}

.inline-field {
  display: flex;
  gap: 8px;
}

.inline-field input {
  flex: 1;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.studio-actions {
  display: flex;
  gap: 10px;
}

.studio-feedback {
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 0.82rem;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: #e0f2fe;
}

.studio-tap-box {
  padding: 16px;
  border-radius: 12px;
  background: rgba(8, 12, 20, 0.5);
  border: 1px solid var(--border-subtle);
}

.studio-tap-box h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.studio-tap-help {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.studio-preview-player {
  aspect-ratio: 16 / 9;
  border-radius: 9px;
  overflow: hidden;
  background: #000;
  margin-bottom: 12px;
}

.studio-preview-player > div {
  width: 100%;
  height: 100%;
}

.tap-line-preview {
  display: block;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.83rem;
  color: var(--text-primary);
  min-height: 34px;
}

.tap-btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ======================================================
   PRACTICE VIEW (/play/<youtubeId>) — Ultra-Clean Minimal
   ====================================================== */
.practice-shell {
  max-width: 960px;
  width: 92vw;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.player-stage {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.video-frame {
  position: relative;
  width: min(370px, 82vw, calc(24vh * 16 / 9));
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #0d121b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 42px rgba(5, 10, 20, 0.45);
}

#yt-player-mount,
#yt-player-mount iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.player-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 21, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Metrics Left + Clean Square-Outline Transport Right */
.telemetry-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.metrics-strip {
  display: flex;
  align-items: center;
  gap: 24px;
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-label {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.transport-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.025) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 20px rgba(8, 12, 22, 0.24);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.outline-icon-btn {
  width: 36px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.13s ease;
}

.outline-icon-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.10);
}

.outline-icon-btn:active {
  transform: scale(0.94);
}

#btn-play-pause {
  background: rgba(96, 197, 248, 0.14);
  border-color: rgba(125, 211, 252, 0.25);
  color: #e0f2fe;
}

#btn-play-pause:hover {
  background: rgba(96, 197, 248, 0.24);
  border-color: rgba(125, 211, 252, 0.45);
}

#btn-skip-gap {
  width: 38px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.03) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 4px 12px rgba(8, 12, 22, 0.25);
}

#btn-skip-gap:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-color: rgba(125, 211, 252, 0.4);
}

.outline-icon-btn.favorited {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(251, 113, 133, 0.28);
}

/* Razor-Thin Timeline Seek Bar (does NOT shout for attention) */
.timeline-section {
  width: 100%;
  margin-bottom: 18px;
}

.timeline-track-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  height: 12px;
}

.hairline-seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--seek-pct, 0%),
    rgba(255, 255, 255, 0.10) var(--seek-pct, 0%),
    rgba(255, 255, 255, 0.10) 100%
  );
  transition: height 0.15s ease;
}

.timeline-track-wrap:hover .hairline-seek {
  height: 3px;
}

.hairline-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: #bae6fd;
  border: 0;
  opacity: 0;
  transition: width 0.12s ease, height 0.12s ease, opacity 0.12s ease;
}

.timeline-track-wrap:hover .hairline-seek::-webkit-slider-thumb {
  width: 8px;
  height: 8px;
  opacity: 0.95;
}

.hairline-seek::-moz-range-thumb {
  width: 0;
  height: 0;
  border: 0;
  border-radius: 50%;
  background: #bae6fd;
  opacity: 0;
}

.timeline-track-wrap:hover .hairline-seek::-moz-range-thumb {
  width: 8px;
  height: 8px;
  opacity: 0.95;
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.track-caption {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.time-display {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Wide Open Borderless Typing Stage */
.typing-stage {
  position: relative;
  width: 100%;
  min-height: 205px;
  padding: 20px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  outline: none;
  cursor: text;
}

.stage-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: filter 0.35s ease, opacity 0.35s ease;
}

.stage-content.is-blurred {
  filter: blur(8px);
  opacity: 0.42;
  pointer-events: none;
  user-select: none;
}

.start-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: auto;
}

.typing-stage.font-sm .lyric-line {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
}

.typing-stage.font-md .lyric-line {
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
}

.typing-stage.font-lg .lyric-line {
  font-size: clamp(1.7rem, 3vw, 2.25rem);
}

.stage-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 130px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.quiet-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.gap-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 150px;
  text-align: center;
}

.gap-line-preview {
  font-size: clamp(1.3rem, 2.3vw, 1.7rem);
  font-weight: 600;
  color: rgba(226, 232, 240, 0.25);
  filter: blur(0.4px);
}

.music-wave {
  width: 200px;
  height: 42px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
}

.music-wave svg {
  width: 200px;
  height: 42px;
  overflow: hidden;
}

.wave-track.wave-1 {
  animation: waveSlideLeft 2.4s linear infinite;
}

.wave-track.wave-2 {
  animation: waveSlideRight 3.2s linear infinite;
}

@keyframes waveSlideLeft {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-180px);
  }
}

@keyframes waveSlideRight {
  from {
    transform: translateX(-180px);
  }
  to {
    transform: translateX(0);
  }
}

.gap-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gap-countdown {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.active-typing-state {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 140px;
  text-align: center;
}

.lyric-line {
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.01em;
  max-width: 820px;
  word-break: break-word;
}

.char {
  position: relative;
  color: rgba(226, 232, 240, 0.36);
  transition: color 0.08s ease;
}

.char.typed {
  color: #f8fafc;
}

.char.current {
  color: rgba(226, 232, 240, 0.78);
}

.char.current::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
}

.char.error {
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: 3px;
}

.next-lyric-line {
  font-size: 0.98rem;
  font-weight: 500;
  color: rgba(148, 163, 184, 0.42);
  min-height: 1.4em;
}

.center-play-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(148, 163, 184, 0.07) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 16px 36px rgba(5, 10, 20, 0.48);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.center-play-btn:hover {
  transform: scale(1.07);
  border-color: rgba(125, 211, 252, 0.55);
  background: linear-gradient(180deg, rgba(94, 194, 247, 0.26) 0%, rgba(94, 194, 247, 0.12) 100%);
}

.center-play-btn:active {
  transform: scale(0.96);
}

.session-complete {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.session-complete h3 {
  margin: 0;
  font-size: 1.35rem;
}

.session-complete p {
  margin: 0 0 6px;
  color: var(--text-secondary);
}

.stage-state,
.gap-action-row {
  position: relative;
  z-index: 5;
}

.hidden-type-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 16px;
  line-height: 1;
  color: transparent;
  caret-color: transparent;
  background: transparent;
  border: 0;
  outline: none;
  pointer-events: none;
  z-index: 2;
}

.typing-stage.input-active .hidden-type-input {
  pointer-events: auto;
}

.mobile-kbd-btn {
  display: none;
}

/* Empty State */
.empty-state {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

/* Apple-style Liquid Glass Settings & Help Sheets */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(11, 16, 26, 0.66);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-glass {
  width: min(444px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(32, 42, 62, 0.92) 0%, rgba(23, 31, 46, 0.94) 100%);
  backdrop-filter: blur(32px) saturate(165%);
  -webkit-backdrop-filter: blur(32px) saturate(165%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 28px 72px rgba(4, 8, 16, 0.58);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.modal-glass::-webkit-scrollbar {
  width: 4px;
}

.modal-glass::-webkit-scrollbar-track {
  background: transparent;
}

.modal-glass::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.modal-header h2 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.modal-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
}

.modal-body {
  padding: 12px 18px 15px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.settings-section-label {
  padding-left: 6px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.settings-card {
  border-radius: 14px;
  background: rgba(14, 20, 31, 0.44);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8.5px 14px;
}

.setting-row + .setting-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.setting-row strong {
  display: block;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-primary);
}

.setting-row small {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Understated Frosted Liquid Glass Switch */
.toggle-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.10);
  position: relative;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(241, 245, 249, 0.92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, background 0.18s ease;
}

.toggle-switch:checked {
  background: rgba(96, 197, 248, 0.42);
  border-color: rgba(125, 211, 252, 0.48);
}

.toggle-switch:checked::after {
  transform: translateX(16px);
  background: #ffffff;
}

.segmented {
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.segmented button {
  padding: 4px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.segmented button.active {
  background: rgba(96, 197, 248, 0.22);
  color: #f0f9ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.volume-modal-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-volume-range {
  -webkit-appearance: none;
  appearance: none;
  width: 118px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    rgba(125, 211, 252, 0.85) 0%,
    rgba(125, 211, 252, 0.85) var(--vol-pct, 85%),
    rgba(255, 255, 255, 0.14) var(--vol-pct, 85%),
    rgba(255, 255, 255, 0.14) 100%
  );
  outline: none;
  cursor: pointer;
}

.modal-volume-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.modal-volume-range::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.volume-modal-wrap span {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-secondary);
  min-width: 38px;
  text-align: right;
}

/* Unified Timing Offset Capsule */
.offset-stepper {
  display: inline-flex;
  align-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  overflow: hidden;
}

.offset-stepper button {
  border: none;
  background: transparent;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.offset-stepper button:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.offset-stepper span {
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 0.77rem;
  color: #e0f2fe;
  min-width: 48px;
  text-align: center;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.modal-footer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 2px;
}

.modal-footer-actions .glass-btn {
  white-space: nowrap;
  padding: 8px 12px;
  font-size: 0.79rem;
}

.help-body p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.shortcut-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 6px;
}

.shortcut-list > div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

kbd {
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-primary);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 0.84rem;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}

@media (max-width: 1120px) {
  .ranked-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px), (pointer: coarse) {
  .mobile-kbd-btn {
    display: inline-flex;
  }
}

@media (max-width: 760px) {
  .ranked-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .practice-shell {
    width: 94vw;
  }
  .video-frame {
    width: min(300px, 78vw);
    transition: width 0.2s ease;
  }
  .practice-page.keyboard-open .video-frame {
    width: min(200px, 52vw);
  }
  .practice-page.keyboard-open .player-stage {
    margin-bottom: 8px;
  }
  .telemetry-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .metrics-strip {
    justify-content: space-between;
    gap: 12px;
  }
  .transport-group {
    align-self: flex-end;
  }
  .typing-stage {
    min-height: 130px;
    padding: 14px 8px 10px;
  }
  .nav-link span {
    display: none;
  }
}

@media (max-width: 480px) {
  .ranked-grid {
    grid-template-columns: 1fr;
  }
  .browse-search-form {
    flex-direction: column;
  }
}
