:root {
  --primary: #00768b;
  --primary-dark: #005e6f;
  --primary-soft: #ebf4f6;
  --club-red: #d40d1d;
  --club-red-dark: #ad0713;
  --ink: #292e2f;
  --muted: #697174;
  --line: #d9dfe0;
  --surface: #ffffff;
  --soft: #f5f7f7;
  --success: #19753b;
  --shadow: 0 16px 45px rgba(25, 48, 52, 0.09);
}

* { box-sizing: border-box; }

/* Author styles such as .loading { display: grid } must never override
   elements that the application has explicitly hidden. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

a { color: inherit; }
button, input, select { font: inherit; }

.topbar {
  min-height: 92px;
  padding: 12px clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--surface);
  border-bottom: 1px solid #eef0f0;
  border-top: 4px solid var(--club-red);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.brand-logo { display: block; width: clamp(210px, 24vw, 315px); height: auto; }

.portal-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.intro {
  position: relative;
  overflow: hidden;
  padding: 72px clamp(20px, 8vw, 120px) 68px;
  color: white;
  background:
    radial-gradient(circle at 83% 14%, rgba(255,255,255,.16) 0 2px, transparent 3px),
    linear-gradient(120deg, #00687b 0%, #007f94 64%, #0793a8 100%);
}

.intro::after {
  content: "";
  position: absolute;
  width: 440px;
  height: 440px;
  right: -140px;
  top: -260px;
  border: 70px solid rgba(255,255,255,.065);
  border-radius: 50%;
}

.eyebrow {
  margin: 0 0 10px;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  max-width: 740px;
  margin: 0;
  font-size: clamp(44px, 7vw, 82px);
  line-height: .97;
  letter-spacing: -.045em;
}

h1 span { color: #f7ced2; }

.lead {
  max-width: 620px;
  margin: 24px 0 38px;
  color: rgba(255,255,255,.82);
  font-size: clamp(17px, 2vw, 21px);
}

.filter-panel {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(230px, 1.6fr) minmax(180px, .8fr) auto;
  gap: 12px;
  align-items: end;
  color: var(--ink);
  background: white;
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0, 42, 51, .23);
}

.field label {
  display: block;
  margin: 0 0 7px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.input-wrap span { color: var(--primary); font-size: 23px; }

input, select {
  width: 100%;
  min-height: 48px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

input { padding: 10px 12px 10px 0; border: 0; }
select { padding: 10px 38px 10px 12px; }

input:focus-visible, select:focus-visible, .input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,118,139,.15);
}

.filter-button, .error-state button {
  min-height: 48px;
  padding: 11px 22px;
  color: white;
  background: var(--club-red);
  border: 1px solid var(--club-red);
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.filter-button:hover, .error-state button:hover { background: var(--club-red-dark); }

.share-row {
  max-width: 1040px;
  min-height: 30px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.share-button {
  padding: 5px 0;
  color: rgba(255,255,255,.9);
  background: transparent;
  border: 0;
  font-weight: 650;
  cursor: pointer;
}

.share-feedback { color: #c6f0f3; font-size: 14px; }

.results {
  max-width: 1200px;
  min-height: 430px;
  margin: 0 auto;
  padding: 58px clamp(20px, 5vw, 68px) 84px;
}

.results-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.results .eyebrow { color: var(--club-red); }

h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -.035em;
}

.result-count { margin: 0 0 5px; color: var(--muted); font-weight: 650; }

.event-list { display: grid; gap: 18px; }

.event-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid #e5e9e9;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.date-block {
  padding: 28px 16px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  text-align: center;
}

.date-day { display: block; color: var(--club-red); font-size: 43px; font-weight: 850; line-height: 1; }
.date-month { display: block; margin-top: 7px; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.date-year { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }

.event-content { padding: 26px 28px 24px; }

.event-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
  margin-bottom: 22px;
}

.event-title { margin: 0; font-size: clamp(20px, 3vw, 27px); line-height: 1.2; }
.event-meta { margin: 8px 0 0; color: var(--muted); }

.event-link {
  flex: none;
  padding: 9px 14px;
  color: var(--primary-dark);
  background: white;
  border: 1px solid #a9cbd1;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.roles { display: grid; gap: 9px; }

.role-row {
  min-height: 60px;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(150px, .8fr) auto;
  align-items: center;
  gap: 14px;
  padding: 11px 12px 11px 16px;
  background: #fafbfb;
  border: 1px solid #edf0f0;
  border-radius: 9px;
}

.role-name { font-weight: 800; }
.role-time { color: var(--muted); font-size: 14px; }

.slot-count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
}

.slot-count::before {
  content: "";
  width: 7px;
  height: 7px;
  background: #31a454;
  border-radius: 50%;
}

.signup-link {
  padding: 9px 15px;
  color: white;
  background: var(--club-red);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  text-align: center;
}

.signup-link:hover { background: var(--club-red-dark); }

.loading { display: grid; gap: 18px; }
.loading div { height: 170px; background: linear-gradient(90deg, #e9eded 25%, #f5f7f7 50%, #e9eded 75%); background-size: 200% 100%; border-radius: 14px; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position-x: -200%; } }

.empty-state, .error-state {
  padding: 55px 24px;
  background: white;
  border: 1px solid #e5e9e9;
  border-radius: 14px;
  text-align: center;
}

.empty-state > span { display: inline-grid; width: 46px; height: 46px; place-items: center; color: white; background: var(--primary); border-radius: 50%; font-weight: 900; }
.empty-state h3, .error-state h3 { margin: 16px 0 6px; font-size: 23px; }
.empty-state p, .error-state p { max-width: 530px; margin: 0 auto 20px; color: var(--muted); }

footer {
  padding: 27px clamp(20px, 5vw, 72px);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: #cfd6d7;
  background: #283234;
  font-size: 14px;
}

footer p { margin: 0; }
footer a { color: white; font-weight: 750; text-decoration: none; }

@media (max-width: 790px) {
  .intro { padding-top: 54px; }
  .filter-panel { grid-template-columns: 1fr; }
  .event-card { grid-template-columns: 1fr; }
  .date-block { display: flex; align-items: baseline; justify-content: flex-start; gap: 8px; padding: 15px 22px; text-align: left; }
  .date-day { font-size: 28px; }
  .date-month { margin: 0; }
  .date-year { margin: 0; }
  .event-topline { flex-direction: column; gap: 14px; }
  .role-row { grid-template-columns: 1fr auto; }
  .role-time { grid-column: 1; }
  .signup-link { grid-column: 2; grid-row: 1 / 3; }
}

@media (max-width: 520px) {
  .brand-logo { width: 190px; }
  .portal-link { font-size: 14px; }
  .intro { padding-bottom: 48px; }
  .results-header { display: block; }
  .result-count { margin-top: 7px; }
  .event-content { padding: 21px 17px 18px; }
  .role-row { grid-template-columns: 1fr; }
  .role-time, .signup-link { grid-column: 1; grid-row: auto; }
  .signup-link { margin-top: 3px; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .loading div { animation: none; }
}
