:root {
  --bg: #0b0d12;
  --ink: #eef1f8;
  --muted: #8b93a7;
  --card: rgba(18, 21, 29, 0.72);
  --line: rgba(255, 255, 255, 0.08);
  --pink: #ff9ecb;
  --blue: #93d2ff;
  --green: #8df0c0;
  --lav: #cfc3ff;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background:
    radial-gradient(900px 600px at 15% -10%, rgba(255, 158, 203, 0.08), transparent 60%),
    radial-gradient(900px 700px at 90% 10%, rgba(147, 210, 255, 0.08), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
}

main {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  display: flex;
  flex-direction: column;
}

/* ---------- hud ---------- */

#hud {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  background: rgba(11, 13, 18, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

#hud .n { color: var(--ink); }

/* ---------- hero ---------- */

.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4.5rem 0 2rem;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.4rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  background: rgba(11, 13, 18, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.badge .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.back {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  background: rgba(11, 13, 18, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.back:hover { color: var(--ink); border-color: color-mix(in srgb, var(--blue) 45%, transparent); }

h1 {
  font-size: clamp(3.2rem, 10vw, 6.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.6);
}

.tagline {
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  max-width: 52ch;
  line-height: 1.6;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
}

.tagline em { color: var(--ink); font-style: normal; }

.cta-row {
  margin-top: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
  background: rgba(18, 21, 29, 0.8);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--blue) 55%, transparent);
  box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--blue) 40%, transparent);
}

.btn.primary {
  background: color-mix(in srgb, var(--pink) 18%, rgba(18, 21, 29, 0.8));
  border-color: color-mix(in srgb, var(--pink) 45%, transparent);
}

.btn.primary:hover {
  border-color: color-mix(in srgb, var(--pink) 75%, transparent);
  box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--pink) 45%, transparent);
}

.btn .play-ic { color: var(--green); }

.hero-note {
  margin-top: 1.4rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.6;
  opacity: 0.85;
}

/* ---------- sections ---------- */

.block {
  margin-top: clamp(3rem, 9vh, 5.5rem);
}

.block > h2 {
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  margin-bottom: 0.9rem;
  padding-left: 1rem;
  border-left: 3px solid var(--pink);
}

.lede {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: 72ch;
  margin-bottom: 1.3rem;
}

.lede.small { font-size: 0.85rem; }
.lede b { color: var(--ink); font-weight: 600; }
.lede a { color: var(--blue); }

.grid {
  display: grid;
  gap: 1rem;
}

.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.4rem 1.3rem 1.5rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 180px at 20% -10%, rgba(147, 210, 255, 0.10), transparent 70%);
  pointer-events: none;
}

.card .num {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--blue);
}

.card h3 {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.card p b { color: var(--ink); font-weight: 600; }

.card.map .map-svg {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 0.3rem;
}

/* difficulty */

.diff-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.8rem;
}

.diff {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.pill {
  font-family: var(--mono);
  font-size: 0.78rem;
  border-radius: 999px;
  padding: 0.18rem 0.7rem;
  width: fit-content;
  border: 1px solid var(--line);
}

.pill.easy      { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); background: color-mix(in srgb, var(--green) 10%, transparent); }
.pill.normal    { color: var(--blue);  border-color: color-mix(in srgb, var(--blue) 40%, transparent);  background: color-mix(in srgb, var(--blue) 10%, transparent); }
.pill.hard      { color: var(--lav);   border-color: color-mix(in srgb, var(--lav) 40%, transparent);   background: color-mix(in srgb, var(--lav) 10%, transparent); }
.pill.expert    { color: var(--pink);  border-color: color-mix(in srgb, var(--pink) 40%, transparent);  background: color-mix(in srgb, var(--pink) 10%, transparent); }
.pill.nightmare { color: #ff8080;      border-color: rgba(255, 128, 128, 0.4);                         background: rgba(255, 128, 128, 0.1); }

.bar {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--pink));
}

.diff:nth-child(1) .bar i { background: var(--green); }
.diff:nth-child(2) .bar i { background: var(--blue); }
.diff:nth-child(3) .bar i { background: var(--lav); }
.diff:nth-child(4) .bar i { background: var(--pink); }
.diff:nth-child(5) .bar i { background: #ff8080; }

/* score balls */

.card.ball { align-items: flex-start; }

.orb {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  margin-bottom: 0.2rem;
}

.orb-blue  { background: radial-gradient(circle at 34% 30%, #d6eeff, #4aa8ff 55%, #1c5fae); box-shadow: 0 0 22px rgba(74, 168, 255, 0.55); }
.orb-green { background: radial-gradient(circle at 34% 30%, #eafff5, #4be0a4 55%, #178a5e); box-shadow: 0 0 22px rgba(75, 224, 164, 0.55); }
.orb-mag   { background: radial-gradient(circle at 34% 30%, #ffe3f6, #ff54c0 55%, #a31a7c); box-shadow: 0 0 22px rgba(255, 84, 192, 0.55); }

/* controls */

.keys {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.keys li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.key {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink);
  min-width: 2rem;
  text-align: center;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom-width: 2.5px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* under the hood */

.tech {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.9rem;
}

.tech > div {
  padding: 1.1rem 1.2rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tech dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  margin-bottom: 0.4rem;
}

.tech dd {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* download */

a.card.dl {
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

a.card.dl:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--green) 55%, transparent);
  box-shadow: 0 12px 40px -12px color-mix(in srgb, var(--green) 35%, transparent);
}

a.card.dl::before {
  background: radial-gradient(420px 180px at 20% -10%, rgba(141, 240, 192, 0.12), transparent 70%);
}

a.card.dl .go {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--green);
  margin-top: auto;
}

/* ticker */

.ticker {
  margin-top: clamp(3rem, 8vh, 5rem);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 0.65rem 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.ticker .track {
  display: flex;
  width: max-content;
  animation: scroll 36s linear infinite;
}

.ticker span {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  padding-right: 0.5rem;
}

.ticker b { font-weight: 400; color: var(--ink); }

.ticker i {
  font-style: normal;
  padding: 0 0.9rem;
  color: var(--pink);
}

@keyframes scroll {
  to { transform: translateX(-50%); }
}

footer {
  margin-top: 1.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--pink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .badge .dot { animation: none; }
  .ticker .track { animation: none; }
}
