/* KurwaBober — Lightweight Warm Studio UI & GPU Animations */

:root {
  --bg: #0c0a0f;
  --surface: rgba(24, 20, 29, 0.82);
  --surface-solid: #17131d;
  --surface-hover: rgba(40, 33, 48, 0.88);
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f7f4f9;
  --muted: #a69bb2;
  --crimson: #e11d48;
  --crimson-soft: rgba(225, 29, 72, 0.18);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.16);
  --green: #22c55e;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Lightweight Ambient Backdrop ---------- */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.24;
  will-change: transform;
}

.orb-1 {
  width: 460px;
  height: 460px;
  top: -140px;
  left: -120px;
  background: radial-gradient(circle, var(--crimson), transparent 70%);
  animation: orbFloat1 18s ease-in-out infinite alternate;
}

.orb-2 {
  width: 420px;
  height: 420px;
  bottom: -140px;
  right: -100px;
  background: radial-gradient(circle, var(--amber), transparent 70%);
  animation: orbFloat2 22s ease-in-out infinite alternate;
}

@keyframes orbFloat1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(60px, 45px, 0) scale(1.1); }
}

@keyframes orbFloat2 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-55px, -40px, 0) scale(1.08); }
}

/* ---------- Glass Card ---------- */
.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ---------- Polish Beaver Logo & Animations ---------- */
.beaver-svg {
  display: block;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.beaver-sm { width: 42px; height: 42px; }
.beaver-lg { width: 88px; height: 88px; }
.beaver-xl { width: 96px; height: 96px; opacity: 0.92; }

.beaver-svg:hover {
  transform: scale(1.07) rotate(-3deg);
}

body.is-playing #header-beaver {
  animation: beaverGroove 1.15s ease-in-out infinite;
}

@keyframes beaverGroove {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25%      { transform: translateY(-2.5px) rotate(-2.5deg); }
  75%      { transform: translateY(-1.5px) rotate(2.5deg); }
}

/* ---------- Buttons & Inputs ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  font-weight: 600;
  transition: transform 0.14s ease, background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--crimson), #b91c48);
  color: #fff;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.32);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f43f5e, var(--crimson));
}

.btn-soft {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border);
  color: var(--text);
}

.btn-soft:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.btn-danger {
  background: rgba(225, 29, 72, 0.14);
  color: #fda4af;
  border-color: rgba(225, 29, 72, 0.28);
}

.btn-danger:hover {
  background: rgba(225, 29, 72, 0.28);
  color: #fff;
}

.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-xs { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-full { width: 100%; padding: 11px 16px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, transform 0.14s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.icon-btn.round {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--amber);
  font-size: 16px;
}

.icon-btn.round:hover {
  background: var(--amber-soft);
  transform: scale(1.06);
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pill-btn:hover,
.pill-btn.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-strong);
}

/* ---------- Auth Screen ---------- */
.auth-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 410px;
  padding: 32px 28px 24px;
  animation: cardEnter 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-brand {
  text-align: center;
  margin-bottom: 22px;
}

.logo-ring {
  width: 104px;
  height: 104px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(225, 29, 72, 0.25), rgba(245, 158, 11, 0.1) 60%, transparent 75%);
  animation: gentlePulse 3.5s ease-in-out infinite;
}

@keyframes gentlePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.03); }
}

.auth-brand h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.info-banner {
  background: var(--amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin-bottom: 14px;
  text-align: center;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.28);
  padding: 4px;
  border-radius: 11px;
  margin-bottom: 18px;
}

.auth-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease;
}

.auth-tab.active {
  background: rgba(255, 255, 255, 0.11);
  color: var(--text);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.text-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.34);
  color: var(--text);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input:focus,
.text-input:focus {
  border-color: var(--crimson);
  box-shadow: 0 0 0 3px var(--crimson-soft);
}

.form-error {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(225, 29, 72, 0.16);
  border: 1px solid rgba(225, 29, 72, 0.4);
  color: #fecdd3;
  font-size: 12.5px;
}

.auth-footnote {
  margin: 18px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.pl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff 50%, #dc143c 50%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: inline-block;
}

/* ---------- Main App Shell ---------- */
.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 0 auto;
  padding: 14px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100vh;
}

/* ---------- Top Bar ---------- */
.topbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  position: relative;
  z-index: 20;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
}

.sync-pill.connected .status-dot {
  background: var(--green);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
}

/* Search Bar */
.search-wrap {
  position: relative;
  max-width: 620px;
  width: 100%;
  justify-self: center;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.36);
  border: 1px solid var(--border);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.search-bar:focus-within {
  border-color: var(--crimson);
  box-shadow: 0 0 0 3px var(--crimson-soft);
}

.search-icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13.5px;
}

.search-mode-toggle {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 2px;
}

.mode-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}

.mode-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 430px;
  overflow-y: auto;
  padding: 10px;
  background: #17131e;
  border-color: var(--border-strong);
  z-index: 40;
  animation: popIn 0.18s ease-out both;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* Topbar User & Listeners */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.listeners-wrap {
  position: relative;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--crimson);
  box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.7);
  animation: livePing 2s ease-out infinite;
}

@keyframes livePing {
  0%   { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.65); }
  70%  { box-shadow: 0 0 0 7px rgba(225, 29, 72, 0); }
  100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}

.listeners-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  padding: 10px 12px;
  background: #17131e;
  z-index: 40;
}

.popover-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}

.listeners-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.listeners-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.listeners-list li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.user-chip {
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Workspace Two-Column Grid ---------- */
.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 1.08fr) minmax(340px, 0.92fr);
  gap: 16px;
  align-items: start;
  flex: 1;
}

/* ---------- Player Stage ---------- */
.stage-card {
  position: relative;
  padding: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stage-glow {
  position: absolute;
  inset: -40px;
  background: radial-gradient(circle at 50% 25%, rgba(225, 29, 72, 0.22), rgba(245, 158, 11, 0.08) 45%, transparent 72%);
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

body.is-playing .stage-glow {
  opacity: 0.9;
  animation: breatheGlow 4s ease-in-out infinite alternate;
}

@keyframes breatheGlow {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}

.stage-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--amber);
}

.stage-actions {
  display: flex;
  gap: 6px;
}

/* Equalizer Bars */
.eq-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.eq-bars span {
  width: 3px;
  height: 4px;
  border-radius: 2px;
  background: var(--crimson);
}

body.is-playing .eq-bars span {
  animation: eqBounce 0.9s ease-in-out infinite alternate;
}

body.is-playing .eq-bars span:nth-child(2) { animation-delay: 0.22s; }
body.is-playing .eq-bars span:nth-child(3) { animation-delay: 0.44s; }

@keyframes eqBounce {
  from { height: 3px; }
  to   { height: 12px; }
}

/* Media Stage */
.media-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: #09070c;
  border: 1px solid var(--border);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.empty-stage {
  text-align: center;
  padding: 24px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-stage h2 {
  margin: 4px 0 0;
  font-size: 19px;
}

.empty-stage p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.art-showcase {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, rgba(225, 29, 72, 0.18), #0b0910 75%);
  z-index: 2;
  transition: opacity 0.25s ease;
}

.vinyl-frame {
  position: relative;
  width: min(72%, 340px);
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: transform 0.35s ease;
}

body.is-playing .vinyl-frame {
  transform: scale(1.02);
}

.vinyl-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.art-eq-overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
  padding: 4px 7px;
  border-radius: 8px;
  background: rgba(12, 10, 15, 0.72);
  backdrop-filter: blur(6px);
}

.art-eq-overlay span {
  width: 3px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--amber), var(--crimson));
}

body.is-playing .art-eq-overlay span {
  animation: eqLarge 0.75s ease-in-out infinite alternate;
}

body.is-playing .art-eq-overlay span:nth-child(2) { animation-delay: 0.15s; }
body.is-playing .art-eq-overlay span:nth-child(3) { animation-delay: 0.35s; }
body.is-playing .art-eq-overlay span:nth-child(4) { animation-delay: 0.2s; }
body.is-playing .art-eq-overlay span:nth-child(5) { animation-delay: 0.45s; }

@keyframes eqLarge {
  from { height: 4px; }
  to   { height: 15px; }
}

/* YouTube IFrame Box: kept rendered in DOM at all times; expands in video mode */
.yt-box {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 168px;
  height: 95px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  z-index: 3;
  opacity: 0.01; /* Keeps browser rendering active without cluttering album mode */
  pointer-events: none;
  transition: all 0.25s ease;
}

.yt-box iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.media-stage.video-mode .art-showcase {
  opacity: 0;
  pointer-events: none;
}

.media-stage.video-mode .yt-box {
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: 0;
  opacity: 1;
  pointer-events: auto;
  z-index: 4;
}

/* Unlock Autoplay Overlay */
.unlock-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  border: 0;
  background: rgba(10, 8, 14, 0.76);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.unlock-pulse {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--crimson);
  font-size: 22px;
  box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.7);
  animation: livePing 1.6s ease-out infinite;
}

/* Track Meta */
.track-meta-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.track-meta-text {
  min-width: 0;
}

.track-meta-text h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-meta-text p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-chip {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

/* Scrubber */
.scrubber-row {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 10px;
}

.time-code {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--muted);
}

.time-code:last-child {
  text-align: right;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--crimson);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: transform 0.12s ease;
}

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

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--crimson);
}

/* Controls Row */
.controls-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.volume-group {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 145px;
}

.transport-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ctrl-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 16px;
  display: grid;
  place-items: center;
  transition: transform 0.14s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.06);
}

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

.ctrl-play {
  width: 54px;
  height: 54px;
  font-size: 20px;
  border: 0;
  background: linear-gradient(135deg, var(--crimson), #be123c);
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.42);
}

.ctrl-play:hover {
  background: linear-gradient(135deg, #fb7185, var(--crimson));
}

/* Toggle Switch */
.autoplay-mini,
.mini-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  cursor: pointer;
  user-select: none;
}

.autoplay-mini input,
.mini-toggle input {
  display: none;
}

.switch-track {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  padding: 3px;
  display: flex;
  align-items: center;
  transition: background 0.2s ease;
}

.switch-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

input:checked + .switch-track {
  background: var(--crimson);
}

input:checked + .switch-track .switch-thumb {
  transform: translateX(16px);
}

.switch-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- Right Panel: Up Next / Suggestions / Playlists / History ---------- */
.panel-column {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 102px);
  min-height: 540px;
  overflow: hidden;
}

.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 6px 8px 0;
  gap: 4px;
}

.panel-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
  padding: 10px 8px;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.panel-tab:hover {
  color: var(--text);
}

.panel-tab.active {
  color: var(--text);
  border-bottom-color: var(--crimson);
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.panel-body {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suggestions-block {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.section-head h3 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.section-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-sub {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.autoplay-pill {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.32);
}

.autoplay-pill.off {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  border-color: var(--border);
}

/* Track Rows */
.track-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.empty-hint {
  padding: 16px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.track-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  animation: rowFade 0.2s ease-out both;
}

@keyframes rowFade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.track-row:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.track-row.next-autoplay {
  background: linear-gradient(90deg, rgba(225, 29, 72, 0.14), rgba(245, 158, 11, 0.07));
  border-color: rgba(225, 29, 72, 0.34);
}

.track-thumb-wrap {
  position: relative;
  width: 52px;
  height: 36px;
  border-radius: 7px;
  overflow: hidden;
  background: #0d0a12;
  cursor: pointer;
}

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

.thumb-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  font-size: 13px;
  transition: opacity 0.14s ease;
}

.track-row:hover .thumb-play {
  opacity: 1;
}

.track-info {
  min-width: 0;
}

.track-title {
  font-weight: 650;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.next-tag {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--crimson);
  color: #fff;
  margin-bottom: 2px;
}

.track-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.track-actions .icon-btn {
  width: 28px;
  height: 28px;
  font-size: 13px;
}

/* Playlists Grid & Detail */
.playlists-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.playlist-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.playlist-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.playlist-cover {
  width: 56px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.35), rgba(245, 158, 11, 0.25));
  display: grid;
  place-items: center;
  font-size: 18px;
}

.playlist-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.detail-meta h4 {
  margin: 0 0 2px;
  font-size: 17px;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(6, 5, 9, 0.72);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 400px;
  padding: 18px;
  background: #181420;
  animation: cardEnter 0.2s ease-out both;
}

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

.modal-head h3 {
  margin: 0;
  font-size: 16px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.modal-row:hover {
  background: rgba(255, 255, 255, 0.11);
}

.modal-inline-form {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* ---------- Toasts ---------- */
.toast-container {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(24, 20, 31, 0.94);
  border: 1px solid var(--border-strong);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.48);
  font-size: 12.5px;
  font-weight: 500;
  max-width: 320px;
  animation: toastIn 0.22s ease-out both;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .panel-column {
    max-height: none;
    min-height: 420px;
  }
  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand user"
      "search search";
  }
  .topbar-brand { grid-area: brand; }
  .topbar-user  { grid-area: user; }
  .search-wrap  { grid-area: search; max-width: none; }
}

@media (max-width: 560px) {
  .hide-sm { display: none; }
  .controls-row {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .volume-group { max-width: 220px; width: 100%; }
  .autoplay-mini { justify-self: center; }
  .user-chip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ---------- Site Navigation Tabs & Background-Alive Music Pane ---------- */
.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  width: fit-content;
}

.site-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13.5px;
  padding: 8px 16px;
  border-radius: 11px;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.site-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.site-tab.active {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.24), rgba(245, 158, 11, 0.14));
  border-color: rgba(225, 29, 72, 0.4);
  color: var(--text);
}

.tab-ico {
  font-size: 14px;
  line-height: 1;
}

/* Keep the Music tab rendered offscreen when viewing Games/Account so YouTube audio never pauses */
.tab-offscreen {
  position: fixed !important;
  left: -9999px !important;
  top: 0 !important;
  width: 360px !important;
  height: 220px !important;
  opacity: 0.001 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

/* ---------- Avatars & Topbar Account Button ---------- */
.user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px 4px 5px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.user-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: var(--border-strong);
}

.user-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--crimson), var(--amber));
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  user-select: none;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-xs { width: 24px; height: 24px; font-size: 11px; }
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar-xl { width: 84px; height: 84px; font-size: 32px; border-width: 2.5px; }

.listeners-list li::before {
  display: none;
}

.listener-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Games Tab ---------- */
.games-library {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.games-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.section-heading {
  margin: 0 0 3px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.games-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.games-filter {
  width: 210px;
  padding: 7px 11px;
  font-size: 13px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.game-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  animation: cardEnter 0.25s ease-out both;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.game-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: radial-gradient(circle at 30% 25%, rgba(225, 29, 72, 0.35), rgba(245, 158, 11, 0.16) 55%, #120e18 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
}

.game-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.game-cover-fallback {
  font-size: 42px;
  font-weight: 800;
  opacity: 0.85;
  text-shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
}

.game-cover-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 8, 14, 0.45);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.game-card:hover .game-cover-play {
  opacity: 1;
}

.game-cover-play span {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--crimson);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.45);
}

.game-card-body {
  padding: 13px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.game-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 34px;
}

.game-card-foot {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.game-uploader {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}

.game-uploader span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-card-btns {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

/* Game Stage */
.game-stage {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.game-stage-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-stage-title {
  display: flex;
  flex-direction: column;
}

.game-stage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.game-stage-actions a {
  text-decoration: none;
}

.game-frame-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 460px;
  max-height: 76vh;
  background: #060509;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.game-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.game-stage-tip {
  margin: 0;
  text-align: center;
}

/* ---------- Account Tab ---------- */
.account-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  gap: 16px;
  align-items: start;
}

.account-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.account-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.account-card-head h3 {
  margin: 0;
  font-size: 15px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-info h2 {
  margin: 0 0 3px;
  font-size: 21px;
}

.profile-info p {
  margin: 0;
}

.avatar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.file-btn {
  cursor: pointer;
}

.file-input {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  background: rgba(0, 0, 0, 0.28);
  font-size: 12.5px;
  width: 100%;
}

textarea.text-input {
  resize: vertical;
  min-height: 58px;
  font-family: inherit;
}

.my-games-card {
  margin-top: 16px;
}

/* ---------- Floating Mini-Player (Active when on Games / Account) ---------- */
.mini-player {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  width: min(560px, calc(100vw - 24px));
  background: rgba(20, 16, 27, 0.94);
  border-color: var(--border-strong);
  animation: toastIn 0.22s ease-out both;
}

.mini-art {
  width: 44px;
  height: 32px;
  border-radius: 7px;
  object-fit: cover;
  background: #0d0a12;
  flex-shrink: 0;
}

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

.mini-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ctrl-sm {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

@media (max-width: 820px) {
  .account-grid {
    grid-template-columns: 1fr;
  }
  .site-nav {
    width: 100%;
  }
  .site-tab {
    flex: 1;
    justify-content: center;
  }
  .game-frame-wrap {
    min-height: 320px;
  }
}
