:root {
  --bg: #efe7d5;
  --bg-deep: #d6c7ae;
  --ink: #102341;
  --muted: #5f6e82;
  --paper: rgba(255, 252, 245, 0.86);
  --paper-strong: rgba(255, 252, 245, 0.96);
  --navy: #0c1d37;
  --navy-soft: #1b315a;
  --line: rgba(16, 35, 65, 0.1);
  --line-strong: rgba(16, 35, 65, 0.16);
  --mi-blue: #0057b8;
  --mi-cyan: #1d9cd8;
  --gold: #cb8a1f;
  --red: #cd4c59;
  --green: #319564;
  --shadow: 0 28px 90px rgba(16, 35, 65, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(0, 87, 184, 0.12), transparent 28%),
    radial-gradient(circle at 90% 10%, rgba(203, 138, 31, 0.22), transparent 24%),
    linear-gradient(180deg, #fbf5e8 0%, var(--bg) 48%, var(--bg-deep) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(16, 35, 65, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 35, 65, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.page-shell {
  position: relative;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 60px;
}

.top-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.top-banner span {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 252, 245, 0.68);
  border: 1px solid rgba(16, 35, 65, 0.08);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: 1.65fr 0.95fr;
  gap: 24px;
  margin-bottom: 24px;
}

.hero-copy,
.hero-panel,
.card {
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-copy {
  position: relative;
  padding: 42px;
  color: #f9f2e7;
  background:
    radial-gradient(circle at 15% 20%, rgba(32, 140, 208, 0.36), transparent 24%),
    radial-gradient(circle at 85% 85%, rgba(203, 138, 31, 0.22), transparent 22%),
    linear-gradient(135deg, #07162b 0%, #102341 54%, #1b315a 100%);
}

.hero-copy::after {
  content: "";
  position: absolute;
  inset: auto -40px -64px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-panel,
.card {
  position: relative;
  background: var(--paper);
  backdrop-filter: blur(18px);
}

.hero-panel::before,
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 22%);
  pointer-events: none;
}

.hero-panel {
  padding: 26px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.eyebrow,
.section-kicker,
.card-meta,
.metric-label,
.hero-stat-label,
.control-index {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
}

.eyebrow {
  color: rgba(249, 242, 231, 0.7);
}

.section-kicker,
.card-meta,
.metric-label,
.hero-stat-label,
.control-index {
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0;
}

h1,
h2 {
  font-family: "Instrument Serif", serif;
}

h1 {
  margin-top: 10px;
  font-size: clamp(3.2rem, 6vw, 5.6rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 1.8rem;
  line-height: 1;
}

.hero-text {
  max-width: 40rem;
  margin: 18px 0 0;
  font-size: 1.08rem;
  line-height: 1.75;
  color: rgba(249, 242, 231, 0.82);
}

.hero-stage {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  margin-top: 34px;
}

.miracle-dial {
  display: grid;
  place-items: center;
}

.miracle-ring {
  --progress: 6;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, rgba(9, 20, 39, 0.9) 0 55%, transparent 56% 100%),
    conic-gradient(from -90deg, #24c3f2 0 calc(var(--progress) * 1%), rgba(255, 255, 255, 0.16) 0);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 18px 40px rgba(0, 0, 0, 0.24);
}

.miracle-ring-core {
  width: 142px;
  height: 142px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  background: linear-gradient(180deg, rgba(5, 14, 28, 0.96), rgba(13, 28, 52, 0.98));
  color: #fff9ef;
}

.miracle-ring-core strong {
  display: block;
  margin-top: 8px;
  font-size: 2.2rem;
  line-height: 1;
}

.dial-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 249, 239, 0.62);
}

.hero-stat-stack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hero-stat-card {
  min-height: 140px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.5rem;
  line-height: 1.1;
  color: #fff7eb;
}

.hero-stat-card p {
  margin: 12px 0 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(249, 242, 231, 0.74);
}

.metric {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.metric:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 1.45rem;
  line-height: 1.18;
}

.metric-subtext,
.refresh-status {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.refresh-button {
  border: 0;
  border-radius: 999px;
  padding: 15px 18px;
  font: inherit;
  font-weight: 700;
  color: #fff7eb;
  background: linear-gradient(135deg, #0057b8, #1a9bd6);
  box-shadow: 0 16px 34px rgba(0, 87, 184, 0.28);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.refresh-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 38px rgba(0, 87, 184, 0.32);
}

.refresh-button:disabled {
  opacity: 0.78;
  cursor: progress;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.card {
  padding: 28px;
}

.card-wide {
  grid-column: 1 / -1;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 20px;
}

.command-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.12)),
    var(--paper);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.control-note {
  position: relative;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.control-index {
  display: inline-block;
  margin-bottom: 10px;
  font-weight: 700;
}

.control-note h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.control-note p,
.summary-item,
.fixture-card p,
td,
th,
.card-meta {
  line-height: 1.6;
}

.accent-blue {
  border-color: rgba(0, 87, 184, 0.2);
}

.accent-gold {
  border-color: rgba(203, 138, 31, 0.22);
}

.accent-red {
  border-color: rgba(205, 76, 89, 0.22);
}

.accent-green {
  border-color: rgba(49, 149, 100, 0.22);
}

.standings-card {
  min-height: 420px;
}

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

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

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

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

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr.mi-row {
  background: rgba(0, 87, 184, 0.08);
}

.rank-cell {
  width: 42px;
}

.rank-pill {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(16, 35, 65, 0.08);
  font-size: 0.8rem;
  font-weight: 700;
}

.rank-pill.top-four {
  background: rgba(49, 149, 100, 0.16);
  color: #1d6541;
}

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

.team-badge {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(16, 35, 65, 0.08);
  font-weight: 700;
  font-size: 0.82rem;
}

.team-badge.mi {
  background: rgba(0, 87, 184, 0.15);
  color: #004ca2;
}

.fixture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.fixture-card,
.summary-item {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.fixture-card {
  position: relative;
}

.fixture-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 22px 0 0 22px;
  background: linear-gradient(180deg, var(--gold), var(--mi-cyan));
}

.fixture-card h3 {
  margin-bottom: 8px;
  font-size: 1.06rem;
}

.fixture-meta {
  margin-bottom: 12px;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.winner-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(16, 35, 65, 0.08);
  font-size: 0.9rem;
  font-weight: 700;
}

.winner-pill.mi {
  background: rgba(0, 87, 184, 0.15);
  color: #004ca2;
}

.summary-list {
  display: grid;
  gap: 12px;
}

.summary-item {
  background: rgba(255, 255, 255, 0.78);
}

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

  .hero-stage {
    grid-template-columns: 1fr;
  }

  .hero-stat-stack {
    grid-template-columns: 1fr;
  }

  .control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .content-grid,
  .fixture-grid,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 16px;
  }

  .hero-copy,
  .hero-panel,
  .card {
    border-radius: 24px;
  }

  .hero-copy {
    padding: 28px 24px;
  }

  .card {
    padding: 22px;
  }

  h1 {
    font-size: clamp(2.8rem, 16vw, 4.4rem);
  }

  .miracle-ring {
    width: 190px;
    height: 190px;
  }
}
