:root {
  --bg: #05070c;
  --bg2: #080d18;
  --surface: #0b1220;
  --surface2: #101827;
  --glass: rgba(8, 18, 34, 0.68);
  --glass-strong: rgba(7, 16, 30, 0.84);
  --glass-soft: rgba(14, 30, 52, 0.46);
  --glass-border: rgba(126, 174, 226, 0.24);
  --glass-highlight: rgba(225, 245, 255, 0.1);
  --glass-shadow: 0 18px 48px rgba(0, 4, 14, 0.28);
  --border: rgba(128, 151, 199, 0.2);
  --border2: rgba(22, 217, 245, 0.38);
  --text: #f4f7ff;
  --muted: #9aa7bd;
  --cyan: #16d9f5;
  --blue: #1677ff;
  --violet: #6336ff;
  --magenta: #d12cff;
  --good: #1ddbb1;
  --bad: #ff4f7a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  background: var(--bg);
  color-scheme: dark;
}
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(112deg, #041015 0%, #050912 44%, #090d1c 100%);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(61, 99, 165, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 99, 165, 0.18) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}
a {
  color: var(--cyan);
  text-decoration: none;
}
a:hover {
  color: #8ff3ff;
}
.container {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}
.narrow {
  width: min(860px, calc(100% - 2rem));
  margin: 0 auto;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(4, 7, 13, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}
.nav-wrap {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #fff;
  font-weight: 800;
}
.brand img {
  width: 44px;
  height: 34px;
  object-fit: contain;
}
.site-navigation {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: max-content;
}
.nav-account {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.55rem 0.7rem;
  color: #fff;
}
.nav-menu-toggle {
  display: none;
  min-width: 44px;
  min-height: 38px;
  margin-left: auto;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(11, 19, 35, 0.92);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.nav-links > a,
.link-button {
  padding: 0.55rem 0.7rem;
  border-radius: 0.55rem;
  color: #cbd5e8;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.nav-links > a:hover,
.link-button:hover {
  background: rgba(73, 109, 255, 0.11);
  color: #fff;
}
.nav-links > a.active {
  color: #fff;
  background: rgba(22, 217, 245, 0.08);
  box-shadow: inset 0 -2px rgba(22, 217, 245, 0.72);
}
.nav-cta,
.admin-link {
  border: 1px solid var(--border2) !important;
}
.inline {
  display: inline;
}
.hero {
  position: relative;
  overflow: hidden;
  padding: 6.5rem 0 5rem;
  border-bottom: 1px solid var(--border);
}
.grid-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 70% 25%,
      rgba(68, 70, 255, 0.28),
      transparent 28rem
    ),
    radial-gradient(
      circle at 35% 45%,
      rgba(0, 214, 255, 0.12),
      transparent 24rem
    );
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.7fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #c7d2e5;
  text-transform: uppercase;
  letter-spacing: 0.17em;
  font-size: 0.72rem;
  font-weight: 800;
}
.eyebrow img {
  width: 46px;
  height: 32px;
  object-fit: contain;
}
.eyebrow.center {
  justify-content: center;
}
.wordmark {
  display: block;
  width: min(100%, 590px);
  margin-top: 1.2rem;
  border-radius: 1rem;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.32);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: -0.04em;
}
.hero h1 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  letter-spacing: 0;
  margin: 1.5rem 0 0.8rem;
}
.lead {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.75;
}
.hero-card {
  min-height: 330px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1rem;
  padding: 2rem;
  border-radius: 1.2rem;
  border: 1px solid var(--border2);
  background: linear-gradient(
    145deg,
    rgba(14, 22, 39, 0.9),
    rgba(8, 13, 24, 0.88)
  );
  box-shadow: var(--shadow);
}
.hero-card img {
  width: min(85%, 340px);
}
.hero-card span {
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.7rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.65rem 1rem;
  border-radius: 0.65rem;
  border: 1px solid transparent;
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  transition: 0.16s ease;
}
.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  color: #fff;
}
.btn.primary {
  background: linear-gradient(110deg, #0ebee9, #1d69ff 50%, #8d2cff);
  box-shadow: 0 12px 30px rgba(42, 104, 255, 0.24);
}
.btn.secondary {
  background: rgba(11, 18, 32, 0.8);
  border-color: var(--border2);
}
.btn.danger {
  background: rgba(255, 79, 122, 0.12);
  border-color: rgba(255, 79, 122, 0.4);
  color: #ff9ab2;
}
.btn.small {
  min-height: 34px;
  padding: 0.4rem 0.7rem;
  font-size: 0.86rem;
}
.section {
  padding: 5rem 0;
}
.section.compact {
  padding-top: 1rem;
}
.section-title > span,
.page-head > span {
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  font-weight: 800;
}
.section-title h2,
.page-head h1 {
  margin: 0.55rem 0 0.65rem;
}
.track-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}
.card,
.table-card {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: linear-gradient(
    165deg,
    rgba(14, 22, 39, 0.9),
    rgba(8, 13, 24, 0.86)
  );
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.15);
}
.card {
  padding: 1.25rem;
}
.track {
  min-height: 145px;
}
.track small {
  color: var(--cyan);
  font-weight: 800;
}
.track h3 {
  margin-top: 2.7rem;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.card-grid.one {
  grid-template-columns: 1fr;
}
.page {
  min-height: calc(100vh - 140px);
  padding: 3.5rem 0 5rem;
}
.page-head {
  margin-bottom: 1.5rem;
}
.page-head p {
  color: var(--muted);
}
.auth-shell {
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
  padding: 4rem 1rem;
}
.auth-card {
  width: min(460px, 100%);
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  background: rgba(11, 18, 32, 0.92);
  box-shadow: var(--shadow);
  text-align: center;
}
.auth-card.wide {
  width: min(600px, 100%);
}
.auth-card p {
  color: var(--muted);
}
.auth-logo {
  width: 100px;
  height: 72px;
  object-fit: contain;
}
.form-stack {
  display: grid;
  gap: 1rem;
  text-align: left;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
label {
  display: grid;
  gap: 0.45rem;
  color: #d7e0ef;
  font-weight: 650;
  font-size: 0.9rem;
}
label small {
  color: var(--muted);
  font-weight: 400;
}
input,
textarea,
select {
  width: 100%;
  padding: 0.72rem 0.78rem;
  border: 1px solid var(--border);
  border-radius: 0.62rem;
  background: #080d17;
  color: #f7f9ff;
  font: inherit;
  outline: none;
}
textarea {
  resize: vertical;
  min-height: 100px;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(22, 217, 245, 0.08);
}
input[type="checkbox"] {
  width: auto;
}
.field-status {
  min-height: 1.2rem;
  margin: -0.55rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.field-status:empty {
  display: none;
}
.field-status.is-available {
  color: #63e6be;
}
.field-status.is-taken {
  color: #ff7898;
}
.password-field {
  position: relative;
  display: block;
}
.password-field input {
  width: 100%;
  padding-right: 3rem;
}
.password-visibility {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  place-items: center;
  transform: translateY(-50%);
}
.password-visibility:hover,
.password-visibility:focus-visible,
.password-visibility.is-visible {
  color: var(--cyan);
  background: rgba(22, 217, 245, 0.08);
}
.password-eye {
  position: relative;
  display: block;
  width: 18px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 70% 25%;
  transform: rotate(45deg);
}
.password-eye::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%);
}
.password-visibility.is-visible .password-eye::before {
  position: absolute;
  top: 50%;
  left: -4px;
  width: 23px;
  height: 2px;
  background: currentColor;
  content: "";
  transform: translateY(-50%);
}
.checks {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.checks label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.alert {
  padding: 0.8rem 1rem;
  border-radius: 0.7rem;
  margin: 0 0 1rem;
  border: 1px solid var(--border);
}
.alert-success {
  background: rgba(29, 219, 177, 0.09);
  border-color: rgba(29, 219, 177, 0.35);
}
.alert-danger {
  background: rgba(255, 79, 122, 0.09);
  border-color: rgba(255, 79, 122, 0.35);
}
.alert-info {
  background: rgba(22, 119, 255, 0.1);
  border-color: rgba(22, 119, 255, 0.35);
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.split {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.status {
  display: inline-flex;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  text-transform: capitalize;
}
.status.good {
  color: #91ffe5;
  background: rgba(29, 219, 177, 0.1);
}
.status.bad {
  color: #ff9ab2;
  background: rgba(255, 79, 122, 0.1);
}
.member-list {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0;
}
.member-list > div {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 0.55rem;
}
.member-list span {
  color: var(--muted);
}
.challenge-group {
  margin: 2rem 0;
}
.challenge-group > h2 {
  font-size: 1rem;
  color: #cbd5e8;
}
.challenge-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}
.challenge-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 135px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: linear-gradient(
    165deg,
    rgba(14, 22, 39, 0.9),
    rgba(8, 13, 24, 0.86)
  );
  color: #fff;
}
.challenge-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}
.challenge-card span {
  font-size: 0.7rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.challenge-card h3 {
  margin: 0.35rem 0;
}
.challenge-card strong {
  color: #dbe6ff;
}
.challenge-card em {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  color: var(--good);
  font-size: 0.72rem;
  font-style: normal;
}
.challenge-card.solved {
  border-color: rgba(29, 219, 177, 0.35);
}
.challenge-detail {
  padding: 1.6rem;
}
.points {
  font-size: 1.25rem;
  color: var(--cyan);
}
.prose {
  color: #ced8e8;
  line-height: 1.8;
  margin: 1.3rem 0;
}
.file-list,
.hint-list,
.submission {
  margin-top: 1.6rem;
}
.file-list {
  display: grid;
  gap: 0.5rem;
}
.file-list a {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 0.55rem;
}
.file-list a span {
  color: var(--muted);
}
.hint {
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  margin: 0.5rem 0;
}
.submit-row,
.inline-form {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.submit-row input {
  flex: 1;
}
.back {
  display: inline-block;
  margin-bottom: 1rem;
}
.table-card {
  overflow: hidden;
}
.table-scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 0.8rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  color: #9fb0c9;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}
code {
  font-family: "Cascadia Code", Consolas, monospace;
  color: #d9e7ff;
  word-break: break-all;
}
.admin-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.3rem;
}
.admin-tabs a {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: #cbd5e8;
}
.admin-tabs a:hover {
  border-color: var(--border2);
  color: #fff;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}
.stat {
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: rgba(11, 18, 32, 0.75);
}
.stat strong {
  display: block;
  font-size: 2rem;
}
.stat span {
  color: var(--muted);
  text-transform: capitalize;
}
.admin-list {
  display: grid;
  gap: 0.8rem;
}
details > summary {
  cursor: pointer;
  list-style: none;
}
details > summary::-webkit-details-marker {
  display: none;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.summary-row span:first-child {
  display: grid;
  gap: 0.2rem;
}
.summary-row small {
  color: var(--muted);
}
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.2rem 0;
}
.mt {
  margin-top: 1rem;
}
.empty {
  padding: 3rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 1rem;
}
.error-code {
  font-size: 4rem;
  font-weight: 900;
  background: linear-gradient(
    90deg,
    var(--cyan),
    var(--violet),
    var(--magenta)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.footer {
  border-top: 1px solid var(--border);
  background: rgba(4, 7, 13, 0.78);
  padding: 1.25rem 0;
}
.footer-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
}
.footer-wrap > div {
  display: grid;
}
.footer strong {
  color: #fff;
}
.footer p {
  margin: 0;
}
.one-line {
  white-space: nowrap;
}
.route-progress {
  position: fixed;
  z-index: 1000;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
}
.route-progress span {
  display: block;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--magenta));
  transform: translateX(-110%);
}
.route-progress.is-active {
  opacity: 1;
}
.route-progress.is-active span {
  animation: route-progress 900ms ease-in-out infinite;
}
.route-status {
  position: fixed;
  z-index: 1001;
  right: 1rem;
  bottom: 1rem;
  max-width: min(420px, calc(100vw - 2rem));
  padding: 0.8rem 1rem;
  border: 1px solid rgba(22, 217, 245, 0.48);
  border-radius: 8px;
  background: rgba(4, 10, 19, 0.97);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
  color: #edf7ff;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.route-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.route-status.is-error {
  border-color: rgba(255, 85, 112, 0.65);
}
.js main {
  transition: opacity 140ms ease, transform 140ms ease;
}
.route-loading main {
  opacity: 0.82;
  pointer-events: none;
  transform: translateY(2px);
}
main:focus {
  outline: 0;
}
@keyframes route-progress {
  0% { transform: translateX(-110%); }
  55% { transform: translateX(115%); }
  100% { transform: translateX(245%); }
}
@media (max-width: 980px) {
  .nav-wrap {
    position: relative;
  }
  .nav-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .site-navigation {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    display: none;
    padding: 0.65rem;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: rgba(4, 7, 13, 0.98);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
  }
  .site-navigation.is-open {
    display: grid;
    gap: 0.5rem;
  }
  .nav-links,
  .nav-actions {
    justify-content: flex-start;
  }
  .nav-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .nav-links > a,
  .link-button,
  .nav-account {
    text-align: center;
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .track-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .challenge-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .nav-wrap {
    min-height: 64px;
  }
  .event-nav-name,
  .event-nav-type {
    display: inline;
  }
  .nav-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nav-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nav-actions .btn,
  .nav-actions form,
  .nav-actions .link-button,
  .nav-actions .nav-account {
    width: 100%;
  }
  .hero {
    padding: 4rem 0;
  }
  .two-col,
  .form-grid,
  .form-grid.three {
    grid-template-columns: 1fr;
  }
  .challenge-grid,
  .track-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .split,
  .submit-row,
  .inline-form,
  .footer-wrap {
    align-items: stretch;
    flex-direction: column;
  }
  .table-card {
    overflow: auto;
  }
  .btn {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .route-progress.is-active span {
    width: 100%;
    animation: none;
    transform: none;
  }
  .route-status,
  .js main {
    transition: none;
  }
}
.pagination {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  gap: 1rem;
}
.pagination > div {
  display: flex;
  gap: 0.6rem;
}
