:root {
  --bg: #06090f;
  --panel: rgba(12, 18, 28, 0.82);
  --line: rgba(255,255,255,0.12);
  --text: #f5f7fb;
  --muted: #9eafc0;
  --teal: #5eead4;
  --amber: #fbbf24;
  --rose: #fb7185;
  --ok: #34d399;
  --radius: 28px;
  --shadow: 0 28px 80px rgba(0,0,0,.5);
  --font: "Poppins", system-ui, sans-serif;
  --display: "Poppins", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { display: block; max-width: 100%; }

.bg-layer { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%;
  filter: blur(90px); opacity: .3; animation: float 16s ease-in-out infinite;
}
.b1 { background: #0f766e; top: -18%; left: -12%; }
.b2 { background: #92400e; right: -16%; bottom: -20%; animation-delay: -7s; opacity: .24; }
.b3 { background: #1d4ed8; top: 40%; left: 40%; width: 35vmax; height: 35vmax; opacity: .14; animation-delay: -3s; }
.grain {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 3px 3px; opacity: .22;
}
@keyframes float {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(3%,5%) scale(1.08); }
}

#app { min-height: 100dvh; }
.display { font-family: var(--display); letter-spacing: -0.045em; line-height: .98; font-weight: 800; }
.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 22px; border-radius: 999px; font-weight: 700; font-size: 1.05rem;
  transition: .2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--teal), #2dd4bf 40%, var(--amber));
  color: #041018;
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
}
.btn-danger {
  background: rgba(251,113,133,.14);
  color: var(--rose);
  border: 1px solid rgba(251,113,133,.28);
  min-height: 42px; padding: 0 14px; font-size: .95rem;
}
.btn-sm { min-height: 42px; padding: 0 14px; font-size: .95rem; }
.field {
  width: 100%; min-height: 56px; padding: 0 18px;
  border-radius: 18px; border: 1px solid var(--line);
  background: rgba(255,255,255,.04); outline: none; font-size: 1.05rem;
}
.field:focus { border-color: var(--teal); }

/* LANDING / LOGIN */
.landing {
  min-height: 100dvh;
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 40px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}
.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0 10px;
}
.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center; font-weight: 800; font-size: 1.35rem;
  background: linear-gradient(135deg, var(--teal), var(--amber)); color: #041018;
}
.brand-name { font-size: clamp(1.25rem, 2.8vw, 1.7rem); font-weight: 800; letter-spacing: -0.03em; }

.landing-main {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  min-height: calc(100dvh - 120px);
}
.landing-copy { padding: 8px 0 20px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--teal); font-weight: 700; font-size: .95rem;
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 18px;
}
.landing-copy h1 {
  font-size: clamp(2.6rem, 7.2vw, 5.2rem);
  max-width: 11ch;
  margin-bottom: 18px;
}
.landing-copy .lead {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--muted);
  max-width: 38ch;
  margin-bottom: 22px;
}
.landing-points {
  list-style: none; display: grid; gap: 12px;
  color: var(--text); font-size: 1.02rem; font-weight: 500;
}
.landing-points li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 16px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line);
}
.landing-points li::before {
  content: ""; width: 10px; height: 10px; margin-top: 7px; flex-shrink: 0;
  border-radius: 50%; background: linear-gradient(135deg, var(--teal), var(--amber));
}

.login-card {
  border-radius: 30px;
  padding: clamp(22px, 3vw, 34px);
  display: grid; gap: 14px;
  background:
    linear-gradient(160deg, rgba(94,234,212,.1), rgba(251,191,36,.05) 40%, rgba(12,18,28,.9)),
    rgba(12,18,28,.85);
}
.login-card h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800; letter-spacing: -0.03em;
}
.login-card .sub { color: var(--muted); font-size: 1.02rem; }

.google-panel {
  margin-top: 6px;
  padding: 18px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 14px 34px rgba(0,0,0,.22);
  display: grid;
  gap: 12px;
  justify-items: stretch;
}
.google-panel-label {
  color: #0f172a;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
}
.google-btn-slot {
  width: 100%;
  min-height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.google-btn-slot > div {
  margin: 0 auto !important;
}

/* SHELL / LOBBY */
.shell { width: min(1280px, calc(100% - 28px)); margin: 0 auto; padding: 22px 0 88px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px;
}
.user-chip {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px 8px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.03);
  font-weight: 600; font-size: 1rem;
}
.avatar, .user-chip img {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #12202b;
}
.lobby-hero {
  display: grid; gap: 22px; margin-bottom: 36px;
  padding: clamp(24px, 4vw, 42px);
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(135deg, rgba(94,234,212,.12), rgba(251,191,36,.08)),
    rgba(255,255,255,.02);
  border: 1px solid var(--line);
}
.lobby-hero h1 { font-size: clamp(2.6rem, 7vw, 4.8rem); }
.lobby-hero p { color: var(--muted); font-size: 1.15rem; max-width: 42ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.section-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin: 32px 0 16px;
}
.section-head h2 { font-family: var(--display); font-size: clamp(1.5rem, 3vw, 2rem); }
.section-head span { color: var(--muted); font-size: 1rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.room-card {
  border-radius: 24px; padding: 22px; min-height: 210px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: .2s ease; border: 1px solid var(--line);
}
.room-card:hover { transform: translateY(-4px); border-color: rgba(94,234,212,.35); }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line);
}
.badge.public { color: var(--teal); }
.badge.private { color: var(--amber); }
.live { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 700; font-size: .95rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(52,211,153,0); } }
.room-card h3 { font-family: var(--display); font-size: 1.85rem; margin-top: 18px; }
.room-card .meta { color: var(--muted); margin-top: 10px; font-size: 1rem; }
.now { margin-top: 14px; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ROOM */
.room-top {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; margin-bottom: 20px;
}
.room-layout {
  display: grid;
  grid-template-columns: 1.45fr .95fr;
  gap: 18px;
}
.side-stack { display: grid; gap: 18px; }
.panel { border-radius: var(--radius); padding: 20px; }
.panel-title {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px;
}
.panel-title h3 { font-family: var(--display); font-size: 1.45rem; }

.player-stage {
  position: relative; border-radius: 22px; overflow: hidden; background: #000;
  aspect-ratio: 16/9;
}
.player-stage iframe, #yt-player { width: 100%; height: 100%; border: 0; }
/* Mode host-saja: hilangkan YT total (bukan cuma visibility) agar judul YT tidak dobel */
.player-stage.show-solo-cover iframe,
.player-stage.show-solo-cover #yt-player {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}
.solo-cover {
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-items: center;
  overflow: hidden;
  background:
    var(--solo-art, none) center / cover no-repeat,
    #05080d;
}
.solo-cover[hidden] { display: none !important; }
.solo-art {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  filter: saturate(1.05) brightness(.72);
}
.solo-cover-fade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(5,8,13,.15), transparent 35%),
    linear-gradient(0deg, rgba(5,8,13,.75), transparent 42%);
  pointer-events: none;
}
.solo-cover-badge {
  position: absolute;
  left: 14px; bottom: 14px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(8,14,22,.72);
  backdrop-filter: blur(8px);
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
}
.sync-unlock {
  position: absolute; inset: 0; z-index: 4;
  display: grid; place-items: center;
  margin: 0; border: 0; cursor: pointer;
  background: rgba(5, 8, 13, 0.72);
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-weight: 700;
  backdrop-filter: blur(4px);
}
.sync-unlock[hidden] { display: none !important; }
.now-block { margin-top: 18px; }
.now-block .kicker { color: var(--muted); font-size: 1rem; margin-bottom: 6px; }
.now-block h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.15; }
.controls {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px;
  position: relative; z-index: 3;
}
.icon-btn {
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255,255,255,.04);
  display: grid; place-items: center; font-size: 1.15rem;
  cursor: pointer; touch-action: manipulation; user-select: none;
}
.icon-btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn:not(:disabled):active { transform: scale(.94); }
.icon-btn.active { border-color: var(--teal); color: var(--teal); }
.progress {
  flex: 1; min-width: 140px; height: 8px; border-radius: 99px;
  appearance: none; background: rgba(255,255,255,.1);
}
.progress::-webkit-slider-thumb {
  appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--teal);
}
.host-bar {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px;
}
.chip-toggle {
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); font-weight: 700; font-size: .95rem;
}
.chip-toggle.on { border-color: var(--teal); background: rgba(94,234,212,.12); color: var(--teal); }

.queue-item, .member-item, .chat-item, .block-item {
  display: flex; gap: 12px; align-items: center; padding: 12px;
  border-radius: 16px; touch-action: none;
}
.queue-item { cursor: grab; background: rgba(255,255,255,.02); margin-bottom: 8px; }
.queue-item:active { cursor: grabbing; }
.queue-item.active { background: rgba(94,234,212,.12); border: 1px solid rgba(94,234,212,.25); }
.queue-item.sortable-ghost { opacity: .4; }
.thumb { width: 72px; height: 52px; border-radius: 12px; object-fit: cover; background: #111; flex-shrink: 0; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 1.05rem; }
.who { color: var(--muted); font-size: .92rem; display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.who img { width: 20px; height: 20px; border-radius: 50%; }
.scroll { overflow: auto; max-height: min(52dvh, 520px); }
.scroll::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 99px; }

.chat-item { align-items: flex-start; }
.chat-bubble {
  background: rgba(255,255,255,.05); padding: 12px 14px; border-radius: 16px; font-size: 1.05rem;
}
.composer { display: grid; gap: 10px; margin-top: 12px; }
.anon { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 1rem; }
.online-dot { width: 10px; height: 10px; border-radius: 50%; background: #475569; flex-shrink: 0; }
.online-dot.on { background: var(--ok); }

.modal-bg {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  padding: 18px; background: rgba(0,0,0,.62);
}
.modal {
  width: min(720px, 100%); border-radius: 28px; padding: 28px;
}
.modal-wide {
  width: min(820px, 100%);
}
.modal h3 { font-family: var(--display); font-size: 2rem; margin-bottom: 8px; }
.modal .row { display: grid; gap: 12px; margin-top: 16px; }
.queue-title {
  font-weight: 600; font-size: 1.05rem; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.search-item .grow.ellipsis,
.search-item .ellipsis {
  white-space: normal;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.35;
}
.toggle { display: flex; gap: 10px; }
.toggle button { flex: 1; }
.search-list { display: grid; gap: 10px; max-height: 42dvh; overflow: auto; margin-top: 14px; }
.recommend-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px;
}
.recommend-head .tiny { margin: 0; }
.search-item {
  display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; cursor: pointer;
}
.search-item:hover { background: rgba(255,255,255,.05); }
.import-item { cursor: default; }
.import-item .icon-btn { flex-shrink: 0; }

#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: grid; gap: 10px; }
.toast {
  background: #0d1520; border: 1px solid var(--line); padding: 14px 16px;
  border-radius: 14px; min-width: 240px; font-size: 1rem; box-shadow: var(--shadow);
}
.empty { color: var(--muted); padding: 28px 10px; text-align: center; font-size: 1.05rem; }
.tiny { color: var(--muted); font-size: .95rem; }
.member-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.lyrics-panel { margin-top: 18px; }
.lyrics-scroll {
  --lyrics-h: min(320px, 42vh);
  height: var(--lyrics-h);
  overflow: hidden;
  position: relative;
  padding: 0;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(8,14,22,.92), transparent 18%),
    linear-gradient(0deg, rgba(8,14,22,.92), transparent 18%),
    rgba(255,255,255,.03);
  border: 1px solid var(--line);
  mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
  touch-action: none;
  user-select: none;
}
.lyrics-track {
  will-change: transform;
  transition: transform .45s cubic-bezier(.22,.61,.36,1);
  padding: 0 18px;
}
.lyric-line {
  padding: 10px 8px;
  color: rgba(244,247,251,.28);
  font-size: 1.15rem;
  line-height: 1.45;
  text-align: center;
  font-weight: 600;
  letter-spacing: .01em;
  transform: scale(.94);
  transform-origin: center;
  transition: color .2s ease, opacity .2s ease, transform .35s ease, filter .2s ease;
  filter: blur(.2px);
}
.lyric-line.near {
  color: rgba(244,247,251,.52);
  transform: scale(.98);
  filter: none;
}
.lyric-line.active {
  color: var(--text);
  transform: scale(1.08);
  filter: none;
}
.lyric-word { display: inline; transition: color .08s linear; }
.lyric-word.done { color: rgba(244,247,251,.55); }
.lyric-word.active {
  color: var(--teal);
  text-shadow: 0 0 18px rgba(94,234,212,.35);
  font-weight: 700;
}
.lyrics-scroll .empty,
.lyrics-scroll .inline-loading {
  height: 100%;
  display: grid;
  place-content: center;
  padding: 24px 12px;
}

.global-loading {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  background: rgba(4, 8, 14, 0.55);
  backdrop-filter: blur(6px);
}
.global-loading[hidden] { display: none !important; }
.global-loading-card {
  min-width: min(280px, calc(100% - 40px));
  padding: 22px 26px;
  border-radius: 22px;
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}
.global-loading-text { font-weight: 600; color: var(--text); }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.inline-loading {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 1rem; padding: 18px 8px;
}
.inline-loading .spinner { width: 22px; height: 22px; border-width: 2px; }

@media (max-width: 980px) {
  .room-layout { grid-template-columns: 1fr; }
  .scroll { max-height: 360px; }
  .shell { width: calc(100% - 20px); }
  .landing { width: calc(100% - 20px); }
  .landing-main {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 22px;
    align-items: stretch;
  }
  .landing-copy h1 { max-width: 14ch; }
  .login-card { order: -1; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .btn { min-height: 50px; }
  .actions { flex-direction: column; }
  .actions .btn { width: 100%; }
  .landing { padding: 14px 0 28px; }
  .landing-copy { padding-top: 4px; }
  .landing-points li { font-size: .98rem; }
  .google-panel { padding: 16px; }
  .icon-btn { width: 46px; height: 46px; }
  .thumb { width: 64px; height: 46px; }
  .brand-mark { width: 46px; height: 46px; font-size: 1.15rem; border-radius: 14px; }
}
