:root {
  --space: #060a1c;
  --night: #0c1433;
  --night-2: #13204a;
  --arcane: #4c9bff;
  --arcane-soft: #2a5aa8;
  --silver: #dde6f4;
  --mist: #9fb0cf;
  --gold: #f6b94a;
  --gold-hi: #ffe2a0;
  --line: rgba(160, 190, 240, 0.18);
  --serif: "IM Fell English SC", Georgia, serif;
  --sans: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--space);
  color: var(--silver);
  font: 400 18px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--arcane); }
a:hover { color: var(--gold-hi); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--space); padding: 6px 12px; z-index: 10; }
.skip:focus { left: 12px; }
h1, h2 { font-family: var(--serif); font-weight: 400; color: #fff; line-height: 1.15; }
h1 { font-size: clamp(2.2rem, 4vw, 3.1rem); margin: 0 0 .3em; }
h2 { font-size: 1.65rem; margin: 0 0 .6em; }
code { background: var(--night-2); padding: 1px 6px; border-radius: 4px; font-size: .9em; }

/* header */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 24px;
  padding: 10px clamp(16px, 4vw, 48px);
  background: rgba(6, 10, 28, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font: 1.35rem var(--serif); margin-right: auto; }
.brand img { border-radius: 8px; }
nav { display: flex; gap: 6px; align-items: center; }
nav a { color: var(--mist); text-decoration: none; padding: 8px 12px; border-radius: 6px; }
nav a:hover { color: #fff; }
nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--arcane); border-radius: 0; }
nav a.nav-play { color: var(--space); background: var(--gold); font-weight: 700; border-radius: 6px; box-shadow: none; }
nav a.nav-play:hover { background: var(--gold-hi); }
.menu-btn { display: none; }

/* buttons */
.btn { display: inline-block; font: 700 1rem var(--sans); text-decoration: none; padding: 12px 22px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; }
.btn-gold { background: var(--gold); color: var(--space); }
.btn-gold:hover { background: var(--gold-hi); color: var(--space); }
.btn-gold[disabled] { background: #4a4f63; color: #9aa0b4; cursor: not-allowed; }
.btn-ghost { color: var(--silver); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--arcane); color: #fff; }
.btn-small { padding: 8px 14px; background: var(--night-2); color: #fff; border-color: var(--line); }
.btn-big { padding: 16px 28px; font-size: 1.1rem; margin: 8px 0 24px; }

/* the sky */
.sky {
  background:
    radial-gradient(ellipse 80% 60% at 72% 100%, rgba(246, 185, 74, 0.10), transparent 70%),
    radial-gradient(ellipse 60% 70% at 20% 30%, rgba(76, 155, 255, 0.10), transparent 70%),
    linear-gradient(180deg, var(--space) 0%, var(--night) 70%, var(--night-2) 100%);
  border-bottom: 1px solid var(--line);
}
.sky-inner {
  max-width: 1180px; margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 48px) clamp(40px, 6vw, 80px);
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center;
}
.wordmark { width: min(560px, 100%); mix-blend-mode: screen; margin: 0 0 12px -14px;
  -webkit-mask-image: radial-gradient(ellipse 58% 60% at 50% 50%, #000 50%, transparent 100%);
          mask-image: radial-gradient(ellipse 58% 60% at 50% 50%, #000 50%, transparent 100%); }
.lede { font-size: 1.2rem; color: var(--silver); max-width: 34em; margin: 0 0 28px; }
.lede-sm { color: var(--mist); max-width: 40em; margin-top: 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.horizon { margin: 0; text-align: center; }
.horizon svg { width: 100%; max-width: 420px; overflow: visible; }
.ring { fill: none; stroke: var(--arcane-soft); stroke-width: 1; stroke-dasharray: 2 7; opacity: .7; }
.ring2 { stroke-dasharray: none; opacity: .35; }
.earth { stroke: var(--arcane); stroke-width: 2; }
.star { transform: translate(200px, 250px); transition: transform 1.6s cubic-bezier(.2, .8, .2, 1); }
.horizon.up .star { transform: translate(200px, 110px); }
.horizon.down .star { transform: translate(200px, 262px); }
.horizon figcaption { display: grid; gap: 4px; margin-top: -48px; }
#status-line { font: 1.5rem var(--serif); color: #fff; font-weight: 400; }
#status-sub, #boss-line { color: var(--mist); }
#boss-line b { color: var(--gold-hi); font-weight: 500; }

/* layout */
.wrap { max-width: 1180px; margin: 0 auto; padding: 48px clamp(16px, 4vw, 48px); }
.wrap.narrow { max-width: 780px; }
.two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; }
.more { display: inline-block; margin-top: 8px; }

/* news */
.news article { padding: 18px 0; border-top: 1px solid var(--line); }
.news article:first-child { border-top: 0; padding-top: 0; }
.news time { color: var(--gold); font-size: .95rem; }
.news h3 { font: 1.3rem var(--serif); color: #fff; margin: 2px 0 8px; font-weight: 400; }
.news ul { margin: 0; padding-left: 1.1em; color: var(--silver); }
.news li { margin: 3px 0; }

.steps { padding-left: 1.3em; margin: 0 0 24px; }
.steps li { margin: 0 0 14px; padding-left: 4px; }
.steps li::marker { color: var(--gold); font-family: var(--serif); }
.plain { padding-left: 1.1em; }
.plain li { margin: 6px 0; }

/* features */
.feature-groups { columns: 2 380px; column-gap: 56px; }
.feature-groups section { break-inside: avoid; margin-bottom: 36px; }
dl { margin: 0; }
dt { color: #fff; font-weight: 700; margin-top: 12px; }
dd { margin: 2px 0 0; color: var(--mist); }

/* story */
.story h2 { margin-top: 1.4em; }
.story p { color: var(--silver); max-width: 38em; }
.story .btn { margin-top: 16px; }

/* hiscores */
.hs-tools { display: flex; flex-wrap: wrap; gap: 24px; align-items: end; margin-bottom: 20px; }
label { color: var(--mist); font-size: .95rem; }
select, input {
  font: 1rem var(--sans); color: #fff; background: var(--night);
  border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; margin-top: 4px;
}
.hs-tools select { display: block; min-width: 200px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.inline-form label { width: 100%; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; color: var(--mist); font-weight: 500; border-bottom: 1px solid var(--line); padding: 8px 10px; }
.table td { padding: 9px 10px; border-bottom: 1px solid rgba(160, 190, 240, 0.08); }
.table .num { text-align: right; }
.table tr:nth-child(-n+3) td:first-child { color: var(--gold); }
.note { color: var(--mist); font-size: .95rem; }
.empty { color: var(--mist); padding: 24px 0; }
#hs-player:not(:empty) { margin-bottom: 28px; padding: 16px 20px; background: var(--night); border: 1px solid var(--line); border-radius: 10px; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 18px; margin-top: 10px; }
.skill-grid span { display: flex; justify-content: space-between; color: var(--mist); }
.skill-grid b { color: #fff; font-weight: 500; }

/* store */
.store-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: start; }
#store-form { display: grid; gap: 10px; max-width: 460px; }
#store-form input { width: 100%; }
fieldset { border: 0; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
legend { color: var(--mist); font-size: .95rem; margin-bottom: 6px; }
.pack { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.pack:hover { border-color: var(--arcane-soft); }
.pack:has(input:checked) { border-color: var(--gold); background: rgba(246, 185, 74, 0.06); }
.pack input { margin: 0; accent-color: var(--gold); }
.pack .credit { color: #fff; font-weight: 700; }
.pack .label { color: var(--mist); display: block; font-size: .9rem; }
.pack .price { color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.cat { margin: 0 0 22px; }
.cat h3 { font: 1.15rem var(--serif); color: #fff; font-weight: 400; margin: 0 0 6px; }
.cat ul { list-style: none; margin: 0; padding: 0; }
.cat li { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; border-bottom: 1px solid rgba(160, 190, 240, 0.08); }
.cat li span:last-child { color: var(--gold-hi); white-space: nowrap; }
.notice { padding: 14px 18px; border-radius: 8px; border: 1px solid var(--gold); background: rgba(246, 185, 74, 0.08); margin-bottom: 24px; }
.notice.bad { border-color: #e2775d; background: rgba(226, 119, 93, 0.08); }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 24px clamp(16px, 4vw, 48px); border-top: 1px solid var(--line); color: var(--mist); font-size: .9rem; }

@media (max-width: 860px) {
  .sky-inner, .two, .store-grid { grid-template-columns: 1fr; }
  .horizon { order: -1; }
  .horizon svg { max-width: 300px; }
  .menu-btn { display: block; background: none; color: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; font: 1rem var(--sans); }
  nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--space); padding: 8px 16px 16px; border-bottom: 1px solid var(--line); }
  nav.open { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .star { transition: none; }
}

/* Dawn boards and the live feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.feed li:first-child { border-top: 0; }
.feed time { color: var(--mist); font-size: .85rem; white-space: nowrap; }
.boards-title { font: 1.4rem var(--serif); color: #fff; font-weight: 400; margin: 28px 0 12px; }
.boards-title span { color: var(--gold); font-size: 1rem; margin-left: 8px; }
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.board { background: var(--night); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.board h3 { margin: 0 0 8px; color: var(--gold); font: 1.15rem var(--serif); font-weight: 400; }
.board ol { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; padding: 4px 0; font-size: .95rem; }
.board li b { color: var(--mist); font-weight: 500; }
.board li i { font-style: normal; color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.rank { font-style: normal; font-size: .75rem; padding: 1px 6px; border-radius: 4px; margin-left: 4px; background: rgba(255,255,255,.08); }
.rank-bronze { color: #e8a060; } .rank-silver { color: #e6ebf2; } .rank-gold { color: #ffc83a; }
.rank-platinum { color: #bfefff; } .rank-diamond { color: #6fe8ff; } .rank-sponsor { color: #ff7fe0; } .rank-member { color: #8fb0ff; }
.empty { color: var(--mist); }

/* custom amount (Stripe) */
.quick-amounts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.credit-preview { color: var(--mist); margin: 8px 0 14px; }
.credit-preview b { color: #fff; }
.credit-preview .bonus { color: var(--gold); }
#store-amount { font-size: 1.2rem; max-width: 160px; }
