:root {
  --bg-0: #0a0710;
  --bg-1: #160d20;
  --bg-2: #241330;
  --surface: rgba(27, 16, 38, 0.92);
  --surface-strong: rgba(35, 20, 49, 0.96);
  --panel-line: rgba(255, 255, 255, 0.06);
  --text: #f5ebff;
  --muted: #c5b8d8;
  --pink: #f77df6;
  --cyan: #33dcff;
  --lime: #c7ff54;
  --gold: #ffcf72;
  --shadow: 0 26px 54px rgba(0, 0, 0, 0.48);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  font-family: "Space Grotesk", "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(circle at 18% 16%, rgba(247, 125, 246, 0.18), transparent 28%),
    radial-gradient(circle at 82% 10%, rgba(51, 220, 255, 0.15), transparent 30%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 52%, var(--bg-2) 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 18%),
    repeating-linear-gradient(180deg, rgba(247, 125, 246, 0.045) 0 2px, transparent 2px 6px);
  opacity: 0.8;
}

.heroes-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  position: relative;
}

.heroes-card {
  width: min(960px, 100%);
  max-height: calc(100dvh - 28px);
  border-radius: 26px;
  padding: clamp(18px, 3vw, 30px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 16%),
    var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    var(--shadow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.heroes-card::before,
.heroes-card::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(8px);
  pointer-events: none;
}

.heroes-card::before {
  width: 180px;
  height: 180px;
  top: -58px;
  right: -40px;
  background: rgba(51, 220, 255, 0.1);
}

.heroes-card::after {
  width: 190px;
  height: 190px;
  left: -74px;
  bottom: -70px;
  background: rgba(247, 125, 246, 0.12);
}

.eyebrow {
  margin: 0;
  color: var(--cyan);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 800;
  position: relative;
  z-index: 1;
}

h1 {
  margin: 8px 0 6px;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
  color: var(--text);
  text-shadow:
    1px 0 rgba(255, 255, 255, 0.12),
    0 0 18px rgba(247, 125, 246, 0.16);
  position: relative;
  z-index: 1;
}

.lead {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 1rem;
  position: relative;
  z-index: 1;
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--panel-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 18%),
    rgba(17, 11, 25, 0.88);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 1;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 860px;
}

th,
td {
  padding: 12px 16px;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--cyan);
  background: rgba(22, 15, 31, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

tbody tr {
  background: rgba(255, 255, 255, 0.015);
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

tbody tr:hover {
  background: rgba(51, 220, 255, 0.05);
}

td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.94rem;
}

td:nth-child(2) {
  color: #d7f6ff;
  font-weight: 700;
}

td:nth-child(3) {
  color: var(--gold);
  font-weight: 700;
}

td:nth-child(4) {
  color: var(--lime);
  font-weight: 700;
}

td:nth-child(5) {
  color: #ffd8ff;
  font-weight: 700;
}

.crown-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.16em;
  margin-left: 0.34em;
  vertical-align: middle;
  user-select: none;
  -webkit-user-select: none;
}

.crown-icon {
  display: inline-block;
  font-size: 0.9em;
  line-height: 1;
  font-weight: 900;
  text-shadow: 0 0 7px rgba(0, 0, 0, 0.45);
}

.crown-blue {
  color: #55d6ff;
  text-shadow: 0 0 8px rgba(85, 214, 255, 0.38);
}

.crown-green {
  color: #8cff66;
  text-shadow: 0 0 8px rgba(140, 255, 102, 0.38);
}

.crown-red {
  color: #ff6894;
  text-shadow: 0 0 8px rgba(255, 104, 148, 0.36);
}

.crown-gold {
  color: #ffd25d;
  text-shadow: 0 0 8px rgba(255, 210, 93, 0.42);
}

.actions {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding-top: 14px;
  background: linear-gradient(180deg, rgba(23, 14, 32, 0), rgba(23, 14, 32, 0.98) 42%);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 50px;
  min-width: 170px;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.btn-primary {
  color: #241503;
  background: linear-gradient(180deg, #ffd78e 0%, #ffbf4d 100%);
}

.btn-secondary {
  color: #071722;
  background: linear-gradient(180deg, #9ff0ff 0%, #5bdbfb 100%);
}

.actions-close {
  margin-left: auto;
}

#heroes-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  position: relative;
  z-index: 1;
}

@media (max-width: 640px) {
  .heroes-shell {
    padding: 8px;
    align-items: stretch;
  }

  .heroes-card {
    width: 100%;
    max-height: calc(100dvh - 16px);
    border-radius: 22px;
    padding: 16px 14px 14px;
  }

  .lead {
    margin-bottom: 12px;
    font-size: 0.96rem;
  }

  .table-wrap {
    border-radius: 16px;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody,
  tr {
    display: block;
  }

  tbody {
    padding: 5px;
  }

  tr {
    margin-bottom: 7px;
    padding: 10px 11px 8px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 18%),
      rgba(31, 19, 43, 0.9);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.02),
      0 10px 18px rgba(0, 0, 0, 0.18);
  }

  tr:last-child {
    margin-bottom: 0;
  }

  td {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 9px;
    padding: 5px 0;
    border-bottom: 0;
    word-break: break-word;
    font-size: 0.91rem;
  }

  td::before {
    content: attr(data-label);
    color: var(--cyan);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.95;
  }

  .actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 10px;
  }

  .btn {
    min-width: 0;
    min-height: 46px;
    padding: 10px 12px;
    font-size: 0.84rem;
    text-align: center;
  }

  .actions-close {
    margin-left: 0;
    width: 100%;
  }

  #heroes-note {
    margin-top: 8px;
    font-size: 0.78rem;
  }
}
