:root {
  --bg-base: #07101d;
  --bg-deep: rgba(8, 15, 28, 0.94);
  --bg-panel: rgba(12, 20, 38, 0.74);
  --bg-panel-strong: rgba(16, 26, 47, 0.86);
  --line-soft: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text-main: #f5f7ff;
  --text-soft: rgba(227, 235, 252, 0.74);
  --text-faint: rgba(201, 214, 236, 0.48);
  --cyan: #72efe0;
  --cyan-soft: rgba(114, 239, 224, 0.14);
  --gold: #ffc27f;
  --gold-soft: rgba(255, 194, 127, 0.14);
  --rose: #ff8fa1;
  --rose-soft: rgba(255, 143, 161, 0.14);
  --green: #98ffcb;
  --green-soft: rgba(152, 255, 203, 0.14);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.34);
  --shadow-md: 0 18px 46px rgba(0, 0, 0, 0.24);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font-display: "Bahnschrift SemiCondensed", "Aptos Display", "Microsoft YaHei UI", sans-serif;
  --font-body: "Aptos", "Segoe UI Variable Text", "Microsoft YaHei UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--text-main);
  background:
    radial-gradient(circle at 12% 14%, rgba(114, 239, 224, 0.16), transparent 26%),
    radial-gradient(circle at 88% 18%, rgba(255, 194, 127, 0.16), transparent 22%),
    radial-gradient(circle at 78% 84%, rgba(255, 143, 161, 0.12), transparent 22%),
    linear-gradient(145deg, rgba(7, 12, 23, 0.98), rgba(9, 16, 30, 0.94) 52%, rgba(8, 13, 24, 0.98));
}

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

body::before {
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black 38%, transparent 92%);
}

body::after {
  opacity: 0.08;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 120px 120px;
}

button,
input,
textarea {
  font: inherit;
}

button,
input,
textarea {
  outline: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  box-shadow:
    0 0 0 1px rgba(114, 239, 224, 0.86),
    0 0 0 5px rgba(114, 239, 224, 0.18);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  margin-bottom: 22px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 22%),
    linear-gradient(180deg, rgba(16, 25, 45, 0.84), rgba(9, 15, 27, 0.64));
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(24px) saturate(145%);
}

.header > div:first-child {
  max-width: 780px;
}

.mini,
.label,
.section-title,
.request-meta,
.hint,
.pill,
.tag,
.subtitle,
.request-song.empty,
.empty-state {
  letter-spacing: 0.02em;
}

.mini {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 56px);
  line-height: 1;
}

.subtitle {
  margin: 12px 0 0;
  max-width: 62ch;
  font-size: 15px;
  line-height: 1.78;
  color: var(--text-soft);
}

.status-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  max-width: 420px;
}

.pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
  color: var(--text-main);
  white-space: nowrap;
}

.pill::before,
.tag::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 16px currentColor;
  animation: pulse 1.9s ease-in-out infinite;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.92fr);
  gap: 22px;
}

.stack {
  display: grid;
  gap: 22px;
  align-content: start;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 20%),
    linear-gradient(180deg, rgba(14, 23, 42, 0.84), rgba(9, 15, 28, 0.68));
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(22px) saturate(140%);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 32%, transparent 68%, rgba(114, 239, 224, 0.16));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.panel::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -120px;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(114, 239, 224, 0.15), transparent 72%);
  pointer-events: none;
}

.panel-inner {
  position: relative;
  z-index: 1;
  padding: 26px;
}

.header-side {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.header-actions {
  justify-content: flex-end;
}

.section-title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text-main);
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
}

.auth-panel-inner {
  padding: 34px;
}

.auth-title {
  font-size: clamp(34px, 5vw, 48px);
}

.auth-copy {
  max-width: none;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.auth-actions {
  align-items: center;
}

.auth-error,
.auth-note {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.7;
}

.auth-error {
  border: 1px solid rgba(255, 143, 161, 0.28);
  background: rgba(255, 143, 161, 0.1);
  color: #ffd6dd;
}

.auth-note {
  border: 1px solid rgba(255, 194, 127, 0.24);
  background: rgba(255, 194, 127, 0.1);
  color: #ffe1ba;
}

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

.span-2 {
  grid-column: span 2;
}

.field {
  display: grid;
  gap: 10px;
}

.label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(7, 14, 26, 0.72);
  color: var(--text-main);
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(211, 221, 242, 0.42);
}

input:hover,
textarea:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

input:focus,
textarea:focus {
  border-color: rgba(114, 239, 224, 0.28);
  background:
    linear-gradient(180deg, rgba(114, 239, 224, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(9, 16, 31, 0.84);
}

textarea {
  min-height: 132px;
  resize: vertical;
}

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

button {
  appearance: none;
  border: 0;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(114, 239, 224, 0.84));
  color: #07131e;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 16px 32px rgba(114, 239, 224, 0.16);
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease,
    opacity 180ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 18px 36px rgba(114, 239, 224, 0.22);
}

button:active {
  transform: translateY(0);
}

button.secondary {
  color: var(--text-main);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

button.success {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(152, 255, 203, 0.86));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 16px 32px rgba(152, 255, 203, 0.16);
}

button.warning {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 194, 127, 0.86));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 16px 32px rgba(255, 194, 127, 0.16);
}

button.danger {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 143, 161, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 16px 32px rgba(255, 143, 161, 0.16);
}

button.secondary.danger {
  color: #ffd6dd;
  background:
    linear-gradient(180deg, rgba(255, 143, 161, 0.1), rgba(255, 143, 161, 0.04)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 143, 161, 0.22);
  box-shadow: none;
}

button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.cards {
  display: grid;
  gap: 14px;
}

.request-card,
.history-card,
.empty-state {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 22%),
    rgba(8, 15, 29, 0.68);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
}

.request-card,
.history-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.request-card.current {
  border-color: rgba(114, 239, 224, 0.22);
  background:
    linear-gradient(135deg, rgba(114, 239, 224, 0.08), rgba(255, 194, 127, 0.05)),
    rgba(10, 18, 33, 0.76);
}

.request-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.two-line {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.request-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-word;
}

.request-meta {
  font-size: 13px;
  color: var(--text-faint);
  line-height: 1.6;
}

.request-song {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.18;
  color: var(--text-main);
  word-break: break-word;
}

.request-song.empty {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-soft);
}

.hint {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-soft);
}

.empty-state {
  padding: 22px 18px;
  font-size: 15px;
  color: var(--text-soft);
}

.tag {
  flex: 0 0 auto;
  font-size: 12px;
}

.tag.waiting {
  color: var(--gold);
  background: rgba(255, 194, 127, 0.1);
  border-color: rgba(255, 194, 127, 0.2);
}

.tag.holding {
  color: var(--cyan);
  background: rgba(114, 239, 224, 0.1);
  border-color: rgba(114, 239, 224, 0.22);
}

.tag.calling {
  color: var(--cyan);
  background: rgba(114, 239, 224, 0.1);
  border-color: rgba(114, 239, 224, 0.2);
}

.tag.ready,
.tag.completed {
  color: var(--green);
  background: rgba(152, 255, 203, 0.1);
  border-color: rgba(152, 255, 203, 0.22);
}

.tag.skipped,
.tag.cancelled {
  color: var(--rose);
  background: rgba(255, 143, 161, 0.1);
  border-color: rgba(255, 143, 161, 0.22);
}

#bridgeCard .request-card {
  background:
    linear-gradient(135deg, rgba(114, 239, 224, 0.06), rgba(255, 255, 255, 0.03)),
    rgba(8, 15, 29, 0.7);
}

.compact-head {
  margin-bottom: 12px;
}

.compact-head .section-title {
  margin-bottom: 8px;
  font-size: 20px;
}

.compact-head .section-copy {
  margin: 0;
}

.json-log-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 22%),
    rgba(8, 15, 29, 0.72);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
  padding: 18px;
}

.json-log-pre {
  margin: 0;
  padding: 14px 16px;
  max-height: 320px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(4, 10, 22, 0.78);
  color: rgba(240, 247, 255, 0.92);
  font-family: "Cascadia Code", "Consolas", "SFMono-Regular", monospace;
  font-size: 12px;
  line-height: 1.66;
  white-space: pre-wrap;
  word-break: break-word;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(0.88);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

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

  .status-bar {
    max-width: none;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 100%);
    padding-top: 12px;
    padding-bottom: 24px;
  }

  .header,
  .panel-inner {
    padding: 20px;
  }

  .header,
  .request-top {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .span-2 {
    grid-column: auto;
  }

  .actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .request-song {
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.page-nav-panel {
  position: sticky;
  top: 14px;
  z-index: 12;
  margin-bottom: 22px;
}

.page-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-nav-btn,
.page-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.04);
  box-shadow: none;
  text-decoration: none;
}

.page-nav-btn.is-active {
  color: #07131e;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(114, 239, 224, 0.84));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 16px 32px rgba(114, 239, 224, 0.18);
}

.page-link-button:hover,
.page-nav-btn:hover {
  filter: brightness(1.04);
}

.admin-pages {
  display: grid;
}

.admin-page {
  display: none;
}

.admin-page.is-active {
  display: block;
  animation: pageFade 220ms ease;
}

.page-grid {
  display: grid;
  gap: 22px;
}

.page-grid.two-col {
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
}

.page-grid.single-col {
  grid-template-columns: 1fr;
}

.page-stack {
  display: grid;
  gap: 22px;
  align-content: start;
}

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

.section-copy {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-soft);
}

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

.summary-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 22%),
    rgba(8, 15, 29, 0.68);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
}

.summary-card.cyan {
  border-color: rgba(114, 239, 224, 0.18);
}

.summary-card.gold {
  border-color: rgba(255, 194, 127, 0.2);
}

.summary-card.green {
  border-color: rgba(152, 255, 203, 0.18);
}

.summary-label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.summary-value {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1;
  color: var(--text-main);
}

.summary-copy {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-soft);
}

.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.inline-number {
  width: 124px;
  max-width: 100%;
}

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

@media (max-width: 1180px) {
  .page-grid.two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-nav-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .page-nav-list {
    width: 100%;
  }

  .page-nav-btn,
  .page-link-button {
    flex: 1 1 calc(50% - 10px);
  }

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

  .panel-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-number {
    width: 100%;
  }
}
