/* History landing — VIP activity ledger */

.history-page {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

.history-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(42vh, 380px);
  padding: clamp(2.5rem, 6vw, 4rem) 1.25rem;
  overflow: hidden;
  background-color: #05020c;
  background-image: url("../assets/history-hero-bg.jpg");
  background-position: center center;
  background-size: cover;
  border-bottom: 1px solid var(--border);
}

.history-hero__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      105deg,
      rgba(5, 2, 12, 0.78) 0%,
      rgba(5, 2, 12, 0.4) 50%,
      rgba(5, 2, 12, 0.65) 100%
    ),
    linear-gradient(180deg, rgba(5, 2, 12, 0.35) 0%, transparent 45%, rgba(5, 2, 12, 0.6) 100%);
}

.history-hero__inner {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  text-align: center;
}

.history-hero__eyebrow {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fff4c4;
  text-shadow: 0 0 16px rgba(240, 208, 96, 0.4);
}

.history-hero__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5.5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.05;
  color: #ffe9a8;
  text-shadow:
    0 2px 24px rgba(0, 0, 0, 0.55),
    0 0 36px rgba(240, 208, 96, 0.32);
}

.history-hero__lead {
  margin: 0 auto;
  max-width: 34ch;
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.5;
  color: #e8dcf5;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

.history-band {
  position: relative;
  flex: 1;
  padding: clamp(2.5rem, 6vw, 4rem) 1.25rem 3.5rem;
  overflow: hidden;
  background-color: #080414;
  background-image: url("../assets/history-list-bg.jpg");
  background-position: center center;
  background-size: cover;
  border-bottom: 1px solid var(--border);
}

.history-band__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 2, 12, 0.7) 0%, rgba(5, 2, 12, 0.55) 40%, rgba(5, 2, 12, 0.8) 100%),
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(107, 47, 181, 0.2), transparent 60%);
}

.history-band__inner {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  margin: 0 auto;
}

.history-card {
  --border-w: 2px;
  position: relative;
  padding: 1.5rem 1.35rem 1.35rem;
  border-radius: 18px;
  isolation: isolate;
  background: linear-gradient(160deg, rgba(28, 12, 52, 0.94), rgba(8, 4, 18, 0.96));
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5), 0 0 36px rgba(107, 47, 181, 0.25);
  backdrop-filter: blur(12px);
}

.history-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  padding: var(--border-w);
  pointer-events: none;
  background: conic-gradient(
    from var(--border-angle),
    #4a1a78 0%,
    #b8922a 12%,
    #fff6c8 20%,
    #f0d060 28%,
    #6b2fb5 42%,
    #d4af37 55%,
    #ffe9a8 64%,
    #5a2499 78%,
    #c9a227 90%,
    #4a1a78 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: borderAngleSpin var(--rim-duration) linear infinite;
}

.history-card__head,
.history-card .ledger-list,
.history-card__actions {
  position: relative;
  z-index: 1;
}

.history-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.22);
}

.history-card__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffe9a8;
}

.history-card__head p {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #cbb8e0;
}

.history-page .ledger-list {
  max-height: min(52vh, 480px);
  overflow-y: auto;
  padding-right: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.45) transparent;
}

.history-page .ledger-list li {
  align-items: center;
  padding: 0.75rem 0.35rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
  color: #e8dcf5;
}

.history-page .ledger-list li:hover {
  background: rgba(240, 208, 96, 0.05);
  border-radius: 8px;
}

.history-page .ledger-list strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: #fff4c4;
}

.history-page .ledger-list .muted {
  font-size: 0.78rem;
  color: #a89bb8;
}

.history-page .amount-pos {
  color: #8ef0c0;
  text-shadow: 0 0 10px rgba(94, 207, 154, 0.35);
}

.history-page .amount-neg {
  color: #f0a090;
}

.history-page .empty-state {
  padding: 1.5rem 0.5rem;
  text-align: center;
  color: #cbb8e0;
  border-bottom: none !important;
  display: block;
}

.history-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(212, 175, 55, 0.18);
}

.history-card__actions .btn {
  text-decoration: none;
}

.history-card__actions .btn:hover {
  text-decoration: none;
}

@media (max-width: 900px) {
  .history-band__inner,
  .history-hero__inner {
    width: min(720px, 100%);
  }
}

@media (max-width: 720px) {
  .history-hero {
    min-height: min(40vh, 340px);
    padding-inline: max(0.85rem, env(safe-area-inset-left)) max(0.85rem, env(safe-area-inset-right));
  }

  .history-band {
    padding-inline: max(0.85rem, env(safe-area-inset-left)) max(0.85rem, env(safe-area-inset-right));
  }
}

@media (max-width: 520px) {
  .history-hero {
    min-height: min(36vh, 300px);
  }

  .history-card__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .history-card__actions {
    flex-direction: column;
  }

  .history-card__actions .btn {
    width: 100%;
    text-align: center;
  }
}
