/* Social Karaoke — plain CSS, dark neon stage-lights theme */
:root {
  --bg: #0b0614;
  --surface: #140a24;
  --surface-2: #1c0f30;
  --border: #2a1a44;
  --text: #f3edff;
  --muted: #a89cc4;
  --primary: #d91fbf;       /* deep fuchsia */
  --primary-glow: #e85dd0;
  --secondary: #8b5cf6;     /* purple */
  --accent: #2dd4bf;         /* warm teal */
  --danger: #ef4444;
  --success: #00e676;
  --primary-rgb: 217, 31, 191;
  --radius: 14px;
  --discord: #5865F2;
  --gradient-neon: linear-gradient(135deg, var(--primary), var(--secondary) 55%, var(--accent));
  --gradient-text: linear-gradient(120deg, var(--primary), var(--accent));
  --shadow-stage: 0 24px 60px -16px rgba(217, 31, 191, 0.3);
  --glow-primary: 0 0 28px rgba(217, 31, 191, 0.4), 0 0 64px rgba(217, 31, 191, 0.18);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body { height: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 62% 0%, rgba(217, 31, 191, 0.18), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(45, 212, 191, 0.13), transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary-glow); }
img, svg { display: block; max-width: 100%; }

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.container-max { width: 100%; max-width: 100%; margin: 0 auto; padding: 0 1.25rem; }

.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.muted { color: var(--muted); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid rgba(42, 26, 68, 0.6);
  background: rgba(11, 6, 20, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.site-header .inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 4px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.05rem; }
.logo .badge {
  width: 36px; height: 36px; border-radius: 12px;
  margin-right: 6px;
  background: var(--gradient-neon);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-stage);
  transition: transform var(--transition);
}
.logo:hover .badge { transform: scale(1.05); }
.logo .badge svg { width: 20px; height: 20px; color: #1a0a2e; }
.inline-icon[data-icon="clock"] svg { width: 16px; height: 16px; }

.nav { display: flex; align-items: center; gap: 0.5rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0 1.1rem; height: 40px;
  border-radius: 10px; font-weight: 600; font-size: 0.92rem;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-lg { height: 52px; padding: 0 1.75rem; font-size: 1rem; border-radius: 12px; }
.btn-sm { height: 34px; padding: 0 0.75rem; font-size: 0.85rem; }
.btn-primary {
  background: var(--gradient-neon);
  color: #1a0a2e;
  box-shadow: var(--shadow-stage);
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-outline {
  background: rgba(20, 10, 36, 0.4);
  border: 1px solid rgba(42, 26, 68, 0.8);
  color: var(--text);
  backdrop-filter: blur(8px);
}
.btn-outline:hover { background: rgba(20, 10, 36, 0.7); color: var(--accent); border-color: var(--accent); }
.btn-ghost { color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-icon { width: 40px; padding: 0; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.btn .icon, .btn .inline-icon svg { width: 1em; height: 1em; flex-shrink: 0; }

/* Pulse animation for hero CTA */
.pulse-glow { animation: pulseGlow 2.5s ease-in-out infinite; }
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(217, 31, 191, 0.35), 0 0 50px rgba(217, 31, 191, 0.15); }
  50%      { box-shadow: 0 0 32px rgba(217, 31, 191, 0.6), 0 0 80px rgba(217, 31, 191, 0.28); }
}

/* HERO */
.hero { position: relative; overflow: hidden; padding: 5rem 0 6rem; }
.hero .blob { position: absolute; border-radius: 9999px; filter: blur(110px); pointer-events: none; z-index: -1; }
.hero .blob.b1 { width: 440px; height: 440px; top: -100px; left: 58%; transform: translateX(-50%); background: rgba(217, 31, 191, 0.22); }
.hero .blob.b2 { width: 300px; height: 300px; top: 200px; right: 20px; background: rgba(45, 212, 191, 0.18); }
.hero .blob.b3 { display: none; }

.hero-inner { text-align: center; max-width: 720px; margin: 0 auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  border: 1px solid rgba(42, 26, 68, 0.7);
  background: rgba(20, 10, 36, 0.4);
  color: var(--muted);
  padding: 0.4rem 0.9rem; border-radius: 9999px; font-size: 0.78rem; font-weight: 500;
  margin-bottom: 1.4rem; backdrop-filter: blur(8px);
}
.eyebrow svg { width: 14px; height: 14px; color: var(--accent); }

.hero h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); font-weight: 700; }
.hero p.lead { color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.2rem); margin-top: 1.2rem; max-width: 560px; margin-left: auto; margin-right: auto; }

.cta-row { display: flex; gap: 0.75rem; justify-content: center; margin-top: 2.4rem; flex-wrap: wrap; }
.fineprint { color: var(--muted); font-size: 0.85rem; margin-top: 1rem; }

.stage-mock {
  margin: 4.5rem auto 0; max-width: 880px;
  border: 1px solid rgba(42, 26, 68, 0.7);
  background: rgba(20, 10, 36, 0.5);
  border-radius: 24px; padding: 12px;
  box-shadow: var(--shadow-stage);
  backdrop-filter: blur(20px);
  position: relative;
}
.stage-mock::before {
  content: ""; position: absolute; inset: -16px; border-radius: 28px;
  background: var(--gradient-neon); opacity: 0.18; filter: blur(40px); z-index: -1;
}
.stage-mock .screen {
  aspect-ratio: 16 / 9; border-radius: 16px;
  background: linear-gradient(135deg, rgba(217, 31, 191, 0.25), rgba(139, 92, 246, 0.18), rgba(45, 212, 191, 0.25));
  display: flex; align-items: center; justify-content: center;
}
.stage-mock .screen .center { text-align: center; }
.stage-mock .screen svg { width: 64px; height: 64px; margin: 0 auto 1rem; opacity: 0.85; animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* Sections */
.section { padding: 5rem 0; }
.section-head { text-align: center; max-width: 600px; margin: 0 auto 3rem; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.section-head p { color: var(--muted); margin-top: 0.8rem; }

/* Features grid */
.features { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature {
  border: 1px solid rgba(42, 26, 68, 0.7);
  background: rgba(20, 10, 36, 0.5);
  border-radius: 16px; padding: 1.4rem;
  backdrop-filter: blur(8px);
  transition: var(--transition);
}
.feature:hover { border-color: rgba(217, 31, 191, 0.4); transform: translateY(-2px); }
.feature .icon-wrap {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--gradient-neon);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.feature .icon-wrap svg { width: 20px; height: 20px; color: #1a0a2e; }
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--muted); margin-top: 0.4rem; font-size: 0.92rem; line-height: 1.5; }

/* How */
.how-card {
  border: 1px solid rgba(42, 26, 68, 0.7);
  background: rgba(20, 10, 36, 0.5);
  border-radius: 24px; padding: 2.4rem; backdrop-filter: blur(8px);
}
.steps { display: grid; gap: 1.1rem; grid-template-columns: 1fr; margin-top: 2.4rem; }
@media (min-width: 700px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  border: 1px solid rgba(42, 26, 68, 0.6);
  background: rgba(11, 6, 20, 0.5);
  border-radius: 16px; padding: 1.4rem;
}
.step .num { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 2rem; }
.step h3 { font-size: 1.05rem; margin-top: 0.6rem; }
.step p { color: var(--muted); margin-top: 0.4rem; font-size: 0.9rem; line-height: 1.5; }

/* Footer */
.site-footer {
  border-top: 1px solid rgba(42, 26, 68, 0.6);
  background: rgba(11, 6, 20, 0.4);
  padding: 2rem 0;
}
.site-footer .inner { display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; }
@media (min-width: 640px) { .site-footer .inner { flex-direction: row; justify-content: space-between; text-align: left; } }
.footer-links { display: flex; gap: 1rem; color: var(--muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--text); }

/* AUTH / JOIN cards */
.center-page { display: flex; align-items: center; justify-content: center; padding: 3rem 1rem; min-height: calc(100vh - 64px - 100px); }
.card {
  width: 100%; max-width: 440px;
  border: 1px solid rgba(42, 26, 68, 0.7);
  background: rgba(20, 10, 36, 0.7);
  border-radius: 24px; padding: 2rem;
  box-shadow: var(--shadow-stage);
  backdrop-filter: blur(20px);
  position: relative;
}
.card::before {
  content: ""; position: absolute; inset: -24px; border-radius: 32px;
  background: var(--gradient-neon); opacity: 0.12; filter: blur(40px); z-index: -1;
}
.card h1 { font-size: clamp(1.75rem, 4vw, 2.2rem); text-align: center; }
.card .subtitle { text-align: center; color: var(--muted); margin-top: 0.5rem; margin-bottom: 0.5rem; font-size: 0.92rem; }

/* Code input */
.code-cells { display: flex; justify-content: center; gap: 0.5rem; margin-top: 0.8rem; }
@media (min-width: 480px) { .code-cells { gap: 0.75rem; } }
.code-cells input {
  width: 56px; height: 64px;
  border-radius: 12px; border: 2px solid var(--border);
  background: rgba(11, 6, 20, 0.6); color: var(--text);
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 1.75rem; text-align: center; text-transform: uppercase;
  outline: none; caret-color: var(--primary);
  transition: var(--transition);
}
@media (min-width: 480px) { .code-cells input { width: 64px; height: 76px; font-size: 2rem; } }
.code-cells input:focus { border-color: var(--primary); background: rgba(11, 6, 20, 0.9); box-shadow: 0 0 0 4px rgba(217, 31, 191, 0.18); }

/* Form fields */
.field { display: block; }
.field + .field, .field-group + .field, .field-group + .field-group { margin-top: 1rem; }
.label { display: block; font-size: 0.82rem; font-weight: 500; margin-bottom: 0.4rem; }
.label.center { text-align: center; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; color: var(--muted); }
.input-wrap { position: relative; }
.input-wrap .lead { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; display: inline-flex; align-items: center; justify-content: center; }
.input-wrap .lead svg { width: 18px; height: 18px; display: block; }
.input {
  width: 100%; height: 48px;
  border-radius: 10px; border: 1px solid var(--border);
  background: rgba(11, 6, 20, 0.6); color: var(--text);
  padding: 0 0.9rem; font-size: 0.95rem; outline: none;
  transition: var(--transition);
}
.input.with-icon { padding-left: 40px; }
.input::placeholder { color: var(--muted); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217, 31, 191, 0.18); }
textarea.input { height: auto; }
.help { color: var(--muted); font-size: 0.78rem; margin-top: 0.35rem; }

.divider { display: flex; align-items: center; gap: 0.75rem; margin: 1.4rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.divider span { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }

.btn-block { width: 100%; }

.below-card { text-align: center; color: var(--muted); margin-top: 1.4rem; font-size: 0.9rem; }
.below-card a { color: var(--text); font-weight: 500; }

/* Toast */
.toast-stack { position: fixed; bottom: 1.25rem; right: 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; z-index: 300; }
.toast {
  border: 1px solid var(--border);
  background: rgba(20, 10, 36, 0.95);
  backdrop-filter: blur(12px);
  border-radius: 12px; padding: 0.8rem 1rem; min-width: 240px; max-width: 360px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  animation: toastIn 0.25s ease-out;
}
.toast.error { border-color: rgba(239, 68, 68, 0.5); }
.toast .t-title { font-weight: 600; font-size: 0.9rem; }
.toast .t-desc { color: var(--muted); font-size: 0.82rem; margin-top: 0.2rem; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ROOM layout */
.room-grid {
  display: grid; gap: 1rem;
  grid-template-columns: 1fr;
  padding: 1.25rem 0;
}
@media (min-width: 1024px) { .room-grid { grid-template-columns: 1fr 380px; } }

.player-card, .panel {
  border: 1px solid rgba(42, 26, 68, 0.7);
  background: rgba(20, 10, 36, 0.6);
  border-radius: 18px;
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.player-card .video {
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(ellipse at center, rgba(217, 31, 191, 0.25), transparent 70%),
    linear-gradient(135deg, #1a0a2e, #0b0614);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden; /* keep YouTube IFrame inside rounded card */
}
.video .nowtext[hidden] { display: none; }
#guestInactiveOverlay:not([hidden]) { display: flex; }
.video .nowtext {
  text-align: center;
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  background:
    radial-gradient(ellipse at center, rgba(217, 31, 191, 0.25), transparent 70%),
    linear-gradient(135deg, #1a0a2e, #0b0614);
}
.video .nowtext .label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.video .nowtext .title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 1.4rem; margin-top: 0.4rem; }
.video .nowtext .artist { color: var(--muted); margin-top: 0.2rem; }

.eq-bars { display: flex; align-items: flex-end; gap: 4px; height: 36px; margin-bottom: 1.4rem; }
.eq-bars span {
  width: 4px; border-radius: 3px;
  background: var(--primary-glow);
  animation: eqBounce 1.1s ease-in-out infinite;
}
.eq-bars span:nth-child(1) { animation-delay: 0.0s; }
.eq-bars span:nth-child(2) { animation-delay: 0.18s; }
.eq-bars span:nth-child(3) { animation-delay: 0.36s; }
.eq-bars span:nth-child(4) { animation-delay: 0.54s; }
.eq-bars span:nth-child(5) { animation-delay: 0.72s; }
@keyframes eqBounce {
  0%, 100% { height: 6px;  opacity: 0.45; }
  50%       { height: 32px; opacity: 1;    }
}

.player-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(42, 26, 68, 0.7);
  flex-wrap: wrap;
}
.controls-left, .controls-right { display: flex; gap: 0.5rem; align-items: center; }
.room-meta { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.2rem; flex-wrap: wrap; }
.room-meta .pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.7rem; border-radius: 9999px;
  background: rgba(11, 6, 20, 0.6); border: 1px solid var(--border);
  font-size: 0.82rem;
}
.room-meta .pill.code { font-family: 'Space Grotesk', sans-serif; font-weight: 700; letter-spacing: 0.2em; color: var(--primary-glow); }
.active-code-badge { font-family: 'Space Grotesk', sans-serif; font-size: .7rem; font-weight: 700; letter-spacing: .15em; color: var(--primary-glow); background: rgba(var(--primary-rgb), .1); border: 1px solid rgba(var(--primary-rgb), .25); border-radius: 5px; padding: .1rem .35rem; margin-left: .4rem; vertical-align: middle; }
.qr-mini {
  width: 56px; height: 56px; border-radius: 10px;
  background: #fff; padding: 5px; display: inline-flex;
}
.qr-mini svg, .qr-mini canvas, .qr-mini img { display: block; width: 100%; height: 100%; }

/* Queue panel */
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; border-bottom: 1px solid rgba(42, 26, 68, 0.7); }
.panel-head h3 { font-size: 1rem; }
.tabs { display: flex; gap: 0.25rem; padding: 0.6rem 1rem; }
.tab {
  padding: 0.5rem 0.9rem; border-radius: 9px; font-size: 0.85rem; font-weight: 500;
  color: var(--muted); transition: var(--transition);
}
.tab.active { background: rgba(217, 31, 191, 0.1); color: var(--primary-glow); }
.tab:hover:not(.active) { color: var(--text); }

.queue-list { padding: 0.5rem; max-height: 540px; overflow-y: auto; }
.queue-item { position: relative; display: flex; gap: 0.75rem; padding: 0.7rem; border-radius: 12px;
  transition: background var(--transition);
}
.delete-confirm {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  background: rgba(14, 6, 26, 0.92);
  border-radius: 12px;
  font-size: .875rem; font-weight: 500;
}
.delete-confirm[hidden] { display: none; }
.queue-item:hover { background: rgba(255, 255, 255, 0.03); }
.queue-item.now-playing { background: linear-gradient(90deg, rgba(217, 31, 191, 0.1), transparent); border: 1px solid rgba(217, 31, 191, 0.25); }
.queue-item.queue-item-played { opacity: 0.45; }
.queue-item.queue-item-played .meta .title { text-decoration: line-through; }
.queue-item[data-play-vid]:hover { background: rgba(255,255,255,0.06); }
.played-badge {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff; font-size: 0.65rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  border-radius: 8px;
}
.queue-item .thumb { width: 84px; height: 56px; border-radius: 8px; overflow: hidden; background: #2a1a44; flex-shrink: 0; position: relative; }
.queue-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.queue-item .thumb .dur {
  position: absolute; bottom: 4px; right: 4px;
  background: rgba(0, 0, 0, 0.75); color: #fff; font-size: 0.7rem;
  padding: 1px 5px; border-radius: 4px;
}
.queue-item .meta { flex: 1; min-width: 0; }
.queue-item .title {
  font-size: 0.92rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.queue-item .added { color: var(--muted); font-size: 0.78rem; margin-top: 0.2rem; }
.queue-item .actions { display: flex; align-items: center; gap: 0.25rem; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); transition: var(--transition); }
.icon-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }

/* Focus rings for keyboard navigation */
.btn:focus-visible,
.tab:focus-visible,
.icon-btn:focus-visible,
.modal-close:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Search bar in add panel */
.search-row { padding: 1rem; border-top: 1px solid rgba(42, 26, 68, 0.7); }

/* Dashboard */
.dash-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .dash-grid { grid-template-columns: repeat(3, 1fr); } }
.stat {
  border: 1px solid rgba(42, 26, 68, 0.7);
  background: rgba(20, 10, 36, 0.5);
  border-radius: 16px; padding: 1.4rem; backdrop-filter: blur(8px);
}
.stat .label { color: var(--muted); font-size: 0.85rem; }
.stat .num { font-family: 'Space Grotesk', sans-serif; font-size: 2.2rem; font-weight: 700; margin-top: 0.4rem; background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 2.4rem 0 1rem; }
.section-title h2 { font-size: 1.4rem; }

.list {
  border: 1px solid rgba(42, 26, 68, 0.7);
  background: rgba(20, 10, 36, 0.5);
  border-radius: 16px; overflow: hidden;
}
.list-row { display: flex; align-items: center; gap: 1rem; padding: 0.9rem 1.1rem; border-bottom: 1px solid rgba(42, 26, 68, 0.6); }
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow .t { font-weight: 500; }
.list-row .grow .s { color: var(--muted); font-size: 0.82rem; margin-top: 0.2rem; }
.list-col { display: flex; flex-direction: column; gap: .15rem; }
.list-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub   { color: var(--muted); font-size: .82rem; }

/* Status badges */
.badge-status { font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: .2rem .55rem; border-radius: 20px; white-space: nowrap; }
.badge-active   { background: rgba(0, 230, 118, .15); color: #00e676; border: 1px solid rgba(0, 230, 118, .3); }
.badge-archived { background: rgba(255, 255, 255, .07); color: var(--muted); border: 1px solid rgba(255, 255, 255, .1); }

/* Extra button size */
.btn-xs { font-size: .78rem; padding: .25rem .7rem; height: auto; }

/* Toggle checkbox — custom pill switch */
.toggle-label { display: flex; align-items: center; gap: .65rem; cursor: pointer; font-size: .9rem; font-weight: 500; }
.toggle-label input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.toggle-label span { position: relative; padding-left: 44px; }
.toggle-label span::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 36px; height: 20px; border-radius: 9999px;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}
.toggle-label span::after {
  content: ''; position: absolute; left: 3px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--muted); transition: left var(--transition), background var(--transition);
}
.toggle-label input[type="checkbox"]:checked + span::before { background: var(--primary); border-color: var(--primary); }
.toggle-label input[type="checkbox"]:checked + span::after { left: 19px; background: #fff; }
.toggle-label:focus-within { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 9999px; }

/* Favorite icon active state */
.icon-btn.fav-on { color: #ff2bd6; }

/* Playlist select in search results */
.sr-pl-select {
  -webkit-appearance: none; appearance: none;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .15);
  color: var(--muted); font-size: .72rem;
  padding: .2rem .5rem; border-radius: 8px; cursor: pointer;
  max-width: 130px;
}
.sr-pl-select:hover { background: rgba(255, 255, 255, .12); }
.sr-pl-select option { background: #1a0b2e; color: var(--text); }

/* Preview modal iframe wrapper */
.preview-frame-wrap {
  position: relative; padding-bottom: 56.25%;
  border-radius: 12px; overflow: hidden; background: #000;
}

/* Animation utilities */
.fade-in { animation: fadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* Hide on mobile helpers */
.hide-mobile { display: none; }
@media (min-width: 640px) { .hide-mobile { display: inline-flex; } }
.show-mobile { display: inline-flex; }
@media (min-width: 640px) { .show-mobile { display: none; } }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5, 2, 12, 0.75);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease-out;
}
.modal-backdrop[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 420px;
  border: 1px solid rgba(42, 26, 68, 0.8);
  background: rgba(20, 10, 36, 0.96);
  border-radius: 20px; padding: 1.6rem;
  box-shadow: var(--shadow-stage);
  position: relative;
  animation: toastIn 0.25s ease-out;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
}
.modal-close {
  position: absolute; top: 0.75rem; right: 0.75rem;
  width: 34px; height: 34px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.modal-close:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.modal h2 { font-size: 1.4rem; text-align: center; }
.modal p.sub { color: var(--muted); text-align: center; margin-top: 0.4rem; font-size: 0.9rem; }
.qr-large {
  width: 240px; height: 240px; margin: 1.4rem auto 1rem;
  background: #fff; border-radius: 14px; padding: 12px;
  box-shadow: 0 0 36px rgba(45, 212, 191, 0.2);
}
.qr-large svg, .qr-large canvas, .qr-large img { display: block; width: 100%; height: 100%; }
.modal .code-display {
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 2.4rem;
  letter-spacing: 0.4em;
  color: var(--primary-glow);
  padding-left: 0.4em; /* visually offset trailing letter-spacing */
  margin-top: 0.2rem;
}
.modal .code-label { text-align: center; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; margin-top: 0.6rem; }
.modal .url-row {
  display: flex; gap: 0.5rem; align-items: center;
  margin-top: 1.2rem;
  padding: 0.6rem 0.8rem;
  border: 1px dashed var(--border); border-radius: 10px;
  background: rgba(11, 6, 20, 0.5);
}
.modal .url-row code { flex: 1; font-size: 0.82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Autoplay countdown progress ring */
.countdown {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.85rem; color: var(--muted);
}
.countdown .ring {
  position: relative; width: 28px; height: 28px;
}
.countdown .ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.countdown .ring circle { fill: none; stroke-width: 3; }
.countdown .ring .track { stroke: rgba(42, 26, 68, 0.8); }
.countdown .ring .bar { stroke: var(--primary); transition: stroke-dashoffset 1s linear; }
.countdown strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* Room: mobile responsive tweaks */
@media (max-width: 640px) {
  .site-header .inner { height: 56px; }
  .site-header .nav .btn { padding: 0 0.6rem; }
  .site-header .nav .btn span:not(.inline-icon) { display: none; } /* icon-only on small */
  .site-header .nav .btn .inline-icon + * { display: none; }
  .player-controls { padding: 0.8rem; gap: 0.6rem; }
  .controls-left, .controls-right { gap: 0.4rem; }
  .controls-right { width: 100%; justify-content: space-between; }
  .room-meta { padding: 0.8rem; gap: 0.6rem; }
  .room-meta .pill { font-size: 0.78rem; padding: 0.35rem 0.6rem; }
  .qr-mini { width: 48px; height: 48px; }
  .video .nowtext .title { font-size: 1.1rem; padding: 0 0.8rem; }
  .panel-head { padding: 0.8rem 1rem; }
  .tabs { padding: 0.5rem 0.6rem 0; }
  .tab { padding: 0.45rem 0.7rem; font-size: 0.8rem; }
  .queue-list { padding: 0.4rem; max-height: 60vh; }
  .queue-item { padding: 0.55rem; gap: 0.55rem; }
  .queue-item .thumb { width: 64px; height: 44px; }
  .queue-item .title { font-size: 0.86rem; }
  .queue-item .added { font-size: 0.72rem; }
  .queue-item .actions .btn-sm { padding: 0 0.55rem; height: 30px; font-size: 0.78rem; }
}

/* Join page mobile */
@media (max-width: 480px) {
  .center-page { padding: 1.2rem 0.75rem; min-height: calc(100vh - 56px - 80px); }
  .card { padding: 1.4rem 1.1rem; border-radius: 18px; }
  .card h1 { font-size: 1.6rem; }
  .code-cells { gap: 0.4rem; }
  .code-cells input { width: 48px; height: 56px; font-size: 1.5rem; }
  .btn-lg { height: 48px; font-size: 0.95rem; }
}

/* Custom scrollbars */
.queue-list::-webkit-scrollbar,
.list::-webkit-scrollbar { width: 5px; }
.queue-list::-webkit-scrollbar-track,
.list::-webkit-scrollbar-track { background: transparent; }
.queue-list::-webkit-scrollbar-thumb,
.list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 9999px; }
.queue-list,
.list { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }

/* ── Theatre / full-page mode ────────────────────────────────────────────── */
body.theatre-mode .site-header { display: none; }
body.theatre-mode .container-max { padding: 0; }
body.theatre-mode .room-grid { display: block; padding: 0; gap: 0; }
body.theatre-mode aside.panel { display: none; }
body.theatre-mode .player-card { border-radius: 0; border: none; }
body.theatre-mode .player-card .video { aspect-ratio: unset; height: 100vh; }
body.theatre-mode .player-controls { display: none; }

/* Theatre exit button */
.theatre-exit-btn {
  position: fixed; top: 1rem; right: 1rem; z-index: 200;
  display: flex; align-items: center; gap: .4rem;
  padding: .45rem .9rem; border-radius: 8px;
  background: rgba(11, 6, 20, .75); border: 1px solid var(--border);
  color: var(--text); font-size: .85rem; cursor: pointer;
  opacity: 0; transition: opacity .3s;
  backdrop-filter: blur(6px);
}
.theatre-exit-btn.visible { opacity: 1; }

/* Up-next overlay */
.upnext-overlay {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .65);
  opacity: 0; pointer-events: none;
  transition: opacity .5s;
}
.upnext-overlay.visible { opacity: 1; }
.upnext-inner {
  display: flex; align-items: center; gap: 1.4rem;
  background: rgba(20, 10, 36, .85); border: 1px solid var(--border);
  border-radius: 18px; padding: 1.4rem 2rem;
  backdrop-filter: blur(10px); max-width: 480px; width: 90%;
}
.upnext-thumb { width: 120px; height: 68px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.upnext-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .3rem; }
.upnext-title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 1.05rem; line-height: 1.3; }
.upnext-countdown { color: var(--muted); font-size: .85rem; margin-top: .3rem; }

/* Theatre song-added toast (slides in from top) */
.theatre-toast {
  position: fixed; top: 1.25rem; left: 50%; transform: translateX(-50%) translateY(-120%);
  z-index: 201; background: rgba(20, 10, 36, .9); border: 1px solid var(--border);
  border-radius: 10px; padding: .6rem 1.2rem; font-size: .88rem;
  backdrop-filter: blur(8px); white-space: nowrap;
  transition: transform .3s ease-out, opacity .3s;
  opacity: 0;
}
.theatre-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .pulse-glow,
  .fade-in,
  .stage-mock .screen svg,
  .eq-bars span,
  .toast { animation: none !important; }
  .btn,
  .modal-backdrop,
  .toast,
  .toggle-label span::before,
  .toggle-label span::after { transition: none !important; }
}

/* User profile page */
.profile-banner {
  width: 100%; height: 200px; object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
}
.profile-banner-placeholder {
  width: 100%; height: 200px;
  background: linear-gradient(135deg, #1c0f30 0%, #0b0614 100%);
  border-radius: var(--radius) var(--radius) 0 0;
}
.profile-avatar {
  width: 90px; height: 90px; border-radius: 50%;
  border: 3px solid var(--bg);
  object-fit: cover;
  margin-top: -45px; background: var(--surface-2);
  flex-shrink: 0;
}
.profile-avatar-placeholder {
  width: 90px; height: 90px; border-radius: 50%;
  border: 3px solid var(--bg);
  background: var(--gradient-neon);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; font-weight: 700; color: #1a0a2e;
  margin-top: -45px; flex-shrink: 0;
}
.post-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: .85rem; }
.post-card .post-body { line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.post-actions { display: flex; align-items: center; gap: 1rem; margin-top: .7rem; }
.comment-list { margin-top: .75rem; border-top: 1px solid var(--border); padding-top: .6rem; display: none; }
.comment-item { display: flex; gap: .6rem; padding: .4rem 0; font-size: .88rem; }
.comment-item .comment-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--surface); flex-shrink: 0; display:flex;align-items:center;justify-content:center;font-size:.75rem;font-weight:600;color:var(--muted); }
.comment-form { display: flex; gap: .5rem; margin-top: .5rem; }
.comment-input { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .45rem .75rem; color: var(--text); font: inherit; font-size: .88rem; resize: none; }
.comment-input:focus { outline: none; border-color: var(--primary); }
.followers-modal-list { display: flex; flex-direction: column; gap: .5rem; max-height: 320px; overflow-y: auto; }
.follower-row { display: flex; align-items: center; gap: .75rem; padding: .4rem 0; }
.follower-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); object-fit: cover; flex-shrink: 0; display:flex;align-items:center;justify-content:center;font-size:.9rem;font-weight:600; color:var(--muted); }
.video-chip { display: inline-flex; align-items: center; gap: .4rem; background: rgba(255,255,255,.06); border: 1px solid var(--border); border-radius: 8px; padding: .25rem .6rem; font-size: .82rem; margin-top: .4rem; text-decoration: none; color: var(--accent); }
.video-chip:hover { background: rgba(255,255,255,.1); color: var(--accent); }
.top-songs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.song-chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; display: flex; align-items: center; gap: .6rem; padding: .5rem .65rem; }
.song-chip img { width: 40px; height: 30px; object-fit: cover; border-radius: 5px; background: var(--surface); flex-shrink: 0; }
.song-chip .song-info { min-width: 0; }
.song-chip .song-title { font-size: .82rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-chip .song-count { font-size: .75rem; color: var(--muted); }
