:root {
  --bg-top: #290a17;
  --bg-bottom: #0d0308;
  --card: #210a14;
  --card-stroke: rgba(255, 255, 255, 0.1);
  --ruby: #d92e47;
  --ruby-deep: #8c0d1f;
  --gold: #f2c773;
  --text: #f5f0f2;
  --text-dim: rgba(255, 255, 255, 0.65);
}

* {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cta:active {
    transform: none;
  }
}

body {
  min-height: 100vh;
  font-family:
    ui-rounded,
    "SF Pro Rounded",
    -apple-system,
    "Segoe UI",
    system-ui,
    sans-serif;
  color: var(--text);
  background: linear-gradient(var(--bg-top), var(--bg-bottom)) fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(
    420px 420px at 50% 18%,
    rgba(217, 46, 71, 0.2),
    transparent 70%
  );
  pointer-events: none;
}

.page {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px 64px;
  max-width: 720px;
  margin: 0 auto;
}

.page-home > main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.site-header {
  text-align: center;
}

.logo-link {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
  color: inherit;
}

.logo-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 6px;
  border-radius: 8px;
}

.gem-hero {
  width: 150px;
  height: 150px;
  filter: drop-shadow(0 0 18px rgba(217, 46, 71, 0.45));
}

.gem-compact {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 0 18px rgba(217, 46, 71, 0.45));
}

h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  margin-top: 12px;
  letter-spacing: -0.02em;
}

.tagline {
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-top: 6px;
}

.hero-pitch {
  margin-top: 20px;
  font-size: 1.15rem;
  font-weight: 500;
  text-align: center;
  max-width: 36ch;
  line-height: 1.55;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 28px;
}

.cta {
  display: inline-block;
  padding: 14px 34px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  text-align: center;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    filter 0.2s ease;
}

.cta:hover {
  opacity: 0.9;
  filter: brightness(1.1);
}

.cta:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 999px;
}

.cta-primary {
  background: linear-gradient(var(--ruby), var(--ruby-deep));
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(140, 13, 31, 0.6);
}

.cta-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.cta:active {
  transform: scale(0.97);
}

.cta:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.section {
  width: 100%;
  margin-top: 48px;
}

.section h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.section p,
.section li {
  color: var(--text-dim);
  line-height: 1.55;
  max-width: 65ch;
}

.section p + p {
  margin-top: 12px;
}

.steps {
  padding-left: 1.25rem;
  display: grid;
  gap: 14px;
}

.steps strong {
  color: var(--text);
}

.modes-note {
  margin-top: 16px;
  font-size: 0.95rem;
}

.card {
  width: 100%;
  margin-top: 32px;
  background: rgba(33, 10, 20, 0.85);
  border: 1px solid var(--card-stroke);
  border-radius: 20px;
  overflow: hidden;
}

.card-narrow {
  padding: 24px;
  text-align: center;
}

.card-narrow p + p {
  margin-top: 12px;
}

.card-prose {
  padding: 28px 24px;
}

.card-prose h1 {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.card-prose h2 {
  font-size: 1.15rem;
  margin-top: 24px;
  margin-bottom: 8px;
}

.card-prose p,
.card-prose li {
  color: var(--text-dim);
  line-height: 1.55;
  margin-top: 10px;
}

.card-prose ul {
  padding-left: 1.25rem;
}

.card-prose a {
  color: var(--gold);
}

.card-prose strong {
  color: var(--text);
}

.text-dim {
  color: var(--text-dim);
}

.thanks-name {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

caption {
  padding: 18px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

th {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 16px;
  text-align: left;
  border-bottom: 1px solid var(--card-stroke);
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

tr:last-child td {
  border-bottom: none;
}

td.rank {
  color: var(--text-dim);
  font-weight: 700;
  width: 3.2em;
}

tr:nth-child(-n + 3) td.rank {
  color: var(--gold);
}

td.score {
  color: var(--gold);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

td.level,
td.date,
th.num {
  text-align: right;
}

td.level {
  color: var(--text-dim);
  width: 4em;
  font-variant-numeric: tabular-nums;
}

td.date {
  color: var(--text-dim);
  font-size: 0.85em;
  white-space: nowrap;
}

td.empty {
  text-align: center;
  color: var(--text-dim);
  padding: 32px 16px;
}

.page-leaderboard > .cta-primary {
  margin-top: 32px;
}

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

a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

.site-footer a {
  color: var(--text-dim);
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--text);
}

.site-footer a:focus-visible,
.card-prose a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (max-width: 480px) {
  td.date,
  th.date {
    display: none;
  }
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--ruby-deep);
  color: var(--text);
  padding: 8px 16px;
  z-index: 100;
  transition: top 0.2s ease;
  text-decoration: none;
  font-weight: 700;
  border-radius: 0 0 8px 0;
}

.skip-link:focus-visible {
  top: 0;
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
