@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #070913;
  --bg-elev: #11162a;
  --glass: rgba(15, 21, 42, 0.78);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #ec4899;
  --primary-2: #8b5cf6;
  --accent: #06b6d4;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow-x: hidden;
}

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

.hidden {
  display: none !important;
}

/* ==================== HOST / TV SCREEN ==================== */
body.host-page {
  overflow: hidden;
  user-select: none;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 20% 20%, #1e1038 0%, #070913 55%, #051626 100%);
  overflow: hidden;
}

#player-wrap {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 1;
  pointer-events: none;
}

#yt-player,
#adfree-video {
  width: 100%;
  height: 100%;
  background: #000;
  pointer-events: none;
}

#adfree-video {
  object-fit: contain;
}

.controls-reveal-layer {
  position: absolute;
  inset: 0;
  z-index: 12;
  background: transparent;
  pointer-events: none;
}

.controls-reveal-layer.active {
  pointer-events: auto;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  background: rgba(7, 9, 19, 0.86);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 1.15rem;
  color: #e2e8f0;
}

.loading-overlay i {
  font-size: 2.2rem;
  color: var(--primary);
}

.key-ctrl-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  padding: 2px;
}

.dock-key-btns {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dock-btn.key-val-btn {
  min-width: 56px;
  text-align: center;
  font-weight: 600;
  color: #67e8f9;
}

/* Idle Screen */
.idle-screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  background:
    radial-gradient(circle at 15% 25%, rgba(236, 72, 153, 0.22), transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(6, 182, 212, 0.2), transparent 40%),
    linear-gradient(160deg, #090d1f 0%, #070913 100%);
}

.brand-title {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #f472b6, #a78bfa, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.35rem;
}

.brand-sub {
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  margin-bottom: 2rem;
}

.idle-card {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  padding: 2rem 2.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  max-width: 92vw;
}

.idle-qr-box {
  background: #fff;
  padding: 14px;
  border-radius: 20px;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.idle-qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.idle-info {
  text-align: left;
  max-width: 360px;
}

.room-badge-label {
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.room-code-big {
  font-size: 3.4rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.1;
  margin: 0.2rem 0 1rem;
  color: #fff;
}

.idle-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  color: #cbd5e1;
  font-size: 1rem;
  margin-bottom: 1.2rem;
}

.idle-url-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.idle-url {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  color: var(--accent);
  word-break: break-all;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
}

.url-icon-btn {
  background: rgba(6, 182, 212, 0.14);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #67e8f9;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.1s ease;
}

.url-icon-btn:hover {
  background: rgba(6, 182, 212, 0.26);
  color: #fff;
}

.url-icon-btn:active {
  transform: scale(0.95);
}

.idle-credit {
  position: absolute;
  bottom: 18px;
  right: 24px;
  font-size: 0.92rem;
  font-weight: 400;
  color: rgba(226, 232, 240, 0.55);
  letter-spacing: 0.03em;
}

.key-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #67e8f9;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
}

.key-select option {
  background: #11162a;
  color: #f8fafc;
}

/* Host Overlays while playing */
.host-top-bar {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  gap: 12px;
}

.now-playing-pill {
  pointer-events: auto;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  border-radius: 16px;
  padding: 10px 16px;
  max-width: min(560px, 60vw);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.np-label {
  font-size: 1.05rem;
  color: #f472b6;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-title {
  font-size: 1.05rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.np-next {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.corner-qr {
  pointer-events: auto;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  border-radius: 18px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.corner-qr img {
  width: 112px;
  height: 112px;
  background: #fff;
  padding: 6px;
  border-radius: 12px;
}

.corner-qr-meta {
  font-size: 0.78rem;
  text-align: center;
  line-height: 1.25;
}

.corner-qr-meta strong {
  color: #fff;
  letter-spacing: 0.08em;
  font-size: 0.92rem;
}

.corner-qr-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
}

/* Host Bottom Controls */
.host-controls {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: max-content;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  opacity: 0.94;
  transition: opacity 0.35s ease, transform 0.35s ease;
  overflow-x: auto;
}

.host-controls:hover {
  opacity: 1;
}

.host-controls.auto-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(18px);
}

.ctrl-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.1s ease;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

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

.ctrl-btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent;
}

/* Sound Unlock Banner */
.unmute-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  background: rgba(236, 72, 153, 0.95);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(236, 72, 153, 0.45);
}

/* Host Queue Drawer */
.queue-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 90vw);
  z-index: 35;
  background: rgba(11, 15, 30, 0.94);
  border-left: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.drawer-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 86px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 50;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(236, 72, 153, 0.5);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.92rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Host screen toast floats at top-center so it never blocks lyrics or bottom bar */
body.host-page .toast {
  top: 20px;
  bottom: auto;
  transform: translateX(-50%) translateY(-18px);
}

body.host-page .toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Remote page toast: rectangular box floating cleanly above the bottom dock */
body.remote-page .toast {
  bottom: calc(var(--remote-dock-height, 0px) + 12px);
  border-radius: 10px;
  width: min(calc(100vw - 24px), 520px);
  max-width: calc(100vw - 24px);
  padding: 11px 16px;
  line-height: 1.4;
  z-index: 60;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(236, 72, 153, 0.55);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

/* ==================== MOBILE REMOTE ==================== */
body.remote-page {
  background: #070913;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.remote-top-shell {
  flex-shrink: 0;
  background: #0b1022;
  border-bottom: 1px solid var(--glass-border);
  z-index: 25;
}

.remote-header {
  height: 48px;
  padding: 0 12px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.remote-sticky-bar {
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  padding: 4px 12px 10px;
}

.remote-brand {
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
  flex-shrink: 0;
  background: linear-gradient(90deg, #f472b6, #a78bfa, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.remote-header-right {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ext-browser-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(6, 182, 212, 0.45);
  background: rgba(6, 182, 212, 0.18);
  color: #67e8f9;
  font-size: 0.84rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.1s ease;
}

.ext-browser-btn:active {
  transform: scale(0.93);
  background: rgba(6, 182, 212, 0.32);
}

.vocal-key-btn {
  height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(236, 72, 153, 0.48);
  background: rgba(236, 72, 153, 0.16);
  color: #f9a8d4;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.vocal-key-btn:active {
  transform: scale(0.95);
  background: rgba(236, 72, 153, 0.3);
}

.vocal-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.vocal-modal-head h3 {
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vocal-saved-box {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.86rem;
  margin-bottom: 12px;
}

.vocal-profile-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #cbd5e1;
  background: rgba(139, 92, 246, 0.18);
  border: 1px solid rgba(139, 92, 246, 0.35);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.vocal-apply-all-chk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.85rem;
  color: #e2e8f0;
  cursor: pointer;
}

.vocal-apply-all-chk input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.vocal-live-circle {
  width: 132px;
  height: 132px;
  margin: 6px auto 16px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.28) 0%, rgba(139, 92, 246, 0.14) 70%);
  border: 2px solid var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 28px rgba(236, 72, 153, 0.35);
}

.vocal-live-note {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.vocal-live-sub {
  font-size: 0.72rem;
  color: #f9a8d4;
  margin-top: 4px;
}

.vocal-meter-wrap,
.vocal-progress-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.vocal-meter-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e, #06b6d4);
  transition: width 0.06s linear;
}

.vocal-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width 0.1s linear;
}

.vocal-result-key {
  font-size: 2.2rem;
  font-weight: 700;
  color: #67e8f9;
  margin: 8px 0 4px;
}

.vocal-result-range {
  font-size: 0.88rem;
  color: var(--muted);
}

.room-chip {
  height: 28px;
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.45);
  padding: 0 9px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}

.remote-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  background: linear-gradient(180deg, #090d1c 0%, #070913 100%);
}

.remote-main-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 14px 20px;
}

/* Join Box */
.join-box {
  margin: 12vh auto 0;
  max-width: 380px;
  background: var(--bg-elev);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 24px;
  text-align: center;
}

.join-box h2 {
  font-size: 1.35rem;
  margin-bottom: 6px;
}

.join-box p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.input-field {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-field:focus {
  border-color: var(--primary);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}

/* Tabs */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  padding: 5px;
  border-radius: 14px;
  margin-bottom: 14px;
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 9px 6px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}

/* Search Area */
.name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.name-row input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.88rem;
}

.search-mode-btn {
  flex-shrink: 0;
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(236, 72, 153, 0.5);
  background: rgba(236, 72, 153, 0.18);
  color: #f9a8d4;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.search-mode-btn:active {
  transform: scale(0.95);
}

.search-mode-btn.music-mode {
  border-color: rgba(6, 182, 212, 0.55);
  background: rgba(6, 182, 212, 0.18);
  color: #67e8f9;
}

.search-box-wrap {
  position: relative;
  margin-bottom: 10px;
}

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

.suggest-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  background: #141a33;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}

.suggest-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 11px 14px;
  font-size: 0.92rem;
  color: #e2e8f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.suggest-item:last-child {
  border-bottom: none;
}

.suggest-item:hover,
.suggest-item:active {
  background: rgba(236, 72, 153, 0.18);
  color: #fff;
}

.suggest-icon {
  color: var(--muted);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.suggest-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

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

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

.suggest-badge {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(236, 72, 153, 0.2);
  color: #f9a8d4;
  flex-shrink: 0;
}

.search-form input {
  flex: 1;
}

.search-form button {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: none;
  border-radius: 12px;
  padding: 0 16px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.search-form button.voice-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  padding: 0 13px;
  font-size: 0.95rem;
}

.search-form button.voice-btn.recording {
  background: var(--danger);
  border-color: #fca5a5;
  color: #fff;
  animation: voicePulse 1s infinite;
}

@keyframes voicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.65); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.toggle-karaoke {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 14px;
  cursor: pointer;
}

/* Song Cards */
.song-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.song-card {
  display: flex;
  gap: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 10px;
  align-items: center;
}

.song-thumb-wrap {
  position: relative;
  width: 104px;
  height: 60px;
  border-radius: 9px;
  overflow: hidden;
  flex-shrink: 0;
  background: #000;
}

.song-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.song-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 4px;
}

.karaoke-mic-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

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

.song-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.song-title {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.star-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.02rem;
  padding: 2px 4px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  transition: transform 0.12s ease, color 0.15s ease;
}

.star-btn:active {
  transform: scale(1.22);
}

.star-btn.active {
  color: #facc15;
}

.auth-btn {
  height: 28px;
  min-width: 28px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.auth-btn.logged-in {
  padding: 0;
  width: 28px;
  border-color: rgba(103, 232, 249, 0.55);
  overflow: hidden;
}

.auth-btn img {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  object-fit: cover;
}

.unavail-badge {
  display: inline-block;
  font-size: 0.68rem;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 6px;
  padding: 1px 6px;
  margin-top: 3px;
}

.gsi-wrap {
  display: flex;
  justify-content: center;
  margin: 14px 0 6px;
  min-height: 44px;
}

.auth-hint {
  margin: 8px 0 2px;
  font-size: 0.76rem;
  color: #94a3b8;
  text-align: center;
  line-height: 1.4;
}

.auth-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
  text-align: left;
}

.auth-profile-card img {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
}

.song-meta {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.mini-btn {
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.mini-btn.add {
  background: var(--primary);
  color: #fff;
}

.mini-btn.next {
  background: rgba(6, 182, 212, 0.2);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.mini-btn.danger {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

.mini-btn.top {
  background: rgba(139, 92, 246, 0.22);
  color: #ddd6fe;
}

.mini-btn.play {
  background: rgba(34, 197, 94, 0.22);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  align-self: stretch;
  color: var(--muted);
  font-size: 1rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
  flex-shrink: 0;
}

.drag-handle:active {
  cursor: grabbing;
  color: var(--primary);
}

.song-card.queue-item {
  user-select: none;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease, background 0.25s ease, opacity 0.15s ease;
}

.song-card.queue-item.just-moved {
  border-color: var(--accent);
  background: rgba(6, 182, 212, 0.16);
}

.drag-placeholder {
  border: 2px dashed var(--accent);
  background: rgba(6, 182, 212, 0.12);
  border-radius: 14px;
  transition: height 0.15s ease;
}

.drag-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  margin: 0 !important;
  transform: scale(1.03);
  border: 1.5px solid var(--primary) !important;
  background: rgba(20, 26, 52, 0.96) !important;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.65), 0 0 0 2px rgba(236, 72, 153, 0.3);
  opacity: 0.96;
}

.song-card.drag-over {
  border-top: 3px solid var(--accent);
}

.queue-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 5px;
  flex-shrink: 0;
}

.mini-btn.icon-btn {
  padding: 5px 8px;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.mini-btn.icon-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.queue-key-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}

.q-key-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 0.7rem;
  cursor: pointer;
  line-height: 1.3;
}

.q-key-val {
  font-size: 0.72rem;
  font-weight: 600;
  color: #67e8f9;
  min-width: 42px;
  text-align: center;
}

.q-key-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #67e8f9;
  border-radius: 6px;
  padding: 2px 5px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

.q-key-select option {
  background: #11162a;
  color: #f8fafc;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 36px 16px;
  font-size: 0.92rem;
}

/* Remote Bottom Control Dock */
.remote-dock {
  flex-shrink: 0;
  z-index: 25;
  background: #0b1022;
  border-top: 1px solid var(--glass-border);
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
}

/* Confirm Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(3, 6, 16, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 360px;
  background: #131a33;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 22px 20px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  text-align: center;
}

.modal-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.modal-title {
  font-size: 1.08rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.modal-msg {
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.45;
  margin-bottom: 18px;
  word-break: break-word;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.modal-btn.cancel {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.modal-btn.confirm-danger {
  background: var(--danger);
  color: #fff;
}

.modal-btn.confirm-play {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}

.remote-dock-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dock-now {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dock-song-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-song-sub {
  font-size: 0.74rem;
  color: var(--muted);
}

.dock-controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  overflow-x: auto;
}

.dock-btns {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  flex-shrink: 0;
}

.dock-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  padding: 6px 8px;
  font-size: 0.76rem;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.dock-btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: none;
  font-weight: 600;
}

.dock-key-btns {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

#dock-key-select {
  border-radius: 9px;
  padding: 6px 5px;
  font-size: 0.74rem;
  max-width: 96px;
}

.guest-warn-banner {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.84rem;
  color: #fde68a;
  line-height: 1.45;
}

.vol-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 170px;
}

.vol-wrap input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

@media (max-width: 720px) {
  .idle-card {
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.2rem;
  }
  .idle-info {
    text-align: center;
  }
}
