/* Sing Any Song — Sunset Stage theme (warm dark, coral→amber→gold) */

:root {
  /* Warm, dark "stage at dusk" base */
  --bg-color: hsl(345, 24%, 7%);
  --sidebar-bg: hsl(345, 22%, 9%);
  --panel-bg: hsl(345, 20%, 11%);
  --panel-bg-soft: hsla(344, 20%, 15%, 0.5);
  --border-color: hsla(18, 35%, 42%, 0.22);
  --border-strong: hsla(18, 45%, 52%, 0.4);

  /* Sunset accent: coral → amber, with a gold highlight */
  --accent: hsl(5, 90%, 67%);                     /* coral/rose */
  --accent-2: hsl(32, 94%, 54%);                  /* amber */
  --accent-soft: hsla(5, 90%, 67%, 0.13);
  --accent-line: hsla(5, 90%, 67%, 0.36);
  --accent-grad: linear-gradient(120deg, hsl(350, 92%, 70%), hsl(32, 94%, 55%));
  --gold: hsl(43, 96%, 58%);                      /* highlight / secondary text */
  --green-glow: hsl(150, 62%, 50%);               /* "connected" state */

  --key-flat: hsl(199, 85%, 63%);  /* ♭ lowers the key (cool) */
  --key-sharp: hsl(14, 90%, 63%);  /* ♯ raises the key (warm) */

  --text-primary: hsl(36, 30%, 95%);
  --text-muted: hsl(28, 12%, 70%);
  --text-dark: hsl(20, 10%, 50%);

  --shadow-panel: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.28);
  --shadow-glow: 0 0 20px hsla(18, 92%, 60%, 0.35);
  --font-primary: 'Outfit', sans-serif;
  --transition-smooth: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Main Layout Grid */
.app-container {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.sidebar {
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border-color);
}

.logo-icon {
  font-size: 1.7rem;
}

.brand h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand h1 span.accent {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Search Section */
.search-section {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 48%;
}

.search-bar {
  display: flex;
  align-items: center;
  background-color: hsla(345, 12%, 5%, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 4px 6px;
  transition: var(--transition-smooth);
}

.search-bar:focus-within {
  border-color: var(--accent-line);
}

.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  padding: 9px 14px;
  font-size: 0.95rem;
  flex-grow: 1;
  font-family: var(--font-primary);
}

.search-bar input::placeholder {
  color: var(--text-dark);
  font-size: 0.85rem; /* keep the full "Song/artist/YouTube link" hint on one line */
}

.search-bar button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.search-bar button svg {
  width: 18px;
  height: 18px;
}

.search-bar button:hover {
  color: var(--accent);
}

/* Search results */
.results-container {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.results-container::-webkit-scrollbar,
.queue-container::-webkit-scrollbar,
.lyrics-container::-webkit-scrollbar {
  width: 6px;
}

.results-container::-webkit-scrollbar-thumb,
.queue-container::-webkit-scrollbar-thumb,
.lyrics-container::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border-radius: 10px;
}

.results-container::-webkit-scrollbar-track,
.queue-container::-webkit-scrollbar-track,
.lyrics-container::-webkit-scrollbar-track {
  background: transparent;
}

.empty-state {
  color: var(--text-dark);
  text-align: center;
  font-size: 0.9rem;
  margin: auto;
  padding: 20px;
  line-height: 1.4;
}

/* Video result item */
.video-item {
  display: flex;
  gap: 12px;
  padding: 8px;
  background-color: hsla(345, 10%, 20%, 0.12);
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.video-item:hover {
  background-color: hsla(345, 10%, 25%, 0.22);
  border-color: var(--border-strong);
}

.thumb-wrapper {
  position: relative;
  width: 110px;
  height: 62px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
}

.thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.video-item:hover .thumb-wrapper img {
  transform: scale(1.05);
}

.duration-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background-color: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.video-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.video-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-views {
  font-size: 0.7rem;
  color: var(--text-dark);
}

/* Queue Section */
.queue-section {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 42%;
  border-top: 1px solid var(--border-color);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-header h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.queue-count {
  font-size: 0.72rem;
  background-color: hsla(345, 10%, 30%, 0.3);
  padding: 4px 9px;
  border-radius: 20px;
  color: var(--text-muted);
}

.queue-container {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.queue-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background-color: hsla(345, 10%, 15%, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: grab;
  user-select: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.queue-item:active {
  cursor: grabbing;
}

.queue-item.active {
  border-color: var(--accent-line);
  background-color: var(--accent-soft);
}

/* The song being dragged */
.queue-item.dragging {
  opacity: 0.4;
}

/* Insertion-point indicator: a red line showing where the song will drop */
.queue-item.drop-before::before,
.queue-item.drop-after::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 6px var(--accent);
}

.queue-item.drop-before::before {
  top: -5px;
}

.queue-item.drop-after::after {
  bottom: -5px;
}

.queue-number {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dark);
  width: 16px;
}

.queue-item.active .queue-number {
  color: var(--accent);
}

.queue-details {
  flex-grow: 1;
  overflow: hidden;
}

.queue-title {
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-remove-btn {
  background: none;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px;
  transition: color 0.2s ease;
}

.queue-remove-btn:hover {
  color: var(--accent);
}

/* Main Content */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Top Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background-color: hsla(345, 14%, 7%, 0.6);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.now-playing {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
}

.now-playing-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-dark);
}

.now-playing-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 460px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Player Grid — left (video + controls) | resizer | right (lyrics).
   Video is larger by default since many instrumental videos show lyrics. */
.player-grid {
  display: grid;
  grid-template-columns: minmax(340px, var(--left-width, 64%)) 16px minmax(260px, 1fr);
  flex-grow: 1;
  padding: 24px;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

.player-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  min-width: 0;
}

/* Resizer handle between the two panels */
.resizer {
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.resizer::before {
  content: '';
  width: 4px;
  height: 56px;
  border-radius: 4px;
  background-color: var(--border-strong);
  transition: background-color 0.2s ease, height 0.2s ease;
}

.resizer:hover::before,
.resizer.dragging::before {
  background-color: var(--accent);
  height: 80px;
}

/* While dragging the resizer, suppress selection/iframe pointer capture */
body.resizing {
  user-select: none;
  cursor: col-resize;
}

body.resizing iframe {
  pointer-events: none;
}

/* Video */
.video-container {
  width: 100%;
  aspect-ratio: 16/9;
  /* Keep the video from pushing the controls off-screen when the panel is wide */
  max-height: calc(100vh - 300px);
  background-color: #000;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-panel);
  margin: 0 auto;
}

.video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: hsl(345, 14%, 6%);
  z-index: 2;
  gap: 16px;
}

.placeholder-icon {
  font-size: 3rem;
  animation: float 3s ease-in-out infinite;
}

.video-placeholder p {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
}

/* Controls Panel */
.controls-panel {
  background-color: var(--panel-bg-soft);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px 20px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Timeline */
.timeline-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.time-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  width: 42px;
  font-variant-numeric: tabular-nums;
}

#current-time {
  text-align: right;
}

/* Shared range slider styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 3px;
  cursor: pointer;
  outline: none;
  background-color: hsla(345, 10%, 35%, 0.4);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-primary);
  border: none;
  transition: transform 0.15s ease;
}

input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.15);
}

.timeline-container input[type="range"] {
  flex-grow: 1;
}

.timeline-container input[type="range"]::-webkit-slider-thumb {
  background: var(--accent);
}

/* Key Shifter Panel */
.key-shifter {
  order: 2; /* below the transport row */
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 16px;
  padding: 12px 18px;
  background-color: hsla(345, 12%, 8%, 0.55);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  min-height: 74px;
}

.ks-label {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gold);
  white-space: normal;
  line-height: 1.3;
  text-align: center;
}

/* Male / Female key presets */
.ks-gender {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 14px;
  border-radius: 19px;
  border: 1px solid var(--border-strong);
  background-color: hsla(345, 10%, 16%, 0.5);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.ks-male:hover, .ks-male.active {
  border-color: var(--key-flat);
  color: var(--key-flat);
  background-color: hsla(205, 78%, 62%, 0.12);
}

.ks-female:hover, .ks-female.active {
  border-color: var(--key-sharp);
  color: var(--key-sharp);
  background-color: hsla(0, 76%, 60%, 0.12);
}

.ks-flat { color: var(--key-flat); }
.ks-sharp { color: var(--key-sharp); }

/* Active controls */
.ks-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ks-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background-color: hsla(345, 10%, 18%, 0.5);
  color: var(--text-primary);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
  transition: var(--transition-smooth);
}

.ks-btn svg {
  width: 16px;
  height: 16px;
}

/* Flat lowers the key (cool), sharp raises it (warm) */
.ks-flat-btn { color: var(--key-flat); }
.ks-sharp-btn { color: var(--key-sharp); }

.ks-btn:hover {
  border-color: currentColor;
  background-color: hsla(345, 10%, 24%, 0.6);
}

.ks-value-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
}

.ks-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ks-unit {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dark);
  letter-spacing: 0.5px;
}

.ks-reset {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-primary);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.ks-reset:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* Locked state */
.ks-locked {
  flex: 0 0 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
}

.ks-lock-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.ks-lock-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
}

.ks-setup-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
  background: hsla(43, 96%, 58%, 0.12);
  border: 1px solid hsla(43, 96%, 58%, 0.3);
  padding: 2px 10px;
  border-radius: 999px;
}

.ks-lock-icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.ks-enable-btn {
  background: var(--accent-grad);
  color: #2a160c;
  border: none;
  font-family: var(--font-primary);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-glow);
}

.ks-enable-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* Toggle between locked / connected states */
.key-shifter .ks-controls { display: none; }
.key-shifter .ks-locked { display: flex; }
.key-shifter.connected .ks-controls { display: flex; }
.key-shifter.connected .ks-locked { display: none; }
.key-shifter.connected {
  border-color: var(--accent-line);
}

/* Locked: this is the headline feature — make it stand out */
.key-shifter.locked {
  padding: 16px 18px;
  border-color: var(--accent-line);
  background:
    linear-gradient(hsla(345, 20%, 11%, 0.6), hsla(345, 20%, 11%, 0.6)),
    var(--accent-soft);
  box-shadow: var(--shadow-soft), 0 0 0 1px hsla(5, 90%, 67%, 0.12), 0 0 26px hsla(18, 92%, 60%, 0.12);
}

.key-shifter.locked .ks-label {
  font-size: 0.9rem;
}

/* TV / casting tip — full-width row below the controls, only when connected */
.ks-tv-note { display: none; }
.key-shifter.connected .ks-tv-note {
  display: flex;
  flex-basis: 100%;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  background-color: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 10px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-primary);
  box-shadow: 0 0 0 1px hsla(5, 90%, 67%, 0.12), 0 0 18px hsla(18, 92%, 60%, 0.12);
}
.ks-tv-lead { color: var(--accent); font-weight: 700; }
.key-shifter.connected .ks-tv-note.dismissed { display: none; }
.ks-tv-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--accent);
}
.ks-tv-text strong { color: var(--text-primary); font-weight: 600; }
.ks-tv-dismiss {
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.ks-tv-dismiss:hover { color: var(--text-primary); }

/* Transport Row */
.control-row {
  order: 1; /* transport (play + volume) sits above the pitch shifter */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.playback-buttons {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 14px;
}

.volume-control {
  grid-column: 3;
  justify-self: end;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background-color: hsla(345, 10%, 16%, 0.4);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.05);
}

.play-pause-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background-color: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-pause-btn svg {
  width: 24px;
  height: 24px;
}

.play-pause-btn:hover {
  transform: scale(1.06);
  filter: brightness(1.08);
}

/* Volume */
.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.volume-icon {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.volume-icon svg {
  width: 20px;
  height: 20px;
}

.volume-icon:hover {
  color: var(--text-primary);
}

.volume-control.muted .volume-icon {
  color: var(--text-dark);
}

#volume-slider {
  width: 110px;
}

/* Lyrics Panel */
.player-right {
  min-height: 0;
  overflow: hidden;
}

.lyrics-panel {
  background-color: var(--panel-bg-soft);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.lyrics-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
}

.lyrics-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.text-btn {
  background: none;
  border: 1px solid var(--border-color);
  padding: 5px 11px;
  border-radius: 16px;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.text-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* Lyric sync nudge control */
.lyrics-sync {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 12px;
  background-color: hsla(345, 12%, 8%, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 20px;
}

.lyrics-sync[hidden] { display: none; }

.sync-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dark);
}

.sync-btn {
  height: 26px;
  padding: 0 11px;
  border-radius: 13px;
  border: 1px solid var(--border-strong);
  background-color: hsla(345, 10%, 18%, 0.6);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.sync-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sync-offset {
  min-width: 44px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.lyrics-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
}

.lyrics-placeholder {
  color: var(--text-dark);
  font-size: 0.95rem;
  text-align: center;
  margin: auto;
  line-height: 1.5;
}

.lyric-line {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  opacity: 0.28;
  transition: var(--transition-smooth);
  cursor: pointer;
  transform-origin: left center;
  padding: 4px 8px;
  border-radius: 8px;
}

.lyric-line:hover {
  opacity: 0.6;
  background-color: hsla(345, 10%, 30%, 0.1);
}

.lyric-line.active {
  opacity: 1;
  color: var(--text-primary);
  transform: scale(1.04);
}

/* Install Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(6, 6, 9, 0.7);
  backdrop-filter: blur(6px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  overflow-y: auto;
  background-color: var(--panel-bg);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 28px 30px;
  box-shadow: var(--shadow-panel);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.modal-head {
  margin-bottom: 22px;
  padding-right: 30px;
}

.modal-eyebrow {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent);
}

.modal-head h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 6px 0 8px;
}

.modal-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

.modal-visual {
  background-color: hsl(345, 14%, 6%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px;
}

.chrome-mock {
  width: 100%;
  height: auto;
  display: block;
}

.modal-steps {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 42px;
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.modal-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-steps li strong {
  color: var(--text-primary);
  font-weight: 600;
}

.modal-steps li code {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  background-color: hsla(345, 10%, 30%, 0.3);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--text-primary);
}

/* A copyable link on its own line — keeps the step text cleanly aligned */
.modal-steps li code.code-block {
  display: block;
  width: fit-content;
  margin-top: 7px;
  padding: 5px 10px;
  font-size: 0.85rem;
  background-color: hsla(345, 12%, 6%, 0.7);
  border: 1px solid var(--border-color);
}

/* Left column: steps + the "next time" note stacked */
.modal-steps-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0;
  padding: 15px 18px;
  background-color: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-primary);
}
.modal-note strong { color: var(--accent); font-weight: 700; }
.modal-note-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent);
}

.btn {
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-smooth);
}

.primary-btn {
  background: var(--accent-grad);
  color: #2a160c;
  font-weight: 700;
  box-shadow: var(--shadow-glow);
}

.primary-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.modal-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 26px;
  width: 100%;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  background-color: hsl(345, 14%, 14%);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-panel);
  max-width: 420px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Responsive: stack modal visual above steps on narrow screens */
@media (max-width: 620px) {
  .modal-body {
    grid-template-columns: 1fr;
  }
  .modal-visual {
    max-width: 320px;
    margin: 0 auto;
  }
}

/* ===== Restructured layout: Up Next in top bar, big video, search + lyrics on right ===== */
.app-container {
  display: flex;
  flex-direction: column;
}

/* Top bar: brand + now playing + Up Next strip */
.top-bar {
  justify-content: flex-start;
  gap: 22px;
  padding: 11px 22px;
}
.top-bar .brand { margin: 0; padding: 0; border: none; flex-shrink: 0; }
.now-playing { align-items: flex-start; flex-shrink: 0; max-width: 220px; }
.now-playing-title { max-width: 220px; }

/* Up Next → horizontal strip */
.queue-section {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  height: auto;
  flex: 1;
  min-width: 0;
  padding: 0;
  border-top: none;
}
.queue-section .section-header { gap: 9px; flex-shrink: 0; }
.queue-container {
  flex-direction: row;
  flex-grow: 1;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  padding: 3px 0;
}
.queue-container .empty-state { white-space: nowrap; }
.queue-item { flex-shrink: 0; max-width: 220px; padding: 7px 11px; }
.queue-details { white-space: nowrap; }
.queue-item.drop-before::before,
.queue-item.drop-after::after {
  left: auto; right: auto; top: 0; bottom: 0; width: 3px; height: auto;
}
.queue-item.drop-before::before { left: -5px; }
.queue-item.drop-after::after { right: -5px; }

/* Main content fills remaining height below the top bar */
.main-content { height: auto; flex: 1; min-height: 0; }

/* Video takes most of the space */
.player-grid { --left-width: 72%; padding: 18px 22px; }

/* Right panel: search over lyrics */
.player-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  min-width: 0;
}
.player-right .search-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
  height: auto;
  padding: 0;
  border: none;
}
.player-right .results-container { flex-grow: 0; max-height: 32vh; }
.player-right .lyrics-panel { flex: 1; min-height: 0; }

/* ===== 3-column layout: Lyrics | Video | Search ===== */
.player-grid {
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr) minmax(210px, 260px);
  gap: 18px;
}
.side-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.side-lyrics .lyrics-panel { flex: 1; min-height: 0; }
.side-search .search-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  padding: 0;
  border: none;
}
.side-search .results-container { flex: 1; max-height: none; min-height: 0; }

/* ===== Neater controls + compact lyrics-sync + a bit wider lyrics ===== */
.player-grid {
  grid-template-columns: minmax(240px, 290px) minmax(0, 1fr) minmax(205px, 250px);
}
.controls-panel { padding: 12px 15px; gap: 9px; }
.key-shifter { padding: 8px 13px; min-height: 48px; gap: 10px; }
.control-row { gap: 12px; }
.playback-buttons { gap: 10px; }
.icon-btn { width: 36px; height: 36px; }
.icon-btn svg { width: 16px; height: 16px; }
.play-pause-btn { width: 46px; height: 46px; }
.play-pause-btn svg { width: 20px; height: 20px; }
.timeline-container { gap: 10px; }

/* Lyrics sync row: compact so it fits the panel width */
.lyrics-header { padding: 12px 16px; gap: 8px; }
.lyrics-sync { gap: 5px; padding: 3px 5px 3px 9px; max-width: 100%; }
.sync-label { font-size: 0.56rem; }
.sync-btn { height: 23px; padding: 0 8px; font-size: 0.68rem; }
.sync-offset { min-width: 34px; font-size: 0.74rem; }

/* Labeled transport buttons (Restart / Next song) */
.ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 19px;
  border: 1px solid var(--border-strong);
  background-color: hsla(345, 10%, 16%, 0.4);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.ctrl-btn svg { width: 16px; height: 16px; }
.ctrl-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* ===== Type-ahead suggestions dropdown ===== */
.search-bar { position: relative; }
.suggest-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  background-color: var(--panel-bg);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 14px 32px hsla(345, 40%, 2%, 0.55);
  max-height: 340px;
  overflow-y: auto;
  padding: 5px;
}
.suggest-dropdown[hidden] { display: none; }
.suggest-item {
  padding: 8px 11px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.suggest-item:hover,
.suggest-item.active { background-color: var(--accent-soft); }
.suggest-item .s-title {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggest-item .s-artist {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Privacy policy link — fixed in the bottom-left corner, overlays without
   touching the 100vh grid layout. */
.privacy-link {
  position: fixed;
  left: 16px;
  bottom: 12px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: var(--text-dark);
  text-decoration: none;
  background-color: hsla(345, 14%, 7%, 0.55);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(6px);
  transition: var(--transition-smooth);
}

.privacy-link svg {
  width: 13px;
  height: 13px;
}

.privacy-link:hover {
  color: var(--text-primary);
  border-color: var(--accent-line);
}
