/* ═══════════════════════════════════════════════════════
   Karaoke Platform – Dark Theme CSS
   Mobile-first, large touch targets, neon accents
═══════════════════════════════════════════════════════ */

:root {
  --bg:          #080812;
  --surface:     #11112a;
  --surface2:    #1a1a38;
  --border:      #2a2a50;
  --accent:      #e91e8c;
  --accent-glow: rgba(233, 30, 140, 0.25);
  --cyan:        #00d4ff;
  --cyan-glow:   rgba(0, 212, 255, 0.2);
  --purple:      #7c3aed;
  --text:        #eeeef8;
  --text-muted:  #7070a0;
  --success:     #00e676;
  --warning:     #ffcc00;
  --danger:      #ff4444;
  --radius:      14px;
  --radius-sm:   8px;
  --transition:  0.18s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Header ───────────────────────────────────────────── */
.header {
  background: linear-gradient(135deg, var(--surface) 0%, #140824 100%);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(12px);
}

.header-logo {
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  text-shadow: none;
}

.header-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.host-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: color var(--transition), border-color var(--transition);
}
.host-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Layout ───────────────────────────────────────────── */
.container {
  max-width: 580px;
  margin: 0 auto;
  padding: 16px 14px 32px;
}

/* Host two-column */
.host-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
  align-items: start;
}
.host-col { display: flex; flex-direction: column; gap: 14px; }

/* ── Card ─────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.card-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--cyan);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ── Form ─────────────────────────────────────────────── */
.form-group { margin-bottom: 12px; }

label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 500;
}

input[type="text"] {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  padding: 13px 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}
input[type="text"]::placeholder { color: var(--text-muted); }
input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active  { transform: scale(0.96); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #b5179e 100%);
  color: #fff;
  width: 100%;
  padding: 15px;
  font-size: 1.05rem;
  box-shadow: 0 4px 24px var(--accent-glow);
  border: none;
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 32px rgba(233,30,140,0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-vote {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text-muted);
  padding: 7px 14px;
  font-size: 0.85rem;
  border-radius: 20px;
  min-width: 64px;
}
.btn-vote:hover:not(:disabled):not(.voted) {
  border-color: var(--cyan);
  color: var(--cyan);
}
.btn-vote.voted {
  background: var(--cyan-glow);
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-danger {
  background: rgba(255,68,68,0.12);
  border-color: rgba(255,68,68,0.28);
  color: var(--danger);
  padding: 6px 12px;
  font-size: 0.82rem;
}
.btn-danger:hover:not(:disabled) { background: rgba(255,68,68,0.22); }

.btn-warning {
  background: rgba(255,204,0,0.12);
  border-color: rgba(255,204,0,0.28);
  color: var(--warning);
}
.btn-warning:hover:not(:disabled) { background: rgba(255,204,0,0.22); }

.btn-success {
  background: rgba(0,230,118,0.12);
  border-color: rgba(0,230,118,0.28);
  color: var(--success);
}

/* ── Now Playing ──────────────────────────────────────── */
.now-playing-bar {
  background: linear-gradient(135deg,
    rgba(233,30,140,0.12) 0%,
    rgba(0,212,255,0.12) 100%
  );
  border: 1px solid rgba(233,30,140,0.35);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.np-pulse {
  font-size: 1.6rem;
  animation: pulse 1.6s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { transform: scale(1);   }
  50%       { transform: scale(1.15); }
}
.np-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 2px;
}
.np-title  { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.np-artist { font-size: 0.82rem; color: var(--text-muted); margin-top: 1px; }

/* ── Queue list ───────────────────────────────────────── */
.queue-list { display: flex; flex-direction: column; gap: 8px; }

.queue-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  transition: border-color var(--transition);
  animation: slideDown 0.25s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0);    }
}
.queue-item:hover { border-color: rgba(233,30,140,0.28); }

.q-pos {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 22px;
  text-align: center;
}
.q-info { flex: 1; min-width: 0; }
.q-title {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.q-artist { font-size: 0.78rem; color: var(--text-muted); margin-top: 1px; }
.q-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

/* ── YouTube player ───────────────────────────────────── */
.player-wrap {
  position: relative;
  padding-top: 56.25%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.player-wrap iframe,
.player-wrap > div { position: absolute; inset: 0; width: 100%; height: 100%; }

.player-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 8px;
}
.player-placeholder .big-icon { font-size: 3.5rem; opacity: 0.4; }

/* ── Host controls strip ──────────────────────────────── */
.ctrl-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ctrl-strip .btn { padding: 11px 10px; font-size: 0.88rem; }

/* ── Queue scroll (host right col) ───────────────────── */
.queue-scroll {
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  padding-right: 2px;
}

/* ── Lock banner ──────────────────────────────────────── */
.lock-banner {
  background: rgba(255,204,0,0.1);
  border: 1px solid rgba(255,204,0,0.3);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  color: var(--warning);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ── Status dot ───────────────────────────────────────── */
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  animation: blink 1.8s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ── Badges ───────────────────────────────────────────── */
.badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Toast notifications ──────────────────────────────── */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  font-size: 0.9rem;
  max-width: 340px;
  text-align: center;
  animation: toastIn 0.25s ease;
  box-shadow: 0 6px 28px rgba(0,0,0,0.5);
  pointer-events: all;
  transition: opacity 0.3s;
}
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error   { border-color: var(--danger);  color: var(--danger);  }
.toast.info    { border-color: var(--cyan);    color: var(--cyan);    }
.toast.warning { border-color: var(--warning); color: var(--warning); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ── Spinner ──────────────────────────────────────────── */
.spinner {
  width: 17px; height: 17px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ──────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted);
}
.empty .icon { font-size: 2.4rem; display: block; margin-bottom: 10px; opacity: 0.4; }

/* ── QR code block ────────────────────────────────────── */
.qr-block { text-align: center; }
.qr-block img {
  width: 180px; height: 180px;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 8px;
  margin-bottom: 8px;
}
.qr-url { font-size: 0.78rem; color: var(--text-muted); word-break: break-all; }

/* ── Host now-playing card ────────────────────────────── */
.host-np {
  background: linear-gradient(135deg, rgba(233,30,140,0.1), rgba(124,58,237,0.1));
  border: 1px solid rgba(233,30,140,0.3);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.host-np .np-label { margin-bottom: 4px; }
.host-np .np-title { font-size: 1.15rem; }

/* ── Responsive ───────────────────────────────────────── */
/* ── Options panel (collapsible) ──────────────────────── */
.options-toggle {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color var(--transition), color var(--transition);
  margin-bottom: 0;
  text-align: left;
}
.options-toggle:hover { border-color: var(--cyan); color: var(--cyan); }
.options-toggle.open  { border-radius: var(--radius-sm) var(--radius-sm) 0 0; border-color: var(--border); }

.options-panel {
  display: none;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 14px 16px;
  background: var(--surface2);
  margin-bottom: 12px;
}
.options-panel.open { display: block; }

/* ── Select input ─────────────────────────────────────── */
.select-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  padding: 12px 36px 12px 16px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%237070a0'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.select-input:focus  { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.select-input option { background: var(--surface2); color: var(--text); }

/* ── Version badges ───────────────────────────────────── */
.v-badges { display: flex; gap: 4px; flex-shrink: 0; }

.vbadge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 7px;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.3px;
  -webkit-tap-highlight-color: transparent;
}
.vbadge:hover:not(.v-active):not(:disabled) { border-color: var(--cyan); color: var(--cyan); }
.vbadge.v-active {
  background: rgba(233,30,140,0.15);
  border-color: var(--accent);
  color: var(--accent);
}
.vbadge:disabled { opacity: 0.25; cursor: default; }

/* ── Language tag in queue item ───────────────────────── */
.lang-tag {
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(0,212,255,0.12);
  border: 1px solid rgba(0,212,255,0.25);
  color: var(--cyan);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  .host-layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .queue-scroll { max-height: 420px; }
}
@media (max-width: 480px) {
  .header-logo { font-size: 1.15rem; }
  .card { padding: 14px 16px; }
  .ctrl-strip { grid-template-columns: 1fr 1fr; }
}
