:root {
  /* Legacy tokens (kept for display/qr page compatibility) */
  --brand-blue: #3b82f6;
  --brand-blue-deep: #1d4ed8;
  --brand-orange: #fb923c;
  --brand-orange-soft: #fdba74;
  --ink: #d0e0ff;
  --ink-soft: #7a96c0;
  --paper: #07101f;
  --panel: #0d1a35;
  --stroke: #1e3360;
  --ok: #14b8a6;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 16px 38px rgba(2, 6, 23, 0.6);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --motion-fast: 180ms;
  --motion-medium: 360ms;
  --motion-slow: 720ms;
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Stage Night palette */
  --midnight: #07101f;
  --stage: #0d1a35;
  --stage-lift: #132244;
  --spotlight: #ff6b1a;
  --spotlight-soft: #ff9a52;
  --arc: #2d5be3;
  --ice: #d0e0ff;
  --fog: #7a96c0;
  --glow-o: rgba(255, 107, 26, 0.18);
  --glow-b: rgba(45, 91, 227, 0.25);
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--ice);
  color-scheme: dark;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  background:
    radial-gradient(ellipse 70% 50% at 88% 0%, rgba(255, 107, 26, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 8% 0%, rgba(45, 91, 227, 0.16) 0%, transparent 50%),
    repeating-linear-gradient(
      -35deg,
      rgba(30, 51, 96, 0.06) 0,
      rgba(30, 51, 96, 0.06) 1px,
      transparent 1px,
      transparent 12px
    ),
    linear-gradient(165deg, #050914, #0a1424 45%, #0c182a);
  background-size: 160% 160%, 170% 170%, auto, auto;
  animation: pageAtmosphere 22s ease-in-out infinite alternate;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  animation: pageRise var(--motion-slow) var(--motion-ease) both;
}

.page-title {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.6rem, 2.6vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.subtitle {
  color: var(--fog);
  margin: 6px 0 0;
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  animation: fadeSlideIn 560ms var(--motion-ease) both;
}

.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 107, 26, 0.55);
  background: linear-gradient(90deg, rgba(45, 91, 227, 0.22), rgba(15, 23, 42, 0.85));
  color: var(--spotlight-soft);
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  border-left: 3px solid rgba(45, 91, 227, 0.55);
  background: linear-gradient(160deg, rgba(19, 34, 68, 0.96), rgba(13, 26, 53, 0.96));
  box-shadow: var(--shadow);
  padding: 20px;
  animation: fadeSlideIn var(--motion-slow) var(--motion-ease) both;
}

.panel::before {
  content: '';
  position: absolute;
  inset: -120% 35% auto -45%;
  height: 230%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(147, 197, 253, 0.08), transparent);
  transform: rotate(14deg);
  animation: panelSheen 8.4s ease-in-out infinite;
}

.panel-grid > .panel:nth-child(2) {
  animation-delay: 70ms;
}

.panel-grid > .panel:nth-child(3) {
  animation-delay: 120ms;
}

.panel-grid > .panel:nth-child(4) {
  animation-delay: 170ms;
}

.panel h2,
.panel h3 {
  margin: 0 0 12px;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ice);
}

.info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 180px;
}

label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fog);
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid var(--stroke);
  color: var(--ice);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  background: rgba(7, 16, 31, 0.8);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(122, 150, 192, 0.5);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--spotlight);
  box-shadow: 0 0 0 2px rgba(255, 107, 26, 0.18), 0 0 12px rgba(255, 107, 26, 0.08);
}

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

button,
.btn-link {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform var(--motion-fast) ease, opacity var(--motion-fast) ease, box-shadow var(--motion-fast) ease, background var(--motion-fast) ease;
}

button:hover,
.btn-link:hover {
  transform: translateY(-1px);
}

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

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

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--spotlight), #d45510);
  border-color: rgba(255, 107, 26, 0.4);
  box-shadow: 0 4px 16px rgba(255, 107, 26, 0.25);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 22px rgba(255, 107, 26, 0.38);
}

.btn-secondary {
  color: var(--ice);
  background: var(--stage-lift);
  border-color: var(--stroke);
}

.btn-secondary:hover:not(:disabled) {
  background: #1a2d56;
  border-color: rgba(45, 91, 227, 0.45);
}

.btn-danger {
  color: #fee2e2;
  background: #5c1111;
  border-color: #8b1c1c;
}

.btn-danger:hover:not(:disabled) {
  background: #7f1d1d;
}

.btn-muted {
  color: var(--fog);
  background: rgba(19, 34, 68, 0.6);
  border-color: var(--stroke);
}

.status-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-requested {
  background: rgba(255, 107, 26, 0.18);
  border: 1px solid rgba(255, 107, 26, 0.45);
  color: var(--spotlight-soft);
}

.status-queued {
  background: rgba(45, 91, 227, 0.18);
  border: 1px solid rgba(45, 91, 227, 0.45);
  color: #91b4ff;
}

.status-playing {
  background: rgba(20, 184, 166, 0.18);
  border: 1px solid rgba(20, 184, 166, 0.45);
  color: #5eead4;
}

.status-done {
  background: rgba(71, 85, 105, 0.3);
  border: 1px solid rgba(71, 85, 105, 0.5);
  color: #94a3b8;
}

.status-declined {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(13, 26, 53, 0.7);
  border: 1px solid var(--stroke);
  transition: transform var(--motion-fast) ease, border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease, background var(--motion-fast) ease;
}

.list-item + .list-item {
  margin-top: 8px;
}

.list-item:hover {
  transform: translateY(-1px);
  border-color: rgba(45, 91, 227, 0.35);
  background: rgba(19, 34, 68, 0.8);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.32);
}

.list-item-appear {
  animation: listItemIn 420ms var(--motion-ease) both;
}

.meta {
  color: var(--fog);
  font-size: 0.9rem;
}

.stack {
  display: grid;
  gap: 12px;
}

.compact {
  font-size: 0.93rem;
}

.notice {
  margin-top: 8px;
  color: var(--fog);
  font-size: 0.9rem;
}

a.brand-link {
  color: var(--spotlight-soft);
  font-weight: 600;
  text-decoration: none;
  transition: color 150ms ease;
}

a.brand-link:hover {
  color: #fff;
}

@media (max-width: 740px) {
  main {
    padding: 16px;
  }

  .panel {
    padding: 16px;
  }
}

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

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

@keyframes pageAtmosphere {
  from {
    background-position: 0% 0%, 100% 0%, 0 0, 0 0;
  }
  to {
    background-position: 18% 14%, 82% 18%, 0 0, 0 0;
  }
}

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

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

@keyframes panelSheen {
  0%,
  100% {
    opacity: 0;
    transform: translateX(-16%) rotate(14deg);
  }
  44% {
    opacity: 0;
  }
  55% {
    opacity: 1;
  }
  68% {
    opacity: 0;
    transform: translateX(72%) rotate(14deg);
  }
}

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