:root {
  --history-radius: 16px;
  --history-motion: 200ms ease-out;
}

.history-page {
  width: 100%;
  min-width: 0;
  margin: 24px auto 0;
}

.history-panel {
  --history-accent: #a78bfa;
  --history-accent-rgb: 167, 139, 250;
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(var(--history-accent-rgb), 0.34);
  border-radius: var(--history-radius);
  background:
    radial-gradient(circle at 12% 0%, rgba(var(--history-accent-rgb), 0.16), transparent 34%),
    linear-gradient(145deg, rgba(9, 13, 26, 0.98), rgba(17, 15, 30, 0.98));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42), 0 0 26px rgba(var(--history-accent-rgb), 0.08);
}

.history-panel--ruby {
  --history-accent: #a78bfa;
  --history-accent-rgb: 167, 139, 250;
}

.history-panel--gold {
  --history-accent: #f8d43b;
  --history-accent-rgb: 248, 212, 59;
  background:
    radial-gradient(circle at 12% 0%, rgba(248, 212, 59, 0.14), transparent 34%),
    linear-gradient(145deg, rgba(18, 15, 17, 0.98), rgba(9, 12, 24, 0.98));
}

.history-panel--forest {
  --history-accent: #86efac;
  --history-accent-rgb: 134, 239, 172;
  background:
    radial-gradient(circle at 12% 0%, rgba(34, 197, 94, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(7, 22, 22, 0.98), rgba(9, 12, 24, 0.98));
}

.history-panel--atm {
  --history-accent: #f59e0b;
  --history-accent-rgb: 245, 158, 11;
  background:
    linear-gradient(145deg, #17110d, #080d19 58%, #111827);
  border-color: rgba(245, 158, 11, 0.38);
}

.history-panel::before,
.history-panel::after {
  content: none;
  display: none;
}

.history-section {
  min-width: 0;
  padding: clamp(16px, 2.4vw, 24px);
}

.history-title {
  margin: 0 0 16px;
  padding: 0;
  color: #fff;
  font-family: "Chakra Petch", sans-serif;
  font-size: clamp(1.3rem, 2.5vw, 1.72rem);
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-shadow: none;
}

.history-title::after {
  content: "";
  display: block;
  width: 88px;
  height: 3px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--history-accent), transparent);
  box-shadow: 0 0 14px rgba(var(--history-accent-rgb), 0.5);
}

.history-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid rgba(var(--history-accent-rgb), 0.22);
  border-radius: 12px;
  background: rgba(5, 9, 20, 0.9);
  scrollbar-color: var(--history-accent) rgba(5, 9, 20, 0.9);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.history-table-wrap:focus-visible {
  outline: 3px solid var(--history-accent);
  outline-offset: 3px;
}

.history-table {
  width: 100%;
  min-width: 760px;
  margin: 0;
  border-collapse: collapse;
  color: #e8edf7;
  font-family: "Inter", Arial, sans-serif;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.history-table th,
.history-table tbody td {
  padding: 11px 12px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  line-height: 1.4;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.history-table th:last-child,
.history-table tbody td:last-child {
  border-right: 0;
}

.history-table th {
  height: 44px;
  color: #fff;
  background: rgba(var(--history-accent-rgb), 0.18);
  font-family: "Chakra Petch", sans-serif;
  font-weight: 800;
  text-shadow: none;
}

.history-table tbody td {
  color: #e8edf7;
  background: rgba(8, 13, 24, 0.94);
}

.history-table tbody tr:nth-child(even) td {
  background: rgba(13, 19, 32, 0.96);
}

.history-table tbody tr:hover td {
  background: rgba(var(--history-accent-rgb), 0.09);
  transition: background-color var(--history-motion);
}

.history-table tbody td:nth-child(3),
.history-table tbody td:nth-child(5) {
  color: #bfdbfe;
}

.history-table tbody td:nth-child(4),
.history-table tbody td:nth-child(6) {
  color: var(--history-accent);
  font-weight: 700;
}

.history-table tbody td[colspan] {
  padding: 22px 14px;
  color: #cbd5e1;
  text-align: center;
  white-space: normal;
}

.history-main {
  width: min(1120px, calc(100% - 24px));
  min-width: 0;
  margin: 0 auto 56px;
  overflow-x: clip;
}

.history-page--atm,
.history-page--atm .history-title,
.history-page--atm .history-table,
.history-page--atm .history-table th,
.history-page--atm .history-table td {
  filter: none;
  opacity: 1;
  text-shadow: none;
}

.history-page--atm .history-table {
  min-width: 680px;
}

.history-page--atm .history-table th {
  color: #ffffff;
  background: #4a2f17;
  border-bottom-color: rgba(245, 158, 11, 0.34);
}

.history-page--atm .history-table tbody td {
  color: #f5f5f5;
}

.history-page--atm .history-table tbody td:nth-child(3),
.history-page--atm .history-table tbody td:nth-child(4),
.history-page--atm .history-table tbody td:nth-child(5) {
  color: #f5f5f5;
}

.history-amount {
  color: #ffd166 !important;
  font-weight: 800;
}

.history-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.history-status.is-success {
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
}

.history-status.is-pending {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.12);
}

.history-status.is-error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
}

.history-empty {
  color: #cbd0dc !important;
  font-weight: 700;
  white-space: normal !important;
}

@media (max-width: 768px) {
  .history-main {
    width: min(100% - 16px, 1120px);
    margin-bottom: 40px;
  }

  .history-page {
    margin-top: 16px;
  }

  .history-section {
    padding: 15px 10px 17px;
  }

  .history-table {
    min-width: 720px;
    font-size: 0.82rem;
  }

  .history-page--atm .history-table {
    min-width: 660px;
    font-size: 0.85rem;
  }

  .history-table th,
  .history-table tbody td {
    padding: 10px 9px;
  }
}

@media (max-width: 430px) {
  .history-table {
    min-width: 680px;
  }

  .history-page--atm .history-table {
    min-width: 640px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .history-table tbody tr:hover td {
    transition: none;
  }
}
