:root {
  color-scheme: dark;
  --bg: #05030a;
  --panel: rgba(8, 5, 15, 0.82);
  --panel-2: rgba(14, 9, 24, 0.9);
  --line: rgba(145, 111, 163, 0.34);
  --line-strong: rgba(216, 184, 255, 0.55);
  --text: #f4edff;
  --muted: #b9adc9;
  --violet: #8b3dff;
  --violet-soft: #d8b8ff;
  --copper: #c68a36;
  --gold: #ffd391;
  --blue: #a9c7ff;
  --teal: #52c7bd;
  --green: #58d184;
  --red: #ff9bb2;
  --serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 4%, rgba(139, 61, 255, 0.18), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(198, 138, 54, 0.12), transparent 30%),
    linear-gradient(160deg, #05030a 0%, #0a0614 55%, #120a1f 100%);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.55 "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

button,
select,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  background: radial-gradient(circle, rgba(216, 184, 255, 0.18), transparent 60%), rgba(5, 3, 10, 0.6);
  transform: rotate(45deg);
  box-shadow: 0 0 26px rgba(139, 61, 255, 0.32);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.language {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.language span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.language select {
  min-height: 38px;
  padding: 8px 32px 8px 11px;
}

.nav a,
.button,
button {
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(7, 5, 14, 0.6);
  color: var(--text);
  padding: 9px 14px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.nav a:hover,
.button:hover,
button:hover {
  border-color: var(--line-strong);
  background: rgba(139, 61, 255, 0.16);
  color: #fff;
}

.button.secondary {
  margin-top: 8px;
  background: rgba(139, 61, 255, 0.12);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}

.hero-main,
.panel,
.metric,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px rgba(198, 138, 54, 0.06), 0 16px 42px rgba(0, 0, 0, 0.4);
}

.hero-main {
  position: relative;
  padding: 30px;
  overflow: visible;
}

.hero-main::before {
  content: "";
  position: absolute;
  inset: 7px;
  pointer-events: none;
  border: 1px solid rgba(198, 138, 54, 0.16);
}

.run-hero-layout {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.run-hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--violet-soft);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-family: var(--serif);
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 0 22px rgba(216, 184, 255, 0.32);
}

h2 {
  margin-bottom: 14px;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-copy {
  max-width: 760px;
  color: var(--muted);
  font-size: 16px;
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 13px;
  background: rgba(139, 61, 255, 0.08);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.pill.good {
  color: var(--green);
  border-color: rgba(88, 209, 132, 0.5);
}

.pill.bad {
  color: var(--red);
  border-color: rgba(255, 155, 178, 0.5);
}

.rating-card {
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.skin-bust {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 106px;
  margin: 0 auto 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(139, 61, 255, 0.08);
}

.skin-bust.large {
  width: 130px;
  height: 146px;
  margin-bottom: 14px;
}

.skin-bust.hero {
  width: 160px;
  height: 220px;
  margin: 0 auto;
  justify-self: center;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.skin-bust img {
  position: absolute;
  top: -16px;
  left: 50%;
  height: 162px;
  image-rendering: pixelated;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 18px rgba(5, 3, 10, 0.7));
}

.skin-bust.large img {
  top: -22px;
  height: 222px;
}

.skin-bust.hero img {
  top: -18px;
  height: 276px;
}

.skin-bust span {
  color: var(--violet-soft);
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 900;
}

.skin-bust.large span {
  font-size: 34px;
}

.skin-bust.hero span {
  font-size: 42px;
}

.skin-bust.loaded span {
  display: none;
}

.skin-bust.missing img {
  display: none;
}

.skin-bust.hero.missing {
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(139, 61, 255, 0.08);
}

.rating {
  display: grid;
  place-items: center;
  width: 154px;
  height: 154px;
  border-radius: 50%;
  background: conic-gradient(from 220deg, var(--violet), var(--copper), var(--violet-soft), var(--violet));
  color: #10081a;
  font-family: var(--serif);
  font-size: 76px;
  font-weight: 900;
  box-shadow: 0 0 44px rgba(139, 61, 255, 0.35);
}

.rating.rating-s {
  background: conic-gradient(from 210deg, var(--copper), var(--gold), #fff2d6, var(--copper));
  color: #2a1c05;
  box-shadow: 0 0 48px rgba(198, 138, 54, 0.45);
}

.rating.rating-a {
  background: conic-gradient(from 220deg, var(--violet), var(--violet-soft), #f0ddff, var(--violet));
  box-shadow: 0 0 44px rgba(139, 61, 255, 0.4);
}

.rating.rating-b {
  background: conic-gradient(from 220deg, #3a63e0, var(--blue), #e3edff, #3a63e0);
  color: #08122b;
}

.rating.rating-c {
  background: conic-gradient(from 220deg, #2f9990, var(--teal), #d6fbf6, #2f9990);
  color: #04201d;
}

.rating.rating-d {
  background: conic-gradient(from 220deg, #6b6276, #9a8fa8, #d8d0e2, #6b6276);
  color: #161018;
}

.rating.rating-f {
  background: conic-gradient(from 220deg, #8a2440, var(--red), #ffe0e8, #8a2440);
  color: #2a0710;
}

.rating-badge {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.rating-badge.rating-s {
  color: var(--gold);
  background: rgba(198, 138, 54, 0.16);
  box-shadow: 0 0 14px rgba(198, 138, 54, 0.28);
}
.rating-badge.rating-a {
  color: var(--violet-soft);
  background: rgba(139, 61, 255, 0.16);
}
.rating-badge.rating-b {
  color: var(--blue);
  background: rgba(71, 118, 255, 0.14);
}
.rating-badge.rating-c {
  color: var(--teal);
  background: rgba(82, 199, 189, 0.14);
}
.rating-badge.rating-d {
  color: #c7bcd6;
  background: rgba(199, 188, 214, 0.1);
}
.rating-badge.rating-f {
  color: var(--red);
  background: rgba(255, 107, 107, 0.12);
}

.score {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 850;
}

.party-score-label {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

/* --- Podium --- */
.leaderboard-content {
  display: grid;
  gap: 18px;
}

.podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.podium-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 20px 16px 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(139, 61, 255, 0.08), rgba(8, 5, 15, 0.92));
  text-align: center;
}

.podium-card.podium-1 {
  border-color: rgba(255, 211, 145, 0.55);
  background: linear-gradient(180deg, rgba(198, 138, 54, 0.18), rgba(8, 5, 15, 0.92));
  box-shadow: 0 0 40px rgba(198, 138, 54, 0.22);
  padding-top: 30px;
}

.podium-card.podium-2 {
  border-color: rgba(216, 184, 255, 0.45);
}

.podium-card.podium-3 {
  border-color: rgba(198, 138, 54, 0.4);
}

.podium-place {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--violet-soft);
}

.podium-1 .podium-place {
  color: var(--gold);
  text-shadow: 0 0 18px rgba(198, 138, 54, 0.5);
}

.podium-name {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}

.podium-name:hover {
  color: var(--violet-soft);
}

.podium-score {
  display: grid;
  gap: 2px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 850;
  color: var(--text);
}

.podium-score small {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.rank {
  font-family: var(--mono);
  font-weight: 700;
}

.rank-medal {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  font-weight: 800;
  color: #1a1206;
}

.rank-medal.rank-1 {
  background: linear-gradient(140deg, var(--gold), var(--copper));
}
.rank-medal.rank-2 {
  background: linear-gradient(140deg, #e6dcf5, #b6a6cf);
}
.rank-medal.rank-3 {
  background: linear-gradient(140deg, #e0ad6f, #9c6a32);
}

.grid {
  display: grid;
  gap: 14px;
}

.metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 18px 0;
}

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 24px;
}

.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.panel {
  padding: 18px;
  overflow: hidden;
}

.mvp-section {
  margin: 18px 0;
}

.mvp-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.mvp-card {
  min-height: 240px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(139, 61, 255, 0.06), rgba(8, 5, 15, 0.9));
  padding: 14px;
}

.mvp-card span,
.mvp-card small {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mvp-card strong {
  display: block;
  margin: 10px 0 8px;
  overflow: hidden;
  color: var(--text);
  font-family: var(--serif);
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mvp-card a {
  display: inline-block;
  margin-top: 10px;
  color: var(--violet-soft);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.table-wrap.flat {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.s-gates {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin: 18px 0;
}

.s-gates h2 {
  margin-bottom: 6px;
}

.s-gates p {
  margin-bottom: 0;
}

.gate-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.gate {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: rgba(139, 61, 255, 0.05);
}

.gate strong,
.gate small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gate small {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.gate.met {
  border-color: rgba(88, 209, 132, 0.4);
}

.gate.met small {
  color: var(--green);
}

.gate.missing small {
  color: var(--red);
}

canvas {
  display: block;
  width: 100%;
  height: 260px;
}

.timeline {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.timeline li:last-child {
  border-bottom: 0;
}

.timeline strong {
  font-weight: 600;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
}

select,
input {
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  padding: 10px 12px;
}

select:focus,
input:focus {
  outline: none;
  border-color: var(--line-strong);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

tbody tr:hover td {
  background: rgba(139, 61, 255, 0.06);
}

td a {
  color: var(--violet-soft);
  text-decoration: none;
  font-weight: 700;
}

td a:hover {
  color: #fff;
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .hero,
  .two,
  .s-gates {
    grid-template-columns: 1fr;
  }

  .mvp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gate-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-main {
    padding: 20px;
  }

  .run-hero-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .skin-bust.hero {
    width: 132px;
    height: 176px;
    margin: 0 auto 4px;
  }

  .skin-bust.hero img {
    top: -16px;
    height: 224px;
  }

  .podium {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .timeline li {
    grid-template-columns: 1fr;
  }

  .gate-list {
    grid-template-columns: 1fr;
  }

  .mvp-grid {
    grid-template-columns: 1fr;
  }
}
