/* History page — "The Observatory" archive ledger. */
.history-shell {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 88px;
}

.history-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.history-hero p {
  margin: 0 0 10px;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.history-hero p::before {
  content: "// ";
}

.history-hero h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--text);
}

.history-hero > div > span,
.history-toolbar > span {
  color: var(--subtle);
  font-size: 13px;
}

.history-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.history-metrics article {
  display: grid;
  gap: 8px;
  min-width: 130px;
  padding: 18px;
  background: var(--surface);
}

.history-metrics span,
.history-outcomes span {
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-metrics strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  color: var(--text);
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0;
  flex-wrap: wrap;
}

.history-filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.history-toolbar button {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  padding: 8px 15px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.history-toolbar button:hover {
  color: var(--text);
  border-color: var(--line-glow);
}

.history-toolbar button.active {
  border-color: transparent;
  background: var(--brand-grad);
  color: #04140d;
}

.history-toolbar > span {
  font-family: var(--font-mono);
  font-size: 12px;
}

.history-list {
  display: grid;
  gap: 14px;
}

.history-card,
.history-empty {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.history-card {
  border-left-width: 4px;
}

.history-card.correct {
  border-left-color: var(--green);
}

.history-card.incorrect {
  border-left-color: var(--rose-strong);
}

.history-card-status,
.history-card footer,
.history-outcomes {
  display: flex;
  align-items: center;
}

.history-card-status,
.history-card footer {
  justify-content: space-between;
  gap: 16px;
}

.history-card-status span,
.history-card-status strong {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-card-status span {
  color: var(--subtle);
}

.history-card.correct .history-card-status strong {
  color: var(--green);
}

.history-card.incorrect .history-card-status strong {
  color: var(--rose);
}

.history-card h2 {
  margin: 16px 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
  overflow-wrap: anywhere;
}

.history-outcomes {
  gap: 1px;
  background: var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.history-outcomes div {
  display: grid;
  flex: 1;
  gap: 6px;
  padding: 13px;
  background: var(--track);
}

.history-outcomes strong {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
}

.history-card p {
  margin: 18px 0;
  color: var(--muted);
  line-height: 1.6;
}

.history-card footer {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 12px;
}

.history-card footer a {
  color: var(--green);
  font-weight: 700;
}

@media (max-width: 760px) {
  .history-hero {
    grid-template-columns: 1fr;
  }

  .history-metrics {
    grid-template-columns: 1fr;
  }

  .history-outcomes {
    display: grid;
  }

  .history-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-filter-group {
    width: 100%;
  }

  .history-toolbar button {
    flex: 1 1 auto;
  }

  .history-card,
  .history-empty {
    padding: 16px;
  }

  .history-outcomes {
    grid-template-columns: 1fr;
  }
}
