:root {
  --ink: #12201b;
  --muted: #63716b;
  --surface: #ffffff;
  --surface-soft: #eef3ec;
  --line: #d9e2d9;
  --green: #0b6b3a;
  --green-dark: #084d2d;
  --red: #c83a2d;
  --yellow: #f3b33a;
  --blue: #244c8f;
  --shadow: 0 18px 42px rgb(18 32 27 / 10%);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: #f6f8f5;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-nav {
  width: min(1120px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 46%, rgb(255 255 255 / 75%) 46% 54%, transparent 54%),
    linear-gradient(0deg, transparent 46%, rgb(255 255 255 / 75%) 46% 54%, transparent 54%),
    var(--green);
  border: 3px solid var(--yellow);
  flex: 0 0 auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}

.nav-links a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--surface-soft);
  color: var(--green-dark);
}

.flash-wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 18px auto 0;
}

.flash {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 700;
}

.flash.notice {
  background: #e8f5ec;
  color: var(--green-dark);
  border: 1px solid #b9dec5;
}

.flash.alert {
  background: #fff0ec;
  color: #8f2218;
  border: 1px solid #f0b5a8;
}

.home-hero {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy {
  min-height: 360px;
  padding: clamp(28px, 6vw, 64px);
  background:
    linear-gradient(90deg, rgb(8 77 45 / 94%), rgb(11 107 58 / 86%)),
    repeating-linear-gradient(90deg, #0b6b3a 0 74px, #0f7a44 74px 148px);
  color: #ffffff;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

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

.hero-copy .eyebrow {
  color: var(--yellow);
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  font-size: clamp(2.35rem, 5vw, 4.75rem);
  max-width: 780px;
}

h2 {
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.intro {
  width: min(600px, 100%);
  margin: 18px 0 0;
  color: rgb(255 255 255 / 88%);
  font-size: clamp(1.05rem, 2vw, 1.22rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

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

.button.primary:hover {
  background: #aa2f25;
}

.button.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

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

.button.full-width {
  width: 100%;
}

.score-panel,
.panel,
.rule-block,
.empty-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.score-panel {
  min-height: 360px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.score-panel-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-weight: 800;
}

.score-panel-top strong {
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
}

.score-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.pitch-visual {
  min-height: 190px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 49%, rgb(255 255 255 / 72%) 49% 51%, transparent 51%),
    repeating-linear-gradient(90deg, #0b6b3a 0 38px, #0f7a44 38px 76px);
  border: 2px solid #ffffff;
  outline: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.pitch-visual::before,
.pitch-visual::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 92px;
  border: 2px solid rgb(255 255 255 / 76%);
}

.pitch-visual::before {
  left: -2px;
  border-left: 0;
}

.pitch-visual::after {
  right: -2px;
  border-right: 0;
}

.pitch-visual span:nth-child(1) {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 72px;
  height: 72px;
  border: 2px solid rgb(255 255 255 / 76%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.pitch-visual span:nth-child(2),
.pitch-visual span:nth-child(3) {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--yellow);
}

.pitch-visual span:nth-child(2) {
  top: 42px;
  left: 42px;
}

.pitch-visual span:nth-child(3) {
  right: 48px;
  bottom: 46px;
  background: var(--red);
}

.split-layout {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  padding: 24px;
}

.section-heading,
.page-title.with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading a {
  color: var(--green-dark);
  font-weight: 800;
  text-decoration: none;
}

.participant-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.participant-list li {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border-radius: 8px;
}

.participant-list strong {
  color: var(--green-dark);
  white-space: nowrap;
}

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

.participant-form {
  margin-top: 20px;
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-weight: 800;
}

.field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
  background: #ffffff;
}

.field input:focus {
  outline: 3px solid rgb(243 179 58 / 35%);
  border-color: var(--green);
}

.error-box {
  padding: 12px 14px;
  background: #fff0ec;
  border: 1px solid #f0b5a8;
  border-radius: 8px;
  color: #8f2218;
}

.error-box ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.page-title {
  margin-bottom: 24px;
}

.page-title h1 {
  color: var(--ink);
}

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

.rule-block {
  padding: 24px;
}

.rule-block.wide {
  grid-column: 1 / -1;
}

.rule-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.rule-list li {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.rule-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.rule-list strong {
  color: var(--green-dark);
}

.rule-list span,
.tie-list {
  color: var(--muted);
}

.tie-list {
  margin: 18px 0 0;
  padding-left: 22px;
}

.tie-list li + li {
  margin-top: 8px;
}

.table-section {
  width: 100%;
}

.standings-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.standings-table th,
.standings-table td {
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.standings-table th {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
}

.standings-table tr:last-child td {
  border-bottom: 0;
}

.standings-table td:first-child,
.standings-table th:first-child {
  width: 84px;
}

.standings-table td:last-child,
.standings-table th:last-child {
  text-align: right;
}

.empty-panel,
.form-page {
  width: min(620px, 100%);
}

.empty-panel {
  padding: 28px;
}

.empty-panel p {
  color: var(--muted);
}

.form-page {
  margin: 0 auto;
}

.form-panel h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

@media (max-width: 820px) {
  .site-nav,
  main,
  .flash-wrap {
    width: min(100% - 24px, 1120px);
  }

  .site-nav {
    min-height: 86px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }

  .nav-links {
    width: 100%;
  }

  .home-hero,
  .split-layout,
  .rules-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .score-panel {
    min-height: auto;
  }

  .pitch-visual {
    min-height: 156px;
  }

  .page-title.with-action {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  main {
    padding-top: 22px;
  }

  .hero-copy,
  .score-panel,
  .panel,
  .rule-block,
  .empty-panel {
    padding: 20px;
  }

  .hero-actions,
  .page-title.with-action .button {
    width: 100%;
  }

  .hero-actions .button,
  .page-title.with-action .button {
    flex: 1 1 100%;
  }

  .rule-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
