/* Member and public pages. Colors come from tokens.css; the header from header.css. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.55;
  overflow-wrap: break-word;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 var(--ds-space-3); }
h1 {
  font-size: clamp(1.875rem, 5vw, 3.125rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 800;
}
h2 { font-size: 1.25rem; letter-spacing: -0.025em; }
h3 { font-size: 1rem; }
p { margin: 0 0 var(--ds-space-3); }
* + h3 { margin-top: var(--ds-space-4); }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-strong); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

img { max-width: 100%; }

.container {
  width: min(1040px, calc(100% - 2rem));
  margin-inline: auto;
}
.narrow { max-width: 34rem; }

.skip-link {
  position: absolute;
  left: var(--ds-space-4);
  top: -5rem;
  padding: var(--ds-space-2) var(--ds-space-4);
  background: var(--accent);
  color: var(--bg);
  z-index: 10;
}
.skip-link:focus { top: var(--ds-space-2); color: var(--bg); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

main { flex: 1; padding-block: 1.625rem var(--ds-space-12); }

/* --- Layout -------------------------------------------------------------- */
.muted { color: var(--muted); }
.meta { color: var(--muted); font-size: var(--ds-text-sm); }
.also { margin-top: var(--ds-space-3); }
.pre-line { white-space: pre-line; }

.box {
  min-width: 0;
  margin-bottom: 0.875rem;
  padding: 1.125rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.box > :last-child, .box > form:last-child > :last-child { margin-bottom: 0; }
/* Sign-in, password, and invitation cards sit in the middle of the page. */
main > div.narrow.box { margin-inline: auto; }
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: var(--ds-space-4);
}
.card > :last-child { margin-bottom: 0; }

.split { display: grid; gap: 0.875rem; margin-top: 0.875rem; margin-bottom: 0.875rem; }
.split > .box { margin: 0; }
@media (min-width: 700px) {
  .split { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
}

.hero {
  margin-bottom: 0.875rem;
  padding: clamp(1.5rem, 5vw, 3.125rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 87% 42%, color-mix(in srgb, var(--accent-support) 14%, transparent), transparent 44%),
    radial-gradient(circle, color-mix(in srgb, var(--accent) 10%, transparent) 1px, transparent 1px) right top / 21px 21px,
    linear-gradient(110deg, var(--surface) 36%, var(--surface-strong));
}
.hero p { color: var(--muted); margin: var(--ds-space-2) 0 0; }
.hero h1 { margin: 0; }
.hero .eyebrow {
  margin: 0 0 var(--ds-space-3);
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.hero-compact { padding-block: var(--ds-space-6); }
.hero-landing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ds-space-8);
}
.hero-landing > img { flex: none; width: clamp(6rem, 22vw, 9.5rem); height: auto; }
.hero-landing > div { flex: 1 1 16rem; }
.hero-landing .button { margin-top: var(--ds-space-3); }
.hero .button:not(.button-secondary), .hero .button:not(.button-secondary):hover { color: var(--action-ink); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--ds-space-3) var(--ds-space-4);
  margin-bottom: 1.125rem;
}
.section-head h1, .section-head h2 { margin-bottom: var(--ds-space-1); }
.section-head p { margin: 0; }

/* An action button that reveals its form, with or without JavaScript. */
.disclose > summary { width: fit-content; list-style: none; }
.disclose > summary::-webkit-details-marker { display: none; }
.disclose[open] { flex-basis: 100%; }
.disclose[open] > summary { margin-bottom: var(--ds-space-3); }
.form-box { max-width: 34rem; }

.note {
  padding: var(--ds-space-3) var(--ds-space-4);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

/* --- Seats --------------------------------------------------------------- */
.seat-bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 3px;
  margin: 0.875rem 0;
}
.seat-bar span { height: 9px; border-radius: 3px; background: var(--seat-empty); }
.seat-bar span.on { background: var(--accent); }
.seat-meter { width: 100%; height: 0.75rem; margin: 0.875rem 0; accent-color: var(--accent); }
.name-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-2);
  padding: 0;
  margin: 0;
  list-style: none;
}
.name-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  padding: var(--ds-space-1) var(--ds-space-3);
  font-size: var(--ds-text-sm);
}

.badge {
  display: inline-block;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--accent-strong);
  font-size: var(--ds-text-xs);
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  vertical-align: middle;
}
/* Magenta is kept for the one rare state that needs to stand out: a full LAN. */
.badge-alert {
  border-color: var(--highlight);
  background: color-mix(in srgb, var(--highlight) 14%, transparent);
  color: var(--text);
}

/* --- Lists: checklist, menu, games --------------------------------------- */
.checklist, .plain-list { list-style: none; padding: 0; margin: 0; }
.check-grid { display: grid; gap: 0 var(--ds-space-6); }
@media (min-width: 700px) {
  .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.check-grid h3 { margin-top: var(--ds-space-3); }
.checklist label { display: flex; gap: var(--ds-space-3); padding-block: var(--ds-space-1); }
.checklist input { width: 1.1rem; height: 1.1rem; margin-top: 0.22rem; flex: none; accent-color: var(--accent); }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; }

.rows > li {
  padding-block: 0.8125rem;
  border-bottom: 1px solid var(--line);
}
.rows > li:first-child { padding-top: 0; }
.rows > li:last-child { border-bottom: 0; padding-bottom: 0; }
.rows { margin-bottom: var(--ds-space-3); }
.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.625rem var(--ds-space-4);
}
.row > div:first-child { flex: 1 1 14rem; min-width: 0; }
#games section + section { margin-top: var(--ds-space-6); }

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ds-space-2) var(--ds-space-4);
}

/* --- Forms and buttons --------------------------------------------------- */
form { margin: 0; }
.field { margin-bottom: var(--ds-space-4); }
.field label { display: block; font-weight: 700; margin-bottom: var(--ds-space-1); }
.help { color: var(--muted); font-size: var(--ds-text-sm); }
.help ul { margin: var(--ds-space-1) 0 0; padding-left: 1.2rem; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="file"], select, textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: var(--ds-space-2) var(--ds-space-3);
  border: 1px solid var(--control-line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
}
input[aria-invalid="true"] { border-color: var(--danger); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2);
  min-height: 2.75rem;
  padding: 0.4rem 0.875rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: var(--action-ink);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: filter 120ms ease;
}
.button:hover { filter: brightness(1.12); color: var(--action-ink); }
.button:disabled { cursor: not-allowed; opacity: 0.6; filter: none; }
.button-secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
  font-weight: 650;
}
.button-secondary:hover { color: var(--text); border-color: var(--accent); }
.button-toggle {
  background: var(--surface);
  border-color: var(--control-line);
  color: var(--text);
  font-weight: 650;
}
.button-toggle:hover { color: var(--text); border-color: var(--accent); }
.button-toggle[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--badge-bg);
  color: var(--accent-strong);
}
form + p { margin-top: var(--ds-space-3); }
.link-button {
  background: none;
  border: 0;
  padding: var(--ds-space-2) 0;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

details > summary { cursor: pointer; color: var(--accent); padding-block: var(--ds-space-2); }
details > summary.button { color: var(--action-ink); padding-block: 0.4rem; }

.errorlist { color: var(--danger); padding-left: 1.2rem; margin: 0 0 var(--ds-space-2); }
.form-errors { border-color: var(--danger); margin-bottom: var(--ds-space-4); }

.messages { list-style: none; padding: 0; margin: 0 0 var(--ds-space-4); }
.messages li {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  padding: var(--ds-space-3) var(--ds-space-4);
  margin-bottom: var(--ds-space-2);
}
.messages li.error { border-left-color: var(--danger); }

/* --- Archive and photos --------------------------------------------------- */
.archive-entry h2 { margin-bottom: var(--ds-space-1); }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.875rem 0;
}
@media (min-width: 571px) {
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.photo-grid figure { margin: 0; }
.photo {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--surface-strong), var(--surface));
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
/* The full gallery shows whole pictures; the index crops previews to fit. */
.photo-grid-full .photo img { object-fit: contain; }
.photo-empty {
  align-content: center;
  gap: var(--ds-space-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--ds-text-sm);
}
.photo-empty .icon { width: 1.75rem; height: 1.75rem; }
.photo-grid figcaption { padding-top: 0.375rem; font-size: var(--ds-text-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
