:root {
  color-scheme: dark;
  --bg: #050505;
  --bg-2: #0b0b0f;
  --card: rgba(17, 17, 22, 0.86);
  --card-2: rgba(24, 24, 31, 0.92);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --muted: #a1a1aa;
  --spotify: #1db954;
  --blue: #3b82f6;
  --yellow: #facc15;
  --red: #ef4444;
  --radius-lg: 32px;
  --radius-md: 24px;
  --radius-sm: 16px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(29, 185, 84, 0.18), transparent 28rem),
    radial-gradient(circle at 85% 10%, rgba(59, 130, 246, 0.16), transparent 30rem),
    radial-gradient(circle at 50% 95%, rgba(250, 204, 21, 0.08), transparent 24rem),
    linear-gradient(180deg, #0b0b0f 0%, #050505 55%, #020203 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

button,
.button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--spotify), #7df7a5);
  color: #031308;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(29, 185, 84, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(29, 185, 84, 0.28);
}

button:active,
.button:active {
  transform: scale(0.98);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

button.secondary,
.button.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 30px rgba(0, 0, 0, 0.22);
}

input,
select {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  padding: 0 18px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
select:focus {
  border-color: rgba(59, 130, 246, 0.75);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: -0.03em;
}

.public-shell {
  width: min(480px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 104px;
}

.admin-shell,
.container {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 52px;
}

.music-app {
  position: relative;
}

.music-app .mobile-topbar {
  position: relative;
  justify-content: center;
}

.music-app .brand-lockup {
  width: 100%;
  justify-content: center;
}

.music-app .provider-badge {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.mobile-topbar,
.admin-header,
.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.venue-logo {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  object-fit: cover;
}

.brand-logo {
  width: 112px;
  max-width: 42vw;
  height: auto;
  display: block;
  margin-inline: auto;
}

.brand-copy,
.request-main,
.track-body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.brand-copy {
  justify-items: center;
  text-align: center;
}

.brand-copy h1,
.admin-header h1,
.player-header h1 {
  margin: 0;
  font-size: clamp(1.4rem, 6vw, 2.25rem);
  line-height: 1;
}

.kicker,
.eyebrow,
.section-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.venue-pill,
.provider-badge,
.status-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 900;
}

.provider-badge.spotify,
.status-badge.green {
  color: #b9ffd0;
  background: rgba(29, 185, 84, 0.16);
  border-color: rgba(29, 185, 84, 0.35);
}

.provider-badge.youtube,
.status-badge.red {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.35);
}

.status-badge.blue {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.35);
}

.status-badge.yellow {
  color: #fef08a;
  background: rgba(250, 204, 21, 0.14);
  border-color: rgba(250, 204, 21, 0.35);
}

.music-card,
.now-card,
.search-panel,
.my-requests,
.status-panel,
.queue-panel,
.login-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(24, 24, 31, 0.9), rgba(12, 12, 16, 0.86));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.music-card,
.now-card,
.search-panel,
.my-requests,
.status-panel,
.queue-panel {
  padding: 20px;
  margin-top: 16px;
}

.hero-widget {
  min-height: 270px;
  padding: 24px;
}

.hero-widget h2 {
  max-width: 13ch;
  margin: 8px 0 12px;
  font-size: clamp(2rem, 12vw, 3.4rem);
  line-height: 0.92;
}

.hero-copy,
.muted,
small {
  color: var(--muted);
}

.widget-orb {
  position: absolute;
  right: -64px;
  top: -72px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(29, 185, 84, 0.48), rgba(59, 130, 246, 0.16) 54%, transparent 70%);
  filter: blur(2px);
}

.mode-row,
.section-heading,
.panel-title,
.admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-actions{
  margin-top: 20px;
}

.search-widget {
  margin-top: 22px;
}

.search-label {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 900;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.feedback {
  min-height: 22px;
  margin: 10px 0;
  color: var(--muted);
}

.feedback.error,
.alert.error {
  color: #fecaca;
}

.feedback.success,
.alert.success,
.status.success,
.status.good {
  color: #bbf7d0;
}

.status.warn {
  color: #fde68a;
}

.results,
.request-list,
.venue-list,
.client-table {
  display: grid;
  gap: 12px;
}

.up-next-block {
  margin-top: 16px;
}

.compact-heading {
  margin-bottom: 10px;
}

.compact-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.autocomplete-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  margin: 8px 0 12px;
  color: var(--muted);
}

.autocomplete-status[hidden],
.hidden {
  display: none;
}

.loader {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--spotify);
  border-radius: 999px;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.suggestion-item,
.track,
.request-card,
.request-row,
.queue-item,
.client-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 13px;
  align-items: center;
  width: 100%;
  min-height: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.my-requests .request-row {
  grid-template-columns: 1fr;
  padding: 18px 20px;
}

.my-requests .request-main {
  padding-left: 2px;
  gap: 6px;
}

.my-requests .request-main strong,
.my-requests .request-main span,
.my-requests .request-main small {
  white-space: normal;
}

.history-panel .request-row {
  grid-template-columns: 1fr;
  padding: 18px 20px;
}

.history-panel .request-main {
  padding-left: 2px;
  gap: 6px;
}

.history-panel .request-main strong,
.history-panel .request-main span,
.history-panel .request-main small {
  white-space: normal;
}

.suggestion-item:hover,
.suggestion-item:focus,
.queue-item.current {
  transform: translateY(-1px);
  border-color: rgba(29, 185, 84, 0.42);
  background: rgba(29, 185, 84, 0.09);
}

.suggestion-item img,
.track img,
.request-card img,
.queue-item img {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.track-body strong,
.request-main strong,
.track-body span,
.request-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.venue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.venue-row-main {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.venue-row-main strong {
  font-size: 1.05rem;
  line-height: 1.2;
}

.venue-row-main span,
.venue-row-main small {
  color: var(--muted);
  overflow-wrap: anywhere;
  white-space: normal;
}

.venue-row-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.venue-row-actions .button {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  text-align: center;
}

.request-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.request-actions button.reject {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.32);
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.035);
}

.floating-action-button {
  position: fixed;
  right: max(18px, calc((100vw - 480px) / 2 + 18px));
  bottom: 18px;
  z-index: 10;
  min-width: 72px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #06120a;
  background: linear-gradient(135deg, var(--spotify), #b4ffca);
  text-decoration: none;
  font-weight: 950;
  box-shadow: 0 18px 48px rgba(29, 185, 84, 0.34);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--spotify);
  box-shadow: 0 0 0 8px rgba(29, 185, 84, 0.12), 0 0 22px rgba(29, 185, 84, 0.6);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: end center;
  padding: 14px;
  background: rgba(0, 0, 0, 0.74);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(480px, 100%);
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: rgba(17, 17, 22, 0.98);
  box-shadow: 0 -24px 80px rgba(0, 0, 0, 0.5);
  animation: sheetIn 180ms ease both;
}

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

.modal-card form,
.login-card {
  display: grid;
  gap: 12px;
  padding: 40px;
}

.checkbox-row,
.toggle-row,
.cooldown-field {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  color: var(--text);
}

.checkbox-row input,
.toggle-row input {
  width: 22px;
  min-height: 22px;
  accent-color: var(--spotify);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.back-link {
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.venue-card {
  display: block;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.055);
  text-decoration: none;
}

.admin-dashboard {
  width: min(1240px, calc(100% - 28px));
}

.admin-hero-grid,
.admin-grid {
  display: grid;
  gap: 16px;
}

.control-card {
  display: grid;
  gap: 14px;
}

.settings-form {
  display: grid;
  gap: 12px;
}

.settings-form h3 {
  margin: 10px 0 0;
}

.venue-edit-grid {
  align-items: start;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.mode-toggle {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segmented-control button {
  min-height: 42px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.segmented-control button.active {
  color: #06120a;
  background: var(--spotify);
}

.settings-grid {
  display: grid;
  gap: 10px;
}

.cooldown-field {
  grid-template-columns: 1fr 96px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.stat-card {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.45rem, 5vw, 2.1rem);
  line-height: 1;
}

.player-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 50px;
}

.player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 36px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}

#youtubePlayer {
  width: 100%;
  height: 100%;
}

.player-stage .empty-state {
  position: absolute;
  inset: 16px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
}

.player-stage .empty-state.hidden {
  display: none;
}

.spotify-visual {
  display: grid;
  gap: 24px;
  place-items: center;
  min-height: min(72vh, 720px);
  padding: 32px;
  text-align: center;
}

.spotify-visual img,
.album-placeholder {
  width: min(52vw, 360px);
  aspect-ratio: 1;
  border-radius: 46px;
  object-fit: cover;
  background:
    radial-gradient(circle at 30% 25%, rgba(29, 185, 84, 0.9), transparent 28%),
    radial-gradient(circle at 72% 35%, rgba(59, 130, 246, 0.75), transparent 30%),
    linear-gradient(135deg, #18181f, #050505);
  box-shadow: 0 30px 90px rgba(29, 185, 84, 0.18);
}

.visual-copy h2 {
  max-width: 780px;
  margin: 8px auto 10px;
  font-size: clamp(2rem, 6vw, 5rem);
  line-height: 0.95;
}

.alert {
  margin: 12px 0;
  padding: 14px 16px;
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.055);
}

@media (min-width: 680px) {
  .public-shell {
    padding-top: 28px;
  }

  .search-box {
    grid-template-columns: 1fr auto;
  }

  .request-actions {
    grid-template-columns: repeat(4, auto);
    justify-content: start;
  }

  .venue-row {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  }

  .venue-row-actions {
    align-self: center;
    grid-template-columns: 1fr;
  }

  .admin-hero-grid,
  .admin-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .stats-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
