:root {
  --field: #14161a;
  --chalk: #e4e2da;
  --signal: #d6ff4a;
  --alert: #ff4b2b;
  --line: #2a2e28;
  --muted: #8e9088;
  --display: "Unbounded", sans-serif;
  --text: "Commissioner", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--field);
  color: var(--chalk);
  font-family: var(--text);
  font-weight: 400;
}

body {
  min-height: 100vh;
}

.sky {
  position: fixed;
  inset: 0 0 auto 0;
  height: 46vh;
  background:
    linear-gradient(to bottom, rgba(20, 22, 26, 0.15), var(--field) 92%),
    url("./field.png") center 40% / cover no-repeat;
  animation: drift 14s ease-out both;
  pointer-events: none;
}

.sky.is-dim {
  height: 18vh;
  opacity: 0.35;
}

.stage {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  padding: 28px 20px 112px;
}

.brand {
  margin: 18vh 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3.4rem, 14vw, 5.4rem);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--signal);
  animation: settle 0.7s ease both;
}

.lead {
  margin: 14px 0 28px;
  max-width: 22rem;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--chalk);
}

.board {
  width: 100%;
  border-collapse: collapse;
}

.board th {
  padding: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
}

.board th:last-child,
.board td:last-child { text-align: right; }

.board td {
  padding: 13px 0;
  border-top: 1px solid var(--line);
  vertical-align: baseline;
}

.board tbody tr {
  animation: settle 0.55s ease both;
  animation-delay: calc(var(--i) * 45ms);
}

.place {
  width: 3.2rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.name { font-size: 1.05rem; }

.points {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 1.05rem;
}

tr.is-prize .place { color: var(--signal); }

tr.is-you .name { color: var(--signal); }

.you {
  position: fixed;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--field) 70%, rgba(20, 22, 26, 0));
  border-top: 1px solid var(--line);
}

.you strong {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1rem;
}

.you span {
  color: var(--muted);
  font-size: 0.95rem;
}

.tools {
  display: flex;
  gap: 18px;
  margin: 0 0 8px;
}

.tools button,
.back,
.pay,
.apply {
  font-family: var(--text);
  color: var(--chalk);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.tools button {
  font-size: 0.95rem;
  color: var(--signal);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.season .brand { margin-top: 12px; font-size: clamp(2.4rem, 10vw, 3.6rem); }

.back {
  color: var(--muted);
  font-size: 0.95rem;
}

.weights {
  margin: 28px 0 0;
  padding: 0;
}

.weights div {
  display: grid;
  grid-template-columns: 1fr 4.5rem;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.weights label { font-size: 1.05rem; }

.weights input,
.promo input {
  width: 100%;
  background: transparent;
  color: var(--chalk);
  border: 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
  font-size: 1.2rem;
  text-align: right;
  padding: 4px 0;
}

.promo {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  margin-top: 28px;
}

.promo label,
.price-note,
.miss {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.apply {
  color: var(--signal);
  font-size: 1rem;
  padding-bottom: 6px;
}

#save-weights {
  display: block;
  margin-top: 16px;
  text-align: left;
}

.price {
  margin: 28px 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.price em {
  font-style: normal;
  color: var(--signal);
}

.pay {
  display: block;
  width: 100%;
  margin-top: 28px;
  padding: 16px 0;
  background: var(--signal);
  color: var(--field);
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.05rem;
  text-align: center;
}

.pay:focus-visible,
.apply:focus-visible,
.back:focus-visible,
.tools button:focus-visible,
.weights input:focus-visible,
.promo input:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.status {
  margin-top: 14px;
  line-height: 1.4;
}

.miss { color: var(--alert); min-height: 1.2em; }

.empty {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 12vh;
}

.empty .brand { margin-top: 0; }

@keyframes settle {
  from { transform: translateY(10px); }
  to { transform: none; }
}

@keyframes drift {
  from { transform: scale(1.06); }
  to { transform: scale(1); }
}

@media (min-width: 800px) {
  .stage { padding-top: 48px; }
  .brand { margin-top: 22vh; }
  .you {
    left: 50%;
    right: auto;
    width: min(560px, 100%);
    transform: translateX(-50%);
  }
}
