:root {
  color-scheme: dark;
  --bg: #120d24;
  --bg2: #26154c;
  --panel: rgba(21, 16, 43, 0.88);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f6f2ff;
  --muted: #c8bde8;
  --accent: #ff5a8f;
  --accent2: #69e1ff;
  --good: #83f2a3;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(255, 90, 143, 0.2), transparent 32%),
    radial-gradient(circle at bottom right, rgba(105, 225, 255, 0.18), transparent 28%),
    linear-gradient(180deg, #231247 0%, var(--bg) 55%, #0c0918 100%);
  color: var(--text);
}

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

.hero,
.stats,
.panel,
.bench-section,
.queue-section,
.actions,
.support-strip,
.result {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero,
.panel,
.bench-section,
.queue-section,
.result {
  padding: 18px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.eyebrow,
.label,
.lane-count,
.bench-name,
.section-head p,
.message,
.support-strip a,
.stats span {
  color: var(--muted);
}

.eyebrow,
.label,
.result-label,
.stats span,
.bench-name,
.lane-count {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 8px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.95;
}

.subtitle {
  margin-top: 10px;
  max-width: 62ch;
  color: #f4dfff;
}

.hub-link,
button,
.support-strip a {
  transition: transform 0.18s ease, opacity 0.18s ease, border-color 0.18s ease;
}

.hub-link,
button {
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.hub-link {
  padding: 12px 16px;
  color: #1a102d;
  background: linear-gradient(135deg, #ffd26f, #ff8d6a);
}

.stats {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 12px 16px;
}

.stats div {
  display: grid;
  gap: 4px;
}

.stats strong {
  font-size: clamp(1.25rem, 3vw, 1.8rem);
}

.panel {
  margin-top: 14px;
}

.message {
  min-height: 24px;
  margin-bottom: 14px;
}

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

.goal-card {
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.goal-card strong {
  display: block;
  margin: 8px 0 6px;
}

.legend {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.92rem;
}

.legend-chip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.bench-section,
.queue-section {
  margin-top: 14px;
}

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

.section-head p {
  max-width: 42ch;
  font-size: 0.92rem;
}

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

.bench,
.lane {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.bench {
  min-height: 192px;
  border-radius: 22px;
  padding: 14px;
}

.bench.selected {
  border-color: rgba(255, 210, 111, 0.95);
  box-shadow: 0 0 0 3px rgba(255, 210, 111, 0.18);
}

.bench.target {
  border-color: rgba(131, 242, 163, 0.9);
  box-shadow: 0 0 0 3px rgba(131, 242, 163, 0.15);
}

.bench-title {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.bench-seats {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
}

.seat {
  min-height: 42px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(8, 6, 18, 0.42);
}

.token {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 16px;
  font-weight: 800;
  color: #130b20;
  border: none;
}

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

.lane {
  border-radius: 22px;
  padding: 14px 12px;
}

.lane.selected {
  border-color: rgba(255, 90, 143, 0.95);
  box-shadow: 0 0 0 3px rgba(255, 90, 143, 0.18);
}

.lane-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.lane-stack {
  min-height: 252px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lane-empty {
  display: grid;
  place-items: center;
  min-height: 252px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.84rem;
}

.queue-token {
  opacity: 0.38;
  transform: scale(0.96);
}

.queue-token.front {
  opacity: 1;
  transform: none;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

.actions,
.support-strip {
  margin-top: 14px;
  padding: 12px;
}

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

button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  touch-action: manipulation;
}

.hub-link:focus-visible,
button:focus-visible,
.support-strip a:focus-visible {
  outline: 3px solid rgba(255, 210, 111, 0.9);
  outline-offset: 3px;
}

button.primary {
  color: #170e2c;
  background: linear-gradient(135deg, #ffd26f, #ff7fb0);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.support-strip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.support-strip a {
  color: #f7f0ff;
  text-decoration: none;
}

.result {
  margin-top: 14px;
  text-align: center;
}

.result strong {
  display: block;
  margin: 8px 0;
  font-size: clamp(2rem, 6vw, 3.6rem);
}

.hub-link:hover,
button:hover:not(:disabled),
.support-strip a:hover {
  transform: translateY(-1px);
}

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

  .hero,
  .section-head,
  .support-strip {
    flex-direction: column;
  }

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

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

@media (max-width: 480px) {
  .stats,
  .goal-grid,
  .bench-grid,
  .queue-grid {
    grid-template-columns: 1fr;
  }

  .lane-stack,
  .lane-empty {
    min-height: 180px;
  }

  .bench {
    min-height: 168px;
  }
}
