:root {
  color-scheme: light;
  --ink: #152029;
  --muted: #5c6872;
  --paper: #f7f8f4;
  --surface: #ffffff;
  --line: #dbe1dd;
  --field: #14744a;
  --field-dark: #0f503b;
  --gold: #d8a021;
  --red: #b9413b;
  --blue: #1f5f91;
  --shadow: 0 18px 45px rgba(21, 32, 41, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  color: #ffffff;
}

.header-backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9, 23, 22, 0.88), rgba(9, 23, 22, 0.55) 48%, rgba(9, 23, 22, 0.18)),
    linear-gradient(180deg, rgba(9, 23, 22, 0.25), rgba(9, 23, 22, 0.78)),
    url("assets/stadium-hero.png") center / cover no-repeat;
  transform: scale(1.02);
}

.top-nav,
.hero-shell,
.tool-band,
.content-band,
.site-footer {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0;
}

.brand,
.nav-actions a {
  color: inherit;
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.nav-actions {
  display: flex;
  gap: 18px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
}

.hero-shell {
  display: grid;
  align-content: center;
  min-height: 520px;
  padding: 46px 0 96px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 18px;
  font-size: clamp(2.55rem, 5.6vw, 5.35rem);
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

h1 span {
  display: block;
}

.hero-copy {
  max-width: 680px;
  margin-bottom: 26px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.12rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(6, 18, 17, 0.32);
  border-radius: 999px;
}

.hero-stats strong {
  color: #ffffff;
}

main {
  margin-top: -74px;
}

.tool-band,
.content-band {
  padding: 34px;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.muted-band {
  background: #eef3ed;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 24px;
  min-width: 0;
}

.section-heading h2 {
  margin-bottom: 8px;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.08;
  overflow-wrap: break-word;
}

.section-heading p {
  color: var(--muted);
}

.section-heading.narrow {
  max-width: 850px;
}

.simulator-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.control-panel,
.matches-panel,
.standings-panel,
.sweepstake-inputs,
.assignments-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  min-width: 0;
}

.control-panel,
.sweepstake-inputs {
  padding: 18px;
  width: 100%;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #26343d;
  font-size: 0.86rem;
  font-weight: 800;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid #cbd5d1;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
}

select,
input {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 220px;
  padding: 12px;
  resize: vertical;
}

select:focus,
input:focus,
textarea:focus {
  outline: 3px solid rgba(31, 95, 145, 0.22);
  border-color: var(--blue);
}

.group-teams {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.team-pill {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-left: 4px solid var(--field);
  background: #f4f8f4;
  border-radius: var(--radius);
  font-weight: 800;
}

.team-pill span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.team-pill span:last-child {
  flex: 0 0 auto;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 900;
}

.primary-button {
  background: var(--field);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--field-dark);
}

.secondary-button {
  background: #ffffff;
  color: var(--ink);
  border-color: #cbd5d1;
}

.secondary-button:hover {
  border-color: var(--field);
}

.scoreboard-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  min-width: 0;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-title h3 {
  margin: 0;
  font-size: 1.05rem;
}

.panel-title span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.match-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 22px 58px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: #f8faf7;
  border: 1px solid #edf1ed;
  border-radius: var(--radius);
}

.match-team {
  min-width: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.match-team:last-child {
  text-align: right;
}

.score-input {
  text-align: center;
  padding: 0;
}

.versus {
  color: var(--muted);
  text-align: center;
  font-weight: 900;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #edf1ed;
  text-align: right;
}

th {
  color: #53616b;
  font-size: 0.78rem;
  text-transform: uppercase;
}

th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

td {
  font-weight: 700;
}

tr.qualify td:first-child {
  color: var(--field);
}

tr.bubble td:first-child {
  color: var(--gold);
}

.rank-badge {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #eef4ef;
}

.scenario-output {
  display: block;
  min-height: 60px;
  padding: 14px 18px 18px;
  color: var(--muted);
}

.planner-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}

.timezone-chip {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid #cbd5d1;
  background: #ffffff;
  border-radius: var(--radius);
}

.timezone-chip span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.timezone-chip strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
}

.schedule-list {
  display: grid;
  gap: 10px;
}

.schedule-item {
  display: grid;
  grid-template-columns: 128px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid #d7dfd7;
  border-radius: var(--radius);
  background: #ffffff;
}

.schedule-time strong,
.schedule-meta strong {
  display: block;
}

.schedule-time span,
.schedule-meta span {
  color: var(--muted);
  font-size: 0.84rem;
}

.group-tag {
  min-width: 82px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #e8f2ec;
  color: var(--field-dark);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
}

.sweepstake-grid {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 18px;
  align-items: start;
}

.assignment-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.assignment-card {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid #edf1ed;
  border-radius: var(--radius);
  background: #f8faf7;
}

.person-name {
  font-weight: 900;
}

.assigned-teams {
  color: var(--muted);
}

.empty-state {
  margin: 0;
  padding: 16px;
  color: var(--muted);
}

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.faq-list summary {
  cursor: pointer;
  padding: 14px 16px;
  color: var(--ink);
  font-weight: 900;
}

.faq-list p {
  margin: 0;
  padding: 0 16px 16px;
}

.content-band {
  box-shadow: none;
}

.site-footer {
  padding: 12px 0 36px;
  color: var(--muted);
}

.site-footer a {
  color: var(--field-dark);
  font-weight: 800;
  text-decoration: none;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.plain-page {
  background: #f7f8f4;
}

.plain-header,
.plain-main {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
}

.plain-header {
  padding: 24px 0;
}

.plain-header .brand {
  color: var(--ink);
}

.plain-main {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.plain-main h1 {
  max-width: 760px;
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.plain-main h2 {
  margin-top: 28px;
}

.plain-main p,
.plain-main li {
  color: var(--muted);
}

.plain-main a {
  color: var(--field-dark);
  font-weight: 800;
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #e8ede8;
}

@media (max-width: 980px) {
  .simulator-layout,
  .scoreboard-panel,
  .sweepstake-grid,
  .planner-toolbar {
    grid-template-columns: 1fr;
  }

  .schedule-item {
    grid-template-columns: 1fr;
  }

  .group-tag {
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 590px;
  }

  .top-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px 18px;
    font-size: 0.9rem;
  }

  h1 {
    max-width: calc(100vw - 48px);
    font-size: clamp(1.82rem, 8.2vw, 2.05rem);
    line-height: 1.05;
  }

  .section-heading h2 {
    font-size: 1.48rem;
    max-width: calc(100vw - 56px);
  }

  .hero-copy {
    max-width: calc(100vw - 56px);
    font-size: 1rem;
    overflow-wrap: break-word;
  }

  .section-heading p {
    max-width: calc(100vw - 56px);
  }

  .hero-shell {
    min-height: 450px;
    padding-bottom: 92px;
  }

  .tool-band,
  .content-band {
    width: min(360px, calc(100vw - 32px));
    max-width: 1180px;
    padding: 12px;
  }

  .top-nav,
  .hero-shell,
  .site-footer {
    width: min(360px, calc(100vw - 32px));
  }

  .top-nav,
  .hero-shell,
  .tool-band,
  .content-band,
  .site-footer,
  .plain-header,
  .plain-main {
    margin-left: 16px;
    margin-right: auto;
  }

  .plain-main {
    width: min(360px, calc(100vw - 32px));
    padding: 18px;
  }

  .match-row {
    grid-template-columns: 1fr 48px 18px 48px 1fr;
    gap: 5px;
    padding: 8px;
  }

  .control-panel,
  .sweepstake-inputs {
    padding: 12px;
  }

  .team-pill span:last-child {
    display: none;
  }

  .score-input {
    min-height: 38px;
  }
}
