:root {
  color-scheme: light;
  --purple: #51258f;
  --purple-deep: #39176b;
  --gold: #f4c542;
  --canvas: #f7f3ff;
  --ink: #2f1c48;
  --muted: #625374;
  --line: #e6dcef;
  --surface: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 16px/1.55 system-ui, sans-serif; }
.shell { width: min(100% - 32px, 1120px); margin-inline: auto; }
main { padding: 20px 0 64px; }
a { color: var(--purple); text-underline-offset: .18em; }
:where(a,button,input,select,textarea,[tabindex]):focus-visible { outline: 3px solid #783bb1; outline-offset: 3px; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-nav { min-height: 66px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; text-decoration: none; color: var(--purple-deep); font-weight: 850; line-height: 1.1; }
.brand span { color: var(--muted); font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.nav-link { min-height: 44px; display: inline-flex; align-items: center; flex: none; font-weight: 700; }
.skip-link { position: fixed; inset: 8px auto auto 8px; z-index: 5; padding: 10px 14px; background: white; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.tournament-hero { isolation: isolate; position: relative; min-height: 275px; overflow: hidden; display: flex; align-items: flex-end; border-radius: 24px; background: var(--purple); color: white; }
.hero-image, .tournament-hero::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-image { z-index: -2; object-fit: cover; object-position: 70% center; }
.tournament-hero::after { content: ""; z-index: -1; background: linear-gradient(0deg,#361465 0%,#51258fbc 42%,#51258f18 100%); }
.hero-copy { width: 100%; padding: 30px 20px 24px; }
.hero-copy::before { content: ""; display: block; width: 52px; height: 4px; background: var(--gold); border-radius: 99px; margin-bottom: 14px; }
h1 { color: var(--purple); font-size: clamp(2rem,6vw,3.5rem); font-weight: 900; line-height: 1.05; letter-spacing: -.035em; margin: 0; overflow-wrap: anywhere; }
.tournament-hero h1 { color: white; max-width: 13ch; font-size: clamp(2.2rem,7vw,5.2rem); text-wrap: balance; text-shadow: 0 3px 18px #3717648c; }
.tournament-hero p { margin: 11px 0 0; color: #f7f3ff; }
.tournament-hero p:empty { display: none; }
h2 { color: var(--purple-deep); font-size: clamp(1.25rem,3vw,1.55rem); line-height: 1.2; margin: 0 0 12px; }
h3 { margin: 12px 0 8px; }
section, article.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(16px,4vw,26px); margin: 18px 0; box-shadow: 0 12px 35px #51258f09; }
p { margin-block: 0 12px; }
.info-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin: 14px 0 22px; }
.info-card { border: 1px solid var(--line); border-radius: 14px; background: white; padding: 10px 12px; min-width: 0; }
.info-card dt { color: var(--muted); font-size: .78rem; font-weight: 650; }
.info-card dd { color: var(--purple-deep); font-size: clamp(.98rem,2.2vw,1.28rem); font-weight: 850; line-height: 1.2; margin: 5px 0 0; overflow-wrap: anywhere; }
.registration-card { border-inline-start: 5px solid var(--gold); }
.registration-counts, .participant-contact, .filtered-count { color: var(--muted); }
.registration-feedback:empty { display: none; }
.private-format { background: #f1e9ff; border-color: #e0d1f4; }
.private-format p { margin-bottom: 0; }
nav, .actions, .registration-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
button, .button { min-height: 44px; display: inline-flex; justify-content: center; align-items: center; padding: 9px 15px; border: 1px solid var(--purple); border-radius: 11px; color: white; background: var(--purple); font: inherit; font-weight: 750; cursor: pointer; text-decoration: none; }
button.primary, .button.primary { background: var(--gold); border-color: var(--gold); color: var(--purple-deep); }
.button.secondary { color: var(--purple); background: white; border-color: #b69ccf; }
button:disabled { opacity: .56; cursor: default; }
.status-chip { display: inline-block; width: fit-content; padding: 7px 12px; border-radius: 999px; font-weight: 750; }
.confirmed { background: #e4f4e8; color: #175633; }
.notice { color: #664009; background: #fff3cd; padding: 10px 13px; border-radius: 10px; }
.notice.status-chip { border-radius: 999px; }
.grid { display: grid; gap: 13px; grid-template-columns: repeat(auto-fit,minmax(min(100%,220px),1fr)); }
label { display: grid; gap: 5px; font-weight: 650; }
.check { display: inline-flex; align-items: center; gap: 8px; }
input, select, textarea { width: 100%; min-width: 0; min-height: 44px; padding: 9px 10px; border: 1px solid #bdaacc; border-radius: 9px; font: inherit; background: white; color: inherit; }
input[type=checkbox] { width: auto; min-height: 0; accent-color: var(--purple); }
input[type=number] { max-width: 12rem; }
.qr-layout, .admin-tools { display: grid; gap: 16px; }
.qr-picture { padding: 10px; border: 1px solid var(--line); border-radius: 14px; }
img.qr { display: block; width: min(360px,100%); height: auto; margin-inline: auto; }
.qr-picture .actions { justify-content: center; margin-top: 10px; }
.qr-picture a { min-height: 44px; display: inline-flex; align-items: center; text-align: center; }
.qr-guide ol { padding-inline-start: 24px; }
.qr-guide li + li { margin-top: 8px; }
.wrap { overflow-wrap: anywhere; }
.match { border-top: 1px solid var(--line); padding: 12px 0; }
.match strong, .participant-contact { display: block; }
details { margin: 12px 0; }
summary { cursor: pointer; font-weight: 750; }
.admin-hero { background: linear-gradient(125deg,#f3e9ff,#fff 78%); border: 1px solid var(--line); border-radius: 20px; padding: 24px 18px; margin-bottom: 16px; }
.admin-tools { background: white; border: 1px solid var(--line); border-radius: 15px; padding: 14px; }
.admin-tools nav a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 750; }
.tournament-admin #event-form .actions { margin-top: 16px; }
.registration-toolbar { margin-bottom: 14px; }
.registration-toolbar p { margin: 0; }
.participant-filters { margin-bottom: 12px; }
.participants-table { width: 100%; border-collapse: collapse; text-align: left; }
.participants-table th, .participants-table td { padding: 9px; }
.participants-table th { color: var(--purple-deep); background: var(--canvas); }
.participants-table td { border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.participants-table label { font-size: .84rem; }
.participant-contact { font-size: .86rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }
@media (min-width: 680px) {
  main { padding-top: 30px; }
  .tournament-hero { min-height: clamp(340px,53vw,505px); align-items: center; }
  .hero-copy { padding: clamp(28px,6vw,72px); }
  .tournament-hero::after { background: linear-gradient(90deg,#351466 0%,#51258fba 43%,#51258f00 79%); }
  .hero-image { object-position: center; }
  .info-cards { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; }
  .admin-metrics { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .info-card { padding: 14px; }
  .qr-layout { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; align-items: start; }
  .admin-tools { grid-template-columns: minmax(200px,340px) 1fr; align-items: end; }
}
@media (max-width: 679px) {
  .participants-table thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .participants-table, .participants-table tbody { display: block; }
  .participants-table tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
  .participants-table td { border: 0; padding: 0; min-width: 0; }
  .participants-table td:first-child, .participants-table td:last-child { grid-column: 1/-1; }
  .registration-card .primary { width: 100%; }
}

.tournament-shop {
  background: radial-gradient(ellipse at 100% 0%,#f2dbff 0%,#f7f3ff 45%,#fffaf0 100%);
  border-color: #d9c3ef;
  border-block-start: 3px solid var(--gold);
}
.tournament-shop h2 {
  margin-bottom: 18px;
  font-weight: 900;
  letter-spacing: -.025em;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,170px),1fr));
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.shop-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 17px 14px 13px;
  border: 1px solid #e1ccef;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 16px #6f3d9010;
}
.shop-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(100deg,#a44be6,#e0a9ff 54%,#f4c542 75%,#ffe8a4);
  pointer-events: none;
}
.shop-category {
  color: #684183;
  font-size: .8rem;
  font-weight: 750;
  margin: 0 0 4px;
}
.shop-card h3 {
  color: var(--purple-deep);
  margin: 0 0 14px;
  font-size: clamp(1rem,2vw,1.18rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.shop-status {
  margin: auto 0 0;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f7edd1;
  color: #60420c;
  font-size: .78rem;
  font-weight: 750;
}
.shop-card .button { margin-top: auto; text-align: center; }
.shop-product-image {
  aspect-ratio: 4/3;
  width: 100%;
  object-fit: contain;
  margin-bottom: 10px;
}
@media (min-width: 345px) and (max-width: 480px) {
  .shop-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

.winter-slam { background: radial-gradient(ellipse at 8% 8%, #eee3ff, transparent 50%), #faf7ff; }
.winter-slam main { padding-top: clamp(12px, 2.5vw, 30px); }
.winter-slam .tournament-hero {
  min-height: 263px;
  align-items: flex-end;
  border-radius: 24px;
  background: #4b2079;
  box-shadow: 0 18px 35px #4d23752d;
}
.winter-slam .hero-image { object-position: 71% 48%; }
.winter-slam .tournament-hero::after {
  background: linear-gradient(0deg,#381461 4%,#4d2379ed 31%,#60329845 77%);
}
.winter-slam .hero-copy { padding: 19px 21px; }
.winter-slam .hero-copy::before { width: 40px; margin-bottom: 10px; }
.winter-slam .tournament-hero h1 { max-width: none; line-height: .98; }
.winter-brand,.winter-year,.winter-name { display: block; }
.winter-brand { font-size: .31em; letter-spacing: .12em; margin-bottom: 5px; }
.winter-name { font-size: .9em; letter-spacing: -.045em; }
.winter-year { color: #ffdf78; font-size: .57em; margin-top: 5px; }
.winter-slam .tournament-hero p { font-weight: 650; font-size: .91rem; }
.winter-slam #content { display: grid; gap: 14px; margin-top: 14px; }
.winter-slam #content section { margin: 0; min-width: 0; }
.winter-slam .winter-registration { padding: clamp(17px,3vw,30px); border-inline-start: 1px solid var(--line); }
.winter-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 99px;
  background: #eee7f7;
  color: #522687;
  margin-bottom: 10px;
  padding: 4px 10px;
  font-size: .8rem;
  font-weight: 750;
}
.winter-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.winter-badge.is-open { background: #ebf7ef; color: #21583a; }
.winter-seats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.seat-meter { padding: 10px; background: #f6efff; border: 1px solid #eadcf8; border-radius: 12px; }
.seat-meter-heading { display: grid; gap: 3px; color: #4d2b6c; font-size: .8rem; font-weight: 700; }
.seat-meter-heading strong { color: #3e185f; font-size: clamp(1.35rem,4vw,2rem); font-variant-numeric: tabular-nums; line-height: 1.2; }
.seat-meter progress { display: block; width: 100%; height: 7px; margin-top: 8px; accent-color: #6a36a0; border: 0; border-radius: 20px; overflow: hidden; background: #e5d7f2; }
.seat-meter progress::-webkit-progress-bar { background: #e5d7f2; }
.seat-meter progress::-webkit-progress-value { background: #6a36a0; }
.seat-meter + .seat-meter progress::-webkit-progress-value { background: #9b6312; }
.winter-registration .registration-counts { margin: 10px 0; font-size: .89rem; }
.winter-registration .winter-cta { width: 100%; min-height: 50px; text-align: center; background: #f9ce55; color: #3c1c56; }
.winter-registration .winter-cta:hover:not(:disabled) { background: #ffdc76; }
.winter-note { font-size: .88rem; color: var(--muted); }
.winter-note:last-child { margin-bottom: 0; }
.winter-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 0; }
.winter-facts div { min-width: 0; padding-top: 8px; border-top: 1px solid var(--line); }
.winter-facts dt { color: var(--muted); font-size: .8rem; }
.winter-facts dd { margin: 3px 0 0; font-weight: 750; overflow-wrap: anywhere; }
@media (min-width: 680px) {
  .winter-slam .tournament-hero { min-height: clamp(310px, 43vw, 438px); align-items: center; }
  .winter-slam .tournament-hero::after { background: linear-gradient(90deg,#381461 0%,#4d2379f5 33%,#60329820 79%); }
  .winter-slam .hero-copy { padding: clamp(30px,6vw,74px); }
  .winter-slam .hero-image { object-position: center; }
  .winter-slam #content { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; gap: 18px; }
}

.winter-slam #content .tournament-shop { grid-column: 1 / -1; }

.tournament-gallery {color:#301b48;margin-block:1.2rem}
.tournament-gallery button,.tournament-gallery .button {background:#633392;color:white;border:1px solid #633392}
.tournament-gallery input,.tournament-gallery select,.tournament-gallery button {margin:.25rem;max-width:100%}
.gallery-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,175px),1fr));gap:.8rem;margin-top:.8rem}
.gallery-grid .card {border:1px solid #e7d4a4;padding:.6rem;min-width:0}
.gallery-grid .card > button:first-child {width:100%;padding:0;margin:0;overflow:hidden}
.gallery-grid img {display:block;width:100%;aspect-ratio:4/3;object-fit:cover}
.gallery-viewer {width:min(96vw,1120px);max-height:95dvh;text-align:center;background:#211032;color:white;border:1px solid #e7bd61;border-radius:12px}
.gallery-viewer::backdrop {background:#120d18da}
.gallery-viewer img {display:block;max-width:100%;max-height:68dvh;margin:.5rem auto;object-fit:contain}

#tournament-results-admin fieldset {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:.65rem;margin-block:1rem;padding:1rem;border:1px solid #dfc38a;border-radius:.65rem}
#tournament-results-admin legend {font-weight:700;color:#522881}
#tournament-results-admin label {display:grid;gap:.25rem}
#tournament-results-admin select,#tournament-results-admin input,#tournament-results-admin textarea {width:100%;min-width:0}
#tournament-results-admin button {margin:.25rem}
.tournament-recap {white-space:pre-wrap;overflow-wrap:anywhere}
#results:empty {display:none}
