:root {
  color-scheme: light;
  --accent: #ffd000;
  --ink: #121212;
  --muted: #898989;
  --white: #ffffff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--white); }
body { min-height: 100%; margin: 0; color: var(--ink); background: var(--white); }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
input:focus-visible { outline: none; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.participant-page {
  width: min(100%, 620px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) clamp(24px, 7vw, 46px) max(20px, env(safe-area-inset-bottom));
  background: var(--white);
}

.brand-header { display: flex; align-items: flex-start; }
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  text-decoration: none;
}
.brand-lockup img {
  display: block;
  width: clamp(104px, 29vw, 158px);
  height: auto;
  filter: brightness(0);
}
.brand-lockup span {
  font-family: "Basier Circle", Inter, ui-sans-serif, sans-serif;
  font-size: clamp(9px, 2.5vw, 13px);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 0.96;
}

.lookup-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.lookup-content {
  display: grid;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
}
.lookup-intro {
  display: grid;
  place-items: center;
  padding: 47px 0 0;
  text-align: center;
}
.lookup-intro h1 {
  max-width: 500px;
  margin: 0;
  font-family: "Basier Circle", Inter, ui-sans-serif, sans-serif;
  font-size: clamp(23px, 6.8vw, 39px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.08;
}
.bib-form { display: grid; gap: 10px; }
.bib-form input {
  width: 100%;
  height: clamp(48px, 7.5svh, 72px);
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  color: var(--ink);
  background: var(--white);
  font-size: clamp(19px, 5vw, 27px);
  font-weight: 400;
  text-align: center;
  text-transform: uppercase;
}
.bib-form input:focus { border-color: var(--accent); outline: none; }
.bib-form input::placeholder { color: #bebebe; opacity: 1; text-transform: none; }
.status {
  min-height: 0;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}
.status:empty { display: none; }
.bib-form button,
.primary-button,
.privacy-action button {
  display: grid;
  width: 100%;
  min-height: clamp(48px, 7.5svh, 72px);
  padding: 10px 18px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  color: var(--ink);
  background: var(--accent);
  font-family: "Basier Circle", Inter, ui-sans-serif, sans-serif;
  font-size: clamp(19px, 5vw, 27px);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.bib-form button:disabled { opacity: 0.55; cursor: wait; }

.modal-open { overflow: hidden; }
.modal-open .lookup-content { opacity: 0.035; }
.privacy-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.privacy-sheet {
  display: grid;
  width: min(100%, 620px);
  height: max(340px, 52svh);
  max-height: 620px;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 5px 5px 0 0;
  color: var(--white);
  background: #000000;
  pointer-events: auto;
}
.privacy-scroll {
  padding: clamp(30px, 7vw, 48px) clamp(26px, 7vw, 46px) 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--accent) #222222;
  scrollbar-width: thin;
}
.privacy-scroll h2,
.privacy-scroll h3 {
  margin: 0;
  font-family: "Basier Circle", Inter, ui-sans-serif, sans-serif;
  font-weight: 700;
}
.privacy-scroll h2 { font-size: clamp(17px, 4.6vw, 24px); line-height: 1.14; }
.privacy-scroll h3 { margin-top: 25px; font-size: clamp(14px, 3.8vw, 18px); line-height: 1.25; }
.privacy-scroll p {
  margin: 13px 0 0;
  color: var(--white);
  font-size: clamp(13px, 3.35vw, 16px);
  font-weight: 400;
  line-height: 1.55;
}
.privacy-scroll .privacy-subtitle { margin-top: 10px; }
.privacy-scroll .privacy-list { padding-left: 12px; }
.privacy-action { padding: 10px clamp(24px, 7vw, 46px) max(20px, env(safe-area-inset-bottom)); background: #000000; }
.privacy-action p {
  min-height: 17px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}
.privacy-action button { min-height: 58px; }
.privacy-action button:disabled { color: var(--muted); background: #262626; cursor: not-allowed; }

.photo-page {
  display: grid;
  height: 100svh;
  min-height: 560px;
  padding-right: clamp(16px, 4vw, 24px);
  padding-left: clamp(16px, 4vw, 24px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}
.portrait-stage {
  display: grid;
  min-height: 0;
  padding: clamp(14px, 2.4svh, 24px) 0 clamp(10px, 1.8svh, 18px);
  overflow: hidden;
  place-items: center;
  container-type: size;
}
.photo-shell {
  position: relative;
  width: min(100cqw, 66.6667cqh);
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border-radius: 5px;
  background: #f7f7f7;
}
.photo-shell img { display: none; width: 100%; height: 100%; object-fit: contain; }
.photo-shell[data-state="ready"] img { display: block; }
.photo-message {
  position: absolute;
  inset: 0;
  display: grid;
  margin: 0;
  padding: 28px;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}
.photo-shell[data-state="ready"] .photo-message { display: none; }
.photo-shell[data-state="error"] .photo-message { color: var(--ink); border: 4px solid var(--accent); background: var(--white); }
.download-button { min-height: clamp(48px, 7.5svh, 72px); }
.download-button[aria-disabled="true"] { pointer-events: none; opacity: 0.45; }

@media (max-height: 580px) {
  .participant-page { padding-top: max(18px, env(safe-area-inset-top)); padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .lookup-intro { padding: 16px 0; }
  .portrait-stage { padding: 10px 0 8px; }
}

@media (min-width: 700px) {
  body { background: #f7f7f7; }
  .participant-page { box-shadow: 0 0 44px rgba(18, 18, 18, 0.06); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
