:root {
  color-scheme: light;
  --ink: #101828;
  --muted: #667085;
  --page: #f4f7f5;
  --surface: #ffffff;
  --surface-soft: #f8fbf9;
  --line: #d8e1dc;
  --green: #087443;
  --green-dark: #075534;
  --green-soft: #e8f6ef;
  --gold: #f4b740;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --success: #067647;
  --shadow: 0 18px 48px rgba(16, 24, 40, 0.09);
  --shadow-soft: 0 10px 28px rgba(16, 24, 40, 0.06);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(8, 116, 67, 0.13), transparent 28rem),
    radial-gradient(circle at top right, rgba(244, 183, 64, 0.15), transparent 26rem),
    linear-gradient(180deg, #fbfdfc 0%, var(--page) 42%, #eef4f1 100%);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 12px 0;
  background: rgba(244, 247, 245, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #ffffff;
  background: var(--green);
  border-radius: 14px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand span:last-child {
  display: grid;
  min-width: 0;
}

.brand strong,
.brand small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 1rem;
  font-weight: 800;
}

.brand small {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.site-nav {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.site-nav a {
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.site-nav a:hover {
  color: #ffffff;
  background: var(--green);
}

main {
  padding-top: 10px;
}

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

.hero-copy,
.quick-card,
.section {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(216, 225, 220, 0.9);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-copy {
  min-height: 390px;
  display: grid;
  align-content: center;
  padding: clamp(28px, 5vw, 58px);
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(7, 33, 27, 0.98), rgba(8, 116, 67, 0.92)),
    radial-gradient(circle at 85% 20%, rgba(244, 183, 64, 0.35), transparent 19rem);
  overflow: hidden;
  position: relative;
}

.hero-copy::after {
  content: "";
  position: absolute;
  top: -90px;
  right: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.quick-card {
  padding: 28px;
  display: grid;
  align-content: center;
  gap: 18px;
}

.trophy {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 22px;
  background: #fff6dc;
  font-size: 2rem;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-copy .eyebrow {
  color: #c8ffe4;
}

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

h1 {
  max-width: 720px;
  margin-bottom: 16px;
  font-size: clamp(3rem, 7vw, 5.6rem);
  line-height: 0.94;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

h3 {
  margin-bottom: 6px;
  font-size: 1.08rem;
}

.hero-text,
.section-subtitle {
  color: var(--muted);
  font-size: 1rem;
}

.hero-text {
  max-width: 640px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.13rem;
  line-height: 1.65;
}

.hero-actions,
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-button {
  color: #ffffff;
  background: var(--green);
  box-shadow: 0 12px 26px rgba(8, 116, 67, 0.24);
}

.primary-button:hover:not(:disabled) {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
}

.secondary-button {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ghost-button {
  color: var(--green);
  border-color: var(--line);
  background: #ffffff;
}

.ghost-button:hover {
  background: var(--green-soft);
}

.score-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.score-mini-grid div {
  min-height: 94px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-soft);
}

.score-mini-grid strong {
  color: var(--green);
  font-size: 2.1rem;
  line-height: 1;
}

.score-mini-grid small {
  color: var(--muted);
  font-weight: 700;
}

.section {
  margin-top: 20px;
  padding: clamp(20px, 3vw, 30px);
}

.section-heading {
  margin-bottom: 18px;
}

.split-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-subtitle {
  max-width: 740px;
  margin: 10px 0 0;
  line-height: 1.6;
}

.profile-status {
  white-space: nowrap;
  color: var(--muted);
  background: #f2f4f7;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 0.88rem;
  font-weight: 700;
}

.profile-status.saved {
  color: var(--success);
  background: #ecfdf3;
  border-color: #abefc6;
}

.profile-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 48px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 13px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(8, 116, 67, 0.11);
}

.winner-meta {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.section-tools {
  display: flex;
  justify-content: flex-end;
  margin: -16px 0 22px;
}

.past-matches {
  margin-top: 28px;
}

.past-matches summary {
  cursor: pointer;
  font-weight: 800;
  list-style-position: inside;
  margin-bottom: 18px;
}

.past-match-card .prediction-state {
  min-height: auto;
}

.progress-card {
  min-width: 104px;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--green-soft);
}

.progress-card strong {
  color: var(--green);
  font-size: 2rem;
  line-height: 1;
}

.progress-card small {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}

.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

[data-matches].match-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, min(100%, 620px)));
  justify-content: center;
}

.match-card {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.match-card.has-prediction {
  border-color: #abefc6;
  background: linear-gradient(180deg, #ffffff, #fbfffd);
}

.match-card-top,
.teams-row,
.score-box,
.prediction-state,
.podium-top {
  display: flex;
  align-items: center;
}

.match-card-top {
  justify-content: space-between;
  gap: 12px;
}

.match-card-top div {
  display: grid;
  gap: 3px;
}

.match-stage {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.match-card time {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.match-status {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.match-status.open {
  color: var(--green);
  background: var(--green-soft);
}

.match-status.submitted {
  color: var(--success);
  background: #ecfdf3;
}

.match-status.locked {
  color: var(--danger);
  background: var(--danger-soft);
}

.teams-row {
  justify-content: space-between;
  gap: 12px;
  min-height: 100px;
  padding: 15px;
  border-radius: 20px;
  background: var(--surface-soft);
}

.team-block {
  flex: 1;
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 10px;
}

.team-block-right {
  justify-items: end;
  text-align: right;
}

.crest {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #ffffff;
  background: var(--green);
  border-radius: 16px;
  font-weight: 900;
  font-size: 0.86rem;
}

.crest-alt {
  background: #172554;
}

.team-block strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
}

.versus {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.score-slip {
  display: grid;
  gap: 14px;
}

.score-box {
  gap: 10px;
}

.score-box label {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.score-box select {
  min-height: 58px;
  padding-left: 16px;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
}

.score-dash {
  align-self: end;
  padding-bottom: 13px;
  color: var(--muted);
  font-size: 1.4rem;
  font-weight: 800;
}

.prediction-state {
  min-height: 58px;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfd;
}

.prediction-state strong,
.prediction-state small {
  display: block;
}

.prediction-state strong {
  font-size: 0.98rem;
}

.prediction-state small {
  color: var(--muted);
  font-size: 0.82rem;
}

.match-submit {
  width: 100%;
}

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

.rules-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-soft);
}

.rules-grid strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  color: #ffffff;
  background: var(--green);
  border-radius: 14px;
  font-size: 1.35rem;
}

.rules-grid p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.site-footer a {
  color: var(--green);
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  max-width: min(420px, calc(100% - 44px));
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  padding: 14px 16px;
  color: #ffffff;
  background: var(--green);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.18);
  font-weight: 800;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  background: var(--danger);
}

@media (max-width: 920px) {
  .site-header,
  .hero,
  .split-heading,
  .profile-panel,
  .rules-grid,
  .site-footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .site-header {
    justify-items: stretch;
  }

  .site-nav {
    justify-content: center;
    overflow-x: auto;
  }

  .hero-copy {
    min-height: 340px;
  }

  .profile-status,
  .progress-card {
    width: fit-content;
  }
}

@media (max-width: 560px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 22px, 1180px);
  }

  .site-nav {
    justify-content: flex-start;
  }

  .hero-copy,
  .quick-card,
  .section {
    border-radius: 22px;
  }

  .hero-copy,
  .section {
    padding: 20px;
  }

  .match-grid {
    grid-template-columns: 1fr;
  }

  .teams-row,
  .score-box,
  .prediction-state {
    align-items: stretch;
    flex-direction: column;
  }

  .team-block,
  .team-block-right {
    justify-items: center;
    text-align: center;
  }

  .versus,
  .score-dash {
    align-self: center;
    padding: 0;
  }

  .score-mini-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.6rem, 16vw, 4rem);
  }

  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }
}


.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

[data-leaderboard-link][aria-disabled="true"] {
  opacity: 0.65;
  cursor: not-allowed;
}

[data-google-form-fallback] {
  display: none !important;
}
