/* Past results page */

.history-page {
  background:
    radial-gradient(circle at 8% 12%, rgba(244, 201, 93, 0.18), transparent 28%),
    radial-gradient(circle at 92% 8%, rgba(233, 101, 69, 0.1), transparent 24%),
    var(--paper);
}

.history-stage {
  flex: 1;
  padding: 54px 0 72px;
}

.history-wrap {
  width: min(920px, 100%);
  margin: 0 auto;
}

.history-chip i {
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(233, 101, 69, 0.12);
}

.history-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: color 160ms ease;
}

.history-back:hover {
  color: var(--coral-deep);
}

.history-back svg {
  width: 14px;
  height: 14px;
}

.history-hero {
  margin-bottom: 38px;
}

.history-title {
  margin: 17px 0 0;
  font-family: var(--font-display);
  font-size: clamp(42px, 6.5vw, 68px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.history-title em {
  color: var(--coral);
  font-style: normal;
}

.history-intro {
  max-width: 560px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
  letter-spacing: 0.015em;
}

.history-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 19px;
  padding: 10px 15px;
  border-radius: 999px;
  color: var(--card-bright);
  background: var(--ink);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition:
    transform 160ms ease,
    background-color 160ms ease;
}

.history-cta:hover {
  transform: translateY(-1px);
  background: #29382d;
}

.history-cta svg {
  width: 14px;
  height: 14px;
}

.history-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line-strong);
}

.history-panel-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.history-panel-head h2 {
  margin: 5px 0 0;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.history-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.5);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.history-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 56px 16px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

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

.history-card {
  padding: 24px 25px 22px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.92), rgba(255, 250, 241, 0.76));
  box-shadow:
    0 18px 40px -34px rgba(64, 49, 27, 0.45),
    0 3px 12px -8px rgba(64, 49, 27, 0.12);
  animation: history-card-in 480ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
  animation-delay: calc(var(--history-index, 0) * 70ms);
}

.history-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.history-card-index {
  color: var(--coral);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.history-card-date {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.history-card-question {
  margin: 10px 0 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.history-card-desc {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.history-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 10px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.025em;
}

.history-type {
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(31, 44, 35, 0.06);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.history-type.is-photo {
  color: #8a4a2b;
  background: #f8e2d6;
}

.history-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.history-winner {
  margin-left: auto;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--coral-deep);
  background: rgba(233, 101, 69, 0.08);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.history-result-list {
  margin-top: 19px;
}

.history-result-list .result-track {
  height: 7px;
}

.history-result-list .result-percent {
  font-size: 18px;
}

.history-result-list .result-row {
  animation: none;
}

.history-empty,
.history-error {
  padding: 38px 22px 32px;
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
  text-align: center;
  background: rgba(255, 253, 248, 0.42);
}

.history-empty-mark,
.history-error-mark {
  width: 50px;
  height: 50px;
  margin: 0 auto 15px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--coral-deep);
  background: rgba(233, 101, 69, 0.09);
}

.history-empty-mark svg {
  width: 26px;
  height: 26px;
}

.history-error-mark {
  border: 1px solid rgba(201, 78, 50, 0.3);
  color: var(--coral-deep);
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
}

.history-empty h3,
.history-error h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.history-empty p,
.history-error p {
  max-width: 390px;
  margin: 9px auto 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.history-empty .history-cta {
  margin-top: 17px;
}

.history-retry {
  margin-top: 17px;
  padding: 9px 17px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background-color 160ms ease;
}

.history-retry:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}

@keyframes history-card-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .history-stage {
    padding: 42px 0 60px;
  }

  .history-title {
    font-size: clamp(38px, 8vw, 54px);
  }
}

@media (max-width: 640px) {
  .history-back {
    padding-left: 12px;
    font-size: 9px;
  }

  .history-chip {
    padding: 6px 9px;
    font-size: 8.5px;
  }

  .history-stage {
    padding: 31px 0 48px;
  }

  .history-hero {
    margin-bottom: 29px;
  }

  .history-title {
    font-size: clamp(36px, 10.4vw, 48px);
    line-height: 1.08;
  }

  .history-intro {
    font-size: 11.5px;
  }

  .history-panel-head h2 {
    font-size: 22px;
  }

  .history-card {
    padding: 18px 16px 17px;
    border-radius: 20px;
  }

  .history-card-question {
    font-size: 22px;
  }

  .history-card-desc {
    font-size: 10px;
  }

  .history-winner {
    margin-left: 0;
  }

  .history-result-list {
    margin-top: 16px;
  }

  .history-result-list .result-percent {
    font-size: 16px;
  }

  .history-empty,
  .history-error {
    padding: 30px 16px 26px;
  }

  .history-empty h3,
  .history-error h3 {
    font-size: 19px;
  }

  .footer-history-link {
    letter-spacing: 0.08em;
  }
}

@media (max-width: 400px) {
  .history-chip {
    display: none;
  }
}
