/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:        #0d1117;
  --surface:   #161b22;
  --surface2:  #1e252f;
  --border:    #30363d;
  --accent:    #e8b84b;
  --accent-dim:#b8912e;
  --text:      #e6edf3;
  --text-muted:#8b949e;
  --green:     #3fb950;
  --red:       #f85149;
  --radius:    8px;
  --shadow:    0 4px 24px rgba(0,0,0,.45);
}

/* ── Reset & base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Header ────────────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.header-logo {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.header-tagline {
  color: var(--text-muted);
  font-size: 0.875rem;
  flex: 1;
}

.header-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

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

/* ── Sections ──────────────────────────────────────────── */
.sport-section {
  margin: 3rem 0;
}

.section-header {
  margin-bottom: 1.25rem;
}

.section-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.section-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ── Odds table ────────────────────────────────────────── */
.odds-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.odds-table table {
  width: 100%;
  border-collapse: collapse;
}

.odds-table thead th {
  background: var(--surface2);
  padding: 0.6rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.odds-table thead th:hover { color: var(--text); }
.odds-table thead th.sorted-asc::after  { content: ' ↑'; color: var(--accent); }
.odds-table thead th.sorted-desc::after { content: ' ↓'; color: var(--accent); }

.odds-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.odds-table tbody tr:last-child { border-bottom: none; }
.odds-table tbody tr:hover { background: var(--surface2); }

.odds-table tbody td {
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
}

.rank-cell {
  color: var(--text-muted);
  font-size: 0.75rem;
  width: 2.5rem;
}

.team-cell { font-weight: 500; }

.odds-cell {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.odds-cell.fav    { color: var(--green); }
.odds-cell.mid    { color: var(--accent); }
.odds-cell.roughie { color: var(--red); }

/* ── Odds source note ──────────────────────────────────── */
.odds-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ── Loading / error ───────────────────────────────────── */
.loading-msg {
  color: var(--text-muted);
  padding: 1.5rem;
  font-style: italic;
  font-size: 0.875rem;
}

.error-msg {
  color: var(--text-muted);
  padding: 1.25rem;
  font-size: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ── Picks form section ────────────────────────────────── */
.picks-section {
  margin: 3rem 0 4rem;
}

.picks-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.picks-intro {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
  max-width: 640px;
}

/* ── Alert ─────────────────────────────────────────────── */
.alert {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.alert-error   { background: rgba(248,81,73,.12); border: 1px solid rgba(248,81,73,.4); color: #f85149; }
.alert-success { background: rgba(63,185,80,.12); border: 1px solid rgba(63,185,80,.4); color: #3fb950; }

/* ── Form layout ───────────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.form-group input,
.form-group select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.65rem 0.85rem;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238b949e' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.2rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input::placeholder { color: var(--text-muted); }

/* ── Sport picks block ─────────────────────────────────── */
.picks-sport-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.picks-sport-block h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.picks-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .picks-row { grid-template-columns: 1fr; }
}

.badge {
  background: rgba(232,184,75,.15);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Submit button ─────────────────────────────────────── */
.submit-btn {
  display: block;
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.9rem;
  background: var(--accent);
  color: #0d1117;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.submit-btn:hover  { background: var(--accent-dim); }
.submit-btn:active { transform: scale(0.99); }
.submit-btn:disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ── Footer ────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  margin-top: 2rem;
}

footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}
