:root {
  color-scheme: light;
  --ink: #151516;
  --muted: #5d625f;
  --paper: #f8efdc;
  --panel: #fff8e8;
  --line: #151516;
  --navy: #132b57;
  --sky: #00a7b5;
  --red: #f24738;
  --gold: #f3c02f;
  --pink: #e46aa9;
  --green: #23765c;
  --shadow: 10px 10px 0 rgba(21, 21, 22, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(0, 167, 181, 0.12) 0 18%, transparent 18% 100%),
    linear-gradient(315deg, rgba(242, 71, 56, 0.12) 0 13%, transparent 13% 100%),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(21, 21, 22, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 21, 22, 0.04) 1px, transparent 1px);
  background-size: 18px 18px;
  mix-blend-mode: multiply;
  z-index: 2;
}

button,
input {
  font: inherit;
}

.hero {
  position: relative;
  min-height: clamp(620px, 91vh, 860px);
  display: grid;
  align-items: end;
  overflow: hidden;
  border-bottom: 8px solid var(--line);
  background: var(--navy);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.hero::before {
  top: 0;
  right: -10vw;
  width: min(720px, 58vw);
  height: 190px;
  background: var(--gold);
  transform: skewX(-24deg);
  transform-origin: top right;
  box-shadow: -18px 18px 0 var(--sky), -36px 36px 0 rgba(21, 21, 22, 0.78);
}

.hero::after {
  left: 0;
  right: 0;
  bottom: 0;
  height: 13px;
  background: repeating-linear-gradient(90deg, var(--gold) 0 52px, var(--red) 52px 104px, var(--sky) 104px 156px, var(--navy) 156px 208px);
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 44%;
  filter: saturate(1.22) contrast(1.06) sepia(0.08);
}

.hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 24, 45, 0.9), rgba(12, 24, 45, 0.5) 44%, rgba(12, 24, 45, 0.08) 74%),
    linear-gradient(0deg, rgba(12, 24, 45, 0.86), rgba(12, 24, 45, 0.1) 56%);
}

.hero__ribbon {
  position: absolute;
  top: 30px;
  left: -12px;
  z-index: 2;
  max-width: min(560px, calc(100% - 28px));
  padding: 12px 28px 12px 38px;
  border: 3px solid var(--line);
  background: var(--gold);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
  transform: rotate(-3deg);
  box-shadow: 7px 7px 0 rgba(21, 21, 22, 0.26);
}

.hero__content {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 clamp(98px, 14vh, 142px);
  color: white;
}

.eyebrow,
.label,
.team-card__meta {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  display: inline-block;
  padding: 6px 10px;
  border: 2px solid var(--gold);
  background: rgba(19, 43, 87, 0.78);
  color: var(--gold);
}

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

h1,
h2,
.round__title {
  font-family: Impact, Haettenschweiler, "Arial Black", "Franklin Gothic Heavy", sans-serif;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  max-width: 900px;
  margin-bottom: 18px;
  font-size: clamp(3.35rem, 9vw, 7.8rem);
  line-height: 0.86;
  letter-spacing: 0;
  text-shadow: 5px 5px 0 rgba(21, 21, 22, 0.72), 8px 8px 0 rgba(242, 71, 56, 0.9);
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.hero__copy {
  max-width: 660px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  font-weight: 700;
}

.hero__actions,
.controls,
.match__tools,
.score-row,
.winner-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  min-height: 44px;
  border: 2px solid var(--line);
  border-radius: 2px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 950;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  box-shadow: 5px 5px 0 rgba(21, 21, 22, 0.2);
}

.button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 7px 7px 0 rgba(21, 21, 22, 0.24);
}

.button--primary {
  background: var(--gold);
  color: #201504;
}

.button--ghost {
  border-color: white;
  color: white;
  background: rgba(0, 167, 181, 0.32);
}

.button--quiet {
  background: var(--panel);
  color: var(--navy);
}

.button--danger {
  background: var(--red);
  color: white;
}

.status-band {
  width: min(1120px, calc(100% - 32px));
  margin: -58px auto 0;
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 3px solid var(--line);
  background: var(--line);
  box-shadow: var(--shadow);
  transform: rotate(-1deg);
}

.status-band > div {
  min-height: 112px;
  padding: 20px;
  background: var(--panel);
}

.status-band > div:nth-child(2) {
  background: #fff1ae;
}

.status-band > div:nth-child(3) {
  background: #dff6f4;
}

.status-band strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.25;
}

.photo-strip {
  width: min(1120px, calc(100% - 32px));
  margin: 54px auto 0;
  display: grid;
  grid-template-columns: 1.25fr 0.9fr 0.9fr;
  gap: 16px;
  align-items: end;
}

.photo-strip figure {
  margin: 0;
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  transform: rotate(-1.4deg);
}

.photo-strip figure:nth-child(2) {
  transform: translateY(24px) rotate(1.8deg);
}

.photo-strip figure:nth-child(3) {
  transform: rotate(-0.6deg);
}

.photo-strip img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: saturate(1.16) contrast(1.04);
}

.photo-strip figcaption {
  padding: 8px 12px 10px;
  color: var(--navy);
  font-weight: 950;
  text-transform: uppercase;
}

.section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(60px, 8vw, 92px) 0 0;
}

.section--split {
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) minmax(0, 2fr);
  gap: 28px;
  align-items: start;
}

.section--compact {
  padding-bottom: 72px;
}

.section__intro {
  position: sticky;
  top: 18px;
  padding: 18px 0;
}

.section__intro p:not(.eyebrow) {
  color: var(--muted);
  font-weight: 700;
}

.section__title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 22px;
}

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

.team-card,
.match,
.rules {
  border: 3px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.team-card {
  overflow: hidden;
}

.team-card__bar {
  min-height: 12px;
  border-bottom: 3px solid var(--line);
}

.team-card__body {
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(0, 167, 181, 0.12), transparent 38%),
    var(--panel);
}

.team-card__meta {
  color: var(--navy);
}

.team-name {
  width: 100%;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 0 0 8px;
  background: transparent;
  color: var(--ink);
  font-size: 1.34rem;
  font-weight: 950;
  text-transform: uppercase;
}

.team-name:focus,
.player-input:focus,
.score-input:focus {
  outline: 4px solid rgba(0, 167, 181, 0.24);
  border-color: var(--sky);
}

.player-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.player-input {
  width: 100%;
  min-height: 40px;
  border: 2px solid rgba(21, 21, 22, 0.55);
  border-radius: 2px;
  padding: 8px 10px;
  background: #fffdf7;
  font-weight: 700;
}

.bracket {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 16px;
  align-items: start;
  overflow-x: auto;
  padding: 8px 0 14px;
}

.round {
  display: grid;
  gap: 16px;
  min-width: 230px;
}

.round__title {
  min-height: 48px;
  display: flex;
  align-items: center;
  border: 3px solid var(--line);
  padding: 8px 12px;
  background: var(--navy);
  color: white;
  font-size: 1.05rem;
  box-shadow: 5px 5px 0 rgba(21, 21, 22, 0.16);
}

.round:nth-child(2) .round__title {
  background: var(--red);
}

.round:nth-child(3) .round__title {
  background: var(--sky);
  color: var(--ink);
}

.round:nth-child(4) .round__title {
  background: var(--gold);
  color: var(--ink);
}

.match {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.match.is-pending {
  background:
    repeating-linear-gradient(-45deg, rgba(21, 21, 22, 0.04) 0 8px, transparent 8px 16px),
    #fffaf0;
}

.match__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 900;
  text-transform: uppercase;
}

.match__teams {
  display: grid;
  gap: 10px;
}

.score-row {
  justify-content: space-between;
  min-height: 50px;
  border: 2px solid rgba(21, 21, 22, 0.62);
  border-radius: 2px;
  padding: 6px;
  background: #fffdf7;
}

.score-row.is-winner {
  border-color: var(--green);
  background: #e6f5e8;
}

.score-row.is-loser {
  opacity: 0.68;
}

.team-chip {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 950;
}

.seed-dot {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--muted);
}

.team-chip span:last-child {
  overflow-wrap: anywhere;
}

.score-controls {
  display: grid;
  grid-template-columns: 32px 48px 32px;
  gap: 4px;
  align-items: center;
}

.score-step {
  width: 32px;
  height: 32px;
  border: 2px solid var(--line);
  border-radius: 2px;
  background: var(--gold);
  color: var(--ink);
  cursor: pointer;
  font-weight: 950;
}

.score-step:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.score-input {
  width: 48px;
  height: 34px;
  border: 2px solid var(--line);
  border-radius: 2px;
  text-align: center;
  font-weight: 950;
}

.winner-line {
  min-height: 28px;
  color: var(--green);
  font-weight: 950;
  text-transform: uppercase;
}

.winner-line[data-empty="true"] {
  color: var(--muted);
  font-weight: 800;
  text-transform: none;
}

.rules {
  padding: 24px;
  background:
    linear-gradient(90deg, var(--gold) 0 12px, transparent 12px),
    var(--panel);
}

.rules ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-weight: 750;
}

@media (max-width: 920px) {
  .status-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-strip {
    grid-template-columns: 1fr 1fr;
  }

  .photo-strip figure:first-child {
    grid-column: 1 / -1;
  }

  .section--split {
    grid-template-columns: 1fr;
  }

  .section__intro {
    position: static;
  }

  .bracket {
    grid-template-columns: repeat(4, minmax(260px, 1fr));
  }
}

@media (max-width: 680px) {
  .hero {
    min-height: 690px;
  }

  .hero::before {
    width: 82vw;
    height: 130px;
  }

  .hero__shade {
    background:
      linear-gradient(0deg, rgba(12, 24, 45, 0.86), rgba(12, 24, 45, 0.18) 74%),
      linear-gradient(90deg, rgba(12, 24, 45, 0.84), rgba(12, 24, 45, 0.24));
  }

  .hero__content {
    padding-bottom: 98px;
  }

  h1 {
    font-size: clamp(3.1rem, 17vw, 5rem);
  }

  .status-band,
  .team-grid,
  .photo-strip,
  .section__title {
    grid-template-columns: 1fr;
  }

  .status-band {
    transform: rotate(0deg);
  }

  .photo-strip figure,
  .photo-strip figure:nth-child(2),
  .photo-strip figure:nth-child(3) {
    transform: none;
  }

  .section__title {
    display: grid;
    align-items: start;
  }

  .controls,
  .hero__actions {
    align-items: stretch;
  }

  .button {
    flex: 1 1 160px;
    text-align: center;
  }
}
