:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #64748b;
  --line: #d9e1ea;
  --teal: #0f766e;
  --blue: #1d4ed8;
  --amber: #b45309;
  --red: #b91c1c;
  --green: #15803d;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px;
  background: #111827;
  color: #fff;
  border-bottom: 4px solid var(--teal);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar .eyebrow {
  color: #9ca3af;
}

h1,
h2 {
  margin: 0;
  line-height: 1.12;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 19px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stream-link,
.button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 7px;
  padding: 9px 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.stream-link {
  border-color: transparent;
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
}

.badge-live {
  background: #dcfce7;
  color: var(--green);
}

.badge-off {
  background: #fee2e2;
  color: var(--red);
}

.badge-wait,
.pill {
  background: #e2e8f0;
  color: #334155;
}

.shell {
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 124px;
  padding: 18px;
}

.metric .label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 34px;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 16px;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

.details div {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 5px 0 0;
  word-break: break-word;
}

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

.library-stats div {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.library-stats strong {
  display: block;
  font-size: 28px;
}

.library-stats span {
  color: var(--muted);
  font-size: 13px;
}

.table-panel {
  margin-top: 16px;
}

.filter {
  width: min(360px, 100%);
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  font: inherit;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.status-ok {
  color: var(--green);
  font-weight: 800;
}

.status-missing {
  color: var(--red);
  font-weight: 800;
}

.status-folder {
  color: var(--amber);
  font-weight: 800;
}

.path-cell {
  color: var(--muted);
  font-size: 13px;
  max-width: 520px;
  word-break: break-word;
}

.error-box {
  margin-top: 16px;
  border-left: 4px solid var(--red);
  background: #fef2f2;
  color: var(--red);
  padding: 12px;
}

.requests-panel {
  margin-top: 16px;
}

.admin-grid {
  margin-top: 16px;
}

.visual-panel {
  margin-top: 16px;
}

.requests-list {
  display: grid;
  gap: 10px;
}

.request-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.folder-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.folder-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.request-card.status-new {
  border-left-color: var(--amber);
}

.request-card.status-rejected {
  border-left-color: var(--red);
}

.request-card.status-played {
  border-left-color: var(--green);
}

.request-title {
  font-weight: 800;
}

.request-meta,
.request-dedication {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.request-card p {
  margin: 9px 0 0;
}

.request-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 300px;
}

.request-actions button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  padding: 7px 9px;
  font-weight: 700;
  cursor: pointer;
}

.request-actions .danger-button {
  border-color: #fecaca;
  background: #fff1f2;
  color: var(--red);
}

.request-status {
  border-radius: 7px;
  background: #e2e8f0;
  padding: 7px 9px;
  font-weight: 800;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.request-form {
  width: min(720px, 100%);
  margin: 24px auto 0;
  padding: 18px;
  border: 1px solid rgba(203, 213, 225, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
}

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

.request-form label {
  display: grid;
  gap: 6px;
  color: #cbd5e1;
  font-weight: 700;
}

.request-form input,
.request-form textarea {
  width: 100%;
  border: 1px solid rgba(203, 213, 225, 0.35);
  border-radius: 7px;
  padding: 10px;
  background: #f8fafc;
  color: #111827;
  font: inherit;
}

.request-form textarea {
  margin-top: 12px;
  resize: vertical;
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: #dbeafe;
}

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

.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.admin-form input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  font: inherit;
}

.admin-form select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  background: #fff;
  font: inherit;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.theme-card {
  display: grid;
  gap: 8px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.theme-card.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.16);
}

.theme-card span {
  display: block;
  min-height: 74px;
  border-radius: 7px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background-color: #111827;
  background-position: center;
  background-size: cover;
}

.theme-card strong {
  min-height: 38px;
  font-size: 13px;
  line-height: 1.15;
}

.theme-classic span {
  background: linear-gradient(135deg, #101820, #16212d 45%, #263445);
}

.theme-zeppelin span {
  background:
    radial-gradient(ellipse at 75% 24%, #f8fafc 0 8%, transparent 9%),
    radial-gradient(ellipse at 22% 70%, #d1d5db 0 10%, transparent 11%),
    linear-gradient(135deg, #18212a, #233243 58%, #111827);
}

.theme-vintage span {
  background:
    radial-gradient(circle at 50% 52%, #f7c873 0 12%, #6b3f22 13% 22%, transparent 23%),
    repeating-linear-gradient(90deg, rgba(70, 38, 20, 0.38) 0 5px, transparent 5px 11px),
    linear-gradient(135deg, #2f1f18, #8a5a34);
}

.theme-score span {
  background:
    repeating-linear-gradient(0deg, transparent 0 15px, rgba(255,255,255,0.42) 15px 17px),
    radial-gradient(circle at 68% 34%, #ef4444 0 7px, transparent 8px),
    radial-gradient(circle at 28% 65%, #22d3ee 0 7px, transparent 8px),
    linear-gradient(135deg, #111827, #334155);
}

.theme-studio span {
  background:
    linear-gradient(90deg, rgba(34,197,94,0.7) 0 4px, transparent 4px 9px),
    linear-gradient(135deg, #0b1120, #172554 50%, #0f172a);
}

.theme-live-preview {
  min-height: 280px;
  display: grid;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #111827;
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.theme-live-preview span {
  display: block;
  padding: 14px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-weight: 900;
}

.media-mode-form {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.playlist-reset-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 14px;
  background: #eff6ff;
}

.playlist-reset-box strong,
.playlist-reset-box span {
  display: block;
}

.playlist-reset-box span,
.reset-feedback {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.reset-feedback {
  min-height: 18px;
  margin-top: 8px;
  font-weight: 800;
}

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

.login-page {
  min-height: 100vh;
  background: #111827;
}

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

.login-card {
  width: min(430px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 26px;
}

.login-card h1 {
  color: var(--text);
  font-size: 28px;
  margin-bottom: 22px;
}

.login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.login-card input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  font: inherit;
}

.login-card .button {
  margin-top: 16px;
}

.login-error {
  margin-top: 12px;
  border-left: 4px solid var(--red);
  background: #fef2f2;
  color: var(--red);
  padding: 10px;
}

@media (max-width: 980px) {
  .overview,
  .grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .request-card {
    grid-template-columns: 1fr;
  }

  .folder-card {
    grid-template-columns: 1fr;
  }

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

  .request-actions {
    justify-content: flex-start;
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .shell {
    padding: 14px;
  }

  .details,
  .library-stats,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .theme-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 25px;
  }
}

.player-page {
  min-height: 100vh;
  background: #101820;
  color: #f8fafc;
  overflow-x: hidden;
  position: relative;
}

.player-page::before,
.player-page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.player-page::before {
  z-index: 0;
}

.player-page::after {
  z-index: 1;
}

.player-theme-classic {
  background:
    radial-gradient(circle at 52% 44%, rgba(30, 41, 59, 0.72), transparent 32%),
    linear-gradient(135deg, #0f1720, #111827 45%, #182330);
}

.player-theme-classic::before {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
}

.player-theme-zeppelin {
  background:
    linear-gradient(180deg, rgba(7, 10, 16, 0.22), rgba(7, 10, 16, 0.78)),
    radial-gradient(circle at 50% 18%, rgba(248, 250, 252, 0.14), transparent 30%),
    linear-gradient(135deg, #1f2933, #263647 48%, #0f172a);
}

.player-theme-zeppelin::before {
  background:
    radial-gradient(ellipse at 16% 24%, rgba(226,232,240,0.42) 0 5%, transparent 5.3%),
    radial-gradient(ellipse at 78% 30%, rgba(203,213,225,0.38) 0 4%, transparent 4.3%),
    radial-gradient(ellipse at 35% 72%, rgba(248,250,252,0.28) 0 4.5%, transparent 4.8%),
    radial-gradient(ellipse at 88% 78%, rgba(209,213,219,0.3) 0 3.8%, transparent 4.1%);
}

.player-theme-zeppelin::after {
  background:
    linear-gradient(90deg, transparent 15%, rgba(248,250,252,0.24) 15% 18%, transparent 18% 78%, rgba(248,250,252,0.2) 78% 81%, transparent 81%),
    linear-gradient(160deg, transparent 0 55%, rgba(239,68,68,0.26) 56% 57%, transparent 58%);
  opacity: 0.45;
}

.player-theme-vintage {
  background:
    radial-gradient(circle at 50% 42%, rgba(245, 158, 11, 0.18), transparent 34%),
    linear-gradient(135deg, #261812, #57351f 52%, #111827);
}

.player-theme-vintage::before {
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.08) 0 4px, transparent 4px 13px),
    radial-gradient(circle at 18% 30%, rgba(251,191,36,0.2) 0 7%, transparent 8%),
    radial-gradient(circle at 82% 70%, rgba(251,191,36,0.18) 0 9%, transparent 10%);
  opacity: 0.46;
}

.player-theme-score {
  background:
    radial-gradient(circle at 22% 18%, rgba(56, 189, 248, 0.16), transparent 24%),
    radial-gradient(circle at 78% 78%, rgba(248, 113, 113, 0.16), transparent 26%),
    linear-gradient(135deg, #0f172a, #1e293b 48%, #111827);
}

.player-theme-score::before {
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(248,250,252,0.22) 31px 33px),
    radial-gradient(circle at 18% 38%, rgba(248,250,252,0.86) 0 8px, transparent 9px),
    radial-gradient(circle at 72% 54%, rgba(248,250,252,0.76) 0 7px, transparent 8px),
    radial-gradient(circle at 46% 72%, rgba(248,250,252,0.64) 0 6px, transparent 7px);
  background-size: auto, 360px 220px, 420px 260px, 390px 240px;
  opacity: 0.42;
}

.player-theme-studio {
  background:
    radial-gradient(circle at 50% 16%, rgba(34, 197, 94, 0.18), transparent 28%),
    linear-gradient(135deg, #020617, #0f172a 46%, #172554);
}

.player-theme-studio::before {
  background:
    repeating-linear-gradient(90deg, rgba(34,197,94,0.45) 0 3px, transparent 3px 12px),
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(59,130,246,0.3) 34px 38px, transparent 38px 64px);
  background-position: center 18%, center 76%;
  background-size: 540px 120px, 640px 110px;
  background-repeat: no-repeat;
  opacity: 0.46;
}

.player-page[class*="player-theme-"] {
  background-image:
    linear-gradient(180deg, rgba(8, 13, 23, 0.18), rgba(8, 13, 23, 0.76)),
    var(--player-bg-image);
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

.player-page[class*="player-theme-"]::before {
  background: linear-gradient(90deg, rgba(0,0,0,0.26), transparent 24%, transparent 76%, rgba(0,0,0,0.26));
  opacity: 1;
}

.player-page[class*="player-theme-"]::after {
  background: linear-gradient(0deg, rgba(0,0,0,0.42), transparent 42%);
  opacity: 1;
}

.player-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 2;
}

.player-hero {
  width: min(760px, 100%);
  text-align: center;
  padding: 42px 26px;
}

.onair-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 7px;
  padding: 7px 12px;
  background: #dc2626;
  color: #fff;
  font-weight: 900;
  margin-bottom: 18px;
}

.player-hero h1 {
  font-size: 42px;
}

.player-hero h2 {
  margin-top: 24px;
  font-size: 30px;
}

.player-artist {
  min-height: 24px;
  color: #cbd5e1;
}

.dedication-box {
  width: min(620px, 100%);
  margin: 16px auto 0;
  border: 1px solid rgba(248, 250, 252, 0.28);
  border-left: 5px solid #dc2626;
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  text-align: left;
}

.dedication-box strong,
.dedication-box span {
  display: block;
}

.dedication-box span {
  margin-top: 6px;
  color: #dbeafe;
}

.player-hero audio {
  width: min(520px, 100%);
  margin: 24px auto 16px;
}

.player-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  color: #cbd5e1;
}

.player-queue {
  width: min(720px, 100%);
  margin: 0 auto 22px;
}

.queue-panel {
  margin-top: 18px;
}

.queue-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.queue-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 8px;
  align-items: center;
  border: 1px solid rgba(203, 213, 225, 0.28);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
}

.queue-light .queue-item {
  background: #f8fafc;
  border-color: var(--line);
}

.queue-item span {
  grid-row: 1 / span 2;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #dc2626;
  color: #fff;
  font-weight: 900;
}

.queue-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-item small {
  color: #cbd5e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-light .queue-item small {
  color: var(--muted);
}

.queue-empty {
  color: #cbd5e1;
}
