/* DXD Invitational — jersey-inspired: black body, electric blue fade, white piping. */
:root {
  --ink: #0b0b0b;
  --ink-2: #121417;
  --ink-3: #1b1e22;
  --line: #2a2e34;
  --blue: #089cf6;
  --blue-deep: #0563c9;
  --blue-glow: rgba(8, 156, 246, 0.35);
  --white: #ffffff;
  --text: #e8ecf0;
  --muted: #9aa3ad;
  --warn: #ffd166;
  --bad: #ff5d6c;
  --ok: #2fd18b;

  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow", system-ui, sans-serif;

  --text-sm: 0.875rem;
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-h2: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  --text-hero: clamp(3.4rem, 1.5rem + 9vw, 7.5rem);

  --cut: 18px;
  --radius: 4px;
  --space-section: clamp(2.5rem, 2rem + 3vw, 4.5rem);
  --duration-fast: 150ms;
  --duration-normal: 280ms;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.wrap { width: min(980px, 100% - 32px); margin-inline: auto; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 28px 0 clamp(64px, 10vw, 120px);
  background:
    linear-gradient(180deg, var(--ink) 0%, var(--ink) 38%, #04294f 78%, var(--blue-deep) 100%);
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto -10% 0 -10%;
  height: 70%;
  pointer-events: none;
}
/* the diagonal "sash" from the jersey front */
.hero::before {
  background: linear-gradient(160deg, transparent 48%, rgba(0, 0, 0, 0.55) 48.2%, rgba(0, 0, 0, 0.55) 62%, transparent 62.2%);
}
.hero::after {
  background: linear-gradient(160deg, transparent 63.4%, rgba(255, 255, 255, 0.85) 63.5%, rgba(255, 255, 255, 0.85) 63.8%, transparent 63.9%);
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hero-top img { width: clamp(120px, 22vw, 170px); height: auto; }
.hero-top .by {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
}
.hero h1 {
  margin: clamp(36px, 7vw, 72px) 0 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: var(--text-hero);
  line-height: 0.86;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--white);
}
.hero h1 .x { color: var(--blue); }
.hero h1 small {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  font-size: clamp(1rem, 0.8rem + 1vw, 1.5rem);
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.32em;
}
.hero h1 small::before, .hero h1 small::after { content: ""; height: 2px; width: 36px; background: var(--blue); }
.hero .tag { margin: 18px 0 0; max-width: 34ch; color: #c9d3dd; }
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 2px;
  margin-top: clamp(28px, 5vw, 44px);
  background: rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--blue);
}
.facts div { background: rgba(11, 11, 11, 0.72); padding: 14px 16px; backdrop-filter: blur(6px); }
.facts b { display: block; font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; color: var(--white); line-height: 1.1; }
.facts span { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ---------- Sections ---------- */
main { padding-bottom: 80px; }
.section {
  position: relative;
  margin-top: var(--space-section);
}
.section-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.section-num {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-size: clamp(3.5rem, 2.5rem + 4vw, 5.5rem);
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--blue);
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-h2);
  text-transform: uppercase;
  line-height: 1;
  color: var(--white);
}
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: var(--text-sm); }

.panel {
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: clamp(18px, 3vw, 28px);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}

/* ---------- Division picker ---------- */
.divisions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.division {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  cursor: pointer;
  transition: border-color var(--duration-fast), transform var(--duration-normal) var(--ease-out-expo), background var(--duration-fast);
}
.division:hover { transform: translateY(-2px); border-top-color: var(--blue); }
.division:has(input:checked) { border-color: var(--blue); border-top-color: var(--blue); background: linear-gradient(180deg, rgba(8, 156, 246, 0.14), var(--ink-3) 70%); }
.division input { position: absolute; opacity: 0; pointer-events: none; }
.division:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 3px; }
.division h3 { margin: 0; font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; text-transform: uppercase; color: var(--white); line-height: 1; }
.division .dupr { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.12em; color: var(--blue); font-size: 0.95rem; }
.division p { margin: 0; color: var(--muted); font-size: var(--text-sm); line-height: 1.45; }
.division .fee { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); font-size: var(--text-sm); color: var(--text); }
.division .fee b { font-family: var(--font-display); font-size: 1.4rem; color: var(--white); }

.brackets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.bracket {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 14px 12px;
  text-align: center;
  background: var(--ink-3);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.bracket input { position: absolute; opacity: 0; pointer-events: none; }
.bracket b { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; text-transform: uppercase; color: var(--white); }
.bracket span { font-size: 0.78rem; color: var(--muted); }
.bracket:hover { border-color: var(--blue); }
.bracket:has(input:checked) { background: var(--blue); border-color: var(--blue); }
.bracket:has(input:checked) span { color: #e6f4ff; }
.bracket:has(input:focus-visible) { outline: 2px solid var(--white); outline-offset: 2px; }
.bracket.full { opacity: 0.45; cursor: not-allowed; }
.bracket.full:hover { border-color: var(--line); }
.bracket .low { color: var(--warn); font-weight: 700; }
@media (max-width: 520px) { .brackets { grid-template-columns: 1fr; } }

/* ---------- Fields ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 18px; }
.grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; }
.field label, .label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #cfd6dd;
}
.field label .req, .label .req { color: var(--blue); }
.field label.drop, .field label.check {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text);
}
.hint { font-size: 0.8rem; color: var(--muted); }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="url"], select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font: inherit;
  color: var(--white);
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
input::placeholder { color: #5d6670; }
input:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-glow); }
.field.invalid input, .field.invalid select { border-color: var(--bad); }
.field .err { display: none; font-size: 0.8rem; color: var(--bad); }
.field.invalid .err { display: block; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--ink);
  border: 1px solid var(--line);
  cursor: pointer;
}
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--blue); flex: none; }
.check:has(input:checked) { border-color: var(--blue); }
.check b { color: var(--white); }

.sizes { display: flex; flex-wrap: wrap; gap: 6px; }
.sizes label { position: relative; }
.sizes input { position: absolute; opacity: 0; }
.sizes span {
  display: grid;
  place-items: center;
  min-width: 52px;
  height: 44px;
  padding: 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--ink);
  cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
.sizes input:checked + span { background: var(--white); color: var(--ink); border-color: var(--white); }
.sizes input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.linkish { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-size: 0.85rem; cursor: pointer; text-decoration: underline; justify-self: start; }

/* ---------- Uploads ---------- */
.drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  min-height: 96px;
  border: 1.5px dashed #3a4048;
  background: var(--ink);
  cursor: pointer;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.drop:hover, .drop.drag { border-color: var(--blue); background: rgba(8, 156, 246, 0.06); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .thumb {
  flex: none;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  background: var(--ink-3);
  border: 1px solid var(--line);
  overflow: hidden;
  color: var(--blue);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
}
.drop.avatar .thumb { border-radius: 50%; width: 76px; height: 76px; }
.drop .thumb img { width: 100%; height: 100%; object-fit: cover; }
.drop strong { display: block; color: var(--white); }
.drop small { color: var(--muted); }
.drop.has-file { border-style: solid; border-color: var(--blue); }
.field.invalid .drop { border-color: var(--bad); }

/* ---------- Payment ---------- */
.pay { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
@media (max-width: 720px) { .pay { grid-template-columns: 1fr; } }
.gcash { background: var(--white); padding: 10px; }
.gcash img { width: 100%; height: auto; }
.summary { border-left: 4px solid var(--blue); background: var(--ink); padding: 16px 18px; }
.summary table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.summary td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.summary td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.summary tr.total td { border-bottom: 0; padding-top: 12px; font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: var(--white); }
.pill { display: inline-block; margin-left: 6px; padding: 1px 8px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; background: var(--blue); color: var(--white); }
.notice { margin: 12px 0 0; padding: 10px 12px; font-size: 0.85rem; background: rgba(255, 209, 102, 0.08); border-left: 3px solid var(--warn); color: #f3e3b5; }
.notice.bad { background: rgba(255, 93, 108, 0.08); border-color: var(--bad); color: #ffc9cf; }
.notice:empty { display: none; }

/* ---------- QR explainer ---------- */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--line); }
.how div { background: var(--ink-2); padding: 18px; }
.how b { display: block; font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; text-transform: uppercase; color: var(--white); margin: 6px 0 4px; }
.how i { font-style: normal; font-family: var(--font-display); font-weight: 900; color: var(--blue); font-size: 1.1rem; letter-spacing: 0.1em; }
.how p { margin: 0; font-size: var(--text-sm); color: var(--muted); }
@media (max-width: 720px) { .how { grid-template-columns: 1fr; } }

/* ---------- Waiver ---------- */
.waiver { max-height: 320px; overflow: auto; padding: 18px; background: var(--ink); border: 1px solid var(--line); font-size: 0.9rem; color: #c8d0d8; }
.waiver h4 { margin: 14px 0 6px; font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--white); }
.waiver h4:first-child { margin-top: 0; }
.waiver ol { margin: 0; padding-left: 20px; }
.waiver li { margin-bottom: 6px; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 28px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--blue);
  border: 0;
  cursor: pointer;
  clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
  transition: transform var(--duration-fast), filter var(--duration-fast);
  text-decoration: none;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn[disabled] { filter: grayscale(1) brightness(0.6); cursor: progress; }
.btn.ghost { background: transparent; color: var(--white); box-shadow: inset 0 0 0 2px var(--line); clip-path: none; }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 0.9rem; }
.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 24px; }
.submit-row p { margin: 0; color: var(--muted); font-size: var(--text-sm); }

/* ---------- Tickets ---------- */
.tickets { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.ticket {
  position: relative;
  overflow: hidden;
  background: linear-gradient(170deg, var(--ink-2) 0%, var(--ink-2) 55%, #062c55 100%);
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  padding: 20px;
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
}
.ticket .who { display: flex; align-items: center; gap: 12px; justify-self: stretch; text-align: left; }
.ticket .who img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--blue); }
.ticket .who b { display: block; font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; color: var(--white); line-height: 1.1; }
.ticket .who span { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.ticket .qr { background: var(--white); padding: 12px; width: min(240px, 100%); }
.ticket .qr img, .ticket .qr svg { width: 100%; height: auto; display: block; }
.ticket .meta { font-size: 0.85rem; color: var(--muted); }
.status {
  display: inline-block;
  padding: 5px 12px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 0.85rem;
  text-transform: uppercase;
}
.status.pending { background: #2a2a2a; color: var(--warn); }
.status.confirmed { background: var(--blue); color: var(--white); }
.status.rejected { background: #3a1419; color: var(--bad); }

/* ---------- Modal ---------- */
dialog {
  width: min(560px, calc(100% - 32px));
  padding: 0;
  color: var(--text);
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(3px); }
dialog .head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
dialog h3 { margin: 0; font-family: var(--font-display); font-size: 1.4rem; text-transform: uppercase; color: var(--white); }
dialog .body { padding: 18px; }
.chart { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.chart th, .chart td { padding: 9px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.chart th { font-family: var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.85rem; color: var(--blue); }
.chart td:first-child { font-family: var(--font-display); font-weight: 800; color: var(--white); text-align: left; }
.close { background: none; border: 0; color: var(--muted); font-size: 1.6rem; cursor: pointer; line-height: 1; }

footer { padding: 32px 0 48px; border-top: 1px solid var(--line); color: #6b7580; font-size: 0.8rem; }

.reveal { animation: rise var(--duration-normal) var(--ease-out-expo) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Mixed entry: the ticket holder's locked details ---------- */
.ticket-me { display: flex; align-items: center; gap: 16px; padding: 14px; background: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--blue); }
.ticket-me img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 3px solid var(--blue); flex: none; }
.ticket-me b { display: block; font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: var(--white); line-height: 1.05; }
.ticket-me small { display: block; color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.ticket .mixed-cta { justify-self: stretch; text-align: left; padding: 14px; background: rgba(8, 156, 246, 0.08); border: 1px dashed var(--blue); }
.ticket .mixed-cta p { margin: 0 0 10px; font-size: 0.88rem; color: var(--text); }

/* ---------- Partner logo, top right of the form hero ---------- */
.hero-top img.partner { width: clamp(92px, 15vw, 132px); height: auto; opacity: 0.92; }

/* ---------- NR option under the rating box, and the FAQ ---------- */
.field .nr-check { padding: 8px 10px; margin-top: 8px; gap: 8px; font-size: 0.85rem; color: var(--text); }
.field .nr-check input { width: 18px; height: 18px; }
.field input[type="number"]:disabled { opacity: 0.45; }
.faq { display: grid; gap: 2px; background: var(--line); border: 1px solid var(--line); }
.faq details { background: var(--ink-2); }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 700; color: var(--white); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--blue); font-family: var(--font-display); font-weight: 900; font-size: 1.3rem; line-height: 1; transition: transform var(--duration-fast, 150ms) ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover, .faq summary:focus-visible { background: var(--ink); outline: none; }
.faq summary:focus-visible { box-shadow: inset 3px 0 0 var(--blue); }
.faq details p { margin: 0; padding: 0 18px 16px; color: var(--muted); font-size: var(--text-sm); line-height: 1.6; }

/* ---------- Kids Doubles: DUPR and Reclub become optional ---------- */
.field label .opt { display: none; margin-left: 8px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: none; color: var(--muted); }
.kids-entry [data-kids-optional] label .req { display: none; }
.kids-entry [data-kids-optional] label .opt { display: inline; }
