:root {
  --navy: #060a13;
  --navy-soft: #0b1322;
  --navy-card: #121d30;
  --navy-raised: #1a2942;
  --white: #fbfffe;
  --grey: #f2f4f4;
  --grey-blue: #eef2f7;
  --ink: #060a13;
  --ink-soft: #415562;
  --dim: #9fb0c4;
  --green: #28e553;
  --green-brand: #1bbd40;
  --green-dark: #2e8542;
  --danger: #ef5c63;
  --danger-dark: #b52f3b;
  --warning: #f4bf4f;
  --line: #e6e6e6;
  --line-dark: #22334d;
  --max: 1180px;
  --radius: 14px;
  --radius-small: 10px;
  --shadow: 0 20px 55px rgba(6, 10, 19, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: "Outfit", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.dialog-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
}

svg,
img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
.display-title,
.section-title,
.challenge-number {
  font-family: "Bebas Neue", "Arial Narrow", sans-serif;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 0.98;
  text-transform: uppercase;
}

.wrap {
  width: min(100% - 52px, var(--max));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 18px;
  top: -80px;
  z-index: 1000;
  background: var(--green);
  color: var(--navy);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 10, 19, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand:hover .brand-mark {
  transform: rotate(3deg);
}

.brand-mark {
  width: 28px;
  height: 28px;
  fill: currentColor;
  transition: transform 0.2s ease;
}

.brand-mark-accent {
  fill: var(--green);
}

.brand-name {
  font-size: 1rem;
}

.brand-year {
  color: var(--green);
  border-left: 1px solid var(--line-dark);
  padding-left: 10px;
  font-weight: 500;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.main-nav a {
  color: #fff;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--green);
}

.main-nav .nav-cta {
  padding: 8px 21px;
  background: var(--green);
  color: var(--navy);
  border-radius: 999px;
  font-weight: 700;
}

.main-nav .nav-cta:hover {
  color: var(--navy);
  background: #57ed77;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: transparent;
  cursor: pointer;
}

.menu-toggle > span:not(.sr-only) {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: #fff;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.app-loading {
  min-height: 72vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--ink-soft);
}

.loader {
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--green-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.eyebrow {
  margin-bottom: 16px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eyebrow-dark {
  color: var(--green-dark);
}

.hero {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  color: #fff;
  min-height: 610px;
  display: flex;
  align-items: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -15% -65% 35%;
  height: 760px;
  background: radial-gradient(circle, rgba(40, 229, 83, 0.17), transparent 61%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(370px, 0.95fr);
  align-items: center;
  gap: 80px;
  padding-block: 96px;
}

.hero h1 {
  margin-bottom: 24px;
  font-size: clamp(4.1rem, 8.1vw, 7.35rem);
}

.accent {
  color: var(--green);
}

.hero-copy {
  max-width: 580px;
}

.hero-lede {
  max-width: 35rem;
  margin-bottom: 34px;
  color: #d6deea;
  font-size: 1.12rem;
}

.hero-actions,
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 25px;
  border-radius: 999px;
  background: var(--green);
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #57ed77;
}

.button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.button-secondary {
  background: var(--navy);
  color: #fff;
}

.button-secondary:hover:not(:disabled) {
  background: var(--navy-raised);
}

.button-outline {
  background: transparent;
  color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.7);
}

.button-outline:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.button-small {
  min-height: 38px;
  padding: 7px 17px;
  font-size: 0.86rem;
}

.button-danger {
  background: var(--danger);
  color: #fff;
}

.button-danger:hover:not(:disabled) {
  background: #ff7780;
}

.button-ghost-dark {
  background: var(--grey-blue);
  color: var(--ink);
}

.button-ghost-dark:hover:not(:disabled) {
  background: #dfe6ef;
}

.hero-visual {
  position: relative;
  min-height: 385px;
  display: grid;
  place-items: center;
}

.hero-orbit {
  position: absolute;
  width: min(100%, 410px);
  aspect-ratio: 1;
  border: 1px solid rgba(40, 229, 83, 0.3);
  border-radius: 50%;
}

.hero-orbit::before,
.hero-orbit::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(159, 176, 196, 0.2);
  border-radius: 50%;
}

.hero-orbit::before { inset: 14%; }
.hero-orbit::after { inset: 29%; }

.hero-core {
  position: relative;
  width: 195px;
  height: 195px;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: var(--green);
  color: var(--navy);
  box-shadow: 0 0 80px rgba(40, 229, 83, 0.22);
  text-align: center;
}

.hero-core strong {
  font-family: "Bebas Neue", sans-serif;
  font-size: 4.5rem;
  font-weight: 400;
  line-height: 0.9;
}

.hero-core span {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.orbit-tag {
  position: absolute;
  padding: 8px 14px;
  background: rgba(18, 29, 48, 0.93);
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
}

.orbit-tag::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
}

.orbit-tag:nth-of-type(1) { top: 5%; left: 5%; }
.orbit-tag:nth-of-type(2) { top: 34%; right: -2%; }
.orbit-tag:nth-of-type(3) { bottom: 5%; left: 7%; }

.metrics-strip {
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.metric {
  padding: 38px 30px;
  border-right: 1px solid var(--line);
}

.metric:first-child { padding-left: 0; }
.metric:last-child { border-right: 0; }

.metric strong {
  display: block;
  color: var(--green-dark);
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
}

.metric span {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.section {
  padding-block: 94px;
}

.section-grey {
  background: var(--grey);
}

.section-dark {
  background: var(--navy);
  color: #fff;
}

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

.section-title {
  margin-bottom: 0;
  font-size: clamp(2.7rem, 5vw, 4.25rem);
}

.section-heading > p {
  max-width: 37rem;
  margin-bottom: 4px;
  color: var(--ink-soft);
}

.section-dark .section-heading > p {
  color: var(--dim);
}

.challenge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.challenge-card {
  position: relative;
  min-height: 490px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--navy-card);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  color: #fff;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.challenge-card:hover {
  transform: translateY(-6px);
  border-color: rgba(40, 229, 83, 0.5);
  box-shadow: 0 22px 48px rgba(6, 10, 19, 0.28);
}

.challenge-art {
  height: 205px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--navy-soft);
  border-bottom: 1px solid var(--line-dark);
}

.challenge-art svg {
  width: 100%;
  height: 100%;
}

.challenge-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 27px 26px 25px;
}

.challenge-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid rgba(40, 229, 83, 0.35);
  border-radius: 999px;
  color: var(--green);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.challenge-card h3 {
  margin-bottom: 10px;
  font-size: 1.22rem;
}

.challenge-card p {
  color: var(--dim);
  font-size: 0.93rem;
}

.challenge-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 24px;
  color: var(--green);
  font-weight: 700;
}

.challenge-link span:last-child {
  font-size: 1.35rem;
  transition: transform 0.2s ease;
}

.challenge-card:hover .challenge-link span:last-child {
  transform: translateX(5px);
}

.leaderboard-shell {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.leaderboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

/* `.segmented-control` is inline-flex, which would otherwise defeat the
   hidden attribute used to collapse a control. */
.segmented-control[hidden] {
  display: none;
}

/* Same for an action card: step 04 is hidden on a finals challenge while its
   event does not show evaluation. */
.action-card[hidden] {
  display: none;
}

.segmented-control {
  display: inline-flex;
  padding: 4px;
  background: var(--grey-blue);
  border-radius: 999px;
}

.segmented-control button {
  padding: 8px 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.segmented-control button.active {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 7px rgba(6, 10, 19, 0.16);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-status {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.live-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green-brand);
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.icon-button:hover {
  border-color: var(--green-dark);
  transform: rotate(12deg);
}

/* One shared toolbar sits above two boards: the combined Nordic standings
   and, below them, a tabbed board per national competition. */
.leaderboard-board + .leaderboard-board {
  border-top: 1px solid var(--line);
}

.board-heading {
  padding: 22px 20px 16px;
}

.board-heading h3 {
  font-family: "Bebas Neue", "Arial Narrow", sans-serif;
  font-size: 1.7rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.board-heading > p {
  max-width: 62ch;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.country-tabs {
  display: flex;
  gap: 6px;
  padding: 0 20px 16px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.country-tabs button {
  flex: 0 0 auto;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.country-tabs button:hover {
  border-color: var(--green-dark);
  color: var(--ink);
}

.country-tabs button.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: 0 2px 7px rgba(6, 10, 19, 0.16);
}

.table-scroll {
  overflow-x: auto;
}

.leaderboard-table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 16px 18px;
  text-align: right;
  border-bottom: 1px solid var(--line);
}

.leaderboard-table th:first-child,
.leaderboard-table td:first-child,
.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) {
  text-align: left;
}

.leaderboard-table th {
  background: #fafbfc;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.leaderboard-table th button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.leaderboard-table th button:hover,
.leaderboard-table th button.active {
  color: var(--green-dark);
}

.leaderboard-table tbody tr:last-child td {
  border-bottom: 0;
}

.leaderboard-table tbody tr {
  transition: background 0.2s ease;
}

.leaderboard-table tbody tr:hover {
  background: #f8faf9;
}

.rank-cell {
  width: 72px;
  color: var(--ink-soft);
  font-weight: 700;
}

.rank-medal {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-content: center;
  border-radius: 50%;
  background: var(--grey-blue);
}

.rank-1 { background: #fff0b8; color: #6f5200; }
.rank-2 { background: #e6edf2; color: #3f5667; }
.rank-3 { background: #f5dac5; color: #7a4320; }

.team-name {
  min-width: 180px;
  font-weight: 700;
}

.university-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}

.university-label {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--grey-blue);
  color: var(--ink-soft);
  font-size: 0.65rem;
  font-weight: 700;
}

.university-label.country-label {
  background: var(--navy);
  color: #fff;
}

.score-main {
  display: block;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.score-real {
  display: block;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.score-empty {
  color: #aeb8c1;
}

.total-score .score-main {
  color: var(--green-dark);
  font-size: 1.02rem;
}

.leaderboard-message {
  min-height: 330px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 50px 24px;
  text-align: center;
  color: var(--ink-soft);
}

.leaderboard-message-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-content: center;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--grey-blue);
  color: var(--green-dark);
  font-size: 1.4rem;
}

.page-hero {
  position: relative;
  overflow: hidden;
  padding: 82px 0 68px;
  background: var(--navy);
  color: #fff;
}

.page-hero::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -130px;
  bottom: -360px;
  border-radius: 50%;
  background: rgba(40, 229, 83, 0.1);
  box-shadow: 0 0 0 80px rgba(40, 229, 83, 0.03);
}

.breadcrumbs {
  position: relative;
  z-index: 1;
  margin-bottom: 27px;
  color: var(--dim);
  font-size: 0.82rem;
}

.breadcrumbs a:hover {
  color: var(--green);
}

.detail-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: end;
  gap: 70px;
}

.page-hero h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(3.7rem, 7vw, 6.3rem);
}

.detail-lede {
  max-width: 670px;
  margin-bottom: 0;
  color: #d6deea;
  font-size: 1.08rem;
}

.detail-stat {
  padding: 26px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: var(--navy-card);
}

.detail-stat span {
  display: block;
  color: var(--dim);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-stat strong {
  display: block;
  margin-top: 5px;
  color: var(--green);
  font-size: 1.25rem;
}

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

.setup-panel {
  position: sticky;
  top: 96px;
  padding: 27px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 35px rgba(6, 10, 19, 0.06);
}

.setup-panel h2 {
  margin-bottom: 7px;
  font-size: 1.2rem;
}

.setup-panel > p {
  margin-bottom: 22px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.field {
  margin-bottom: 19px;
}

.field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 0.8rem;
  font-weight: 700;
}

.field-wrap {
  position: relative;
}

.field input {
  width: 100%;
  min-height: 47px;
  padding: 11px 42px 11px 13px;
  border: 1px solid #bbc7db;
  border-radius: var(--radius-small);
  background: var(--grey-blue);
  color: var(--ink);
  font-size: 0.91rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
  outline: 0;
  border-color: var(--green-dark);
  box-shadow: 0 0 0 3px rgba(46, 133, 66, 0.13);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-action {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.73rem;
  overflow-wrap: anywhere;
}

.endpoint-preview {
  color: var(--green-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.setup-state {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.state-dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: #aeb8c1;
}

.setup-state.ready .state-dot {
  background: var(--green-brand);
  box-shadow: 0 0 0 4px rgba(27, 189, 64, 0.12);
}

.workflow-header {
  margin-bottom: 25px;
}

.workflow-header h2 {
  margin-bottom: 4px;
  font-size: 1.55rem;
}

.workflow-header p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.action-list {
  display: grid;
  gap: 16px;
  counter-reset: steps;
}

.action-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.action-card:hover {
  border-color: #cad5db;
  box-shadow: 0 12px 30px rgba(6, 10, 19, 0.05);
}

.action-card.danger-card {
  border-color: rgba(239, 92, 99, 0.35);
  background: linear-gradient(90deg, rgba(239, 92, 99, 0.035), #fff 28%);
}

.step-number {
  width: 44px;
  height: 44px;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: var(--navy);
  color: var(--green);
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.35rem;
}

.danger-card .step-number {
  background: var(--danger);
  color: #fff;
}

.action-copy h3 {
  margin-bottom: 5px;
  font-size: 1rem;
}

.action-copy > p {
  max-width: 580px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.action-controls {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 8px;
}

.text-button {
  padding: 3px;
  background: transparent;
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover {
  text-decoration: underline;
}

.action-result {
  grid-column: 2 / -1;
  min-width: 0;
}

.result-box {
  margin-top: 3px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--navy-soft);
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line-dark);
  color: var(--dim);
  font-size: 0.7rem;
}

.result-status {
  color: var(--green);
  font-weight: 700;
}

.result-status.error { color: #ff7a83; }
.result-status.pending { color: var(--warning); }

.result-box pre,
.request-preview pre {
  margin: 0;
  overflow: auto;
  padding: 15px;
  color: #dce5ef;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.request-preview {
  grid-column: 2 / -1;
  overflow: hidden;
  border-radius: var(--radius-small);
  background: var(--navy-soft);
}

.request-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line-dark);
  color: var(--dim);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copy-button {
  background: transparent;
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.queue-progress {
  margin-top: 12px;
}

.queue-progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line-dark);
}

.queue-progress-track span {
  display: block;
  width: 35%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  animation: queue-slide 1.5s ease-in-out infinite;
}

@keyframes queue-slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(300%); }
}

.resources-band {
  padding-block: 66px;
  background: var(--navy);
  border-top: 1px solid var(--line-dark);
  color: #fff;
}

.resources-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: center;
}

.resources-grid h2 {
  margin-bottom: 8px;
  font-size: 2.2rem;
}

.resources-grid p {
  margin-bottom: 0;
  color: var(--dim);
}

.resource-links {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.footer {
  padding: 59px 0 26px;
  background: var(--navy);
  border-top: 1px solid var(--line-dark);
  color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 60px;
}

.footer-brand {
  margin-bottom: 13px;
}

.footer p {
  max-width: 310px;
  color: var(--dim);
  font-size: 0.88rem;
}

.footer h2 {
  margin-bottom: 12px;
  color: var(--dim);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.footer-grid > div > a:not(.brand) {
  display: block;
  padding: 3px 0;
  font-size: 0.88rem;
}

.footer-grid > div > a:hover:not(.brand) {
  color: var(--green);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line-dark);
  color: var(--dim);
  font-size: 0.78rem;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: min(360px, calc(100vw - 44px));
  padding: 13px 16px;
  background: var(--navy-card);
  border: 1px solid var(--line-dark);
  border-left: 3px solid var(--green);
  border-radius: 9px;
  box-shadow: 0 16px 38px rgba(6, 10, 19, 0.3);
  color: #fff;
  font-size: 0.85rem;
  animation: toast-in 0.25s ease both;
}

.toast.error {
  border-left-color: var(--danger);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

.confirm-dialog {
  width: min(100% - 36px, 520px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 32px 90px rgba(6, 10, 19, 0.45);
}

.confirm-dialog::backdrop {
  background: rgba(6, 10, 19, 0.76);
  backdrop-filter: blur(4px);
}

.confirm-dialog form {
  position: relative;
  padding: 36px;
}

.confirm-dialog h2 {
  margin-bottom: 12px;
  font-size: 1.55rem;
}

.confirm-dialog p:not(.eyebrow) {
  color: var(--ink-soft);
}

.dialog-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-content: center;
  margin-bottom: 22px;
  border-radius: 50%;
  background: rgba(239, 92, 99, 0.12);
  color: var(--danger-dark);
  font-size: 1.4rem;
  font-weight: 800;
}

.dialog-close {
  position: absolute;
  top: 15px;
  right: 16px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.6rem;
  cursor: pointer;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 28px;
}

.danger-text { color: var(--danger-dark); }

.noscript {
  position: fixed;
  z-index: 200;
  left: 20px;
  right: 20px;
  bottom: 20px;
  padding: 14px;
  background: var(--danger);
  border-radius: 8px;
  color: #fff;
  text-align: center;
}

.not-found {
  min-height: 72vh;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 70px 26px;
  background: var(--navy);
  color: #fff;
  text-align: center;
}

.not-found strong {
  color: var(--green);
  font-family: "Bebas Neue", sans-serif;
  font-size: 7rem;
  font-weight: 400;
  line-height: 1;
}

.not-found h1 {
  font-size: 3rem;
}

.not-found p {
  color: var(--dim);
}

@media (max-width: 960px) {
  .menu-toggle { display: block; }

  .main-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    padding: 10px 26px 22px;
    background: var(--navy);
    border-bottom: 1px solid var(--line-dark);
  }

  .main-nav.open { display: flex; }
  .main-nav a { padding: 10px 0; }
  .main-nav .nav-cta { margin-top: 8px; text-align: center; }

  .menu-toggle[aria-expanded="true"] > span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] > span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] > span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-block: 78px;
  }

  .hero-copy { max-width: 720px; }
  .hero-visual { min-height: 310px; }
  .hero-orbit { width: 320px; }
  .hero-core { width: 150px; height: 150px; }
  .hero-core strong { font-size: 3.6rem; }

  .challenge-grid { grid-template-columns: 1fr 1fr; }
  .challenge-card:last-child { grid-column: 1 / -1; min-height: 410px; }

  .workspace-layout { grid-template-columns: 1fr; }
  .setup-panel { position: static; }
}

@media (max-width: 760px) {
  .wrap { width: min(100% - 34px, var(--max)); }
  .brand-year { display: none; }

  .hero { min-height: 0; }
  .hero h1 { font-size: clamp(3.7rem, 18vw, 5.2rem); }
  .hero-grid { padding-block: 65px; }

  .metrics-grid { grid-template-columns: 1fr; }
  .metric,
  .metric:first-child { padding: 23px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: 0; }

  .section { padding-block: 70px; }
  .section-heading { align-items: start; flex-direction: column; margin-bottom: 30px; }
  .section-title { font-size: 3rem; }

  .challenge-grid { grid-template-columns: 1fr; }
  .challenge-card,
  .challenge-card:last-child { grid-column: auto; min-height: 450px; }

  .leaderboard-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-right { justify-content: space-between; }
  .board-heading { padding-inline: 16px; }
  .country-tabs { padding-inline: 16px; }

  .detail-grid { grid-template-columns: 1fr; gap: 35px; }
  .detail-stat { max-width: 360px; }

  .action-card {
    grid-template-columns: 45px minmax(0, 1fr);
    padding: 19px;
    gap: 14px;
  }

  .action-controls {
    grid-column: 2;
    align-items: start;
  }

  .action-result,
  .request-preview { grid-column: 1 / -1; }

  .resources-grid { grid-template-columns: 1fr; }
  .resource-links { justify-content: flex-start; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 35px; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .hero-visual { min-height: 270px; }
  .hero-orbit { width: 255px; }
  .hero-core { width: 126px; height: 126px; }
  .hero-core strong { font-size: 3rem; }
  .orbit-tag:nth-of-type(1) { left: 0; }
  .orbit-tag:nth-of-type(2) { right: 0; }

  .segmented-control { display: grid; grid-template-columns: 1fr 1fr; }
  .segmented-control button { padding-inline: 12px; }

  .page-hero { padding-block: 60px 50px; }
  .page-hero h1 { font-size: 3.7rem; }
  .setup-panel { padding: 22px; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > div:first-child { grid-column: auto; }
  .footer-bottom { align-items: flex-start; flex-direction: column; }

  .confirm-dialog form { padding: 29px 23px 24px; }
  .dialog-actions { align-items: stretch; flex-direction: column-reverse; }
  .dialog-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
