@font-face {
  font-family: "Alexandria";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/songrequests-alexandria-500.ttf") format("truetype");
}
@font-face {
  font-family: "Alexandria";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/songrequests-alexandria-600.ttf") format("truetype");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/songrequests-source-sans-3-400.ttf") format("truetype");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/songrequests-source-sans-3-500.ttf") format("truetype");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/songrequests-source-sans-3-600.ttf") format("truetype");
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(170, 0, 255, 0.18), transparent 34%),
    radial-gradient(circle at 90% 20%, rgba(0, 255, 170, 0.12), transparent 32%),
    #07090d;
  color: #d8dce2;
  font-family: "Source Sans 3", sans-serif;
}
body:not(.admin-page):not(.legal-page) { overflow: auto; }
.app {
  width: min(1420px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
body:not(.admin-page):not(.legal-page) .app { height: auto; }
.header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(128px, 1fr);
  gap: 18px;
  align-items: flex-start;
  flex: 0 0 auto;
}
.header > div:first-child { min-width: 0; }
.header-actions {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: flex-start;
  justify-self: stretch;
}
.header > .status,
.header > .secondary-link {
  grid-column: 3;
  justify-self: end;
}
.channel-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: max-content;
}
h1, h2 { margin: 0; font-family: "Alexandria", sans-serif; line-height: 1.1; }
h1 { font-size: 36px; }
h2 { font-size: 20px; }
p { margin: 8px 0 0; color: #aeb6c2; }
.hidden { display: none !important; }
.status {
  justify-self: end;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(10, 13, 18, 0.72);
  border: 1px solid rgba(0, 255, 170, 0.35);
  color: #00ffaa;
  white-space: nowrap;
}
.channel-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  min-height: 36px;
  max-height: 36px;
  padding: 8px 13px;
  border-radius: 10px;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(90deg, #aa00ff, #00ffaa);
  border: 0;
  line-height: 1;
  cursor: pointer;
}
.channel-button:visited { color: #ffffff; }
.channel-button:hover {
  transform: translateY(-1px);
  color: #ffffff;
  filter: brightness(1.08);
}
.quotes-page { max-width: 1100px; }
.quote-browser { display: grid; gap: 16px; }
.quote-browser > input { width: 100%; padding: 12px 14px; }
.quote-public-list { display: grid; gap: 12px; }
.quote-public-item { position: relative; padding: 18px 20px 18px 76px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.035); }
.quote-public-item blockquote { margin: 0; font-size: 1.08rem; line-height: 1.5; white-space: pre-wrap; }
.quote-number { position: absolute; left: 18px; top: 18px; color: #b987ff; font-weight: 700; }
.quote-author { margin-top: 8px; color: var(--muted); }
.channel-button svg {
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
  flex: 0 0 auto;
  fill: currentColor;
  display: block;
}
.channel-button span {
  color: inherit;
  line-height: 1;
}
.viewer {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: 14px;
  background: rgba(10, 13, 18, 0.48);
  border: 1px solid rgba(216, 220, 226, 0.10);
  flex: 0 0 auto;
}
.viewer label { color: #aeb6c2; font-weight: 600; }
.username-wrap { display: grid; gap: 5px; }
.username-hint { color: #7f8896; font-size: 13px; }
input, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(216, 220, 226, 0.16);
  background: rgba(10, 13, 18, 0.72);
  color: #eceff4;
  font: inherit;
  outline: none;
}
input:focus, select:focus {
  border-color: rgba(0, 255, 170, 0.42);
  box-shadow: 0 0 0 3px rgba(0, 255, 170, 0.06);
}
.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr);
  gap: 14px;
  min-height: 0;
  flex: 1 1 auto;
}
body:not(.admin-page):not(.legal-page) .page-grid {
  align-items: start;
  flex: 0 0 auto;
}
.admin-page .page-grid {
  align-items: start;
  flex: 0 0 auto;
}
.now-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  flex: 0 0 auto;
}
.panel {
  min-height: 0;
  border-radius: 16px;
  background: rgba(10, 13, 18, 0.58);
  border: 1px solid rgba(216, 220, 226, 0.10);
  box-shadow:
    0 0 10px rgba(0, 255, 170, 0.04),
    0 0 16px rgba(170, 0, 255, 0.04);
}
.library-panel { display: flex; flex-direction: column; padding: 16px; }
body:not(.admin-page):not(.legal-page) .library-panel {
  max-height: clamp(430px, 62vh, 720px);
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex: 0 0 auto;
}
.panel-header.compact { margin-bottom: 4px; }
.panel-title { padding-bottom: 1rem; }
.panel-header.compact .panel-title { padding-bottom: 0.35rem; }
.now-card { padding: 16px; }
.now-content { min-height: 58px; }
.muted { color: #7f8896; }
.controls {
  display: grid;
  grid-template-columns: 1fr 190px 160px;
  gap: 12px;
  margin-bottom: 14px;
  flex: 0 0 auto;
}
.song-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
  overflow: auto;
  flex: 1 1 auto;
  padding-right: 6px;
  min-height: 0;
  align-content: start;
  grid-auto-rows: max-content;
}
.song-card {
  position: relative;
  padding: 15px 16px;
  background: rgba(10, 13, 18, 0.72);
  box-shadow:
    0 0 10px rgba(0, 255, 170, 0.05),
    0 0 14px rgba(170, 0, 255, 0.05);
  overflow: hidden;
  align-self: start;
  min-height: 142px;
}
.song-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: 14px;
  background: linear-gradient(90deg, #aa00ff, #00ffaa);
  opacity: 0.32;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.song-title {
  font-family: "Alexandria", sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #eceff4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-artist { margin-top: 3px; color: #b4bbc6; }
.meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #cfd5df;
  font-size: 13px;
}
.played-count {
  color: #00ffaa;
  border-color: rgba(0, 255, 170, 0.22);
  white-space: nowrap;
}
.actions { display: flex; justify-content: flex-end; margin-top: 14px; }
button {
  border: 0;
  border-radius: 10px;
  padding: 8px 13px;
  background: linear-gradient(90deg, #aa00ff, #00ffaa);
  color: #081016;
  font-weight: 700;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button:disabled { cursor: not-allowed; opacity: 0.45; filter: grayscale(0.6); }
.secondary-button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #d8dce2;
}
.queue { display: flex; flex-direction: column; padding: 16px; }
.queue-list {
  overflow: auto;
  min-height: 0;
  padding: 2px 4px 0 0;
}
body:not(.admin-page) .queue-list {
  padding-top: 6px;
}
.legal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  flex: 0 0 auto;
  color: #7f8896;
  font-size: 13px;
}
.admin-stats {
  flex-basis: 100%;
  text-align: center;
  color: #aeb6c2;
}
.legal-footer a {
  color: #aeb6c2;
  text-decoration: none;
}
.legal-footer a:hover {
  color: #00ffaa;
}
.secondary-link {
  align-self: flex-start;
  padding: 8px 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #d8dce2;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.secondary-link:hover {
  border-color: rgba(0, 255, 170, 0.35);
  color: #00ffaa;
}
.legal-app {
  max-width: 960px;
  min-height: 100vh;
}
.legal-content {
  display: grid;
  gap: 22px;
  padding: 22px;
}
.legal-content section {
  display: grid;
  gap: 8px;
}
.legal-content h2 {
  font-size: 18px;
}
.legal-content p {
  margin: 0;
  max-width: 78ch;
  line-height: 1.6;
}
.empty-queue {
  height: 100%;
  min-height: 160px;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  color: #aeb6c2;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  padding: 18px;
}
.empty-title { font-family: "Alexandria", sans-serif; font-size: 18px; color: #eceff4; }
.empty-subtitle { color: #8d96a5; }
.queue-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.queue-item:first-child { border-top: 0; padding-top: 0; }
.queue-position {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 255, 170, 0.075);
  border: 1px solid rgba(0, 255, 170, 0.22);
  color: #00ffaa;
  font-weight: 800;
  line-height: 1;
  margin-top: 0.2em;
}
.queue-content { min-width: 0; }
.queue-title {
  font-family: "Alexandria", sans-serif;
  font-weight: 600;
  color: #eceff4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-artist, .queue-user {
  color: #aeb6c2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-user { margin-top: 5px; color: #7f8896; font-size: 13px; }
.now-content .song-title,
.now-content .song-artist,
.now-content .queue-user,
.queue-item .queue-title,
.queue-item .queue-artist {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}
.queue-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.queue-button { padding: 6px 10px; font-size: 13px; }
.delete-button {
  background: rgba(255, 138, 138, 0.14);
  border: 1px solid rgba(255, 138, 138, 0.35);
  color: #ffb3b3;
}
.pause-active-button {
  background: rgba(255, 205, 96, 0.14);
  border: 1px solid rgba(255, 205, 96, 0.35);
  color: #ffe0a3;
}
.cookie-notice {
  position: fixed;
  inset: auto 16px 16px 16px;
  z-index: 50;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.cookie-notice-content {
  width: min(760px, 100%);
  padding: 16px;
  border-radius: 14px;
  background: rgba(10, 13, 18, 0.96);
  border: 1px solid rgba(0, 255, 170, 0.28);
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.42);
  pointer-events: auto;
}
.cookie-notice h2 {
  font-size: 18px;
}
.cookie-notice p {
  margin-top: 8px;
}
.cookie-notice-small {
  font-size: 13px;
  color: #8d96a5;
}
.cookie-notice button {
  margin-top: 12px;
}
.library-admin-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 260px;
}
.admin-page .library-admin-panel {
  max-height: clamp(430px, 62vh, 720px);
}
.admin-library-search {
  max-width: 340px;
  padding: 9px 12px;
}
.admin-library-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 44vh;
  padding-right: 4px;
}
.admin-page .admin-library-list {
  max-height: none;
}
.library-edit-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(170px, 1.25fr) 112px minmax(130px, 0.8fr) minmax(130px, 0.9fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: rgba(10, 13, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.library-edit-row input,
.library-edit-row select {
  padding: 8px 10px;
  border-radius: 9px;
}
.library-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.login-panel { padding: 20px; max-width: 680px; }
.login-form { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-top: 16px; }
.admin-dashboard { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.admin-main-actions { margin-top: 14px; }
.admin-add-form {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(170px, 1.3fr) 120px 150px minmax(130px, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.admin-add-form input, .admin-add-form select { padding: 10px 12px; }
.admin-add-form button { white-space: nowrap; }
.admin-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  color: #aeb6c2;
  background: rgba(0, 255, 170, 0.045);
  border: 1px solid rgba(0, 255, 170, 0.14);
}
.quotes-admin-panel { display: grid; gap: 14px; }
.admin-quotes-list { display: grid; gap: 12px; }
.quote-admin-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr) auto; gap: 10px; align-items: start; padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; }
.quote-admin-form textarea { min-height: 78px; resize: vertical; padding: 10px 12px; }
.quote-admin-form input { padding: 10px 12px; }
.quote-admin-form .queue-user, .quote-admin-form label, .quote-admin-heading, .quote-admin-actions { grid-column: 1 / -1; }
.quote-admin-heading, .quote-admin-actions { display: flex; gap: 10px; align-items: center; }
@media (max-width: 760px) { .quote-admin-form { grid-template-columns: 1fr; } .quote-admin-form > * { grid-column: 1 !important; } }
.suggestion-panel {
  padding: 16px;
  flex: 0 0 auto;
}
.suggestion-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.2fr) minmax(220px, 1.4fr) auto;
  gap: 10px;
  align-items: center;
}
.suggestion-form input { padding: 10px 12px; }
.suggestion-form button { white-space: nowrap; }
.suggestions-admin-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 220px;
}
.suggestions-admin-panel .admin-note {
  margin-top: 0;
  margin-bottom: 12px;
}
.admin-suggestions-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  max-height: 34vh;
  padding-right: 4px;
}
.suggestion-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: rgba(10, 13, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.suggestion-content { min-width: 0; }
.suggestion-note {
  margin-top: 6px;
  color: #cfd5df;
  overflow-wrap: anywhere;
}
.suggestion-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.song-list::-webkit-scrollbar, .queue-list::-webkit-scrollbar { width: 8px; }
.song-list::-webkit-scrollbar-track, .queue-list::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.035); border-radius: 999px; }
.song-list::-webkit-scrollbar-thumb, .queue-list::-webkit-scrollbar-thumb { background: rgba(0, 255, 170, 0.22); border-radius: 999px; }
@media (max-width: 1180px) {
  .admin-add-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-add-form button { grid-column: 1 / -1; }
  .library-edit-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-row-actions { justify-content: flex-start; }
  .suggestion-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .suggestion-form button { grid-column: 1 / -1; }
}
@media (max-width: 920px) {
  body { overflow: auto !important; }
  .app { height: auto !important; min-height: 100vh; }
  .header {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .header > .status,
  .header > .secondary-link {
    grid-column: 2;
  }
  .header-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: auto minmax(0, 1fr);
  }
  .channel-links { justify-content: flex-start; }
  .page-grid, .now-grid { grid-template-columns: 1fr; }
  .queue-list { max-height: none; overflow: visible; }
}
@media (max-width: 720px) {
  .header, .viewer, .controls, .login-form { grid-template-columns: 1fr; display: grid; }
  .header > .status,
  .header > .secondary-link {
    grid-column: auto;
    justify-self: start;
  }
  .header-actions {
    grid-column: auto;
    grid-row: auto;
    grid-template-columns: 1fr;
    display: grid;
    gap: 10px;
  }
  .channel-links { justify-content: flex-start; }
  .status { justify-self: start; }
  .song-list { grid-template-columns: 1fr; }
  .suggestion-form,
  .suggestion-item {
    grid-template-columns: 1fr;
  }
  .suggestion-actions { justify-content: flex-start; }
}
