/* AtlasCTF: approved light palette and GitHub Dimmed adaptation. */
/* Keep hidden and revealed submissions inside the challenge dialog. */
#challenge-window #submissions table {
  width: 100%;
  table-layout: fixed;
}
#challenge-window #submissions th:first-child { width: 38%; }
#challenge-window #submissions th:nth-child(2) { width: 30%; }
#challenge-window #submissions th:last-child { width: 32%; }
#challenge-window #submissions td {
  overflow-wrap: anywhere;
}
#challenge-window #submissions code {
  white-space: normal;
  overflow-wrap: anywhere;
}
html:root {
  --bs-body-font-family: var(--atlas-font);
  --bs-body-bg: var(--atlas-canvas);
  --bs-body-color: var(--atlas-text);
  --bs-heading-color: var(--atlas-text);
  --bs-secondary-color: var(--atlas-muted);
  --bs-tertiary-color: var(--atlas-muted);
  --bs-secondary-bg: var(--atlas-tag);
  --bs-tertiary-bg: var(--atlas-surface);
  --bs-border-color: var(--atlas-line);
  --bs-link-color: var(--atlas-accent);
  --bs-link-hover-color: var(--atlas-hover);
  --bs-primary: var(--atlas-accent);
  --bs-primary-bg-subtle: var(--atlas-tint);
  --bs-primary-text-emphasis: var(--atlas-accent);
  --bs-emphasis-color: var(--atlas-text);
  color-scheme: light;
  accent-color: var(--atlas-accent);
  scrollbar-color: var(--atlas-control-line) var(--atlas-canvas);
}
html:root[data-bs-theme="dark"] {
  color-scheme: dark;
}
html:root body,
html:root h1,
html:root h2,
html:root h3,
html:root h4,
html:root h5,
html:root h6,
html:root button,
html:root input,
html:root select,
html:root textarea { font-family: var(--atlas-font); }
html:root body { font-size: 1rem; line-height: 1.6; }
html:root h1,
html:root h2 { font-weight: 600; letter-spacing: -.025em; }
html:root .navbar {
  background: var(--atlas-canvas) !important;
  border-bottom: 1px solid var(--atlas-line);
  --bs-navbar-color: var(--atlas-muted);
  --bs-navbar-hover-color: var(--atlas-text);
  --bs-navbar-active-color: var(--atlas-text);
  --bs-navbar-brand-color: var(--atlas-text);
  --bs-navbar-brand-hover-color: var(--atlas-accent);
}
html:root .navbar-brand { font-weight: 600; letter-spacing: -.025em; }
html:root .navbar-toggler { border-color: var(--atlas-control-line); color: var(--atlas-text); }
html:root[data-bs-theme="light"] .navbar-toggler-icon { filter: invert(1); }
html:root .jumbotron { background: var(--atlas-canvas) !important; color: var(--atlas-text); border-bottom: 1px solid var(--atlas-line); }
html:root .atlas-home { line-height: 1.8; }
html:root .atlas-home .atlas-intro { max-width: 72ch; }
html:root .atlas-home h1 { font-weight: 600; letter-spacing: -.035em; }
html:root .atlas-home h2 { font-weight: 600; }
html:root .atlas-home .atlas-subtitle { font-weight: 400; }
html:root .atlas-home a:not(.btn) { text-decoration: underline !important; text-underline-offset: 4px; }
html:root .btn-primary {
  --bs-btn-bg: var(--atlas-accent);
  --bs-btn-border-color: var(--atlas-accent);
  --bs-btn-color: var(--atlas-button-text);
  --bs-btn-hover-bg: var(--atlas-hover);
  --bs-btn-hover-border-color: var(--atlas-hover);
  --bs-btn-hover-color: var(--atlas-button-text);
  --bs-btn-active-bg: var(--atlas-hover);
  --bs-btn-active-border-color: var(--atlas-hover);
  --bs-btn-active-color: var(--atlas-button-text);
}
html:root .btn-outline-secondary { --bs-btn-color: var(--atlas-muted); --bs-btn-border-color: var(--atlas-control-line); --bs-btn-hover-bg: var(--atlas-tint); --bs-btn-hover-color: var(--atlas-text); }
html:root .challenge-button {
  background: var(--atlas-surface) !important;
  color: var(--atlas-text) !important;
  border: 1px solid var(--atlas-line) !important;
  border-radius: 8px;
  box-shadow: none !important;
  --bs-btn-hover-color: var(--atlas-text);
}
html:root .challenge-button:hover { background: var(--atlas-tint) !important; border-color: var(--atlas-control-line) !important; }
html:root .challenge-button .challenge-inner > p { font-weight: 500; line-height: 1.45; }
html:root .challenge-button .challenge-inner > span { font-weight: 500; font-variant-numeric: tabular-nums; color: var(--atlas-muted); }
html:root .challenge-button.challenge-solved { background: var(--atlas-solved) !important; border-color: var(--atlas-control-line) !important; color: var(--atlas-solved-text) !important; }
html:root .challenge-button.challenge-solved:hover { background: var(--atlas-solved-hover) !important; }
html:root .atlas-card-tags .badge,
html:root .badge.bg-info { background: var(--atlas-tag) !important; color: var(--atlas-text) !important; font-weight: 400; }
html:root .atlas-chip {
  color: var(--atlas-muted) !important;
  border-color: var(--atlas-line) !important;
  background: transparent !important;
  opacity: 1;
}
html:root .atlas-chip .n,
html:root .atlas-tag-filter .label { opacity: 1; }
html:root .atlas-chip.active,
html:root .atlas-chip[aria-pressed="true"] { color: var(--atlas-button-text) !important; background: var(--atlas-accent) !important; border-color: var(--atlas-accent) !important; }
html:root .challenge-button > .atlas-admin-solve-count { color: var(--atlas-muted); background: var(--atlas-tag); }
html:root[data-bs-theme="dark"] .atlas-chip:not(.active) { border-color: var(--atlas-control-line) !important; }
html:root[data-bs-theme="dark"] .challenge-button,
html:root[data-bs-theme="dark"] .challenge-button:hover,
html:root[data-bs-theme="dark"] .challenge-button.challenge-solved { border-color: transparent !important; }
html:root .challenge-solved .challenge-inner > span,
html:root .challenge-solved .atlas-admin-prerequisites-card { color: var(--atlas-solved-text); }
html:root .challenge-solved .atlas-card-tags .badge,
html:root .challenge-solved .atlas-admin-solve-count { background: var(--atlas-solved-tag) !important; color: var(--atlas-solved-tag-text) !important; }
html:root .modal-content,
html:root .dropdown-menu { background: var(--atlas-surface); color: var(--atlas-text); border-color: var(--atlas-line); }
html:root .nav-tabs .nav-link { color: var(--atlas-muted); }
html:root .nav-tabs .nav-link.active { color: var(--atlas-accent); background: var(--atlas-surface); border-color: var(--atlas-line); }
html:root .form-control { background: var(--atlas-canvas); border-color: var(--atlas-control-line); color: var(--atlas-text); caret-color: var(--atlas-accent); }
html:root .form-control::placeholder { color: var(--atlas-muted); opacity: 1; }
html:root .text-muted { color: var(--atlas-muted) !important; }
html:root :focus-visible { outline: 2px solid var(--atlas-accent); outline-offset: 4px; box-shadow: none; }
html:root ::selection { background: var(--atlas-accent); color: var(--atlas-button-text); }
@media (prefers-reduced-motion: no-preference) {
  html:root .challenge-button { transition: background-color .16s ease-out, border-color .16s ease-out; }
}

/* Match Bootstrap helpers to the palette on every public page. */
html:root {
  --bs-primary-rgb: 35, 102, 83;
  --bs-link-color-rgb: 35, 102, 83;
  --bs-link-hover-color-rgb: 25, 79, 64;
  --bs-body-color-rgb: 38, 51, 47;
  --bs-body-bg-rgb: 246, 245, 240;
  --bs-secondary-color-rgb: 91, 105, 99;
}
html:root[data-bs-theme="dark"] {
  --bs-primary-rgb: 83, 155, 245;
  --bs-link-color-rgb: 83, 155, 245;
  --bs-link-hover-color-rgb: 117, 175, 247;
  --bs-body-color-rgb: 242, 242, 242;
  --bs-body-bg-rgb: 29, 29, 29;
  --bs-secondary-color-rgb: 201, 201, 201;
}
html:root .challenge-solved .atlas-admin-prerequisites-card { color: var(--atlas-solved-text); opacity: 1; }
