:root {
  --bg: #101018;
  --wave1: #261745;
  --wave2: #0d1130;
  --dialog: #1c1b1f;
  --card: rgba(16, 15, 26, 0.55);
  --card-border: rgba(255, 255, 255, 0.22);
  --primary: #bb86fc;
  --on-primary: #381e72;
  --text: #ffffff;
  --muted: #a6a2b2;
  --faint: #6f6b7c;
  --green: #66bb6a;
  --green-dark: #388e3c;
  --warpath: #ef5350;
  --fortune: #ffca28;
  --echoes: #7e57c2;
  --forge: #42a5f5;
  --hub: #ff7043;
  --radius: 14px;
  --gutter: 16px;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Pixelify Sans", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1000px 600px at 85% -10%, var(--wave1) 0%, transparent 60%),
    radial-gradient(800px 600px at 5% 105%, var(--wave2) 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}

html.has-void-bg body { background: transparent; }

.void-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

img.pixel { image-rendering: pixelated; }

a { color: var(--primary); }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- Nav ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  box-shadow: 0 0 0 1px rgba(187, 134, 252, 0.5);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); }

.nav-links .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--green);
  vertical-align: 2px;
  box-shadow: 0 0 8px var(--green);
}

/* ---------- Type ---------- */

h1, h2, h3 {
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 0;
}

h1 { font-size: clamp(3rem, 11vw, 6rem); }
h2 { font-size: clamp(2rem, 6vw, 2.8rem); margin-bottom: 12px; }
h3 { font-size: 1.35rem; margin-bottom: 8px; }

.flavor {
  font-style: italic;
  color: var(--muted);
  font-size: 1.15rem;
  margin: 12px 0 0;
}

.lead {
  font-size: 1.15rem;
  color: #ddd9e6;
  max-width: 34em;
}

.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* ---------- Building blocks from the game UI ---------- */

.card {
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.pill-green { background: var(--green-dark); color: #d7f5d9; }
.pill-purple { background: rgba(187, 134, 252, 0.18); color: var(--primary); }

.chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1.5px solid var(--card-border);
  background: rgba(16, 15, 26, 0.5);
  color: var(--primary);
  font: inherit;
  font-size: 1.05rem;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 6px 24px rgba(187, 134, 252, 0.25);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.btn img { width: 22px; height: 22px; }
.btn small { display: block; font-size: 0.75rem; opacity: 0.8; line-height: 1; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--green);
}

/* ---------- Phones ---------- */

.phone {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 720 / 1490;
  border-radius: 34px;
  padding: 8px;
  background: #07070c;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 60px rgba(126, 87, 194, 0.18);
}

.phone img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 27px;
}

/* ---------- Sections ---------- */

section { padding: 56px 0; }

.hero {
  max-width: 760px;
  padding-top: 48px;
  text-align: center;
}

.hero .lead { margin: 20px auto 0; }
.hero .btn-row, .hero .meta-line { justify-content: center; }

.hero h1 { text-shadow: 0 0 40px rgba(187, 134, 252, 0.35); }


.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.meta-line span::before { content: "\25C6"; color: var(--primary); margin-right: 6px; font-size: 0.7em; vertical-align: 2px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature img {
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
}

.feature p { margin: 0; color: var(--muted); }

.gallery {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px var(--gutter) 28px;
  margin: 0 calc(-1 * var(--gutter));
  scrollbar-width: thin;
  scrollbar-color: rgba(187, 134, 252, 0.4) transparent;
}

.gallery figure {
  flex: 0 0 auto;
  width: 240px;
  margin: 0;
  scroll-snap-align: start;
}

.gallery .phone { border-radius: 28px; padding: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); }
.gallery .phone img { border-radius: 23px; }

.gallery.store img {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.gallery .shot {
  display: block;
  border-radius: 18px;
  transition: transform 0.15s ease;
}

.gallery .shot:hover { transform: translateY(-4px); }
.gallery .shot:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }

.gallery figcaption {
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
}

.split .phone { margin: 0 auto; }

.video-section { text-align: center; }
.video-section .lead { margin: 0 auto; }

.video-phone {
  margin: 28px auto 0;
  aspect-ratio: 720 / 1448;
}

.video-phone video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 27px;
  background: #000;
}

/* ---------- Coming soon banner ---------- */

.announce {
  display: grid;
  grid-template-columns: 1fr 260px;
  align-items: center;
  gap: 24px;
  padding: 28px;
  color: inherit;
  text-decoration: none;
  border-color: rgba(255, 112, 67, 0.45);
  background:
    radial-gradient(400px 260px at 85% 50%, rgba(255, 112, 67, 0.16), transparent 70%),
    var(--card);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.announce:hover { border-color: var(--hub); transform: translateY(-2px); }
.announce h2 { margin: 12px 0 8px; }
.announce p { margin: 0; color: var(--muted); }
.announce .go { display: inline-block; margin-top: 16px; color: var(--primary); }

.announce canvas {
  width: 260px;
  height: 260px;
  justify-self: center;
}

/* ---------- Support ---------- */

.support {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.support .card { text-align: left; margin-top: 24px; }
.support .card p { color: var(--muted); margin: 0 0 18px; }
.support .btn { width: 100%; }
.support .flavor { min-height: 3em; }

/* ---------- Altar page ---------- */

.altar-hero {
  text-align: center;
  padding-top: 24px;
}

.altar-hero h1 { font-size: clamp(2.6rem, 9vw, 5rem); margin-top: 16px; }
.altar-hero .lead { margin: 20px auto 0; }

.constellation-wrap {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 24px auto 0;
  aspect-ratio: 1;
}

.constellation-wrap canvas {
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

.rank-readout {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
  color: var(--muted);
}

.rank-readout strong { color: var(--text); font-weight: 400; font-size: 1.5rem; }
.rank-readout #ring-label { color: var(--green); }

.altar-card .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.altar-card .row h3 { margin: 0; font-size: 1.6rem; }
.altar-card .ok { color: var(--green); margin: 12px 0 4px; }
.altar-card .next { color: var(--muted); margin: 0; }

.rings {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 20px;
  text-align: center;
}

.rings div {
  padding: 8px 2px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  font-size: 0.8rem;
  color: var(--muted);
}

.rings b { display: block; color: var(--text); font-weight: 400; font-size: 1.1rem; }

.branches {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.branch { border-top: 3px solid var(--c); }
.branch h3 { color: var(--c); display: flex; align-items: center; gap: 10px; }
.branch h3::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.branch p { color: var(--muted); margin: 0 0 14px; }

.keystone {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 8px;
}

.keystone .k { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c); }
.keystone .name { display: block; }
.keystone .fx { display: block; color: var(--muted); font-size: 0.92rem; }

.perks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.perk {
  background: rgba(28, 27, 31, 0.86);
  border-color: rgba(126, 87, 194, 0.55);
}

.perk .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.perk h3 { margin: 0; }
.perk .chips { display: flex; gap: 6px; margin: 8px 0 12px; flex-wrap: wrap; }
.perk .chips .chip { background: rgba(126, 87, 194, 0.25); color: #b39ddb; }
.perk .chips .chip.forge { background: rgba(66, 165, 245, 0.2); color: #90caf9; }
.perk blockquote { margin: 0 0 12px; font-style: italic; color: var(--muted); }

.perk .effect {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
}

.perk .effect span { display: block; font-size: 0.8rem; color: var(--green); }

.cta {
  text-align: center;
}

.cta .btn-row { justify-content: center; }

/* ---------- Lightbox ---------- */

.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(8, 8, 14, 0.88);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.lightbox-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 72px;
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  border-radius: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.lightbox button {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--card-border);
  background: rgba(28, 27, 31, 0.8);
  color: var(--text);
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox button:hover { border-color: var(--primary); color: var(--primary); }
.lightbox .lb-close { top: 12px; right: 12px; }
.lightbox .lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

.lightbox .lb-count {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 560px) {
  .lightbox-stage { padding: 64px 12px 56px; }
  .lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 6px; transform: none; }
}

/* ---------- Footer ---------- */

footer {
  padding: 40px 0 48px;
  text-align: center;
  color: var(--faint);
  font-size: 0.9rem;
}

footer nav { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 32px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .announce { grid-template-columns: 1fr; }
  .announce canvas { width: 220px; height: 220px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  section { padding: 40px 0; }
  .grid, .branches { grid-template-columns: 1fr; }
  .nav-links a { padding: 6px 6px; }
  .rings { grid-template-columns: repeat(4, 1fr); }
  .btn-row .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .announce { transition: none; }
}
