:root {
  --ink: #11140f;
  --muted: #5e665c;
  --paper: #f6f8f1;
  --surface: #ffffff;
  --line: #dce3d3;
  --green: #166d49;
  --green-dark: #0b3d2a;
  --yellow: #d9ff46;
  --court: #245f8a;
  --clay: #c95d2e;
  --shadow: 0 20px 60px rgba(17, 20, 15, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC",
    "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.5;
}

body::selection {
  background: var(--yellow);
  color: var(--ink);
}

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

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

.site-header {
  position: fixed;
  z-index: 20;
  top: 16px;
  left: 50%;
  display: flex;
  width: min(1120px, calc(100% - 32px));
  min-height: 56px;
  transform: translateX(-50%);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(12, 16, 12, 0.72);
  color: #fff;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-mark {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid var(--yellow);
  border-radius: 50%;
  box-shadow: inset 6px 0 0 rgba(255, 255, 255, 0.38);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  min-width: 48px;
  padding: 8px 10px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  text-align: center;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  outline: none;
}

.hero {
  position: relative;
  display: grid;
  min-height: 78svh;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.55fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: end;
  overflow: hidden;
  padding: clamp(112px, 15vw, 160px) clamp(20px, 6vw, 80px) 44px;
  color: #fff;
}

.hero-bg,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-bg {
  background-image: url("assets/hero-courts.png");
  background-position: center;
  background-size: cover;
  transform: scale(1.01);
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.38) 42%, rgba(0, 0, 0, 0.2) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.14) 0%, rgba(0, 0, 0, 0.68) 100%);
}

.hero-content,
.event-panel {
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 760px;
  min-width: 0;
}

.title-break {
  display: inline;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

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

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(48px, 8vw, 112px);
  line-height: 0.92;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(30px, 4vw, 56px);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 620px;
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(17px, 2vw, 22px);
  overflow-wrap: anywhere;
}

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

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.button-primary {
  padding: 12px 18px;
  background: var(--yellow);
  color: #10140b;
  box-shadow: 0 14px 28px rgba(217, 255, 70, 0.22);
}

.button-secondary {
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.event-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: min(100%, 360px);
  min-width: 0;
  justify-self: end;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(15, 21, 15, 0.7);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(20px);
}

.event-panel div {
  display: grid;
  grid-template-columns: minmax(56px, 0.62fr) minmax(0, 1fr);
  min-height: 54px;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.event-panel span,
.rule span,
.champion-card span,
.final-match span,
.round-card span,
.signup-form span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.event-panel span {
  color: rgba(255, 255, 255, 0.62);
}

.event-panel strong {
  text-align: right;
  overflow-wrap: anywhere;
}

.event-panel div > * {
  min-width: 0;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
  background: #fcfdf8;
}

.summary-strip div {
  display: grid;
  min-height: 112px;
  place-items: center;
  padding: 20px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.summary-strip div:last-child {
  border-right: 0;
}

.metric {
  color: var(--green-dark);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 900;
  line-height: 1;
}

.section {
  padding: clamp(56px, 8vw, 108px) clamp(20px, 6vw, 80px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 36px;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
}

.section-heading.compact {
  max-width: 680px;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

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

.info-card,
.group-board,
.final-match,
.signup-form,
.signup-roster,
.champion-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.info-card {
  min-height: 220px;
  padding: 22px;
}

.card-index {
  display: inline-flex;
  width: 38px;
  height: 30px;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  border-radius: 6px;
  background: #e8f2dd;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
}

.info-card p,
.group-board p,
.final-match p,
.champion-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.rules-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #253422;
  color: #fff;
}

.rule {
  min-height: 128px;
  padding: 26px clamp(20px, 4vw, 44px);
  background: #172016;
}

.rule span {
  display: block;
  margin-bottom: 14px;
  color: var(--yellow);
}

.rule strong {
  display: block;
  max-width: 260px;
  font-size: clamp(19px, 2vw, 26px);
  line-height: 1.12;
}

.signup-section,
.schedule-section {
  background: #eef5e7;
}

.signup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 18px;
  align-items: start;
}

.signup-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: clamp(18px, 3vw, 28px);
}

.signup-form label {
  display: grid;
  gap: 8px;
}

.signup-form .full {
  grid-column: 1 / -1;
}

.signup-form input,
.signup-form select,
.signup-form textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cbd7c3;
  border-radius: 6px;
  background: #fbfdf8;
  color: var(--ink);
  padding: 12px;
}

.signup-form textarea {
  resize: vertical;
}

.signup-form input:focus,
.signup-form select:focus,
.signup-form textarea:focus {
  border-color: var(--green);
  outline: 3px solid rgba(22, 109, 73, 0.14);
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--green-dark);
  font-weight: 800;
}

.signup-roster {
  padding: 22px;
}

.roster-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.roster-top h3 {
  margin: 0;
}

.spots {
  display: flex;
  min-width: 76px;
  height: 52px;
  align-items: baseline;
  justify-content: center;
  border-radius: 6px;
  background: #152017;
  color: #fff;
}

.spots strong {
  font-size: 32px;
  line-height: 1.4;
}

.spots span {
  color: rgba(255, 255, 255, 0.64);
  font-weight: 800;
}

.roster-list {
  display: grid;
  min-height: 168px;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.roster-list li,
.empty-state {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #d8e0d1;
  border-radius: 6px;
  background: #f8fbf5;
}

.roster-list strong {
  font-size: 15px;
}

.roster-list small,
.empty-state {
  color: var(--muted);
}

.text-button {
  border: 0;
  background: none;
  color: var(--green);
  cursor: pointer;
  font-weight: 900;
  padding: 0;
}

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

.group-board {
  overflow: hidden;
}

.group-board header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.group-board h3 {
  margin: 0;
}

.group-pill {
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--green-dark);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.group-pill.alt {
  background: var(--court);
}

.round-list {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.round-card {
  padding: 18px 20px;
  background: #fff;
}

.round-card span,
.final-match span {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
}

.finals-board {
  display: grid;
  grid-template-columns: 1.2fr repeat(2, minmax(0, 0.9fr));
  gap: 18px;
  margin-top: 18px;
}

.final-match {
  min-height: 220px;
  padding: 22px;
}

.main-final {
  background:
    linear-gradient(135deg, rgba(217, 255, 70, 0.2), rgba(255, 255, 255, 0.76)),
    #fff;
  border-color: rgba(22, 109, 73, 0.32);
}

.versus {
  display: grid;
  gap: 10px;
  margin: 18px 0 16px;
}

.versus strong {
  display: block;
  padding: 12px;
  border-radius: 6px;
  background: #f2f6ed;
  font-size: clamp(17px, 2vw, 24px);
}

.versus em {
  color: var(--clay);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.schedule-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.table-row {
  display: grid;
  grid-template-columns: 160px repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row span {
  min-height: 58px;
  padding: 16px;
  border-right: 1px solid var(--line);
  font-weight: 700;
}

.table-row span:last-child {
  border-right: 0;
}

.table-head {
  background: #162018;
  color: #fff;
}

.table-head span {
  min-height: 48px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  text-transform: uppercase;
}

.table-row.accent {
  background: #f3ffd4;
}

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

.champion-card {
  min-height: 180px;
  padding: 20px;
}

.champion-card.current {
  background: #121a12;
  color: #fff;
}

.champion-card span {
  display: block;
  margin-bottom: 22px;
  color: var(--green);
}

.champion-card.current span,
.champion-card.current p {
  color: rgba(255, 255, 255, 0.68);
}

.champion-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 26px;
  line-height: 1.05;
}

.site-footer {
  display: flex;
  min-height: 90px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(20px, 6vw, 80px);
  background: var(--ink);
  color: #fff;
}

.site-footer span {
  color: rgba(255, 255, 255, 0.68);
}

@media (max-width: 980px) {
  .site-header {
    align-items: start;
  }

  .nav-links {
    max-width: 380px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .event-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    justify-self: stretch;
  }

  .section-grid,
  .signup-layout,
  .draw-layout,
  .finals-board {
    grid-template-columns: 1fr;
  }

  .rules-band,
  .champion-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .final-match {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .site-header {
    top: 10px;
    width: calc(100% - 20px);
    min-height: 50px;
    padding: 9px;
  }

  .brand span:last-child {
    max-width: 92px;
    white-space: normal;
    line-height: 1.05;
  }

  .nav-links {
    gap: 2px;
  }

  .nav-links a {
    min-width: 40px;
    padding: 7px 6px;
    font-size: 12px;
  }

  .hero {
    min-height: 76svh;
    padding: 108px 18px 28px;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(42px, 13vw, 56px);
    line-height: 0.96;
  }

  .title-break {
    display: block;
  }

  .hero-copy {
    font-size: 16px;
  }

  .button {
    width: 100%;
  }

  .event-panel {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .event-panel div {
    min-height: 44px;
    padding: 8px 10px;
  }

  .summary-strip,
  .rules-band,
  .format-cards,
  .signup-form,
  .champion-grid {
    grid-template-columns: 1fr;
  }

  .summary-strip div {
    min-height: 92px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-strip div:last-child {
    border-bottom: 0;
  }

  .section {
    padding: 54px 18px;
  }

  .info-card {
    min-height: auto;
  }

  .schedule-table {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    margin-inline: -18px;
  }

  .table-row {
    grid-template-columns: 1fr;
  }

  .table-row span {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .table-row span:first-child {
    background: #f5f9ef;
    color: var(--green-dark);
  }

  .table-head {
    display: none;
  }

  .site-footer {
    display: grid;
    align-items: start;
  }
}
