@import url("https://fonts.googleapis.com/css2?family=Anton&display=swap");

:root {
  --bg: #0f172a;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.13);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --line: rgba(255, 255, 255, 0.16);
  --gold: #facc15;
  --red: #ef4444;
  --blue: #38bdf8;
  --black: #020617;
  --white: #f8fafc;
  --green: #22c55e;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(250, 204, 21, 0.18), transparent 34rem),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.16), transparent 30rem),
    linear-gradient(135deg, #020617, #0f172a 50%, #111827);
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.05)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 28px solid rgba(250, 204, 21, 0.24);
  box-shadow:
    0 0 0 28px rgba(239, 68, 68, 0.14),
    0 0 0 56px rgba(56, 189, 248, 0.11),
    0 0 0 84px rgba(255, 255, 255, 0.08);
}

.hero > * {
  position: relative;
  z-index: 2;
}

.hero::before {
  content: "";
  position: absolute;
  right: -61px;
  top: 32%;
  width: 245px;
  height: 245px;
  transform: translateY(-50%);
  background-image: url("https://warringaharchers.com.au/wp-content/uploads/2025/10/WA_transparent_medium_logo_only.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.22;
  z-index: 1;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 3.5rem;
  font-family: "Anton", sans-serif;
  font-synthesis: none;
}

.eyebrow a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.eyebrow a:hover,
.eyebrow a:focus {
  color: inherit;
  text-decoration: none;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.92rem;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.stat {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(14px);
}

.stat .number {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.stat .label {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 22px 0;
}

input[type="search"] {
  width: 100%;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  font-size: 1rem;
}

input[type="search"]::placeholder {
  color: rgba(203, 213, 225, 0.7);
}

.event-select,
.event-date-picker {
  min-width: 220px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  font-size: 1rem;
}

.event-select {
  min-width: 320px;
}

.event-select option {
  color: #020617;
}

.event-date-picker::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.8;
}

.event-date-picker.has-results {
  border-color: rgba(250, 204, 21, 0.55);
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.12);
}

@media (max-width: 900px) {
  .toolbar {
    flex-wrap: wrap;
  }

  .event-select,
  .event-date-picker,
  input[type="search"] {
    width: 100%;
    min-width: 0;
  }

  .source-link {
    width: 100%;
    text-align: center;
  }
}

.source-link {
  white-space: nowrap;
  padding: 14px 17px;
  border-radius: 16px;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.09);
  font-weight: 700;
}

.flight {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.065);
  overflow: hidden;
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.2);
}

#results > .flight:first-child {
  margin-top: 0;
}

.flight-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(250, 204, 21, 0.14), transparent),
    rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--line);
}

.flight-title {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.025em;
}

.flight-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.92rem;
}

.flight-count {
  align-self: start;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.16);
  color: #fde68a;
  font-weight: 800;
  font-size: 0.85rem;
}

.division {
  padding: 18px 22px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.division:first-of-type {
  border-top: none;
}

.division-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 1.05rem;
  font-weight: 900;
}

.division-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(250, 204, 21, 0.14);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 12px;
}

.archer-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.11), rgba(255,255,255,0.045));
}

.archer-card.place-1 {
  border-color: rgba(250, 204, 21, 0.48);
  background:
    linear-gradient(135deg, rgba(250, 204, 21, 0.18), rgba(255,255,255,0.055));
}

.place {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid var(--line);
  font-weight: 900;
}

.name {
  padding-right: 48px;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.club {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.score-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 15px;
}

.score-box {
  padding: 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.17);
  border: 1px solid rgba(255,255,255,0.08);
}

.score-box strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.score-box span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.classification {
  display: inline-flex;
  margin-top: 13px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,0.16);
}

.classification.red {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

.classification.blue {
  background: rgba(56, 189, 248, 0.18);
  color: #bae6fd;
}

.classification.black {
  background: rgba(2, 6, 23, 0.72);
  color: #f8fafc;
}

.classification.white {
  background: rgba(248, 250, 252, 0.88);
  color: #020617;
}

.classification.master-bowman {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

.classification.grand-master-bowman {
  background: rgba(34, 197, 94, 0.28);
  color: #dcfce7;
  border-color: rgba(34, 197, 94, 0.55);
}

.classification.elite-gold {
  background: rgba(250, 204, 21, 0.24);
  color: #fef3c7;
  border-color: rgba(250, 204, 21, 0.55);
}

.classification.elite-silver {
  background: rgba(203, 213, 225, 0.24);
  color: #f8fafc;
  border-color: rgba(203, 213, 225, 0.55);
}

.classification.elite-bronze {
  background: rgba(180, 83, 9, 0.24);
  color: #fed7aa;
  border-color: rgba(251, 146, 60, 0.5);
}

.classification.na {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.loading,
.error,
.empty {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.awards-widget {
  position: sticky;
  top: 18px;
}

.awards-widget-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(14px);
}

.awards-widget-panel h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.awards-widget-legend {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.awards-widget-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-ring {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  display: inline-block;
}

.legend-ring.claimed {
  border: 3px solid #020617;
  background: transparent;
}

.legend-ring.unclaimed {
  border: 3px solid #f8fafc;
  background: transparent;
}

.awards-widget-list {
  display: grid;
  gap: 10px;
}

.all-gold-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.award-disc {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

.award-disc.bronze {
  background: linear-gradient(135deg, #92400e, #f59e0b);
}

.award-disc.silver {
  background: linear-gradient(135deg, #94a3b8, #f8fafc);
}

.award-disc.gold {
  background: linear-gradient(135deg, #b45309, #facc15);
}

.award-disc.claimed {
  border: 2px solid #020617;
}

.award-disc.unclaimed {
  border: 2px solid #f8fafc;
}

.all-gold-name {
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.all-gold-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.all-gold-meta span {
  padding: 4px 7px;
  border-radius: 999px;
  color: #fde68a;
  background: rgba(250, 204, 21, 0.14);
  font-size: 0.72rem;
  font-weight: 850;
}

.awards-widget-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.all-gold-archer {
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.all-gold-archer-name {
  margin-bottom: 10px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.all-gold-awards {
  display: grid;
  gap: 8px;
}

.all-gold-award {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.all-gold-award-text {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.all-gold-award-text span {
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 850;
}

.all-gold-distance {
  color: #fde68a;
  background: rgba(250, 204, 21, 0.14);
}

.all-gold-level {
  color: #dbeafe;
  background: rgba(56, 189, 248, 0.14);
}

@media (max-width: 1020px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  #results {
    order: 1;
  }

  .awards-widget {
    position: static;
    order: 2;
  }
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .hero {
    padding: 24px;
  }

  .summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .summary-card {
    min-height: 0;
    padding: 10px 8px;
    border-radius: 14px;
    text-align: center;
  }

  .summary-card strong {
    display: block;
    font-size: 1.15rem;
    line-height: 1;
    letter-spacing: -0.04em;
  }

  .summary-card span {
    display: block;
    margin-top: 4px;
    font-size: 0.68rem;
    line-height: 1.1;
    white-space: nowrap;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    overflow: hidden;
  }

  .event-date-picker,
  .event-select,
  input[type="search"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .event-date-picker {
    appearance: none;
    -webkit-appearance: none;
  }

  .source-link {
    text-align: center;
  }

  .flight {
    margin-top: 14px;
    border-radius: 18px;
  }

  #results > .flight:first-child {
    margin-top: 0;
  }

  .flight-header {
    grid-template-columns: 1fr;
    padding: 16px 16px 14px;
    gap: 10px;
  }

  .flight-title {
    font-size: 1.05rem;
    line-height: 1.15;
  }

  .flight-subtitle {
    font-size: 0.82rem;
  }

  .flight-count {
    padding: 6px 10px;
    font-size: 0.76rem;
  }

  .division {
    padding: 14px 14px 16px;
  }

  .division-heading {
    margin-bottom: 9px;
    font-size: 0.95rem;
  }

  .cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .archer-card {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto auto auto auto;
    grid-template-areas: "place name total rating class badge";
    align-items: center;
    gap: 7px;
    min-height: 0;
    padding: 9px 10px;
    border-radius: 13px;
  }

  .place {
    position: static;
    grid-area: place;
    width: 26px;
    height: 26px;
    font-size: 0.78rem;
  }

  .name {
    grid-area: name;
    min-width: 0;
    padding-right: 0;
    font-size: 0.86rem;
    line-height: 1.12;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .club {
    display: none;
  }

  .score-row {
    display: contents;
  }

  .score-box {
    min-width: 42px;
    padding: 5px 7px;
    border-radius: 9px;
    text-align: center;
  }

  .score-box:nth-child(1) {
    grid-area: total;
  }

  .score-box:nth-child(2) {
    grid-area: rating;
  }

  .score-box:nth-child(3) {
    grid-area: class;
  }

  .score-box strong {
    font-size: 0.9rem;
    line-height: 1;
    letter-spacing: -0.03em;
  }

  .score-box span {
    display: none;
  }

  .classification {
    grid-area: badge;
    max-width: 86px;
    margin-top: 0;
    padding: 5px 7px;
    font-size: 0.65rem;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 460px) {

  .archer-card {
    grid-template-columns: 26px minmax(0, 1fr) 40px 40px 42px;
    grid-template-areas:
      "place name total rating class"
      "place badge badge badge badge";
    row-gap: 6px;
  }

  .classification {
    justify-self: start;
    max-width: 100%;
  }
}

@media (max-width: 390px) {
  .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  .hero::before {
    top: 19%;
  }
}
