:root {
  --brand-font: "MacTuffX Brand", Inter, Arial, sans-serif;
}

@font-face {
  font-family: "MacTuffX Brand";
  src: url("assets/NotesStyleNbr-Brand.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --blue: #071f49;
  --blue-2: #0b2f6b;
  --black: #05070b;
  --ink: #101827;
  --white: #ffffff;
  --muted: #9aa7ba;
  --line: rgba(255, 255, 255, 0.12);
  --panel: rgba(255, 255, 255, 0.07);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --blue-glow: rgba(20, 91, 194, 0.42);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--white);
  background:
    radial-gradient(circle at 18% 12%, rgba(17, 62, 136, 0.85), transparent 28rem),
    linear-gradient(135deg, var(--black) 0%, #07101f 42%, var(--blue) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.hero {
  padding: 8px 0 30px;
}

.topbar,
.hero-grid,
.controls-card,
.leaderboard-card,
.profile-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.045));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 8px;
  padding: 16px 18px;
}

.topbar-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

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

.home-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.28);
  font-family: var(--brand-font);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.home-button:hover,
.home-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.1);
}

.brand-logo {
  display: block;
  width: clamp(170px, 24vw, 300px);
  height: auto;
  object-fit: contain;
}

.stat-label,
.eyebrow,
.event-pill,
.result-count,
.filter-group span,
label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.event-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  font-family: var(--brand-font);
  font-weight: 400;
  white-space: nowrap;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  margin-top: 22px;
  border-radius: 8px;
  padding: clamp(28px, 5vw, 56px);
  overflow: hidden;
  position: relative;
}

.hero-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 3px solid rgba(255, 255, 255, 0.22);
  background: radial-gradient(circle at 76% 12%, var(--blue-glow), transparent 24rem);
  pointer-events: none;
}

.hero-copy h1 {
  position: relative;
  max-width: 850px;
  margin: 8px 0 14px;
  font-family: var(--brand-font);
  font-weight: 400;
  font-size: clamp(2.4rem, 5vw, 5.1rem);
  line-height: 0.96;
  text-transform: uppercase;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy h1 span,
.hero-copy h1 strong {
  display: block;
}

.hero-copy h1 strong {
  margin-top: 8px;
  color: #e9f2ff;
  font-weight: 400;
  font-size: clamp(1.05rem, 2.4vw, 2.1rem);
  letter-spacing: 0.1em;
}

.hero-copy p:last-child {
  max-width: 650px;
  margin: 0;
  color: #dbe5f4;
  font-size: 1.05rem;
  line-height: 1.7;
}

.controls-card {
  display: grid;
  gap: 18px;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 20px;
}

.utility-controls {
  display: grid;
  grid-template-columns: minmax(210px, 0.72fr) minmax(280px, 1.3fr) minmax(220px, 0.58fr);
  gap: 14px;
  align-items: end;
}

.event-select-wrap,
.search-wrap,
.sort-wrap {
  display: grid;
  gap: 8px;
}

.event-select-wrap,
.search-wrap,
.sort-wrap {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.32);
  outline: none;
}

.event-select-wrap select {
  min-height: 54px;
  border-color: rgba(255, 255, 255, 0.28);
  background:
    linear-gradient(135deg, rgba(11, 47, 107, 0.72), rgba(0, 0, 0, 0.38)),
    rgba(0, 0, 0, 0.32);
  font-weight: 900;
}

.sort-wrap select {
  min-height: 54px;
  min-width: 210px;
}

.search-wrap input {
  min-height: 54px;
  background: rgba(0, 0, 0, 0.4);
}

.search-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.56);
}

input:focus,
select:focus,
.chip:focus-visible,
.result-row:focus-visible,
.close-button:focus-visible {
  border-color: var(--white);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.control-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.filter-group {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.12);
}

.filter-group span {
  font-family: var(--brand-font);
  font-weight: 400;
  padding-top: 9px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.chip {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.07);
  font-family: var(--brand-font);
  font-weight: 400;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.chip:hover,
.chip.is-active {
  transform: translateY(-1px);
  background: var(--white);
  border-color: var(--white);
  color: var(--blue);
}

.leaderboard-card {
  border-radius: 8px;
  padding: 18px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--brand-font);
  font-weight: 400;
  font-size: 1.5rem;
}

.eyebrow {
  margin: 0 0 5px;
}

.result-head,
.result-row {
  display: grid;
  grid-template-columns: 76px minmax(180px, 1.8fr) 120px minmax(120px, 1fr) 100px 130px;
  gap: 12px;
  align-items: center;
}

.result-head {
  padding: 0 16px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.result-row {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--white);
  text-align: left;
  background: rgba(0, 0, 0, 0.22);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
  animation: riseIn 260ms ease both;
}

.result-row:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.28);
  background: var(--panel-strong);
}

.position-badge {
  display: inline-grid;
  min-width: 44px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: var(--white);
  font-weight: 900;
}

.name-cell strong {
  display: block;
  font-size: 1rem;
}

.name-cell small,
.muted {
  color: var(--muted);
}

.time-cell {
  font-weight: 900;
}

.tag {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 9px;
  color: #dce8fb;
  background: rgba(255, 255, 255, 0.08);
  font-family: var(--brand-font);
  font-weight: 400;
}

.empty-state {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  place-items: center;
  padding: 18px;
}

.modal.is-open {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
}

.profile-card {
  position: relative;
  width: min(920px, 100%);
  max-height: min(860px, calc(100vh - 36px));
  overflow: auto;
  border-radius: 8px;
  padding: clamp(18px, 4vw, 30px);
  animation: modalIn 220ms ease both;
}

.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.34);
}

.profile-title {
  max-width: calc(100% - 56px);
  margin: 0 0 8px;
  font-family: var(--brand-font);
  font-weight: 400;
  font-size: clamp(1.8rem, 5vw, 3.6rem);
  line-height: 1;
  text-transform: uppercase;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.profile-stats,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.profile-stat,
.detail-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.22);
}

.profile-stat.is-highlight {
  border-color: rgba(255, 255, 255, 0.46);
  background: var(--white);
  color: var(--blue);
}

.profile-stat.is-highlight span {
  color: var(--blue-2);
}

.profile-stat span,
.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-stat strong,
.detail-item strong {
  display: block;
  margin-top: 6px;
  font-size: 1.15rem;
}

.profile-stat strong {
  font-family: var(--brand-font);
  font-weight: 400;
}

.splits-wrap {
  margin-top: 18px;
}

.splits-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.splits-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.splits-table th,
.splits-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.splits-table th {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

  .utility-controls,
  .control-groups {
    grid-template-columns: 1fr;
  }

  .result-head {
    display: none;
  }

  .result-row {
    grid-template-columns: 64px 1fr;
  }

  .result-row > span:not(.position-badge):not(.name-cell) {
    grid-column: 2;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .topbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-main {
    width: 100%;
  }

  .event-pill {
    white-space: normal;
  }

  .brand-logo {
    width: min(240px, 72vw);
  }

  .hero-grid {
    padding: 22px;
  }

  .hero-copy h1 {
    font-size: 2.35rem;
  }

  .hero-copy h1 strong {
    font-size: 1.05rem;
  }

  .filter-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .filter-group span {
    padding-top: 0;
  }

  .profile-stats,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
