:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
  color-scheme: dark;
  --bs-body-bg: #111314;
  --bs-body-color: #f1f2ee;
  --bs-primary: #8bb9ff;
  --bs-primary-rgb: 139, 185, 255;
  --bs-secondary-color: #a5acae;
  --bs-border-color: #303538;
  --bs-link-color: #8bb9ff;
  --bs-link-hover-color: #aecfff;
  --bs-tertiary-bg: #191c1e;
  --bs-emphasis-color: #f1f2ee;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111314 !important;
  color: #f1f2ee;
  line-height: 1.6;
}
h1,
h2,
h3 {
  font-weight: 500;
  letter-spacing: -0.025em;
}
.navbar {
  background: #111314 !important;
  border-bottom: 1px solid #303538;
  padding: 1.2rem 0;
}
.nav-link {
  font-size: 0.82rem;
}
.jumbotron {
  background: #111314 !important;
  padding: 4rem 0 2rem;
}
.jumbotron h1 {
  font-size: 3.2rem;
}
.btn {
  border-radius: 7px;
  padding: 0.7rem 1rem;
  transition: background-color 0.15s ease;
}
.btn-primary,
.btn-dark,
.challenge-button {
  background: #23272a !important;
  color: #f1f2ee !important;
  border: 1px solid #3c4445 !important;
  box-shadow: none !important;
}
.btn-primary:hover,
.challenge-button:hover {
  background: #263448 !important;
}
.btn-success,
.challenge-solved {
  background: #1d2b40 !important;
  color: #b8d2fa !important;
  border-color: #365681 !important;
}
.form-control,
.form-select,
.modal-content,
.card {
  background: #191c1e !important;
  color: #f1f2ee !important;
  border-color: #3c4445 !important;
}
.form-control::placeholder {
  color: #a5acae;
}
.modal-content {
  border-radius: 12px;
}
.modal-body {
  padding: 2rem;
}
.table {
  --bs-table-bg: transparent;
  --bs-table-color: #f1f2ee;
  --bs-table-border-color: #303538;
}
.table td,
.table th {
  padding: 1rem;
}
.table th {
  color: #a5acae;
  font-size: 0.82rem;
  font-weight: 400;
}
a {
  color: #8bb9ff;
}
a:hover {
  color: #aecfff;
}
.text-muted,
.text-secondary {
  color: #a5acae !important;
}
.footer {
  border-top: 1px solid #303538;
  margin-top: 4rem;
  padding: 2rem 0;
}
main {
  min-height: 70vh;
}
:focus-visible {
  outline: 2px solid #8bb9ff;
  outline-offset: 4px;
}
pre,
code {
  color: #d7e5ff;
}
input,
button,
a {
  touch-action: manipulation;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    animation: none !important;
  }
}

/* NUCA adaptation of the pinned WMCTF theme. Native JS owns all competition state. */
:root,
[data-bs-theme="dark"] {
  --wmctf-primary: #8bb9ff;
  --wmctf-secondary: #8bb9ff;
  --dark-bg: #111314;
  --dark-surface: #191c1e;
  --dark-card: #191c1e;
  --dark-text: #f1f2ee;
  --dark-muted: #a5acae;
  --dark-border: #303538;
  --bs-primary-text-emphasis: #8bb9ff;
  --bs-primary-bg-subtle: #1d2b40;
  --bs-secondary-bg: #23272a;
}
body {
  padding-top: 82px;
}
body::before,
.jumbotron::before,
.jumbotron::after {
  display: none !important;
}
body h1,
body h2,
body h3,
body h4,
body h5,
body h6,
body .btn {
  font-family: inherit;
}
body .jumbotron {
  border-radius: 0;
  margin-bottom: 0;
}
body .jumbotron h1 {
  font-weight: 500 !important;
}
body .jumbotron .lead {
  color: #a5acae;
  font-size: 1rem;
}
body .navbar {
  backdrop-filter: none;
  box-shadow: none;
  min-height: 82px !important;
  padding: 0.75rem 0;
}
body .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #f1f2ee !important;
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: 1.15rem;
}
.nuca-mark {
  width: 27px;
  height: 27px;
  color: #8bb9ff;
  flex-shrink: 0;
}
.nuca-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #23272a;
}
.nuca-account {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  background: none;
}
body .nav-link {
  color: #a5acae !important;
}
body .nav-link:hover {
  color: #f1f2ee !important;
}
body .nav-link::after {
  background: none;
}
body .dropdown-menu {
  background: #23272a;
  border: 1px solid #303538;
  border-radius: 12px;
  padding: 0.5rem;
}
.dropdown-header {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
body .dropdown-item {
  color: #f1f2ee;
  border-radius: 6px;
  padding: 0.6rem;
}
body .dropdown-item:hover {
  background: #303538;
}
body .btn {
  border-radius: 8px !important;
  box-shadow: none !important;
  font-weight: 500;
}
body .btn:hover,
body .card:hover,
body .challenge-card:hover {
  transform: none !important;
}
body .btn-primary,
body .bg-gradient-primary {
  background: #8bb9ff !important;
  color: #10213c !important;
  border-color: #8bb9ff !important;
}
body .btn-primary:hover {
  background: #aecfff !important;
}
body .btn-outline-primary {
  color: #8bb9ff;
  border-color: #365681;
  background: transparent;
}
body .btn-outline-primary:hover {
  color: #d7e5ff;
  background: #1d2b40;
}
body .card,
body .challenge-card {
  border: 1px solid #303538 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  background: #191c1e !important;
}
body .card-header,
body .card-header.bg-light {
  background: transparent !important;
  color: #f1f2ee;
  border-bottom: 1px solid #303538 !important;
  padding: 1rem 1.25rem;
}
body .category-header,
body .glass-effect {
  background: transparent !important;
  backdrop-filter: none !important;
  border: 0;
  box-shadow: none;
  padding-left: 0 !important;
}
body .category-filter-btn {
  color: #a5acae !important;
}
body .category-filter-btn.active,
body .category-filter-btn:hover {
  background: #1d2b40 !important;
  color: #b8d2fa !important;
  border-left: 0;
}
body .challenge-card.challenge-solved {
  border-color: #365681 !important;
}
body .challenge-card::before {
  display: none;
}
body .badge.bg-light {
  background: #23272a !important;
}
body .badge {
  font-weight: 500;
}
body .modal-dialog {
  max-width: 800px;
}
body .modal-header {
  background: #191c1e;
  border-color: #303538;
}
body .challenge-value {
  display: grid !important;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: center;
  column-gap: 0.45rem;
  width: max-content;
  min-width: 112px;
  min-height: 52px;
  padding: 0.5rem 0.9rem 0.55rem;
  margin: 0.9rem auto 1.5rem !important;
  border: 1px solid #456991;
  border-radius: 9px;
  background: #192a40;
  color: #f1f2ee;
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1;
}
body .challenge-value::after {
  content: "points";
  color: #9fbce6;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0;
}
body .nav-pills .nav-link.active {
  background: #1d2b40;
  color: #b8d2fa !important;
}
body .nav-tabs .nav-link.active {
  color: #8bb9ff !important;
  background: #23272a;
  border-color: #303538;
}
body .form-control:focus {
  background: #191c1e;
  color: #f1f2ee;
  border-color: #8bb9ff;
}
body .table {
  box-shadow: none;
  border-radius: 0;
}
body .table th {
  background: transparent;
  border-bottom: 1px solid #303538;
}
body .text-primary {
  color: #8bb9ff !important;
}
body .fw-bold {
  font-weight: 550 !important;
}
body .slide-up {
  animation: none;
}
body :focus-visible {
  outline: 2px solid #8bb9ff !important;
  outline-offset: 4px;
}
body .alert {
  border-left-width: 1px;
}
body .footer {
  background: #111314;
}
.nuca-score-graph {
  min-height: 250px;
}
.nuca-skip {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 2000;
  padding: 0.75rem;
  background: #191c1e;
}
.nuca-skip:focus {
  top: 1rem;
}
[x-cloak] {
  display: none !important;
}
@media (max-width: 991px) {
  .nuca-account {
    padding-left: 0;
  }
}
@media (max-width: 575px) {
  body .modal-body {
    padding: 1.2rem;
  }
  body .jumbotron h1 {
    font-size: 2.5rem;
  }
}
body .jumbotron h1,
body .jumbotron .lead {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
body #score-graph {
  height: 280px;
}

/* A compact event gateway, distinct from the permanent NUCA platform. */
body main.nuca-gateway-main {
  padding-top: 0;
  margin-bottom: 0;
}
.nuca-gateway {
  max-width: 900px;
  min-height: calc(100vh - 90px);
  padding: 48px 28px 90px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.nuca-gateway-logo {
  display: block;
  width: 244px;
  height: 244px;
  object-fit: contain;
  margin-bottom: 20px;
  mix-blend-mode: lighten;
}
.nuca-gateway h1 {
  color: #f1f2ee;
  font-size: clamp(2rem, 4vw, 3.35rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  margin: 0 0 24px;
}
.nuca-countdown {
  display: grid;
  gap: 4px;
  margin-bottom: 32px;
}
.nuca-countdown[hidden] {
  display: none;
}
.nuca-countdown-label {
  color: #a5acae;
  font-size: 0.82rem;
}
.nuca-countdown-value {
  color: #f1f2ee;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.nuca-countdown[data-state="frozen"] .nuca-countdown-value,
.nuca-countdown[data-state="paused"] .nuca-countdown-value {
  color: #b8d2fa;
}
.nuca-gateway-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}
.nuca-gateway-actions .btn {
  min-height: 48px;
  padding: 12px 22px;
}
.nuca-gateway-actions .btn span {
  margin-left: 20px;
}
.nuca-managed-page {
  max-width: 960px;
}
body main .table-responsive {
  border: 1px solid #303b44;
  border-radius: 10px;
  background: #151c21;
}
body main .table-responsive .table {
  margin-bottom: 0;
}
body main .table-responsive thead th {
  background: #1a232a;
  color: #b6c0c8;
  font-weight: 400;
  font-size: 0.85rem;
}
body main .table-responsive th,
body main .table-responsive td {
  padding: 16px 24px;
}
body main .table-responsive tbody tr:last-child td {
  border-bottom: 0;
}
body main .table-responsive tbody tr:hover > td {
  background: #1d2831;
}
body main .card .table-responsive {
  border: 0;
  border-radius: 0;
}
body main .table-responsive .text-end {
  font-variant-numeric: tabular-nums;
}
.nuca-rank {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 60px;
  font-variant-numeric: tabular-nums;
}
.nuca-rank:not(.nuca-gold):not(.nuca-silver):not(.nuca-bronze) {
  padding-left: 34px;
}
.nuca-gold {
  color: #f3c56a;
}
.nuca-silver {
  color: #ccd5e2;
}
.nuca-bronze {
  color: #dfa07c;
}
.nuca-icon {
  flex: 0 0 auto;
}
@media (max-height: 800px) {
  .nuca-gateway {
    padding-top: 24px;
    padding-bottom: 48px;
  }
  .nuca-gateway-logo {
    width: 196px;
    height: 196px;
    margin-bottom: 12px;
  }
}
/* Desktop navigation has separate brand, competition and account regions. */
body .navbar .nuca-nav-layout {
  display: grid;
  grid-template-columns: minmax(120px, 220px) minmax(0, 1fr);
  gap: 24px;
  max-width: 1760px;
  padding: 0 28px;
}
body .navbar {
  min-height: 90px !important;
  padding: 8px 0;
}
body {
  padding-top: 90px;
}
body .navbar-brand {
  min-width: 0;
  margin: 0;
  padding: 0;
}
body #nuca-nav {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-width: 0;
}
body .navbar .nuca-main-nav,
body .navbar .nuca-account-nav {
  flex-direction: row;
  align-items: center;
  flex-shrink: 0;
  gap: 10px;
}
body .navbar .nuca-account-nav {
  margin-left: auto;
  gap: 20px;
}
body .navbar .nav-link {
  white-space: nowrap;
  padding: 10px 8px !important;
}
body .navbar .nuca-account {
  display: flex !important;
  flex-direction: row;
  min-width: 54px;
  min-height: 48px;
  justify-content: center;
  gap: 8px;
}
body .navbar .nuca-account::after {
  width: 0;
  height: 0;
  transform: none;
  display: inline-block;
  position: static;
  margin: 0;
  border-top: 4px solid;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-bottom: 0;
}
body .navbar .dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: auto;
  right: 0;
  min-width: 230px;
}
.nuca-logo {
  display: block;
  position: relative;
  width: 100px;
  height: 70px;
  overflow: hidden;
  flex-shrink: 0;
}
body .nuca-logo img {
  position: absolute;
  top: -18px;
  left: -10px;
  width: 120px;
  height: 120px;
  max-width: none;
  mix-blend-mode: lighten;
}
/* Avoid colliding links at laptop widths and browser zoom, without a mobile UI. */
@media (max-width: 1199px) {
  body .navbar .nuca-nav-layout {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 20px;
    padding: 0 24px;
  }
  body .navbar .nuca-main-nav {
    gap: 4px;
  }
  body #nuca-nav {
    gap: 16px;
  }
}
@media (max-width: 899px) {
  body .navbar .nuca-nav-layout {
    grid-template-columns: 100px minmax(0, 1fr);
  }
  body #nuca-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0 16px;
  }
  body .navbar .nuca-main-nav {
    order: 2;
    width: 100%;
    justify-content: flex-end;
  }
  body .navbar .nuca-account-nav {
    order: 1;
  }
  body .navbar {
    position: relative;
  }
  body {
    padding-top: 0;
  }
}
/* WMCTF's category icons need their own gutter, including the category heading. */
body .category-sidebar .category-filter-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px !important;
}
body .category-sidebar .category-filter-btn > i {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  margin: 0 !important;
}
body .category-sidebar .category-filter-btn > .badge {
  margin-left: auto !important;
}
body .challenges-main .category-header {
  padding: 16px 20px !important;
}
body .challenges-main .category-icon {
  width: 24px;
  flex-shrink: 0;
  text-align: center;
}
/* Respect the native Theme Settings modal size selector. */
body .modal-dialog.modal-sm {
  max-width: 420px;
}
body .modal-dialog.modal-lg {
  max-width: 900px;
}
body .modal-dialog.modal-xl {
  max-width: 1140px;
}

/* Three desktop columns: categories, work area, player and event updates. */
body .navbar-brand {
  mix-blend-mode: lighten;
}
body .nuca-challenge-layout {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr) 290px;
  align-items: start;
  gap: 24px;
  max-width: 1712px;
  margin: 0 auto;
}
body .nuca-challenge-layout > * {
  min-width: 0;
}
body .nuca-challenge-layout > .modal {
  grid-column: 1 / -1;
}
body .nuca-challenge-layout .sticky-top {
  top: 114px !important;
  z-index: 1;
}
body .nuca-challenge-cell {
  width: 50%;
}
body .nuca-challenge-cell .card-title {
  white-space: normal;
  overflow-wrap: anywhere;
}
body .category-sidebar .category-filter-btn {
  font-size: 0.875rem;
}
body .category-sidebar .category-filter-btn > span:not(.badge) {
  min-width: 0;
  overflow-wrap: anywhere;
}
body .category-sidebar .category-filter-btn > .badge {
  flex-shrink: 0;
}
body .category-sidebar .card-header {
  padding-left: 18px !important;
}
.nuca-player-panel,
.nuca-feed-panel {
  background: #191c1e;
  border: 1px solid #303538;
  border-radius: 12px;
  overflow: hidden;
}
.nuca-player-panel {
  margin-bottom: 20px;
}
.nuca-player-identity {
  padding: 24px 20px 20px;
  text-align: center;
  background: #1a2638;
}
.nuca-player-identity img {
  display: block;
  border-radius: 50%;
  margin: 0 auto 12px;
}
.nuca-player-identity h2 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}
.nuca-player-identity a {
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}
.nuca-player-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 20px 12px;
  gap: 8px;
  text-align: center;
}
.nuca-player-stats dd {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 2px;
  color: #b8d2fa;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.nuca-player-stats dt {
  font-size: 0.72rem;
  font-weight: 400;
  color: #a5acae;
}
.nuca-panel-note {
  padding: 0 20px 16px;
  margin: 0;
  font-size: 0.75rem;
  color: #a5acae;
}
.nuca-team-progress {
  padding: 0 20px 20px;
}
.nuca-team-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.75rem;
  color: #a5acae;
  margin-bottom: 8px;
}
.nuca-team-progress progress {
  display: block;
  appearance: none;
  width: 100%;
  height: 5px;
  border: 0;
  border-radius: 4px;
  background: #303538;
  overflow: hidden;
}
.nuca-team-progress progress::-webkit-progress-bar {
  background: #303538;
}
.nuca-team-progress progress::-webkit-progress-value {
  background: #8bb9ff;
}
.nuca-team-progress progress::-moz-progress-bar {
  background: #8bb9ff;
}
.nuca-feed-tabs {
  display: flex;
  gap: 4px;
  padding: 10px;
  border-bottom: 1px solid #303538;
}
.nuca-feed-tabs button {
  flex: 1;
  border: 0;
  border-radius: 6px;
  padding: 9px 4px;
  background: transparent;
  color: #a5acae;
  font-size: 0.8rem;
  white-space: nowrap;
}
.nuca-feed-tabs button[aria-selected="true"] {
  background: #263448;
  color: #b8d2fa;
}
.nuca-feed-tabs i {
  margin-right: 5px;
}
.nuca-feed-state {
  padding: 20px;
  margin: 0;
  color: #a5acae;
  font-size: 0.8125rem;
}
.nuca-feed-list {
  list-style: none;
  margin: 0;
  padding: 0 20px;
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.nuca-feed-list li {
  padding: 16px 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  border-bottom: 1px solid #303538;
}
.nuca-feed-list li:last-child {
  border-bottom: 0;
}
.nuca-feed-list strong {
  font-weight: 500;
}
.nuca-feed-list p {
  margin: 6px 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
  color: #a5acae;
}
.nuca-feed-list time {
  display: block;
  margin-top: 6px;
  color: #a5acae;
  font-size: 0.6875rem;
}
.nuca-all-notices {
  display: block;
  font-size: 0.75rem;
  padding: 12px 20px 16px;
}
.nuca-feed-footer {
  border-top: 1px solid #303538;
  padding: 8px 12px 8px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #a5acae;
  font-size: 0.6875rem;
}
.nuca-feed-footer button {
  width: 32px;
  height: 32px;
  background: transparent;
  color: #8bb9ff;
  border: 0;
  border-radius: 5px;
}
.nuca-feed-footer button:disabled {
  opacity: 0.5;
}
@media (min-width: 1600px) {
  body .nuca-challenge-cell {
    width: 33.333333%;
  }
}
@media (max-width: 1199px) {
  body .nuca-challenge-layout {
    grid-template-columns: 200px minmax(0, 1fr) 256px;
    gap: 16px;
  }
  body .category-sidebar .category-filter-btn {
    padding: 14px 12px !important;
    gap: 8px;
  }
  body .nuca-challenge-cell {
    width: 100%;
  }
}
/* Browser zoom can reduce CSS width on a desktop. Reflow without hiding controls. */
@media (max-width: 959px) {
  body .nuca-challenge-layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  body .nuca-competition-sidebar {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }
}
@media (max-width: 600px) {
  body .nuca-challenge-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  body .nuca-competition-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Upstream global button and translucent navbar rules otherwise win here. */
html[data-nuca-theme] body .navbar {
  background: #111314 !important;
}
