:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #121212;
  --panel-2: #1b1b1b;
  --text: #f5f5f0;
  --muted: #a4a4a4;
  --lime: #dfff00;
  --lime-2: #a6c900;
  --danger: #ff4d4d;
  --line: #313131;
  --blue: #4bb3fd;
  --pink: #ff4fb8;
  --radius: 8px;
  font-family: Inter, Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

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

button {
  border: 0;
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--lime);
  color: #080808;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

button.secondary {
  background: #2a2a2a;
  color: var(--text);
  border: 1px solid var(--line);
}

button.danger {
  background: var(--danger);
  color: #080808;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #090909;
  color: var(--text);
  padding: 10px 12px;
}

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

a {
  color: var(--lime);
}

.page {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 56px;
}

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

.brand {
  display: grid;
  gap: 2px;
  text-transform: uppercase;
  line-height: 1;
}

.brand small {
  color: #080808;
  background: var(--lime);
  width: fit-content;
  padding: 4px 8px;
  font-weight: 900;
  transform: rotate(-3deg);
}

.brand strong {
  font-size: clamp(32px, 6vw, 72px);
  font-style: italic;
  letter-spacing: 0;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.panel h2,
.panel h3 {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.row > * {
  flex: 1 1 auto;
}

.row .fit {
  flex: 0 0 auto;
}

.metric {
  display: grid;
  gap: 3px;
}

.metric b {
  font-size: 28px;
  color: var(--lime);
}

.metric span,
.muted {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  background: #0b0b0b;
}

.list {
  display: grid;
  gap: 8px;
}

.item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 12px;
}

.item-title {
  font-weight: 900;
}

.code {
  font-family: Consolas, Menlo, monospace;
  font-size: 28px;
  color: var(--lime);
}

.error {
  color: #ffd1d1;
}

.ok {
  color: var(--lime);
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tabs button {
  background: #1f1f1f;
  color: var(--text);
  border: 1px solid var(--line);
}

.tabs button.active {
  background: var(--lime);
  color: #080808;
}

.hidden {
  display: none !important;
}

.display-body {
  overflow: hidden;
}

.display {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 28px;
}

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

.display-logo {
  text-transform: uppercase;
  line-height: 0.9;
}

.display-logo span {
  display: inline-block;
  color: #080808;
  background: var(--lime);
  padding: 5px 10px;
  font-weight: 900;
  transform: rotate(-3deg);
}

.display-logo strong {
  display: block;
  font-size: clamp(52px, 9vw, 138px);
  font-style: italic;
}

.display-main {
  display: grid;
  align-items: center;
  justify-items: center;
  min-height: 0;
}

.display-footer {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  color: var(--muted);
}

.match {
  width: min(1500px, 100%);
  display: grid;
  gap: 26px;
}

.versus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.track-card {
  min-height: 420px;
  display: grid;
  grid-template-rows: 1fr auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101010;
  overflow: hidden;
}

.track-card.active {
  outline: 4px solid var(--lime);
}

.track-card.winner-card {
  outline: 5px solid var(--lime);
  box-shadow: 0 0 42px rgba(223, 255, 0, 0.34);
}

.cover {
  width: 100%;
  min-height: 300px;
  background: #191919;
  object-fit: cover;
}

.track-meta {
  padding: 18px;
}

.track-meta b {
  display: block;
  font-size: clamp(24px, 3vw, 48px);
  line-height: 1;
  text-transform: uppercase;
}

.track-meta span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 28px);
}

.vs {
  font-size: clamp(34px, 5vw, 80px);
  color: var(--lime);
  font-weight: 900;
}

.vote-bars {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: end;
  min-height: 240px;
}

.vote-column {
  display: grid;
  gap: 8px;
  align-items: end;
}

.vote-bar {
  height: 28px;
  width: 100%;
  background: #1b1b1b;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.vote-fill {
  height: 100%;
  width: 0%;
  background: var(--lime);
  transition: width 900ms cubic-bezier(0.18, 0.87, 0.24, 1);
}

.vote-column.winner .vote-fill {
  background: #f0ff35;
  box-shadow: 0 0 28px rgba(223, 255, 0, 0.45);
}

.vote-count {
  font-size: clamp(38px, 6vw, 90px);
  font-weight: 900;
  line-height: 1;
}

.vote-column.winner .vote-count {
  color: var(--lime);
}

.winner-pop {
  animation: winner-pop 900ms ease both;
}

@keyframes winner-pop {
  0% {
    transform: translateY(0) scale(1);
  }
  70% {
    transform: translateY(-44px) scale(1.08);
  }
  100% {
    transform: translateY(-28px) scale(1.04);
  }
}

.swarm {
  position: relative;
  width: 100%;
  height: 68vh;
  overflow: hidden;
}

.swarm-card {
  position: absolute;
  width: clamp(80px, 9vw, 150px);
  aspect-ratio: 1;
  border: 2px solid var(--lime);
  background: #191919;
  object-fit: cover;
  animation: swarm-fly 5.5s ease-in-out infinite alternate;
}

@keyframes swarm-fly {
  from {
    transform: translate3d(var(--x1), var(--y1), 0) rotate(var(--r1));
  }
  to {
    transform: translate3d(var(--x2), var(--y2), 0) rotate(var(--r2));
  }
}

.timer {
  font-size: clamp(62px, 14vw, 220px);
  font-weight: 900;
  color: var(--lime);
  line-height: 0.9;
}

.award-list {
  display: grid;
  gap: 12px;
  width: min(900px, 100%);
}

.award {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 8px solid var(--lime);
  padding: 18px;
  border-radius: var(--radius);
  font-size: clamp(22px, 3vw, 48px);
}

.player-choice {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.choice {
  display: grid;
  gap: 6px;
  text-align: left;
  text-transform: none;
}

.choice.selected {
  outline: 3px solid var(--lime);
}

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

  .topbar,
  .display-header,
  .display-footer {
    display: grid;
  }

  .versus,
  .vote-bars {
    grid-template-columns: 1fr;
  }

  .vs {
    text-align: center;
  }

  .track-card {
    min-height: 0;
  }
}
