:root {
  --bg: #f6f0e7;
  --panel: rgba(255, 252, 247, 0.92);
  --panel-strong: #fffaf2;
  --line: rgba(57, 40, 23, 0.12);
  --text: #2b2016;
  --muted: #78614d;
  --accent: #1d7a52;
  --accent-strong: #0d5f3d;
  --accent-soft: #dcefe4;
  --shadow: 0 24px 60px rgba(63, 42, 18, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Space Grotesk", "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 30%),
    radial-gradient(circle at bottom right, rgba(29, 122, 82, 0.14), transparent 25%),
    linear-gradient(145deg, #efe1cf 0%, #f7f2ea 40%, #e7f2ec 100%);
}

code {
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
}

.page-shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-card,
.controls-card,
.table-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.hero-copy {
  border-radius: 28px;
  padding: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero-text {
  max-width: 58ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.hero-card {
  border-radius: 28px;
  padding: 22px;
  display: grid;
  gap: 16px;
  align-content: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.92)),
    linear-gradient(135deg, rgba(29, 122, 82, 0.12), rgba(255, 255, 255, 0));
}

.hero-stat {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.hero-stat:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.hero-stat-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-stat strong {
  font-size: 1.1rem;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
}

.controls-card,
.table-card {
  border-radius: 24px;
  padding: 22px;
}

.controls-card {
  height: fit-content;
  position: sticky;
  top: 24px;
}

.control {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.control span {
  font-size: 0.9rem;
  font-weight: 700;
}

.control select,
.reload-button {
  width: 100%;
  border: 1px solid rgba(43, 32, 22, 0.12);
  border-radius: 14px;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
}

.control select {
  padding: 12px 14px;
}

.reload-button {
  margin-top: 8px;
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.hint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.table-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.table-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.legend-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 700;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-message {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 247, 235, 0.9);
  color: var(--muted);
}

.status-error {
  background: rgba(255, 226, 226, 0.95);
  color: #8a2727;
}

.table-wrapper {
  overflow-x: auto;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.standings-table th,
.standings-table td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.95rem;
}

.standings-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.standings-table tbody tr:hover {
  background: rgba(29, 122, 82, 0.04);
}

.position-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.position-bar {
  width: 4px;
  height: 28px;
  border-radius: 999px;
}

.team-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-badge {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex: 0 0 auto;
}

.team-cell strong,
.team-cell span {
  display: block;
}

.team-cell span {
  color: var(--muted);
  font-size: 0.82rem;
}

.form-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.form-badge,
.form-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
}

.form-w {
  background: rgba(29, 122, 82, 0.14);
  color: var(--accent-strong);
}

.form-d {
  background: rgba(161, 122, 36, 0.14);
  color: #8d6408;
}

.form-l {
  background: rgba(181, 70, 70, 0.14);
  color: #a22929;
}

.form-empty {
  width: auto;
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .controls-card {
    position: static;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 20px, 1280px);
    padding-top: 20px;
  }

  .hero-copy,
  .hero-card,
  .controls-card,
  .table-card {
    border-radius: 20px;
    padding: 18px;
  }

  .table-toolbar {
    flex-direction: column;
  }

  .legend-list {
    justify-content: flex-start;
  }
}
