:root {
  --archive-border: rgba(120, 120, 120, 0.22);
}

body {
  min-height: 100vh;
}

a {
  text-decoration: none;
}

.archive-hero,
.search-panel,
.filter-bar,
.challenge-card,
.metadata-panel,
.auth-panel,
.admin-form {
  border: 1px solid var(--archive-border);
  border-radius: 8px;
  background: var(--bs-body-bg);
}

.archive-hero {
  padding: clamp(1.5rem, 4vw, 3rem);
}

.search-panel,
.filter-bar,
.metadata-panel,
.auth-panel,
.admin-form {
  padding: 1.25rem;
}

.challenge-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  min-height: 190px;
}

.challenge-card.is-solved {
  border-color: rgba(25, 135, 84, 0.55);
}

.challenge-card-footer {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.challenge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.section-heading h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--bs-secondary-color);
  margin-bottom: .75rem;
}

.tag-cloud,
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.tag-filter-group,
.active-filters,
.challenge-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

.tag-filter-group {
  max-height: 8.5rem;
  overflow-y: auto;
  padding: .25rem;
  border: 1px solid var(--archive-border);
  border-radius: 8px;
}

.tag-filter {
  --bs-btn-padding-y: .2rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .55rem;
  border: 1px solid var(--archive-border);
  border-radius: 999px;
  color: var(--bs-body-color);
  background: var(--bs-tertiary-bg);
  font-size: .875rem;
}

.filter-chip:hover {
  color: var(--bs-body-color);
  background: var(--bs-secondary-bg);
}

.challenge-meta span:not(:last-child)::after {
  content: "·";
  margin-left: .5rem;
  color: var(--bs-secondary-color);
}

.tags .badge {
  border: 1px solid var(--archive-border);
}

.difficulty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 1.5rem;
  padding: 0 .45rem;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
  line-height: 1;
}

.difficulty-low {
  background: #198754;
}

.difficulty-medium {
  background: #b58100;
}

.difficulty-high {
  background: #d05f00;
}

.difficulty-extreme {
  background: #b02a37;
}

.description-body {
  line-height: 1.65;
  white-space: pre-wrap;
}

.code-value {
  font-family: var(--bs-font-monospace);
  font-size: .85rem;
}

.auth-wrap {
  max-width: 420px;
  margin: 2rem auto;
}

.flash-stack {
  margin-bottom: 1rem;
}

.theme-toggle {
  min-width: 4.5rem;
}

.theme-toggle [data-theme-label] {
  display: none;
}

:root[data-bs-theme="dark"] .theme-toggle [data-theme-label="light"],
:root[data-bs-theme="light"] .theme-toggle [data-theme-label="dark"] {
  display: inline;
}
