:root {
  --black: #131313;
  --black-deep: #030303;
  --gold: #d4af37;
  --gold-light: #e8c15c;
  --gray-bg: #f6f6f4;
  --text: #1f2020;
  --text-light: #5c5c5c;
  --font-display: 'Oswald', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.5;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: inherit;
}

/* Header */
.site-header {
  background: var(--black);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.logo-img {
  height: 40px;
  width: auto;
}

.logo-text {
  white-space: nowrap;
}

.logo-text-cn {
  font-size: 0.8em;
  font-weight: 600;
  opacity: 0.8;
  margin-left: 2px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.locale-switch {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 3px;
}

.locale-btn {
  border: none;
  background: transparent;
  color: #d8d8d8;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.locale-btn.active {
  background: var(--gold);
  color: var(--black);
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--gold);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  min-width: 150px;
  background: var(--black);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: 9px 16px;
  white-space: nowrap;
  font-size: 0.9rem;
}

.nav-cta {
  background: var(--gold);
  color: var(--black) !important;
  padding: 8px 16px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-weight: 700 !important;
}

.nav-game {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  padding: 7px 14px !important;
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  font-weight: 600 !important;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-game:hover {
  background: var(--gold);
  color: var(--black) !important;
}

.nav-game-icon {
  font-size: 1rem;
  line-height: 1;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  min-height: 680px;
  display: flex;
  align-items: flex-start;
  padding: 90px 0 40px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url("assets/hero-bg.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center 30%;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(5,5,5,0.85) 0%, rgba(5,5,5,0.65) 24%, rgba(5,5,5,0.15) 42%, rgba(5,5,5,0) 55%);
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  max-width: 360px;
  margin-left: max(20px, calc((100vw - 1100px) / 2));
}

.hero-logo {
  height: 100px;
  width: auto;
  margin-bottom: 20px;
}

.hero-kicker {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 6px;
}

.hero h1 {
  font-size: 2.75rem;
  margin: 0 0 8px;
}

.hero-cn-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-light);
  margin: 0 0 14px;
}

.hero-tagline {
  font-size: 1.15rem;
  opacity: 0.9;
  margin: 0 0 32px;
  max-width: 420px;
}

.hero-facts {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 36px;
}

.hero-fact {
  display: flex;
  flex-direction: column;
}

.hero-fact-label {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
  opacity: 0.75;
  margin-bottom: 4px;
  color: var(--gold-light);
}

.hero-fact-value {
  font-size: 1.15rem;
  font-weight: 600;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 4px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.3px;
  font-size: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--gold);
  color: var(--black);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.is-disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.is-disabled:hover {
  transform: none;
  box-shadow: none;
}

.hero-cta-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.hero-cta-note {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold-light);
  opacity: 0.9;
}

/* Sections */
.section {
  padding: 64px 0;
}

.section-alt {
  background: var(--gray-bg);
}

.section h2 {
  font-size: 2rem;
  margin: 0 0 20px;
  color: var(--black);
  border-bottom: 3px solid var(--gold);
  display: inline-block;
  padding-bottom: 6px;
}

.section p {
  color: var(--text-light);
  max-width: 700px;
}

.about-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.about-text {
  flex: 1;
}

.highlight-note {
  display: block;
  margin: 0 0 16px;
  font-weight: 600;
  color: var(--black);
  max-width: none;
}

.zh-only {
  display: none;
}

html[lang="zh-CN"] .zh-only {
  display: block;
}

.aside-note {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-light);
}

.partner-logo {
  height: 180px;
  width: auto;
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .about-content {
    flex-direction: column-reverse;
    text-align: center;
  }

  .about-text p {
    max-width: none;
  }
}

.tbd {
  display: inline-block;
  background: #fff3cd;
  color: #7a5c00;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9rem;
}

.sponsors-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 28px;
}

.sponsor-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: transparent;
  border: none;
  padding: 12px 20px;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.sponsor-card:hover {
  transform: translateY(-2px);
  opacity: 0.85;
}

.sponsor-logo {
  max-height: 120px;
  max-width: min(320px, 80vw);
  width: auto;
  height: auto;
}

.sponsor-logo-icon {
  height: 80px;
  width: 80px;
  border-radius: 16px;
}

.sponsor-name {
  font-size: 2rem;
  font-weight: 800;
  color: rgb(255, 184, 37);
}

.details-toggle summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--gold);
  list-style: none;
}

.details-toggle summary::-webkit-details-marker {
  display: none;
}

.details-toggle summary::after {
  content: "▾";
  display: inline-block;
  transition: transform 0.15s ease;
}

.details-toggle[open] summary::after {
  transform: rotate(180deg);
}

.details-toggle summary:hover {
  color: var(--gold-light);
}

.details-block {
  margin-top: 28px;
}

.details-block:first-of-type {
  margin-top: 20px;
}

.details-block h3 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  color: var(--black);
}

.teams-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100px;
  text-align: center;
}

.team-logo {
  height: 88px;
  width: 88px;
  object-fit: contain;
}

.team-name {
  font-weight: 700;
  color: var(--black);
  font-size: 0.95rem;
}

.register-fee {
  margin: 4px 0 20px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--black);
}

.register-note {
  margin-top: 16px;
  font-size: 0.9rem;
}

.register-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 420px;
}

.register-form[hidden] {
  display: none;
}

.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 0;
  width: 0;
  overflow: hidden;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--black);
}

.form-row input,
.form-row select {
  padding: 12px 14px;
  border: 1px solid #d8d8d4;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}

.form-row input:focus,
.form-row select:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.register-form .btn {
  align-self: flex-start;
  border: none;
  cursor: pointer;
}

.register-form .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.register-success {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 4px;
  background: var(--gray-bg);
  color: var(--black);
  font-weight: 600;
  max-width: 420px;
}

.register-error {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 4px;
  background: #fbe9e7;
  color: #9c3a2e;
  font-weight: 600;
  max-width: 420px;
}

.roster-form {
  max-width: 720px;
}

.player-row {
  display: flex;
  gap: 12px;
}

.player-row .form-row {
  flex: 1;
  min-width: 0;
}

.player-row .form-row:first-child {
  flex: 1.4;
}

@media (max-width: 700px) {
  .player-row {
    flex-direction: column;
  }
}

.schedule-group-title {
  margin: 20px 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-light);
  text-transform: uppercase;
}

.schedule-round-label {
  margin: 14px 0 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
}

.schedule-division-summary,
.schedule-section-summary {
  cursor: pointer;
  list-style: none;
}

.schedule-division-summary::-webkit-details-marker,
.schedule-section-summary::-webkit-details-marker {
  display: none;
}

.schedule-division-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.schedule-division-summary::after,
.schedule-section-summary::after {
  content: "▾";
  display: inline-block;
  color: var(--gold);
  transition: transform 0.15s ease;
}

details[open] > .schedule-division-summary::after,
details[open] > .schedule-section-summary::after {
  transform: rotate(180deg);
}

.schedule-section-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin: 16px 0 10px;
}

.schedule-section {
  margin-bottom: 8px;
}

.schedule-table,
.standings-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.standings-table {
  margin-top: 14px;
}

.schedule-table th,
.schedule-table td,
.standings-table th,
.standings-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.95rem;
}

.standings-table th:not(:first-child),
.standings-table td:not(:first-child) {
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
}

.schedule-table th,
.standings-table th {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-light);
  border-bottom: 2px solid var(--gold);
}

.schedule-table tbody tr:not(:last-child) td,
.standings-table tbody tr:not(:last-child) td {
  border-bottom: 1px solid #eee;
}

.schedule-score-final {
  font-weight: 700;
  color: var(--black);
}

.standings-advance td {
  background: #fdf6e6;
}

.standings-pts {
  font-weight: 700;
  color: var(--black);
}

.standings-note {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--text-light);
}

.team-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-cell-logo {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #eee;
}

.team-cell-logo-empty {
  background: transparent;
  border: none;
}

.schedule-result-col {
  text-align: center;
}

#schedule-content,
#teams-content {
  overflow-x: auto;
}

.detail-note {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-light);
  font-weight: 400;
}

.age-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-weight: 600;
  color: var(--gold);
}

.age-group-list li {
  padding: 2px 0;
}

.rules-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  max-width: 640px;
}

.rules-list li {
  position: relative;
  padding: 8px 0 8px 28px;
  color: var(--text);
  border-bottom: 1px solid #e3e3e0;
}

.rules-list li:last-child {
  border-bottom: none;
}

.rules-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 8px;
  color: var(--gold);
  font-weight: 700;
}

.field-plan {
  margin: 28px 0 0;
  max-width: 640px;
}

.field-plan img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.field-plan figcaption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Instagram banner */
.instagram-banner {
  background: linear-gradient(135deg, var(--black) 0%, var(--black-deep) 100%);
  color: #fff;
  padding: 56px 0;
  text-align: center;
}

.instagram-banner-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.instagram-banner svg {
  color: var(--gold);
  margin-bottom: 12px;
}

.instagram-banner h2 {
  margin: 0 0 8px;
  font-size: 1.75rem;
}

.instagram-banner p {
  margin: 0 0 24px;
  color: #d8d8d8;
}

/* Footer */
.site-footer {
  background: var(--black-deep);
  color: #fff;
  padding: 24px 0;
  text-align: center;
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
  color: #c9c9c9;
}

/* Nav collapses to hamburger earlier than the rest of the mobile layout —
   with 10 nav items, the horizontal nav no longer fits next to the bilingual
   logo between ~768px and ~1160px, which was wrapping "King Juan Cup 卷王杯"
   onto multiple lines instead. */
@media (max-width: 1160px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--black);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    border-top: 1px solid rgba(255,255,255,0.15);
  }

  .nav-links a {
    display: block;
    padding: 14px 20px;
  }

  .nav-cta {
    margin: 12px 20px;
    display: inline-block;
  }

  .nav-game {
    margin: 4px 20px 16px;
    display: inline-flex !important;
  }

  .nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }

  .nav-dropdown-menu li {
    border-top: none;
  }

  .nav-dropdown-menu a {
    padding: 12px 20px 12px 34px;
    font-size: 0.9rem;
    opacity: 0.85;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--black);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    border-top: 1px solid rgba(255,255,255,0.15);
  }

  .nav-links a {
    display: block;
    padding: 14px 20px;
  }

  .nav-cta {
    margin: 12px 20px;
    display: inline-block;
  }

  .nav-game {
    margin: 4px 20px 16px;
    display: inline-flex !important;
  }

  .nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }

  .nav-dropdown-menu li {
    border-top: none;
  }

  .nav-dropdown-menu a {
    padding: 12px 20px 12px 34px;
    font-size: 0.9rem;
    opacity: 0.85;
  }

  .logo-img {
    height: 32px;
  }

  .logo-text-cn {
    display: none;
  }

  .logo {
    font-size: 1.05rem;
  }

  .main-nav {
    gap: 10px;
  }

  .locale-switch {
    padding: 2px;
  }

  .locale-btn {
    padding: 4px 9px;
    font-size: 0.75rem;
  }

  .hero {
    min-height: 0;
    padding: 32px 20px 28px;
  }

  .hero-bg {
    background-size: cover;
    background-position: center 25%;
  }

  .hero-overlay {
    background: linear-gradient(180deg, rgba(5,5,5,0.55) 0%, rgba(5,5,5,0.82) 60%, rgba(5,5,5,0.92) 100%);
  }

  .hero-cta-row {
    align-items: center;
  }

  .hero-inner {
    align-items: center;
    text-align: center;
    max-width: none;
    width: 100%;
    margin-left: 0;
  }

  .hero-tagline {
    max-width: none;
    margin-bottom: 22px;
  }

  .hero-facts {
    align-items: center;
    margin-bottom: 24px;
    gap: 10px;
  }

  .hero-logo {
    height: 80px;
    margin-bottom: 14px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }
}
