/* ============================================================
   NEXUS — custom competition UI
   A complete visual layer over CTFd's functional markup.
   Dark-only, responsive, no external runtime dependencies.
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  --nx-bg: #05070f;
  --nx-bg-soft: #080c18;
  --nx-panel: rgba(13, 19, 34, 0.72);
  --nx-panel-solid: #0b1120;
  --nx-panel-2: rgba(18, 26, 45, 0.78);
  --nx-line: rgba(148, 163, 184, 0.13);
  --nx-line-strong: rgba(148, 163, 184, 0.24);
  --nx-text: #e8eefb;
  --nx-muted: #93a1bb;
  --nx-dim: #7e8da8;
  --nx-cyan: #22d3ee;
  --nx-blue: #60a5fa;
  --nx-indigo: #818cf8;
  --nx-violet: #c084fc;
  --nx-lime: #a3e635;
  --nx-rose: #fb7185;
  --nx-amber: #fbbf24;
  --nx-green: #34d399;
  --nx-gradient: linear-gradient(120deg, #22d3ee 0%, #818cf8 52%, #c084fc 100%);
  --nx-gradient-soft: linear-gradient(120deg, rgba(34, 211, 238, 0.16), rgba(129, 140, 248, 0.12) 50%, rgba(192, 132, 252, 0.16));
  --nx-radius: 18px;
  --nx-radius-sm: 12px;
  --nx-radius-lg: 26px;
  --nx-sidebar: 272px;
  --nx-topbar: 70px;
  --nx-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --nx-display: "Space Grotesk", "Inter", -apple-system, sans-serif;
  --nx-mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --nx-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
  --nx-shadow-glow: 0 0 0 1px rgba(34, 211, 238, 0.22), 0 24px 60px -28px rgba(34, 211, 238, 0.28);
  --nx-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --bs-body-bg: #05070f;
  --bs-body-color: #e8eefb;
  --bs-primary: #22d3ee;
  --bs-link-color: #7dd3fc;
  --bs-link-hover-color: #a5f3fc;
  --bs-border-color: rgba(148, 163, 184, 0.13);
}

/* ---------- 2. Base ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(129, 140, 248, 0.4) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(34, 211, 238, 0.5), rgba(129, 140, 248, 0.45)); border-radius: 99px; border: 2px solid var(--nx-bg); }
*::-webkit-scrollbar-track { background: transparent; }

html { scroll-behavior: smooth; }

body {
  margin: 0 !important;
  padding: 0 !important;
  background: var(--nx-bg);
  color: var(--nx-text);
  font-family: var(--nx-font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(58% 42% at 82% -8%, rgba(124, 92, 255, 0.17), transparent 62%),
    radial-gradient(46% 36% at 8% 2%, rgba(34, 211, 238, 0.11), transparent 60%),
    radial-gradient(40% 30% at 55% 108%, rgba(129, 140, 248, 0.09), transparent 65%),
    var(--nx-bg);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(80% 60% at 50% 20%, #000 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(80% 60% at 50% 20%, #000 0%, transparent 80%);
}

::selection { background: rgba(34, 211, 238, 0.28); color: #fff; }
[x-cloak] { display: none !important; }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--nx-display);
  color: var(--nx-text);
  letter-spacing: -0.025em;
  font-weight: 600;
}
h1, .h1 { font-size: clamp(2rem, 3.4vw, 3rem); }
h2, .h2 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); }
h3, .h3 { font-size: clamp(1.2rem, 1.8vw, 1.5rem); }
p { color: var(--nx-text); }
a { color: #7dd3fc; text-decoration: none; transition: color 0.2s var(--nx-ease); }
a:hover { color: #a5f3fc; }
hr { border: 0; border-top: 1px solid var(--nx-line); opacity: 1; }
small, .small { font-size: 0.82em; }
strong, b { font-weight: 600; }
code, kbd, pre, samp { font-family: var(--nx-mono); }
code { color: #a5f3fc; background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.12); border-radius: 6px; padding: 0.12em 0.4em; }
pre { background: #060b16; border: 1px solid var(--nx-line); border-radius: var(--nx-radius-sm); padding: 1rem 1.15rem; color: #cbd5e1; }
.text-muted { color: var(--nx-muted) !important; }
.text-secondary { color: var(--nx-muted) !important; }
.text-white { color: #fff !important; }
.text-center { text-align: center; }
.opacity-50 { opacity: 0.5; }
.sr-only, .visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.min-vh-25 { min-height: 25vh; }
.min-vh-50 { min-height: 50vh; }
.w-100 { width: 100% !important; }
.m-auto { margin: auto !important; }
.m-0 { margin: 0 !important; }
.p-0 { padding: 0 !important; }
.ps-2 { padding-left: 0.5rem !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pt-3 { padding-top: 1rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.pb-3 { padding-bottom: 1rem !important; }
.px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.float-end { float: right !important; }
.float-start { float: left !important; }
.clearfix::after { content: ""; display: table; clear: both; }
.d-flex { display: flex !important; }
.d-block { display: block !important; }
.d-none { display: none !important; }
.align-items-center { align-items: center !important; }
.justify-content-center { justify-content: center !important; }
.text-start { text-align: left !important; }
.text-success { color: var(--nx-green) !important; }
.text-danger { color: var(--nx-rose) !important; }
.bg-body-tertiary { background: var(--nx-panel) !important; }

/* ---------- 3. Shell ---------- */
.nx-body { min-height: 100vh; }

.nx-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--nx-sidebar);
  display: flex;
  flex-direction: column;
  padding: 26px 18px 20px;
  background: linear-gradient(180deg, rgba(8, 12, 23, 0.96), rgba(5, 8, 16, 0.97));
  border-right: 1px solid var(--nx-line);
  z-index: 1040;
  transition: transform 0.42s var(--nx-ease);
}
.nx-sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(70% 22% at 50% 0%, rgba(34, 211, 238, 0.1), transparent 70%);
}
.nx-sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  width: 1px;
  height: 180px;
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.65), transparent);
}

.nx-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 22px;
  color: var(--nx-text) !important;
}
.nx-brand:hover { color: #fff !important; }
.nx-brand__mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  filter: drop-shadow(0 0 16px rgba(34, 211, 238, 0.35));
}
.nx-brand__mark img, .nx-brand__mark svg { width: 100%; height: 100%; display: block; }
.nx-brand__text { min-width: 0; }
.nx-brand__word {
  display: block;
  font-family: var(--nx-display);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  line-height: 1.05;
  background: var(--nx-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nx-brand__sub {
  display: block;
  margin-top: 5px;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--nx-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 178px;
}
.nx-brand__logo { max-height: 38px; max-width: 190px; object-fit: contain; }

.nx-nav { display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 1; }
.nx-nav__label {
  margin: 22px 12px 8px;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--nx-dim);
}
.nx-nav__label:first-child { margin-top: 4px; }

.nx-navlink {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid transparent;
  color: #aab6cc !important;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all 0.22s var(--nx-ease);
}
.nx-navlink svg { width: 18px; height: 18px; flex: 0 0 18px; stroke: currentColor; opacity: 0.78; transition: opacity 0.2s; }
.nx-navlink:hover { color: #fff !important; background: rgba(148, 163, 184, 0.07); border-color: rgba(148, 163, 184, 0.08); }
.nx-navlink:hover svg { opacity: 1; }
.nx-navlink.active {
  color: #fff !important;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.14), rgba(129, 140, 248, 0.07) 60%, transparent);
  border-color: rgba(34, 211, 238, 0.2);
}
.nx-navlink.active svg { opacity: 1; stroke: var(--nx-cyan); filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.5)); }
.nx-navlink.active::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: var(--nx-gradient);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.7);
}
.nx-navlink__badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 99px;
  background: rgba(251, 113, 133, 0.16);
  border: 1px solid rgba(251, 113, 133, 0.3);
  color: #fda4af;
  font-size: 0.68rem;
  font-weight: 600;
}

.nx-sidebar__foot { margin-top: auto; padding-top: 18px; position: relative; z-index: 1; }
.nx-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--nx-line);
  background: rgba(15, 23, 42, 0.55);
  transition: border-color 0.2s;
}
.nx-user:hover { border-color: rgba(34, 211, 238, 0.25); }
.nx-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--nx-gradient-soft);
  border: 1px solid rgba(129, 140, 248, 0.32);
  color: #e0e7ff;
  font-family: var(--nx-display);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
}
.nx-user__meta { min-width: 0; flex: 1; }
.nx-user__name { display: block; color: var(--nx-text); font-size: 0.84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-user__role { display: block; font-size: 0.65rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--nx-dim); }
.nx-user__action { color: var(--nx-dim); display: inline-flex; padding: 4px; border-radius: 8px; }
.nx-user__action:hover { color: var(--nx-rose); background: rgba(251, 113, 133, 0.1); }
.nx-user__action svg { width: 17px; height: 17px; }

.nx-auth-cta { display: grid; gap: 8px; }
.nx-auth-cta .btn { width: 100%; justify-content: center; }

.nx-sidebar__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 0 4px;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--nx-dim);
}
.nx-sidebar__meta .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--nx-green); box-shadow: 0 0 8px var(--nx-green); margin-right: 6px; }

/* Topbar */
.nx-shell {
  min-height: 100vh;
  margin-left: var(--nx-sidebar);
  display: flex;
  flex-direction: column;
}
.nx-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  height: var(--nx-topbar);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 30px;
  background: rgba(5, 8, 16, 0.72);
  border-bottom: 1px solid var(--nx-line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.nx-topbar__menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--nx-line);
  background: rgba(15, 23, 42, 0.6);
  color: var(--nx-text);
}
.nx-topbar__menu svg { width: 20px; height: 20px; }
.nx-topbar__brand { display: none; align-items: center; gap: 9px; font-family: var(--nx-display); font-weight: 700; letter-spacing: 0.2em; font-size: 0.9rem; }
.nx-topbar__brand img, .nx-topbar__brand svg { width: 26px; height: 26px; }
.nx-topbar__crumb { display: flex; align-items: center; gap: 10px; font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--nx-dim); }
.nx-topbar__crumb b { color: var(--nx-muted); font-weight: 500; }
.nx-topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.nx-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid rgba(52, 211, 153, 0.22);
  background: rgba(52, 211, 153, 0.07);
  color: #a7f3d0;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nx-live__pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--nx-green); box-shadow: 0 0 10px var(--nx-green); animation: nx-pulse 2.4s infinite; }
.nx-live b { font-variant-numeric: tabular-nums; font-weight: 600; color: #d1fae5; }

.nx-iconbtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--nx-line);
  background: rgba(15, 23, 42, 0.5);
  color: var(--nx-muted);
  transition: all 0.2s var(--nx-ease);
}
.nx-iconbtn:hover { color: #fff; border-color: rgba(34, 211, 238, 0.3); background: rgba(34, 211, 238, 0.08); }
.nx-iconbtn svg { width: 18px; height: 18px; }
.nx-iconbtn .nx-dot-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nx-rose);
  box-shadow: 0 0 0 3px rgba(5, 8, 16, 0.9);
}

.nx-main {
  flex: 1;
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 34px 30px 70px;
}

.nx-footer {
  margin-top: auto;
  border-top: 1px solid var(--nx-line);
  background: rgba(4, 7, 14, 0.7);
}
.nx-footer__inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 22px 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nx-dim);
}
.nx-footer__brand { display: flex; align-items: center; gap: 9px; color: var(--nx-muted); letter-spacing: 0.24em; }
.nx-footer__brand svg,
.nx-footer__brand img { width: 18px; height: 18px; object-fit: contain; }
.nx-footer a { color: var(--nx-muted); }
.nx-footer a:hover { color: var(--nx-cyan); }

.nx-scrim {
  position: fixed;
  inset: 0;
  z-index: 1030;
  background: rgba(2, 4, 10, 0.7);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--nx-ease);
}
.nx-scrim.is-open { opacity: 1; pointer-events: auto; }

/* Bottom mobile nav */
.nx-bottomnav {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1010;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--nx-line-strong);
  background: rgba(10, 15, 28, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9);
}
.nx-bottomnav__inner { display: flex; align-items: stretch; justify-content: space-between; gap: 4px; }
.nx-bottomnav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 4px 5px;
  border-radius: 12px;
  color: var(--nx-muted);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.nx-bottomnav a svg { width: 19px; height: 19px; }
.nx-bottomnav a.active { color: var(--nx-cyan); background: rgba(34, 211, 238, 0.08); }

/* ---------- 4. Buttons ---------- */
.btn {
  --bs-btn-border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0.62rem 1.15rem;
  border-radius: 11px;
  font-family: var(--nx-font);
  font-size: 0.83rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  border: 1px solid transparent;
  transition: transform 0.2s var(--nx-ease), box-shadow 0.2s var(--nx-ease), background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.995); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.3); }
.btn i, .btn svg { font-size: 0.92em; }
.btn-primary {
  color: #041018 !important;
  background: var(--nx-gradient);
  border: 0;
  box-shadow: 0 12px 30px -14px rgba(34, 211, 238, 0.65);
}
.btn-primary:hover, .btn-primary:focus {
  color: #02070c !important;
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 16px 38px -12px rgba(34, 211, 238, 0.7);
}
.btn-secondary {
  color: #dbe4f5 !important;
  background: rgba(30, 41, 59, 0.7);
  border-color: var(--nx-line-strong);
}
.btn-secondary:hover { background: rgba(51, 65, 85, 0.8); border-color: rgba(148, 163, 184, 0.36); transform: translateY(-1px); }
.btn-outline-primary { color: var(--nx-cyan) !important; border-color: rgba(34, 211, 238, 0.35); background: rgba(34, 211, 238, 0.04); }
.btn-outline-primary:hover { background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.55); }
.btn-outline-secondary { color: #cbd5e1 !important; border-color: var(--nx-line-strong); background: rgba(15, 23, 42, 0.35); }
.btn-outline-secondary:hover { color: #fff !important; border-color: rgba(148, 163, 184, 0.45); background: rgba(30, 41, 59, 0.6); }
.btn-outline-info { color: #7dd3fc !important; border-color: rgba(125, 211, 252, 0.3); }
.btn-outline-info:hover { background: rgba(125, 211, 252, 0.1); }
.btn-outline-success { color: var(--nx-green) !important; border-color: rgba(52, 211, 153, 0.3); }
.btn-outline-success.active, .btn-outline-success:hover { background: rgba(52, 211, 153, 0.16); border-color: rgba(52, 211, 153, 0.5); }
.btn-outline-danger { color: var(--nx-rose) !important; border-color: rgba(251, 113, 133, 0.3); }
.btn-outline-danger:hover { background: rgba(251, 113, 133, 0.12); }
.btn-info { color: #041018 !important; background: linear-gradient(120deg, #67e8f9, #a5b4fc); border: 0; }
.btn-info:hover { filter: brightness(1.06); }
.btn-success { color: #04140d !important; background: linear-gradient(120deg, #34d399, #6ee7b7); border: 0; }
.btn-danger { color: #fff !important; background: linear-gradient(120deg, #fb7185, #f43f5e); border: 0; }
.btn-warning { color: #1a1203 !important; background: linear-gradient(120deg, #fbbf24, #f59e0b); border: 0; }
.btn-link { color: var(--nx-cyan) !important; text-decoration: none; min-height: auto; padding: 0; }
.btn-link:hover { color: #a5f3fc !important; }
.btn-sm { min-height: 34px; padding: 0.4rem 0.8rem; font-size: 0.76rem; border-radius: 9px; }
.btn-lg { min-height: 52px; padding: 0.8rem 1.6rem; font-size: 0.95rem; border-radius: 13px; }
.btn-block { width: 100%; }
.btn-file { justify-content: flex-start; }
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child { border-radius: 10px 0 0 10px; }
.btn-group > .btn:last-child { border-radius: 0 10px 10px 0; }
.btn-close {
  filter: invert(1) grayscale(1) brightness(1.7);
  opacity: 0.65;
  width: 0.8em;
  height: 0.8em;
  background-size: 0.8em;
}
.btn-close:hover { opacity: 1; }

/* ---------- 5. Forms ---------- */
.form-group { margin-bottom: 1rem; }
label, .form-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--nx-muted);
}
.form-control, .form-select, .custom-select, textarea.form-control, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="search"] {
  width: 100%;
  min-height: 46px;
  padding: 0.62rem 0.95rem;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-line-strong);
  background: rgba(3, 6, 14, 0.55);
  color: var(--nx-text);
  font-family: var(--nx-font);
  font-size: 0.9rem;
  box-shadow: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.form-control::placeholder { color: #5b6b85; opacity: 1; }
.form-control:focus, .form-select:focus, .custom-select:focus, textarea.form-control:focus, input:focus {
  background: rgba(3, 6, 14, 0.8);
  border-color: rgba(34, 211, 238, 0.55);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.13), 0 0 24px -12px rgba(34, 211, 238, 0.45);
}
textarea.form-control { min-height: 110px; resize: vertical; }
.form-select, .custom-select {
  appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2393a1bb' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
}
.form-select option, .custom-select option { background: #0b1120; color: var(--nx-text); }
.form-text, small.form-text { display: block; margin-top: 0.35rem; color: var(--nx-dim); font-size: 0.75rem; }
.form-check { display: flex; align-items: flex-start; gap: 9px; padding-left: 0; }
.form-check-input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  flex: 0 0 17px;
  border-radius: 5px;
  border: 1px solid var(--nx-line-strong);
  background: rgba(3, 6, 14, 0.7);
}
.form-check-input:checked { background: linear-gradient(120deg, #22d3ee, #818cf8); border-color: transparent; }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18); border-color: rgba(34, 211, 238, 0.5); }
.form-check-label { font-size: 0.82rem; letter-spacing: 0; text-transform: none; color: var(--nx-text); font-weight: 400; }
.form-switch .form-check-input { width: 2.4em; border-radius: 99px; }
input[type="file"].form-control { padding: 0.5rem 0.7rem; min-height: auto; color: var(--nx-muted); }
input[type="color"] { background: transparent; border: 1px solid var(--nx-line-strong); border-radius: 8px; padding: 2px; }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--nx-text);
  box-shadow: 0 0 0 60px #070c17 inset;
  transition: background-color 9999s ease-in-out 0s;
}
.invalid-feedback, .form-text.text-danger { color: var(--nx-rose) !important; }
.sr-only { position: absolute; }

/* ---------- 6. Panels / cards / tables ---------- */
.nx-panel, .card {
  border-radius: var(--nx-radius);
  border: 1px solid var(--nx-line);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.62), rgba(9, 14, 26, 0.55));
  box-shadow: var(--nx-shadow);
  color: var(--nx-text);
}
.card-header, .card-footer { border-color: var(--nx-line); background: rgba(148, 163, 184, 0.04); }
.card-body { padding: 1.35rem; }
.card-title { color: var(--nx-text); }
blockquote, .blockquote { border-left: 2px solid rgba(34, 211, 238, 0.5); padding-left: 1rem; color: var(--nx-muted); }

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--nx-text);
  --bs-table-border-color: var(--nx-line);
  width: 100%;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}
.table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--nx-line-strong);
  color: var(--nx-dim);
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}
.table > tbody > tr > td, .table > tbody > tr > th {
  padding: 13px 14px;
  border-bottom: 1px solid var(--nx-line);
  vertical-align: middle;
}
.table-striped > tbody > tr:nth-of-type(odd) { background: rgba(148, 163, 184, 0.03); }
.table > tbody > tr { transition: background 0.18s; }
.table > tbody > tr:hover { background: rgba(34, 211, 238, 0.045); }
.table a { color: var(--nx-text); font-weight: 500; }
.table a:hover { color: var(--nx-cyan); }
.table-responsive { border-radius: var(--nx-radius); border: 1px solid var(--nx-line); overflow: hidden; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.28em 0.62em;
  border-radius: 7px;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.badge.bg-secondary { background: rgba(148, 163, 184, 0.14) !important; color: #cbd5e1; border-color: rgba(148, 163, 184, 0.18); }
.badge.bg-primary { background: rgba(34, 211, 238, 0.12) !important; color: #a5f3fc; border-color: rgba(34, 211, 238, 0.25); }
.badge.bg-info { background: rgba(96, 165, 250, 0.12) !important; color: #bfdbfe; border-color: rgba(96, 165, 250, 0.25); }
.badge.bg-success { background: rgba(52, 211, 153, 0.12) !important; color: #a7f3d0; border-color: rgba(52, 211, 153, 0.25); }
.badge.bg-danger { background: rgba(251, 113, 133, 0.14) !important; color: #fecdd3; border-color: rgba(251, 113, 133, 0.25); }
.badge.bg-warning { background: rgba(251, 191, 36, 0.14) !important; color: #fde68a; border-color: rgba(251, 191, 36, 0.25); }
.badge.rounded-pill { border-radius: 99px; }
.text-bg-light { background: rgba(226, 232, 240, 0.12) !important; color: #e2e8f0 !important; }
.badge-notification { margin-left: 4px; background: rgba(251, 113, 133, 0.9) !important; }

.alert {
  position: relative;
  padding: 0.95rem 1.1rem;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-line);
  background: rgba(15, 23, 42, 0.7);
  color: var(--nx-text);
  font-size: 0.87rem;
}
.alert-info { border-color: rgba(96, 165, 250, 0.25); background: rgba(30, 58, 138, 0.16); color: #dbeafe; }
.alert-success { border-color: rgba(52, 211, 153, 0.28); background: rgba(6, 78, 59, 0.18); color: #d1fae5; }
.alert-danger { border-color: rgba(251, 113, 133, 0.3); background: rgba(76, 5, 25, 0.22); color: #ffe4e6; }
.alert-warning { border-color: rgba(251, 191, 36, 0.28); background: rgba(69, 26, 3, 0.2); color: #fef3c7; }
.alert .btn-close { position: absolute; top: 0.9rem; right: 0.9rem; }

.progress {
  height: 8px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}
.progress-bar { border-radius: 99px; transition: width 0.7s var(--nx-ease); }

/* ---------- 7. Page headings & prose ---------- */
.nx-page { position: relative; }
.nx-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.nx-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--nx-cyan);
}
.nx-kicker::before { content: ""; width: 22px; height: 1px; background: linear-gradient(90deg, var(--nx-cyan), transparent); }
.nx-page-head h1, .jumbotron h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.15rem);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.045em;
}
.nx-page-head h1 span, .jumbotron h1 span { background: var(--nx-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nx-lede { max-width: 560px; margin: 14px 0 0; color: var(--nx-muted); font-size: 0.94rem; }
.nx-page-head__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.jumbotron {
  position: relative;
  margin: 0 0 26px;
  padding: 8px 0 20px;
  background: transparent !important;
  border-radius: 0;
}
.jumbotron::after {
  content: "";
  display: block;
  width: 66px;
  height: 3px;
  margin-top: 18px;
  border-radius: 4px;
  background: var(--nx-gradient);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
}
.jumbotron .container { max-width: none; padding: 0; }
.jumbotron h1 { color: var(--nx-text); }
.jumbotron p, .jumbotron .lead { color: var(--nx-muted); }

.container { max-width: 1240px; }
.nx-main > .container, .nx-main > .container-fluid { padding-left: 0; padding-right: 0; }
.nx-main .container > .row:first-child { margin-top: 0; }
.row { --bs-gutter-x: 1.5rem; }

.nx-prose { color: #c7d2e5; font-size: 0.96rem; line-height: 1.8; }
.nx-prose h2, .nx-prose h3 { margin-top: 1.8em; }
.nx-prose p { color: #c7d2e5; }
.nx-prose > :first-child { margin-top: 0; }
.nx-prose img { max-width: 100%; border-radius: var(--nx-radius-sm); }

.nx-panel-block {
  border-radius: var(--nx-radius-lg);
  border: 1px solid var(--nx-line);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.5), rgba(7, 11, 21, 0.6));
  padding: clamp(20px, 3vw, 38px);
  box-shadow: var(--nx-shadow);
}

/* Home page */
.nx-home { position: relative; }
.nx-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 64px);
  border-radius: var(--nx-radius-lg);
  border: 1px solid var(--nx-line-strong);
  background:
    radial-gradient(60% 80% at 88% 12%, rgba(129, 140, 248, 0.2), transparent 62%),
    radial-gradient(45% 60% at 6% 100%, rgba(34, 211, 238, 0.13), transparent 60%),
    linear-gradient(160deg, rgba(13, 19, 34, 0.92), rgba(5, 8, 16, 0.96));
  box-shadow: var(--nx-shadow);
}
.nx-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(75% 75% at 50% 40%, #000, transparent 85%);
  -webkit-mask-image: radial-gradient(75% 75% at 50% 50%, #000, transparent 85%);
  pointer-events: none;
}
.nx-hero__orb {
  position: absolute;
  right: -90px;
  top: -100px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, rgba(34, 211, 238, 0.22), rgba(129, 140, 248, 0.05), rgba(192, 132, 252, 0.2), rgba(34, 211, 238, 0.22));
  filter: blur(2px);
  opacity: 0.55;
  animation: nx-float 14s ease-in-out infinite;
  pointer-events: none;
}
.nx-hero__orb::after {
  content: "";
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 1px dashed rgba(148, 163, 184, 0.2);
}
.nx-hero__eyebrow { position: relative; }
.nx-hero h1 {
  position: relative;
  max-width: 760px;
  margin: 18px 0 0;
  font-size: clamp(2.4rem, 5.6vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  font-weight: 700;
}
.nx-hero h1 em { font-style: normal; background: var(--nx-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nx-hero__copy { position: relative; max-width: 560px; margin: 20px 0 0; color: var(--nx-muted); font-size: 1rem; }
.nx-hero__actions { position: relative; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.nx-hero__stats { position: relative; display: flex; flex-wrap: wrap; gap: 26px; margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--nx-line); }
.nx-hero__stats dl { margin: 0; }
.nx-hero__stats dt { font-size: 0.6rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--nx-dim); font-weight: 600; }
.nx-hero__stats dd { margin: 4px 0 0; font-family: var(--nx-display); font-size: 1.25rem; font-weight: 600; color: var(--nx-text); }
.nx-home__content { margin-top: 34px; }

/* ---------- 8. Challenge board ---------- */
.nx-stat-strip {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius);
  background: rgba(10, 16, 30, 0.55);
  overflow: hidden;
}
.nx-stat-strip > div {
  min-width: 104px;
  padding: 13px 20px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-left: 1px solid var(--nx-line);
}
.nx-stat-strip > div:first-child { border-left: 0; }
.nx-stat-strip strong, .nx-stat-strip b {
  font-family: var(--nx-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--nx-text);
  font-variant-numeric: tabular-nums;
}
.nx-stat-strip strong.nx-accent { color: var(--nx-cyan); }
.nx-stat-strip span { font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--nx-dim); }

.nx-cat-rail {
  position: sticky;
  top: calc(var(--nx-topbar) + 10px);
  z-index: 900;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px;
  margin: 0 -10px 12px;
  border-radius: 14px;
  background: rgba(5, 8, 16, 0.78);
  border: 1px solid var(--nx-line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  scrollbar-width: none;
}
.nx-cat-rail::-webkit-scrollbar { display: none; }
.nx-cat-rail a {
  flex: 0 0 auto;
  padding: 7px 13px;
  border-radius: 9px;
  border: 1px solid transparent;
  color: var(--nx-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: all 0.2s;
}
.nx-cat-rail a:hover { color: #fff; background: rgba(148, 163, 184, 0.08); }
.nx-cat-rail a .n { color: var(--nx-dim); font-variant-numeric: tabular-nums; margin-left: 5px; }

.nx-category {
  padding-top: 34px;
}
.nx-category:first-of-type { padding-top: 8px; }
.nx-category__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.nx-category__title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.nx-category__index {
  font-family: var(--nx-mono);
  font-size: 0.68rem;
  color: var(--nx-cyan);
  letter-spacing: 0.12em;
  opacity: 0.8;
}
.nx-category h3 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.nx-category__count { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--nx-dim); white-space: nowrap; }
.nx-category__bar { width: 150px; max-width: 32vw; }
.nx-category__bar .progress { height: 4px; }

.nx-challenge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.nx-challenge-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  min-height: 158px;
  padding: 17px;
  text-align: left;
  border-radius: 16px;
  border: 1px solid var(--nx-line);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(129, 140, 248, 0.08), transparent 55%),
    linear-gradient(170deg, rgba(17, 25, 43, 0.85), rgba(7, 11, 21, 0.85));
  color: var(--nx-text);
  overflow: hidden;
  transition: transform 0.25s var(--nx-ease), border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.nx-challenge-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(34, 211, 238, 0.07) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.7s var(--nx-ease);
  pointer-events: none;
}
.nx-challenge-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.36);
  box-shadow: 0 24px 44px -30px rgba(34, 211, 238, 0.55), 0 0 0 1px rgba(34, 211, 238, 0.12);
}
.nx-challenge-card:hover::before { transform: translateX(100%); }
.nx-challenge-card:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.25); }
.nx-challenge-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nx-challenge-card__points { display: inline-flex; align-items: baseline; gap: 3px; font-family: var(--nx-display); font-weight: 600; color: #c7d2fe; }
.nx-challenge-card__points b { font-size: 1.05rem; font-weight: 600; }
.nx-challenge-card__points small { font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--nx-dim); }
.nx-challenge-card__state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 99px;
  border: 1px solid rgba(52, 211, 153, 0.25);
  background: rgba(52, 211, 153, 0.08);
  color: #a7f3d0;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nx-challenge-card__state svg { width: 11px; height: 11px; }
.nx-challenge-card__lock { color: var(--nx-dim); display: inline-flex; }
.nx-challenge-card__lock svg { width: 15px; height: 15px; }
.nx-challenge-card__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--nx-display);
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--nx-text);
  margin-top: 2px;
}
.nx-challenge-card__bottom { margin-top: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nx-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--nx-line);
  background: rgba(148, 163, 184, 0.06);
  color: var(--nx-dim);
  font-size: 0.63rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nx-challenge-card__cta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--nx-dim);
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nx-challenge-card__cta svg { width: 13px; height: 13px; transition: transform 0.2s; }
.nx-challenge-card:hover .nx-challenge-card__cta { color: var(--nx-cyan); }
.nx-challenge-card:hover .nx-challenge-card__cta svg { transform: translateX(2px); }
.nx-challenge-card.is-solved {
  border-color: rgba(52, 211, 153, 0.25);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(52, 211, 153, 0.1), transparent 55%),
    linear-gradient(170deg, rgba(14, 31, 30, 0.55), rgba(7, 11, 21, 0.85));
}
.nx-challenge-card.is-solved .nx-challenge-card__name { color: #d1fae5; }
.nx-challenge-card.is-solved .nx-challenge-card__points { color: #a7f3d0; }

.nx-empty {
  padding: 56px 20px;
  text-align: center;
  border-radius: var(--nx-radius);
  border: 1px dashed var(--nx-line-strong);
  color: var(--nx-muted);
}
.nx-empty h3 { color: var(--nx-text); margin-bottom: 6px; }
.nx-empty p { margin: 0; color: var(--nx-dim); font-size: 0.88rem; }

/* Spinner */
.spinner, .fa-spin { color: var(--nx-cyan); }
.fa-circle-notch.fa-spin { filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.5)); }

/* ---------- 9. Challenge panel ---------- */
#challenge-window.modal { z-index: 1060; }
#challenge-window .modal-dialog {
  width: 100%;
  max-width: 680px;
  margin: 0 0 0 auto;
  min-height: 100%;
}
#challenge-window .modal-content {
  min-height: 100vh;
  border: 0;
  border-left: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0;
  background:
    radial-gradient(80% 30% at 100% 0%, rgba(129, 140, 248, 0.14), transparent 60%),
    #080d18;
  box-shadow: -40px 0 120px -40px rgba(0, 0, 0, 0.9);
  padding: 0;
}
#challenge-window .modal-body { padding: 0 !important; }
.nx-challenge-panel { display: flex; flex-direction: column; min-height: 100vh; }
.nx-challenge-panel__bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 62px;
  padding: 0 24px;
  border-bottom: 1px solid var(--nx-line);
  background: rgba(8, 13, 24, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nx-challenge-panel__tag { display: flex; align-items: center; gap: 8px; font-family: var(--nx-mono); font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--nx-cyan); }
.nx-challenge-panel__tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--nx-cyan); box-shadow: 0 0 10px var(--nx-cyan); }
.nx-challenge-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--nx-line);
  background: rgba(15, 23, 42, 0.6);
  color: var(--nx-muted);
  transition: all 0.2s;
}
.nx-challenge-panel__close:hover { color: #fff; border-color: rgba(251, 113, 133, 0.4); background: rgba(251, 113, 133, 0.1); }
.nx-challenge-panel__close svg { width: 16px; height: 16px; }

.nx-challenge-panel__head { padding: 28px 26px 18px; }
.nx-challenge-panel__head h2 {
  margin: 8px 0 0;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.nx-challenge-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.nx-points {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid rgba(34, 211, 238, 0.26);
  background: rgba(34, 211, 238, 0.08);
  color: #a5f3fc;
  font-family: var(--nx-display);
  font-size: 0.98rem;
  font-weight: 600;
}
.nx-points small { font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: #67e8f9; }
.nx-challenge-tags { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.nx-challenge-tags .badge { background: rgba(148, 163, 184, 0.1) !important; color: #cbd5e1 !important; border: 1px solid var(--nx-line); }

.nx-challenge-tabs {
  display: flex;
  gap: 4px;
  margin: 0 26px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--nx-line);
  background: rgba(3, 6, 14, 0.45);
  overflow-x: auto;
  scrollbar-width: none;
}
.nx-challenge-tabs::-webkit-scrollbar { display: none; }
.nx-challenge-tabs .nav-item { flex: 0 0 auto; }
.nx-challenge-tabs .nav-link {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--nx-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: all 0.2s;
}
.nx-challenge-tabs .nav-link:hover { color: #fff; background: rgba(148, 163, 184, 0.07); }
.nx-challenge-tabs .nav-link.active {
  color: #041018;
  background: var(--nx-gradient);
  border-color: transparent;
  box-shadow: 0 8px 22px -12px rgba(34, 211, 238, 0.6);
}
.nx-challenge-panel__body { flex: 1; padding: 24px 26px 42px; }
.nx-challenge-panel .tab-content > .tab-pane { animation: nx-fade-in 0.35s var(--nx-ease); }
.nx-challenge-name { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.nx-challenge-value { font-family: var(--nx-display); font-size: 1rem; color: var(--nx-cyan); }
.nx-challenge-desc {
  display: block;
  color: #c7d2e5;
  font-size: 0.93rem;
  line-height: 1.75;
  margin: 18px 0;
  word-wrap: break-word;
}
.nx-challenge-desc p:last-child { margin-bottom: 0; }
.nx-challenge-desc img, .nx-challenge-desc pre { max-width: 100%; }
.challenge-attribution { display: block; color: var(--nx-dim); font-size: 0.7rem; margin-bottom: 10px; }
.challenge-ratings { font-size: 0.72rem; color: var(--nx-dim); }
.challenge-connection-info code { word-break: break-all; }
.challenge-hints details {
  border-radius: 12px;
  border: 1px solid var(--nx-line);
  background: rgba(148, 163, 184, 0.045);
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}
.challenge-hints details:hover { border-color: var(--nx-line-strong); }
.challenge-hints summary { cursor: pointer; color: var(--nx-muted); font-size: 0.82rem; font-weight: 500; }
.challenge-hints details[open] summary { color: var(--nx-cyan); margin-bottom: 8px; }
.challenge-hints details > div { color: #c7d2e5; font-size: 0.87rem; }
.challenge-files .btn-file { justify-content: flex-start; }

.nx-flag-row { display: flex; gap: 8px; margin-top: 20px; }
.nx-anon-gate {
  width: 100%;
  padding: 22px;
  text-align: center;
  border-radius: 13px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  background: rgba(10, 16, 30, 0.55);
}
.nx-anon-gate p { margin: 0 0 14px; color: var(--nx-muted); font-size: 0.88rem; }
.nx-anon-gate .btn { display: inline-flex; align-items: center; gap: 8px; }
.nx-flag-row .challenge-input {
  flex: 1;
  min-height: 50px;
  font-family: var(--nx-mono);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  border-radius: 12px;
}
.nx-flag-row .challenge-submit {
  flex: 0 0 auto;
  min-width: 118px;
  min-height: 50px;
  border-radius: 12px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #041018 !important;
  background: var(--nx-gradient);
  border: 0;
  box-shadow: 0 14px 34px -18px rgba(34, 211, 238, 0.7);
}
.nx-flag-row .challenge-submit:hover { filter: brightness(1.07); transform: translateY(-1px); }
.nx-attempts { margin-top: 12px; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--nx-dim); text-align: center; }

.nx-challenge-panel .table { font-size: 0.82rem; }
.nx-challenge-panel .table-responsive { margin-top: 12px; }
.nx-rating { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--nx-line); }
.nx-rating .rating-buttons .btn { min-width: 52px; }
.nx-rating .rating-buttons .btn.active { background: rgba(52, 211, 153, 0.16); border-color: rgba(52, 211, 153, 0.5); }
.nx-rating textarea { margin-top: 12px; }
.nx-challenge-panel .alert { margin-top: 18px; }
.nx-challenge-panel .alert strong { display: block; margin-bottom: 4px; }
.nx-challenge-panel .alert .btn-info { margin-top: 12px; }

/* ---------- 10. Scoreboard ---------- */
.nx-scoreboard-head { align-items: flex-end; }
.nx-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 8px 0 24px;
}
.nx-podium__card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 112px;
  padding: 18px;
  border-radius: var(--nx-radius);
  border: 1px solid var(--nx-line);
  background: linear-gradient(160deg, rgba(17, 25, 43, 0.8), rgba(7, 11, 21, 0.8));
  color: var(--nx-text) !important;
  overflow: hidden;
  transition: transform 0.25s var(--nx-ease), border-color 0.2s;
}
.nx-podium__card:hover { transform: translateY(-3px); border-color: rgba(251, 191, 36, 0.35); }
.nx-podium__card.place-1 { border-color: rgba(251, 191, 36, 0.32); background: radial-gradient(120% 120% at 100% 0%, rgba(251, 191, 36, 0.16), transparent 60%), linear-gradient(160deg, rgba(30, 26, 16, 0.7), rgba(7, 11, 21, 0.82)); }
.nx-podium__card.place-2 { border-color: rgba(203, 213, 225, 0.25); }
.nx-podium__card.place-3 { border-color: rgba(217, 119, 6, 0.28); }
.nx-podium__rank {
  position: absolute;
  right: 10px;
  top: 2px;
  font-family: var(--nx-display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(148, 163, 184, 0.1);
}
.nx-podium__card.place-1 .nx-podium__rank { color: rgba(251, 191, 36, 0.18); }
.nx-podium__avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: var(--nx-gradient-soft);
  border: 1px solid rgba(129, 140, 248, 0.3);
  color: #e0e7ff;
  font-family: var(--nx-display);
  font-size: 1.05rem;
  font-weight: 700;
}
.nx-podium__card.place-1 .nx-podium__avatar { background: rgba(251, 191, 36, 0.16); border-color: rgba(251, 191, 36, 0.4); color: #fde68a; }
.nx-podium__meta { min-width: 0; position: relative; z-index: 1; }
.nx-podium__name { display: block; font-family: var(--nx-display); font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-podium__score { display: block; margin-top: 2px; font-size: 0.72rem; color: var(--nx-muted); }
.nx-podium__score b { font-family: var(--nx-display); color: var(--nx-cyan); font-size: 0.95rem; }

.nx-board { border-radius: var(--nx-radius); border: 1px solid var(--nx-line); overflow: hidden; background: rgba(9, 14, 26, 0.55); }
.nx-board .table { margin: 0; }
.nx-board .table > tbody > tr > td:first-child { padding-left: 20px; }
.nx-board .table > thead > tr > th:first-child { padding-left: 20px; }
.nx-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  border-radius: 9px;
  border: 1px solid var(--nx-line);
  background: rgba(148, 163, 184, 0.06);
  font-family: var(--nx-mono);
  font-size: 0.72rem;
  color: var(--nx-muted);
}
.nx-rank.top-1 { color: #fde68a; border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.12); }
.nx-rank.top-2 { color: #e2e8f0; border-color: rgba(203, 213, 225, 0.35); background: rgba(203, 213, 225, 0.1); }
.nx-rank.top-3 { color: #fdba74; border-color: rgba(217, 119, 6, 0.35); background: rgba(217, 119, 6, 0.12); }
.nx-score-cell { font-family: var(--nx-display); font-weight: 600; color: var(--nx-cyan); font-variant-numeric: tabular-nums; }
.nx-player-cell { display: flex; align-items: center; gap: 10px; }
.nx-player-cell .nx-mini-avatar {
  width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(129, 140, 248, 0.12); border: 1px solid rgba(129, 140, 248, 0.22); color: #c7d2fe;
  font-family: var(--nx-display); font-size: 0.72rem; font-weight: 600; flex: 0 0 30px;
}

#score-graph { min-height: 360px; margin: 0 0 26px; padding: 14px; border-radius: var(--nx-radius); border: 1px solid var(--nx-line); background: rgba(9, 14, 26, 0.5); }
#score-graph:empty { display: none; }

/* Custom score-race graph (replaces CTFd's chart) */
.nx-race {
  position: relative;
  margin: 4px 0 24px;
  padding: 22px 22px 12px;
  border-radius: var(--nx-radius);
  border: 1px solid var(--nx-line);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(34, 211, 238, 0.09), transparent 55%),
    radial-gradient(100% 100% at 100% 100%, rgba(129, 140, 248, 0.08), transparent 60%),
    rgba(9, 14, 26, 0.58);
  overflow: visible;
}
.nx-race.is-busy .nx-race__canvas { opacity: 0.55; }
.nx-race.is-busy .nx-race__canvas { transition: opacity 0.2s; }
.nx-race::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.65), rgba(192, 132, 252, 0.5), transparent);
  opacity: 0.7;
}
.nx-race__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.nx-race__head .nx-kicker { margin-bottom: 8px; }
.nx-race__head h2 { margin: 0; font-size: clamp(1.35rem, 2vw, 1.65rem); }
.nx-race__head h2 span { color: var(--nx-cyan); }
.nx-race__sub { margin: 5px 0 0; color: var(--nx-muted); font-size: 0.79rem; }
.nx-race__legend { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; max-width: 560px; }
.nx-race__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 150px;
  padding: 4px 9px;
  border-radius: 99px;
  border: 1px solid var(--nx-line);
  background: rgba(3, 6, 14, 0.4);
  color: var(--nx-muted);
  font-size: 0.66rem;
  font-weight: 500;
  line-height: 1.4;
}
.nx-race__chip i { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.nx-race__chip b { color: var(--nx-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.nx-race__chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-race__canvas { position: relative; min-height: 310px; margin-top: 14px; }
.nx-race__canvas svg { display: block; width: 100%; height: auto; overflow: visible; }
.nx-race__canvas .nx-grid line { stroke: rgba(148, 163, 184, 0.11); stroke-width: 1; shape-rendering: crispEdges; }
.nx-race__canvas .nx-axis text { fill: var(--nx-dim); font-family: var(--nx-mono); font-size: 10px; letter-spacing: 0.03em; }
.nx-race__canvas .nx-line { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.nx-race__canvas .nx-line-glow { fill: none; stroke-width: 7; stroke-linecap: round; opacity: 0.12; }
.nx-race__canvas .nx-endpoint { stroke: #05070f; stroke-width: 2.5; }
.nx-race__canvas .nx-crosshair { stroke: rgba(232, 238, 251, 0.28); stroke-width: 1; stroke-dasharray: 3 4; }
.nx-race__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--nx-dim);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nx-race__spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(34, 211, 238, 0.2);
  border-top-color: var(--nx-cyan);
  animation: nx-spin 0.8s linear infinite;
}
.nx-race__tip {
  position: absolute;
  z-index: 4;
  min-width: 176px;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--nx-line-strong);
  background: rgba(7, 11, 21, 0.96);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.95);
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 0.12s;
  pointer-events: none;
  backdrop-filter: blur(12px);
}
.nx-race__tip.is-visible { opacity: 1; }
.nx-race__tip time { display: block; margin-bottom: 6px; color: var(--nx-dim); font-family: var(--nx-mono); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; }
.nx-race__tip-row { display: flex; align-items: center; gap: 7px; padding: 2px 0; font-size: 0.71rem; }
.nx-race__tip-row i { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; }
.nx-race__tip-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--nx-muted); }
.nx-race__tip-row b { color: var(--nx-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.nx-race__empty { padding: 46px 20px; text-align: center; color: var(--nx-dim); }
.nx-race__empty i { margin-bottom: 8px; font-size: 1.5rem; color: rgba(34, 211, 238, 0.55); }
.nx-race__empty p { margin: 0; font-size: 0.8rem; color: var(--nx-muted); }

.nx-tabs-pills { display: flex; gap: 6px; flex-wrap: wrap; padding: 5px; border-radius: 12px; border: 1px solid var(--nx-line); background: rgba(3, 6, 14, 0.4); }
.nx-tabs-pills .nav-link {
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--nx-muted);
  font-size: 0.74rem;
  font-weight: 600;
  transition: all 0.2s;
}
.nx-tabs-pills .nav-link:hover { color: #fff; background: rgba(148, 163, 184, 0.08); }
.nx-tabs-pills .nav-link.active { color: #041018; background: var(--nx-gradient); }

/* ---------- 11. Auth ---------- */
.auth-layout .nx-sidebar,
.auth-layout .nx-topbar,
.auth-layout .nx-footer,
.auth-layout .nx-bottomnav { display: none !important; }
.auth-layout .nx-shell { margin-left: 0; }
.auth-layout .nx-main { max-width: none; padding: 0; }
.auth-layout::before { background: radial-gradient(60% 60% at 80% 0%, rgba(124, 92, 255, 0.2), transparent 60%), radial-gradient(50% 50% at 10% 90%, rgba(34, 211, 238, 0.12), transparent 60%), var(--nx-bg); }
.auth-layout::after { mask-image: none; -webkit-mask-image: none; opacity: 0.6; }

.nx-auth {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  min-height: 100vh;
}
.nx-auth__brandside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 64px);
  overflow: hidden;
  border-right: 1px solid var(--nx-line);
  background:
    radial-gradient(70% 60% at 20% 20%, rgba(34, 211, 238, 0.12), transparent 60%),
    radial-gradient(60% 50% at 90% 90%, rgba(192, 132, 252, 0.14), transparent 60%),
    rgba(6, 10, 19, 0.6);
}
.nx-auth__brandside::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(80% 80% at 40% 40%, #000, transparent 85%);
  -webkit-mask-image: radial-gradient(80% 80% at 40% 40%, #000, transparent 85%);
  pointer-events: none;
}
.nx-auth__brand { position: relative; display: flex; align-items: center; gap: 12px; color: var(--nx-text) !important; }
.nx-auth__brand img, .nx-auth__brand svg { width: 38px; height: 38px; }
.nx-auth__brand .word { font-family: var(--nx-display); font-size: 1.3rem; font-weight: 700; letter-spacing: 0.26em; background: var(--nx-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nx-auth__display { position: relative; margin: 40px 0; }
.nx-auth__display p.nx-kicker { margin-bottom: 18px; }
.nx-auth__display h2 {
  margin: 0;
  max-width: 620px;
  font-family: var(--nx-display);
  font-size: clamp(2.6rem, 5.4vw, 4.8rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
  font-weight: 700;
}
.nx-auth__display h2 em { font-style: normal; background: var(--nx-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nx-auth__display p.nx-auth__sub { max-width: 430px; margin: 22px 0 0; color: var(--nx-muted); font-size: 0.95rem; }
.nx-auth__chips { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }
.nx-auth__chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 99px; border: 1px solid var(--nx-line); background: rgba(148, 163, 184, 0.04); color: var(--nx-muted); font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; }
.nx-auth__chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--nx-cyan); box-shadow: 0 0 8px var(--nx-cyan); }
.nx-auth__foot { position: relative; margin-top: 26px; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--nx-dim); }

.nx-auth__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 56px);
}
.nx-auth__card { width: min(100%, 430px); }
.nx-auth__card .nx-kicker { margin-bottom: 10px; }
.nx-auth__card h1 { margin: 0 0 8px; font-size: clamp(1.9rem, 3vw, 2.5rem); letter-spacing: -0.04em; }
.nx-auth__card > p { margin: 0 0 26px; color: var(--nx-muted); font-size: 0.9rem; }
.nx-auth__card .form-group, .nx-auth__card .mb-3 { margin-bottom: 16px; }
.nx-auth__card .btn-primary { width: 100%; min-height: 50px; margin-top: 6px; }
.nx-auth__inner-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: 0.78rem; color: var(--nx-muted); }
.nx-auth__inner-links a { color: var(--nx-cyan); }
.nx-auth__switch { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--nx-line); text-align: center; font-size: 0.82rem; color: var(--nx-muted); }
.nx-auth__switch a { color: var(--nx-cyan); font-weight: 600; }
.nx-auth__alert { margin-bottom: 18px; }
.nx-auth__card hr { margin: 24px 0; }

.nx-auth .jumbotron { display: none; }
.nx-auth .container { max-width: none; padding: 0; }
.nx-auth .row { margin: 0; }
.nx-auth .row > [class*="col-"] { width: 100%; max-width: 100%; padding: 0; margin: 0; }
.nx-auth > .container { width: 100%; }
.nx-auth__simple {
  width: min(100%, 540px);
  margin: 0 auto;
}

/* Wrapping generic auth content when no custom shell */
.nx-auth__generic { width: 100%; display: flex; justify-content: center; }
.nx-auth-standalone {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 5vw, 60px);
}
.nx-auth-card {
  width: min(100%, 520px);
  padding: clamp(24px, 4vw, 42px);
  border-radius: var(--nx-radius-lg);
  border: 1px solid var(--nx-line);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(7, 11, 21, 0.86));
  box-shadow: var(--nx-shadow);
}
.nx-auth-card h1 { font-size: clamp(1.9rem, 3vw, 2.4rem); margin-bottom: 8px; }
.nx-auth-card > p { color: var(--nx-muted); font-size: 0.9rem; }
.nx-auth-card .btn-primary { width: 100%; min-height: 50px; }
.nx-auth-card hr { margin: 24px 0; }

/* ---------- 12. Profiles, notifications, misc ---------- */
.nx-profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.nx-profile-head__avatar {
  width: 74px;
  height: 74px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--nx-gradient-soft);
  border: 1px solid rgba(129, 140, 248, 0.32);
  color: #e0e7ff;
  font-family: var(--nx-display);
  font-size: 1.7rem;
  font-weight: 700;
  text-transform: uppercase;
}
.nx-profile-head h1 { margin: 0; }
.nx-profile-head p { margin: 2px 0 0; color: var(--nx-muted); font-size: 0.85rem; }

.nx-stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.nx-stat-card { padding: 16px 18px; border-radius: 14px; border: 1px solid var(--nx-line); background: rgba(10, 16, 30, 0.55); }
.nx-stat-card span { display: block; font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--nx-dim); }
.nx-stat-card strong { display: block; margin-top: 4px; font-family: var(--nx-display); font-size: 1.5rem; font-weight: 600; color: var(--nx-text); }

/* Public operative dossier */
.nx-profile { display: grid; gap: 20px; }
.nx-profile-crumbs { display: flex; align-items: center; gap: 9px; color: var(--nx-dim); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; }
.nx-profile-crumbs a { display: inline-flex; align-items: center; gap: 7px; color: var(--nx-muted); }
.nx-profile-crumbs a:hover { color: var(--nx-cyan); }
.nx-profile-crumbs b { color: var(--nx-text); font-weight: 600; }

.nx-profile-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 3.4vw, 38px);
  border-radius: var(--nx-radius-lg);
  border: 1px solid var(--nx-line-strong);
  background:
    radial-gradient(90% 130% at 100% 0%, rgba(129, 140, 248, 0.16), transparent 58%),
    radial-gradient(80% 120% at 0% 100%, rgba(34, 211, 238, 0.1), transparent 60%),
    linear-gradient(150deg, rgba(15, 23, 42, 0.82), rgba(6, 10, 20, 0.9));
  box-shadow: var(--nx-shadow);
}
.nx-profile-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(85% 100% at 78% 0%, #000, transparent 72%);
  -webkit-mask-image: radial-gradient(85% 100% at 78% 0%, #000, transparent 72%);
}
.nx-profile-hero__glow {
  position: absolute;
  top: -150px;
  right: -90px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.18), transparent 66%);
  filter: blur(10px);
  pointer-events: none;
}
.nx-profile-hero__main { position: relative; z-index: 1; display: flex; align-items: center; gap: clamp(18px, 3vw, 28px); flex-wrap: wrap; }
.nx-profile-avatar {
  position: relative;
  width: 108px;
  height: 108px;
  flex: 0 0 108px;
  display: grid;
  place-items: center;
  border-radius: 30px;
  border: 1px solid rgba(129, 140, 248, 0.4);
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.22), rgba(129, 140, 248, 0.16) 52%, rgba(192, 132, 252, 0.24));
  box-shadow: inset 0 0 34px rgba(34, 211, 238, 0.1), 0 24px 54px -28px rgba(34, 211, 238, 0.65);
}
.nx-profile-avatar::before {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 38px;
  border: 1px dashed rgba(129, 140, 248, 0.32);
  animation: nx-orbit 28s linear infinite;
}
.nx-profile-avatar::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--nx-green);
  border: 3px solid #070b15;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.65);
}
.nx-profile-avatar span {
  font-family: var(--nx-display);
  font-size: 2.9rem;
  font-weight: 700;
  line-height: 1;
  color: #e6ecff;
  text-shadow: 0 0 28px rgba(34, 211, 238, 0.45);
}
.nx-profile-id { flex: 1 1 280px; min-width: 0; }
.nx-profile-id .nx-kicker { margin-bottom: 8px; }
.nx-profile-id h1 { margin: 0; font-size: clamp(2.2rem, 4.4vw, 3.5rem); line-height: 0.98; letter-spacing: -0.055em; overflow-wrap: anywhere; }
.nx-profile-id h1 span { background: var(--nx-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nx-profile-tags { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.nx-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--nx-line);
  background: rgba(3, 6, 14, 0.4);
  color: var(--nx-muted) !important;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nx-tag i { font-size: 0.66rem; color: var(--nx-dim); }
.nx-tag:hover { border-color: rgba(34, 211, 238, 0.3); color: #fff !important; }
.nx-tag--team { border-color: rgba(34, 211, 238, 0.26); background: rgba(34, 211, 238, 0.08); color: #a5f3fc !important; }
.nx-tag--team i { color: var(--nx-cyan); }
.nx-tag--official { border-color: rgba(251, 191, 36, 0.28); background: rgba(251, 191, 36, 0.08); color: #fde68a !important; }
.nx-tag--official i { color: var(--nx-amber); }
.nx-profile-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.nx-profile-medal {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  min-width: 158px;
  padding: 4px 0 4px clamp(18px, 3vw, 30px);
  border-left: 1px solid var(--nx-line);
  text-align: right;
}
.nx-profile-medal__label { display: block; font-size: 0.58rem; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--nx-dim); }
.nx-profile-medal strong {
  display: block;
  margin-top: 2px;
  font-family: var(--nx-display);
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.055em;
  background: linear-gradient(120deg, #fde68a, #fbbf24 45%, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.nx-profile-medal__pts { display: block; margin-top: 5px; color: var(--nx-muted); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }
.nx-profile-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--nx-line); }
.nx-profile-stats > div { min-width: 0; padding: 2px 20px; border-left: 1px solid var(--nx-line); }
.nx-profile-stats > div:first-child { padding-left: 0; border-left: 0; }
.nx-profile-stats span { display: block; font-size: 0.58rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--nx-dim); }
.nx-profile-stats b { display: block; margin-top: 3px; font-family: var(--nx-display); font-size: clamp(1.25rem, 2vw, 1.6rem); font-weight: 600; color: var(--nx-text); font-variant-numeric: tabular-nums; }

.nx-profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 328px; gap: 20px; align-items: start; }
.nx-profile-main { min-width: 0; display: grid; gap: 20px; }
.nx-profile-side { display: grid; gap: 20px; position: sticky; top: calc(var(--nx-topbar) + 18px); min-width: 0; }
.nx-profile-panel {
  position: relative;
  padding: 22px;
  border-radius: var(--nx-radius);
  border: 1px solid var(--nx-line);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.62), rgba(7, 11, 21, 0.72));
}
.nx-profile-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.nx-profile-panel__head .nx-kicker { margin-bottom: 7px; }
.nx-profile-panel__head h2 { margin: 0; font-size: 1.4rem; letter-spacing: -0.04em; }
.nx-profile-panel__head h2 span { color: var(--nx-cyan); }
.nx-profile-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--nx-line);
  background: rgba(34, 211, 238, 0.07);
  color: var(--nx-cyan);
  font-family: var(--nx-mono);
  font-size: 0.65rem;
}

.nx-awards { display: grid; gap: 10px; }
.nx-award {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, 0.16);
  background: linear-gradient(120deg, rgba(251, 191, 36, 0.06), rgba(3, 6, 14, 0.3));
}
.nx-award__icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.26);
  background: rgba(251, 191, 36, 0.09);
  color: var(--nx-amber);
  font-size: 1rem;
}
.nx-award__body { min-width: 0; flex: 1; }
.nx-award__body h3 { margin: 0; font-size: 0.93rem; }
.nx-award__body p { margin: 3px 0 0; color: var(--nx-muted); font-size: 0.74rem; }
.nx-award__value { flex: 0 0 auto; font-family: var(--nx-display); font-size: 0.92rem; font-weight: 600; color: var(--nx-amber); font-variant-numeric: tabular-nums; }

.nx-solve-table { border: 0; border-radius: 0; background: transparent; overflow-x: auto; }
.nx-solve-table .table { margin: 0; }
.nx-solve-table .table > thead > tr > th { padding-left: 0; padding-right: 12px; }
.nx-solve-table .table > thead > tr > th:last-child { padding-right: 0; }
.nx-solve-table .table > tbody > tr > td { padding-left: 0; padding-right: 12px; border-bottom-color: var(--nx-line); }
.nx-solve-table .table > tbody > tr:last-child > td { border-bottom: 0; padding-bottom: 0; }
.nx-solve-table .table > tbody > tr > td:last-child { padding-right: 0; }
.nx-solve-name { display: inline-flex; align-items: center; gap: 9px; color: var(--nx-text) !important; font-weight: 500; }
.nx-solve-name:hover { color: var(--nx-cyan) !important; }
.nx-solve-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--nx-cyan); box-shadow: 0 0 9px rgba(34, 211, 238, 0.7); }
.nx-solve-value { font-family: var(--nx-display); font-weight: 600; color: var(--nx-green); font-variant-numeric: tabular-nums; }
.nx-solve-time-col .solve-time { color: var(--nx-dim); font-size: 0.72rem; white-space: nowrap; }
.nx-cat {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--nx-line);
  background: rgba(148, 163, 184, 0.07);
  color: var(--nx-muted);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nx-cat--web { color: #a5f3fc; border-color: rgba(34, 211, 238, 0.26); background: rgba(34, 211, 238, 0.08); }
.nx-cat--crypto { color: #ddd6fe; border-color: rgba(192, 132, 252, 0.26); background: rgba(192, 132, 252, 0.08); }
.nx-cat--forensics { color: #fde68a; border-color: rgba(251, 191, 36, 0.26); background: rgba(251, 191, 36, 0.08); }
.nx-cat--pwn { color: #fecdd3; border-color: rgba(251, 113, 133, 0.26); background: rgba(251, 113, 133, 0.08); }
.nx-cat--osint { color: #d9f99d; border-color: rgba(163, 230, 53, 0.26); background: rgba(163, 230, 53, 0.08); }
.nx-cat--reversing, .nx-cat--reverse { color: #bfdbfe; border-color: rgba(96, 165, 250, 0.26); background: rgba(96, 165, 250, 0.08); }
.nx-cat--misc, .nx-cat--other { color: #cbd5e1; }

.nx-empty--profile { padding: 42px 20px; text-align: center; border: 0; background: transparent; }
.nx-empty--profile .btn { margin-top: 16px; }

.nx-intel dl { display: grid; gap: 0; margin: 0; }
.nx-intel dl > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--nx-line); }
.nx-intel dl > div:first-child { padding-top: 0; }
.nx-intel dl > div:last-child { padding-bottom: 0; border-bottom: 0; }
.nx-intel dt { color: var(--nx-dim); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; }
.nx-intel dd { margin: 0; min-width: 0; color: var(--nx-text); font-size: 0.79rem; overflow-wrap: anywhere; }
.nx-intel dd a { color: var(--nx-cyan); }

.nx-cat-breakdown { display: grid; gap: 15px; }
.nx-cat-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; }
.nx-cat-row__name { display: inline-flex; align-items: center; gap: 7px; color: var(--nx-muted); font-size: 0.76rem; font-weight: 500; }
.nx-cat-row__value { color: var(--nx-text); font-family: var(--nx-mono); font-size: 0.66rem; font-variant-numeric: tabular-nums; }
.nx-cat-bar { grid-column: 1 / -1; display: block; height: 6px; border-radius: 99px; background: rgba(148, 163, 184, 0.11); overflow: hidden; }
.nx-cat-bar i { display: block; height: 100%; border-radius: inherit; background: var(--nx-gradient); box-shadow: 0 0 12px rgba(34, 211, 238, 0.32); }
.nx-cat-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--nx-gradient); }
.nx-cat-dot--web { background: #22d3ee; box-shadow: 0 0 8px rgba(34, 211, 238, 0.7); }
.nx-cat-dot--crypto { background: #c084fc; box-shadow: 0 0 8px rgba(192, 132, 252, 0.7); }
.nx-cat-dot--forensics { background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.7); }
.nx-cat-dot--pwn { background: #fb7185; box-shadow: 0 0 8px rgba(251, 113, 133, 0.7); }
.nx-cat-dot--osint { background: #a3e635; box-shadow: 0 0 8px rgba(163, 230, 53, 0.7); }
.nx-cat-dot--reversing, .nx-cat-dot--reverse { background: #60a5fa; box-shadow: 0 0 8px rgba(96, 165, 250, 0.7); }
.nx-cat-total { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--nx-line); color: var(--nx-dim); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; }

.nx-notifications { display: grid; gap: 12px; }
.nx-notification {
  position: relative;
  padding: 20px 22px;
  border-radius: var(--nx-radius);
  border: 1px solid var(--nx-line);
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.62), rgba(7, 11, 21, 0.7));
  transition: border-color 0.2s, transform 0.2s;
}
.nx-notification:hover { border-color: rgba(34, 211, 238, 0.25); transform: translateY(-2px); }
.nx-notification h3 { margin: 0 0 8px; font-size: 1.08rem; }
.nx-notification p { margin: 0 0 6px; color: var(--nx-muted); font-size: 0.88rem; }
.nx-notification small { color: var(--nx-dim); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }

.nx-section-title { display: flex; align-items: center; gap: 12px; margin: 26px 0 14px; }
.nx-section-title h3 { margin: 0; font-size: 1.3rem; }
.nx-section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--nx-line), transparent); }

.nx-searchbar {
  display: flex;
  gap: 10px;
  align-items: stretch;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--nx-line);
  background: rgba(10, 16, 30, 0.55);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.nx-searchbar .form-select { flex: 1 1 170px; max-width: 220px; }
.nx-searchbar .form-control { flex: 3 1 260px; }
.nx-searchbar .btn { flex: 0 0 auto; min-width: 52px; }
/* Core ships `input { padding: .6rem !important }`, so icon spacing needs priority. */
.nx-searchbar input[type="search"] { padding-left: 2.45rem !important; }

.nx-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.nx-person-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--nx-line);
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.6), rgba(7, 11, 21, 0.65));
  color: var(--nx-text) !important;
  transition: border-color 0.2s, transform 0.2s;
}
.nx-person-card:hover { border-color: rgba(34, 211, 238, 0.3); transform: translateY(-2px); }
.nx-person-card__body { min-width: 0; flex: 1; }
.nx-person-card__name { display: block; font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-person-card__meta { display: block; font-size: 0.7rem; color: var(--nx-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-person-card__flag { font-size: 1.1rem; }
.nx-person-card .badge { flex: 0 0 auto; }

.nx-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 24px; font-size: 0.76rem; color: var(--nx-muted); }
.nx-pager .page-select { width: auto; min-width: 76px; min-height: 36px; padding: 4px 28px 4px 12px; font-size: 0.78rem; }
.nx-pager a { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--nx-line); color: var(--nx-muted); }
.nx-pager a:hover { border-color: rgba(34, 211, 238, 0.3); color: #fff; }

.nx-settings-grid { display: grid; grid-template-columns: 230px 1fr; gap: 22px; align-items: start; }
.nx-settings-grid .nav.flex-column { position: sticky; top: calc(var(--nx-topbar) + 18px); gap: 4px; padding: 6px; border-radius: 14px; border: 1px solid var(--nx-line); background: rgba(10, 16, 30, 0.55); }
.nx-settings-grid .nav-link {
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--nx-muted);
  font-size: 0.8rem;
  font-weight: 500;
}
.nx-settings-grid .nav-link:hover { color: #fff; background: rgba(148, 163, 184, 0.07); }
.nx-settings-grid .nav-link.active { color: #fff; background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.22); }
.nx-settings-grid .tab-content { padding: 26px; border-radius: var(--nx-radius); border: 1px solid var(--nx-line); background: rgba(10, 16, 30, 0.5); }

.nx-token-list { display: grid; gap: 10px; }
.nx-token { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--nx-line); background: rgba(3, 6, 14, 0.35); }
.nx-token code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 13. Modals / notices ---------- */
.modal { z-index: 1055; }
.modal-backdrop { background: #02040a; }
.modal-backdrop.show { opacity: 0.72; }
.modal-content {
  border-radius: var(--nx-radius);
  border: 1px solid var(--nx-line-strong);
  background: linear-gradient(180deg, #0c1322, #070b15);
  color: var(--nx-text);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9);
}
.modal-header, .modal-footer { border-color: var(--nx-line); padding: 18px 22px; }
.modal-body { padding: 22px; }
.modal-title { font-size: 1.2rem; }
.modal-action { font-size: 1.1rem; }
.modal.fade .modal-dialog { transform: translateY(14px) scale(0.985); transition: transform 0.32s var(--nx-ease), opacity 0.32s; }
.modal.show .modal-dialog { transform: none; }
#challenge-window.modal.fade .modal-dialog { transform: translateX(46px); }
#challenge-window.modal.show .modal-dialog { transform: none; }

.toast { border-radius: 13px; border: 1px solid var(--nx-line-strong); background: #0c1322; color: var(--nx-text); box-shadow: var(--nx-shadow); }
.toast-header { border-color: var(--nx-line); background: rgba(148, 163, 184, 0.05); color: var(--nx-text); }
.toast-header .btn-close { filter: invert(1); }
.nx-notification-pop { position: fixed; bottom: 22px; right: 22px; z-index: 1060; }
.ctfdio-email-nudge { border-radius: 13px !important; background: #0c1322 !important; border: 1px solid var(--nx-line-strong) !important; color: var(--nx-text) !important; }

.dropdown-menu {
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--nx-line-strong);
  background: #0c1322;
  box-shadow: var(--nx-shadow);
}
.dropdown-item { border-radius: 8px; padding: 7px 10px; color: var(--nx-muted); font-size: 0.8rem; }
.dropdown-item:hover, .dropdown-item:focus { background: rgba(34, 211, 238, 0.1); color: #fff; }
.dropdown-item.bg-primary { background: rgba(34, 211, 238, 0.18) !important; color: #fff !important; }

/* nav pills & tabs elsewhere */
.nav-pills .nav-link {
  border-radius: 9px;
  border: 1px solid transparent;
  color: var(--nx-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 13px;
}
.nav-pills .nav-link:hover { color: #fff; background: rgba(148, 163, 184, 0.07); }
.nav-pills .nav-link.active { color: #041018; background: var(--nx-gradient); }
.nav-tabs { border-color: var(--nx-line); }
.nav-tabs .nav-link { color: var(--nx-muted); border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 9px 13px; font-size: 0.8rem; font-weight: 600; }
.nav-tabs .nav-link:hover { color: #fff; border-bottom-color: var(--nx-line-strong); }
.nav-tabs .nav-link.active { color: var(--nx-cyan); background: transparent; border-bottom-color: var(--nx-cyan); }

.page-item .page-link { background: rgba(10, 16, 30, 0.6); border-color: var(--nx-line); color: var(--nx-muted); }
.page-item.active .page-link { background: var(--nx-gradient); border-color: transparent; color: #041018; }

/* tooltips */
.tooltip-inner { background: #0c1322; border: 1px solid var(--nx-line-strong); color: var(--nx-text); font-size: 0.72rem; border-radius: 8px; padding: 5px 9px; }
.tooltip .tooltip-arrow::before { border-top-color: var(--nx-line-strong); }

/* awards */
.award-icon { color: var(--nx-amber); }
[class^="award-"] { color: var(--nx-amber); }

/* flag icons spacing */
[class*="flag-"] { border-radius: 2px; margin-right: 5px; }

/* generic page content spacing */
.nx-main > .container > .row + .row,
.nx-main > .container > hr + .row { margin-top: 16px; }
.nx-main > .container > .row > [class*="col-"] { margin-bottom: 8px; }
.nx-main h2.text-center, .nx-main h3.text-center { color: var(--nx-muted); }

/* setup */
.nx-setup .nx-auth__card { width: min(100%, 880px); }
.nx-setup .nx-auth__panel { padding-top: 40px; padding-bottom: 40px; }
.nx-setup .container { max-width: 900px; }
.nx-setup .jumbotron { display: none; }
.nx-setup .nav-pills { margin-bottom: 20px; }
.nx-setup .tab-content { padding: 24px; border-radius: var(--nx-radius); border: 1px solid var(--nx-line); background: rgba(10, 16, 30, 0.5); }
.nx-setup .card { background: rgba(10, 16, 30, 0.5); }
.nx-setup .card-radio:checked + .card { border-color: rgba(34, 211, 238, 0.55) !important; box-shadow: 0 0 0 0.1rem rgba(34, 211, 238, 0.35) !important; background: rgba(34, 211, 238, 0.06) !important; }

/* error pages */
.nx-error { text-align: center; padding: 70px 20px; }
.nx-error .code { font-family: var(--nx-display); font-size: clamp(5rem, 16vw, 10rem); line-height: 0.85; font-weight: 700; background: var(--nx-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: 0.85; }
.nx-error h1 { margin: 12px 0 8px; font-size: 2rem; }
.nx-error p { color: var(--nx-muted); }

/* ---------- 14. Responsive ---------- */
@media (min-width: 1600px) {
  .nx-challenge-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1279px) {
  .nx-challenge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1199px) {
  .nx-profile-layout { grid-template-columns: 1fr; }
  .nx-profile-side { position: static; }
}

@media (max-width: 1023px) {
  :root { --nx-topbar: 64px; }
  .nx-sidebar { transform: translateX(-102%); width: min(84vw, 320px); box-shadow: 40px 0 100px -40px #000; }
  .nx-sidebar.is-open { transform: none; }
  .nx-shell { margin-left: 0; }
  .nx-topbar { padding: 0 18px; }
  .nx-topbar__menu { display: inline-flex; }
  .nx-topbar__brand { display: inline-flex; }
  .nx-topbar__crumb { display: none; }
  .nx-main { padding: 24px 18px 104px; }
  .nx-footer { padding-bottom: 86px; }
  .nx-footer__inner { padding: 18px; }
  .nx-bottomnav { display: block; }
  .nx-challenge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nx-podium { grid-template-columns: 1fr; }
  .nx-podium__card { min-height: 92px; }
  .nx-auth { grid-template-columns: 1fr; }
  .nx-auth__brandside { min-height: auto; padding: 26px 24px 30px; border-right: 0; border-bottom: 1px solid var(--nx-line); }
  .nx-auth__display { margin: 26px 0 24px; }
  .nx-auth__display h2 { font-size: clamp(2.2rem, 9vw, 3.4rem); }
  .nx-auth__chips { display: none; }
  .nx-auth__panel { padding: 30px 22px 50px; }
  .nx-auth__foot { display: none; }
  .nx-settings-grid { grid-template-columns: 1fr; }
  .nx-settings-grid .nav.flex-column { position: static; flex-direction: row; overflow-x: auto; }
  .nx-settings-grid .nav-link { width: auto; white-space: nowrap; }
  .nx-profile-layout { grid-template-columns: 1fr; }
  .nx-profile-side { position: static; }
  #challenge-window .modal-dialog { max-width: 100%; }
  #challenge-window .modal-content { border-left: 0; }
}

@media (max-width: 767px) {
  .nx-main { padding: 18px 14px 104px; }
  .nx-page-head { align-items: flex-start; margin-bottom: 22px; }
  .nx-stat-strip { width: 100%; }
  .nx-stat-strip > div { flex: 1; min-width: 0; padding: 11px 14px; }
  .nx-stat-strip strong, .nx-stat-strip b { font-size: 1.15rem; }
  .nx-cat-rail { top: calc(var(--nx-topbar) + 6px); margin: 0 -4px 10px; }
  .nx-category { padding-top: 26px; }
  .nx-category__bar { display: none; }
  .nx-challenge-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .nx-challenge-card { min-height: 138px; padding: 14px; }
  .nx-challenge-card__name { font-size: 0.95rem; }
  .nx-challenge-card__cta { display: none; }
  .nx-searchbar { padding: 8px; }
  .nx-searchbar .form-select, .nx-searchbar .form-control { max-width: none; flex: 1 1 100%; }
  .nx-searchbar .btn { width: 100%; }
  .nx-settings-grid .tab-content { padding: 18px; }
  .nx-auth { min-height: 100svh; }
  .nx-auth__display p.nx-auth__sub { display: none; }
  .nx-auth__display h2 { font-size: clamp(2rem, 11vw, 3rem); }
  .nx-flag-row { flex-direction: column; }
  .nx-flag-row .challenge-submit { width: 100%; }
  .nx-challenge-panel__bar { height: 56px; padding: 0 16px; }
  .nx-challenge-panel__head { padding: 22px 18px 14px; }
  .nx-challenge-tabs { margin: 0 18px; }
  .nx-challenge-panel__body { padding: 20px 18px 34px; }
  .nx-board { overflow-x: auto; }
  .nx-board .table { min-width: 480px; }
  .nx-footer__inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .nx-hero { padding: 26px 20px; }
  .nx-hero__stats { gap: 18px; }
  .nx-hero__orb { width: 260px; height: 260px; right: -120px; }
  .nx-person-card { padding: 12px; }
  .nx-profile-head__avatar { width: 58px; height: 58px; font-size: 1.3rem; }
  .table-responsive { border: 0; }
  .nx-race { padding: 18px 16px 8px; }
  .nx-race__head { gap: 14px; }
  .nx-race__legend { justify-content: flex-start; max-width: none; }
  .nx-race__chip { max-width: 132px; }
  .nx-race__canvas { min-height: 270px; }
  .nx-profile-hero { padding: 22px 18px; }
  .nx-profile-hero__main { gap: 18px; }
  .nx-profile-avatar { width: 86px; height: 86px; flex-basis: 86px; border-radius: 24px; }
  .nx-profile-avatar span { font-size: 2.2rem; }
  .nx-profile-id h1 { font-size: clamp(2rem, 8vw, 2.7rem); }
  .nx-profile-medal {
    flex: 1 1 100%;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
    padding: 14px 0 0;
    border-left: 0;
    border-top: 1px solid var(--nx-line);
    text-align: left;
  }
  .nx-profile-medal strong { margin-top: 0; font-size: 2.2rem; }
  .nx-profile-medal__pts { margin-left: auto; }
  .nx-profile-stats { grid-template-columns: 1fr 1fr; row-gap: 16px; margin-top: 22px; }
  .nx-profile-stats > div { padding: 0 0 0 16px; }
  .nx-profile-stats > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .nx-profile-stats > div:nth-child(n + 3) { padding-top: 14px; border-top: 1px solid var(--nx-line); }
  .nx-profile-panel { padding: 18px; }
  .nx-solve-cat-col { display: none !important; }
  .nx-profile-crumbs { font-size: 0.62rem; }
}

@media (max-width: 359px) {
  .nx-topbar { padding: 0 12px; gap: 10px; }
  .nx-topbar__right { gap: 6px; }
  .nx-topbar__brand { font-size: 0.82rem; letter-spacing: 0.16em; }
  .nx-live { display: none; }
}

@media (max-width: 479px) {
  .nx-challenge-grid { grid-template-columns: 1fr; }
  .nx-challenge-card { min-height: 122px; }
  .nx-topbar__brand img, .nx-topbar__brand svg { width: 23px; height: 23px; }
  .nx-live { padding: 0 9px; font-size: 0.6rem; }
  .nx-page-head h1 { font-size: 2rem; }
  .nx-auth__brandside { padding: 22px 18px 24px; }
  .nx-auth__panel { padding: 24px 16px 44px; }
  .nx-auth-card { padding: 22px 18px; }
  .nx-podium__card { padding: 14px; }
  .nx-race { padding: 16px 13px 6px; }
  .nx-race__canvas { min-height: 240px; }
  .nx-race__chip { max-width: 118px; font-size: 0.62rem; }
  .nx-race__sub { font-size: 0.73rem; }
  .nx-profile-avatar { width: 74px; height: 74px; flex-basis: 74px; border-radius: 21px; }
  .nx-profile-avatar span { font-size: 1.9rem; }
  .nx-profile-avatar::before { inset: -7px; border-radius: 27px; }
  .nx-profile-medal strong { font-size: 1.9rem; }
  .nx-solve-time-col { display: none !important; }
  .nx-profile-panel { padding: 16px 14px; }
  .nx-profile-panel__head h2 { font-size: 1.24rem; }
}

/* ---------- 15. Motion / a11y ---------- */
@keyframes nx-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes nx-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.55; transform: scale(0.82); } }
@keyframes nx-float { 0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); } 50% { transform: translate3d(-14px, 18px, 0) rotate(8deg); } }
@keyframes nx-spin { to { transform: rotate(360deg); } }
@keyframes nx-orbit { to { transform: rotate(360deg); } }
@keyframes nx-trace { to { stroke-dashoffset: 0; } }

.nx-reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--nx-ease), transform 0.6s var(--nx-ease); }
.nx-reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .nx-reveal { opacity: 1; transform: none; }
}

/* Print */
@media print {
  .nx-sidebar, .nx-topbar, .nx-bottomnav, .nx-footer, .nx-cat-rail { display: none !important; }
  .nx-shell { margin: 0; }
  body { background: #fff; color: #000; }
}

/* ---------- 16. Setup & final adjustments ---------- */
.nx-setup .nx-setup-head {
  position: relative;
  padding: clamp(34px, 6vw, 64px) 20px 8px;
}
.nx-setup-head__inner { max-width: 980px; margin: 0 auto; }
.nx-setup-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 28px; }
.nx-setup-brand img { width: 34px; height: 34px; }
.nx-setup-brand span {
  font-family: var(--nx-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  background: var(--nx-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nx-setup-brand small {
  margin-left: 4px;
  padding-left: 13px;
  border-left: 1px solid var(--nx-line-strong);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--nx-dim);
}
.nx-setup-title { font-size: clamp(2.2rem, 5vw, 3.5rem); margin: 4px 0 10px; letter-spacing: -0.045em; }
.nx-setup-sub { max-width: 560px; color: var(--nx-muted); font-size: 0.93rem; }
.nx-setup .nx-setup-card {
  max-width: 980px;
  margin: 26px auto 64px;
  padding: 28px clamp(16px, 3.4vw, 40px) 36px;
  border-radius: var(--nx-radius-lg);
  border: 1px solid var(--nx-line);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.65), rgba(7, 11, 21, 0.82));
  box-shadow: var(--nx-shadow);
}
.nx-setup .nx-setup-card > .col-12 { padding: 0; }
.nx-setup .nav-pills { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; border-radius: 12px; border: 1px solid var(--nx-line); background: rgba(3, 6, 14, 0.4); }
.nx-setup .nav-pills .nav-link { flex: 1 1 auto; text-align: center; white-space: nowrap; }
.nx-setup .tab-content { border: 0; background: transparent; padding: 22px 2px 0; }
.nx-setup .card { background: rgba(10, 16, 30, 0.55) !important; }
.nx-setup .form-text { color: var(--nx-dim) !important; }
.nx-setup .text-right { text-align: right; }
.nx-setup h1, .nx-setup h2, .nx-setup h3, .nx-setup h4, .nx-setup h5 { text-transform: none; }

/* Stagger challenge cards */
@keyframes nx-card-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.nx-challenge-card { animation: nx-card-in 0.42s var(--nx-ease) both; }
.nx-challenge-grid .nx-challenge-card:nth-child(2) { animation-delay: 0.035s; }
.nx-challenge-grid .nx-challenge-card:nth-child(3) { animation-delay: 0.07s; }
.nx-challenge-grid .nx-challenge-card:nth-child(4) { animation-delay: 0.105s; }
.nx-challenge-grid .nx-challenge-card:nth-child(5) { animation-delay: 0.14s; }
.nx-challenge-grid .nx-challenge-card:nth-child(6) { animation-delay: 0.175s; }
.nx-challenge-grid .nx-challenge-card:nth-child(7) { animation-delay: 0.21s; }
.nx-challenge-grid .nx-challenge-card:nth-child(8) { animation-delay: 0.245s; }

/* Settings grid children */
.nx-settings-grid > * { min-width: 0; width: auto !important; max-width: 100% !important; }
.nx-settings-grid .tab-pane { animation: nx-fade-in 0.35s var(--nx-ease); }

/* Auth layout: keep the shell clear of padding */
.auth-layout .nx-main { padding: 0 !important; }
.auth-layout .nx-shell { min-height: 100vh; }

/* Mobile auth tweaks */
@media (max-width: 767px) {
  .nx-setup .nx-setup-head { padding-top: 28px; }
  .nx-setup .nx-setup-card { margin: 18px 12px 40px; padding: 20px 14px 28px; }
  .nx-auth__panel { justify-content: flex-start; }
  .nx-auth__card { padding-top: 6px; }
}

/* Generic input groups */
.input-group { display: flex; width: 100%; }
.input-group > .form-control { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.input-group > .btn { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }

/* Cleaner default page containers (profiles etc.) */
.nx-main .container > .row > [class*="col-"] > .jumbotron:first-child { padding-top: 0; }
.nx-main .jumbotron .container { padding-left: 0; padding-right: 0; }
.nx-main .table-responsive { background: rgba(9, 14, 26, 0.45); }
.nx-main .table-responsive .table { margin-bottom: 0; }

/* Keep modals above the sidebar */
.modal-backdrop { z-index: 1050; }
.modal { z-index: 1055; }
#challenge-window { z-index: 1065; }
