
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #02030a;
  --bg-alt: #070a18;
  --card: rgba(11, 15, 36, 0.96);
  --card-soft: rgba(20, 26, 63, 0.96);
  --border-strong: rgba(255, 215, 128, 0.8);
  --border-soft: rgba(255, 215, 128, 0.25);
  --accent: #ffd166;
  --accent-soft: #ffb347;
  --accent-strong: #ffe89a;
  --text: #f7f8ff;
  --muted: #9ea4d1;
  --danger: #ff6b6b;
  --radius-lg: 18px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.75);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-main);
  background:
    radial-gradient(circle at 0% 0%, #2a1a4a 0, transparent 60%),
    radial-gradient(circle at 100% 0%, #203d6b 0, transparent 55%),
    radial-gradient(circle at 50% 100%, #23134a 0, transparent 55%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 16px 40px;
}

.hero {
  padding: 12px 12px 28px;
  background: linear-gradient(135deg, rgba(9, 11, 31, 0.96), rgba(14, 17, 46, 0.98));
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid transparent;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 215, 128, 0.2)) border-box;
  mask-composite: exclude;
  pointer-events: none;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.logo-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.08), transparent 55%);
  text-decoration: none;
  color: var(--muted);
  font-size: 0.78rem;
}

.logo-pill img {
  height: 20px;
  width: auto;
}

.hero-main h1 {
  margin: 0 0 6px;
  font-size: 1.9rem;
  letter-spacing: 0.03em;
}

.hero-main .hero-subtitle {
  margin: 0;
  font-size: 0.96rem;
  color: var(--muted);
  max-width: 620px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-actions.primary-row {
  margin-top: 22px;
}

.hero-actions.secondary-row {
  margin-top: 10px;
  opacity: 0.92;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.16s ease-out;
  white-space: nowrap;
}

.btn.primary {
  background: linear-gradient(135deg, #f9d977, #f6b35f);
  color: #1b102c;
  box-shadow: 0 0 0 1px rgba(255, 215, 128, 0.4), 0 12px 30px rgba(0, 0, 0, 0.65);
}

.btn.secondary {
  background: rgba(11, 16, 43, 0.8);
  color: var(--accent-strong);
  border-color: rgba(255, 215, 128, 0.45);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn.accent {
  background: rgba(255, 215, 128, 0.08);
  color: var(--accent-strong);
  border-color: rgba(255, 215, 128, 0.7);
}

.btn.outline {
  background: rgba(7, 9, 24, 0.85);
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.14);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(255, 215, 128, 0.6), 0 14px 30px rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 215, 128, 0.8);
}

/* Main content */

.main {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.1fr);
  gap: 18px;
}

.summary-card {
  padding: 16px 18px 18px;
  border-radius: 22px;
  background: linear-gradient(145deg, var(--card), var(--card-soft));
  border: 1px solid var(--border-soft);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.summary-card h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.summary-value {
  margin: 4px 0;
  font-size: 1.8rem;
  font-weight: 600;
}

.summary-caption {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.summary-card ul {
  margin: 6px 0 0 1.2rem;
  padding: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.summary-card li + li {
  margin-top: 4px;
}

/* Table */

.table-section {
  margin-top: 4px;
}

.table-card {
  padding: 16px 18px 18px;
  border-radius: 26px;
  background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.03), transparent 60%), var(--card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.table-header h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.table-header p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.table-wrapper {
  margin-top: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

thead {
  background: linear-gradient(90deg, rgba(9, 13, 40, 0.98), rgba(18, 23, 59, 0.98));
}

th, td {
  padding: 9px 10px;
}

th {
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: left;
}

tbody tr:nth-child(odd) {
  background: rgba(10, 12, 30, 0.98);
}

tbody tr:nth-child(even) {
  background: rgba(7, 9, 24, 0.98);
}

tbody tr:nth-child(1) {
  box-shadow: inset 3px 0 0 rgba(255, 215, 128, 0.8);
}

tbody tr:nth-child(2) {
  box-shadow: inset 3px 0 0 rgba(192, 192, 192, 0.8);
}

tbody tr:nth-child(3) {
  box-shadow: inset 3px 0 0 rgba(205, 127, 50, 0.9);
}

tbody tr:hover {
  background: rgba(22, 28, 68, 0.98);
}

.loading {
  text-align: center;
  padding: 14px 10px;
  color: var(--muted);
}

/* Column alignment */

#combined-leaderboard th:nth-child(1),
#combined-leaderboard td:nth-child(1) {
  width: 40px;
  text-align: right;
}

#combined-leaderboard th:nth-child(2),
#combined-leaderboard td:nth-child(2) {
  text-align: left;
  min-width: 150px;
}

#combined-leaderboard th:nth-child(3),
#combined-leaderboard td:nth-child(3),
#combined-leaderboard th:nth-child(4),
#combined-leaderboard td:nth-child(4),
#combined-leaderboard th:nth-child(5),
#combined-leaderboard td:nth-child(5) {
  text-align: right;
  white-space: nowrap;
}

/* Disclaimer & footer */

.disclaimer {
  padding: 14px 16px 16px;
  border-radius: 18px;
  background: rgba(7, 9, 22, 0.95);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  font-size: 0.84rem;
  color: var(--muted);
}

.disclaimer h2 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-strong);
}

.footer {
  margin-top: 10px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Responsive */

@media (max-width: 900px) {
  .summary-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .hero {
    padding: 14px 12px 20px;
  }
  .hero-main h1 {
    font-size: 1.4rem;
  }
  .hero-main .hero-subtitle {
    font-size: 0.86rem;
  }
  .hero-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .btn {
    width: 100%;
    justify-content: center;
  }
  .table-wrapper {
    overflow-x: auto;
  }
}

.scenario-block {
  margin-top: 16px;
}

.scenario-block h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.scenario-caption {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Apply column alignment to all combined tables */
.combined-leaderboard th:nth-child(1),
.combined-leaderboard td:nth-child(1) {
  width: 40px;
  text-align: right;
}

.combined-leaderboard th:nth-child(2),
.combined-leaderboard td:nth-child(2) {
  text-align: left;
  min-width: 150px;
}

.combined-leaderboard th:nth-child(3),
.combined-leaderboard td:nth-child(3),
.combined-leaderboard th:nth-child(4),
.combined-leaderboard td:nth-child(4),
.combined-leaderboard th:nth-child(5),
.combined-leaderboard td:nth-child(5) {
  text-align: right;
  white-space: nowrap;
}

.summary-multi {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.84rem;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.summary-label {
  color: var(--muted);
}

.summary-amount {
  font-weight: 600;
}
