:root {
  --pitch: #0f3d2e;
  --pitch-light: #164b39;
  --panel: #123a2c;
  --line: #2a5c47;
  --chalk: #f5f3ea;
  --muted: #9fb3a8;
  --gold: #d4a857;
  --red: #c85c4a;
  --font-display: 'Oswald', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--pitch);
  color: var(--chalk);
  font-family: var(--font-body);
  line-height: 1.6;
}

a { color: inherit; }

h1, h2, h3, .display {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ---------- Nav ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 2px dashed var(--line);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-brand .gold { color: var(--gold); }

.nav-links {
  display: flex;
  gap: 24px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-links a { text-decoration: none; color: var(--muted); }
.nav-links a:hover { color: var(--chalk); }

/* ---------- Layout ---------- */

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 24px;
}

/* ---------- Hero ---------- */

.hero {
  text-align: center;
  padding: 64px 24px 48px;
}

.hero-eyebrow {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(32px, 6vw, 56px);
  margin: 0 0 20px;
  line-height: 1.05;
}

.hero p {
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 32px;
  font-size: 16px;
}

.countdown {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.03em;
  color: var(--chalk);
  margin-bottom: 32px;
}

.countdown .num { color: var(--gold); font-size: 20px; }

.btn {
  display: inline-block;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 14px;
  padding: 14px 32px;
  border-radius: 4px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.btn:hover { filter: brightness(1.1); }

.btn-primary { background: var(--gold); color: var(--pitch); }
.btn-secondary { background: transparent; color: var(--chalk); border: 1px solid var(--line); }

/* ---------- Form ---------- */

.field { margin-bottom: 20px; }

.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.field input, .field select {
  width: 100%;
  background: var(--pitch);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--chalk);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
}

.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--gold);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}

.section-title:first-child { margin-top: 0; }

/* ---------- Rank list (drag to reorder) ---------- */

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

.rank-item {
  counter-increment: rank;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--pitch);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 6px;
  cursor: grab;
  font-size: 14px;
}

.rank-item.dragging { opacity: 0.4; }

.rank-item::before {
  content: counter(rank);
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 15px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.rank-handle { color: var(--muted); font-size: 13px; margin-left: auto; }

/* ---------- Messages ---------- */

.msg {
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 20px;
}

.msg-error { background: rgba(200, 92, 74, 0.15); border: 1px solid var(--red); color: var(--red); }
.msg-ok { background: rgba(212, 168, 87, 0.15); border: 1px solid var(--gold); color: var(--gold); }

/* ---------- Results table ---------- */

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.results-table th, .results-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.results-table th {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
  background: var(--panel);
}

.results-scroll {
  overflow-x: auto;
}

.name-badge {
  font-family: var(--font-display);
  color: var(--gold);
}

.locked-notice {
  text-align: center;
  padding: 40px 24px;
  color: var(--muted);
}

.entrant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

.entrant-chip {
  background: var(--pitch);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
}
