/* Gold Merge Winner — royal treasury landing
   Palette pulled from in-game UI: velvet purple, metallic gold, lime CTA, magenta cash-out.
*/

:root {
  --velvet: #3b146e;
  --velvet-deep: #1e0a3c;
  --velvet-mid: #4c1d82;
  --gold: #f6d14a;
  --gold-hi: #fff3a8;
  --gold-lo: #c48a12;
  --magenta: #e91e8c;
  --magenta-lo: #b01060;
  --lime: #7ed321;
  --lime-lo: #3f8c0a;
  --sapphire: #4fc3f7;
  --cream: #fff6d8;
  --ink: #140624;
  --white: #fffdf8;
  --hud-h: 84px;
  --radius-pill: 999px;
  --font-display: "Russo One", sans-serif;
  --font-body: "Figtree", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--cream);
  background: var(--velvet-deep);
  line-height: 1.55;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
a {
  font-family: inherit;
}

.cursor-pointer {
  cursor: pointer;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  background: var(--gold);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
}

.skip-link:focus {
  left: 8px;
}

/* ---------- Atmosphere ---------- */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.atmosphere__velvet {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(168, 85, 247, 0.45), transparent 55%),
    radial-gradient(ellipse 40% 40% at 100% 80%, rgba(233, 30, 140, 0.18), transparent 50%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.015) 0 1px,
      transparent 1px 7px
    ),
    linear-gradient(180deg, #4a1b86 0%, var(--velvet-deep) 42%, #2a0d52 100%);
}

.atmosphere__sparkles {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 70%, transparent),
    radial-gradient(1.5px 1.5px at 78% 26%, var(--gold-hi) 70%, transparent),
    radial-gradient(1px 1px at 34% 62%, #fff 70%, transparent),
    radial-gradient(1.5px 1.5px at 88% 72%, var(--gold) 70%, transparent),
    radial-gradient(1px 1px at 56% 12%, #fff 70%, transparent),
    radial-gradient(1px 1px at 8% 80%, var(--gold-hi) 70%, transparent);
  opacity: 0.55;
}

.scroll-meter {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 50;
  background: rgba(0, 0, 0, 0.25);
}

.scroll-meter__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi));
  box-shadow: 0 0 12px var(--gold);
}

/* ---------- HUD / Navbar ---------- */
.hud {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 10px 16px 12px;
  transition: background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.hud.is-scrolled {
  background: rgba(30, 10, 60, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.hud__inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand__mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid var(--gold);
  box-shadow: 0 0 14px rgba(246, 209, 74, 0.45);
}

.brand__copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: var(--gold-hi);
}

.brand__tag {
  font-size: 0.68rem;
  color: #d7b8ff;
  font-weight: 600;
}

.level-track {
  flex: 1;
  min-width: 0;
}

.level-track__list {
  list-style: none;
  margin: 0;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  background: linear-gradient(180deg, #5a2496, #3a1570);
  border: 2px solid var(--gold-lo);
  border-radius: var(--radius-pill);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 0 #2a0a4a;
  position: relative;
}

.level-track__list::before {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  top: 50%;
  height: 3px;
  background: linear-gradient(90deg, var(--lime), var(--gold), #8a6a20);
  opacity: 0.55;
  z-index: 0;
}

.level-node {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
  border: 2px solid #fff3c4;
  box-shadow: 0 3px 0 #7a5608, 0 0 10px rgba(246, 209, 74, 0.35);
  text-decoration: none;
  transition: filter 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.level-node svg {
  width: 18px;
  height: 18px;
}

.level-node__label {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.hud.is-scrolled .level-node__label {
  display: none;
}

.level-node:hover,
.level-node:focus-visible {
  filter: brightness(1.08);
  box-shadow: 0 3px 0 #7a5608, 0 0 16px rgba(246, 209, 74, 0.7);
  outline: none;
}

.level-node.is-active {
  box-shadow: 0 0 0 3px var(--lime), 0 3px 0 #7a5608;
}

.hud__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-toggle {
  width: 44px;
  height: 44px;
  border: 2px solid var(--gold);
  border-radius: 12px;
  background: #3a1570;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

.drawer {
  max-width: 1240px;
  margin: 10px auto 0;
  display: grid;
  gap: 4px;
  background: #2a0d52;
  border: 2px solid var(--gold-lo);
  border-radius: 16px;
  padding: 10px;
}

.drawer[hidden] {
  display: none;
}

.drawer__a {
  color: var(--cream);
  text-decoration: none;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: 10px;
  transition: background 0.2s var(--ease);
}

.drawer__a:hover,
.drawer__a:focus-visible {
  background: rgba(246, 209, 74, 0.12);
  outline: none;
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--white);
  transition: filter 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn:focus-visible {
  outline: 3px solid var(--gold-hi);
  outline-offset: 3px;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn svg,
.btn i {
  width: 18px;
  height: 18px;
}

.btn__glyph {
  width: 18px;
  height: 18px;
}

.btn--cashout {
  background: linear-gradient(180deg, #ff5dad, var(--magenta-lo));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 4px 0 #7a0a42, 0 0 12px rgba(233, 30, 140, 0.45);
  padding: 10px 14px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn--lime {
  background: linear-gradient(180deg, #b6f25a, var(--lime-lo));
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.35), 0 6px 0 #2d6408, 0 0 18px rgba(126, 211, 33, 0.45);
}

.btn--store {
  background: linear-gradient(180deg, #6d3cb0, #3a1570);
  border: 2px solid var(--gold);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.15), 0 4px 0 #1a0830;
}

.btn--wide {
  width: 100%;
  padding: 14px 20px;
  font-size: 1rem;
}

/* ---------- Gold titles ---------- */
.gold-title {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  margin: 0;
  color: var(--gold-hi);
  letter-spacing: 0.01em;
  text-shadow:
    0 2px 0 var(--gold-lo),
    0 4px 0 #7a5608,
    0 8px 18px rgba(0, 0, 0, 0.45),
    0 0 22px rgba(246, 209, 74, 0.35);
}

.gold-title--md {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
}

.gold-title--sm {
  font-size: 1.4rem;
}

/* ---------- Hero stage ---------- */
.stage {
  position: relative;
  min-height: calc(100svh - var(--hud-h));
  padding: 12px 16px 72px;
  overflow: hidden;
}

.stage__rays {
  position: absolute;
  inset: 8% 10% 20%;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(246, 209, 74, 0.16) 0 8deg, transparent 8deg 18deg);
  mask-image: radial-gradient(circle, #000 20%, transparent 70%);
  animation: spin-rays 48s linear infinite;
  pointer-events: none;
}

.stage__meander {
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(520px, 80vw);
  height: min(520px, 80vw);
  transform: translate(-50%, -50%);
  border: 10px solid rgba(246, 209, 74, 0.08);
  border-radius: 50%;
  box-shadow: inset 0 0 0 6px rgba(246, 209, 74, 0.05);
  pointer-events: none;
}

.stage__grid {
  max-width: 1240px;
  margin: 48px auto 56px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 18px;
}

.stage__throne {
  text-align: center;
  position: relative;
  z-index: 1;
}

.stage__banner {
  width: min(680px, 100%);
  margin: 0 auto 18px;
  border-radius: 28px;
  border: 3px solid var(--gold);
  box-shadow:
    0 0 0 6px rgba(90, 30, 140, 0.5),
    0 20px 50px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(246, 209, 74, 0.25);
}

.stage__eyebrow {
  display: inline-block;
  margin: 0 0 10px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(233, 30, 140, 0.85);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stage h1 {
  font-size: clamp(2rem, 7vw, 4.2rem);
  margin-bottom: 12px;
}

.stage__lede {
  max-width: 42rem;
  margin: 0 auto 20px;
  color: #f3e7ff;
  font-size: 1.05rem;
}

.stage__cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.gold-arch {
  margin: 36px auto 0;
  max-width: 720px;
  text-align: center;
  padding: 18px 24px 10px;
  border: 3px solid var(--gold-lo);
  border-bottom: 0;
  border-radius: 180px 180px 0 0;
  background: linear-gradient(180deg, rgba(90, 30, 140, 0.4), transparent);
  box-shadow: 0 -8px 24px rgba(246, 209, 74, 0.15);
}

.gold-arch__title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--gold-hi);
  text-shadow: 0 3px 0 #7a5608;
}

.phone {
  margin: 0 auto;
  width: min(220px, 46vw);
  border-radius: 28px;
  overflow: hidden;
  border: 3px solid var(--gold);
  background: #1a0830;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(246, 209, 74, 0.2);
}

.phone img {
  width: 100%;
  height: auto;
  aspect-ratio: 576 / 1024;
  object-fit: contain;
  background: #1a0830;
}

/* ---------- Shared chapter ---------- */
.chapter {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 32px;
}

.chapter__kicker {
  margin: 0 0 8px;
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.chapter__lede {
  color: #ead9ff;
  font-size: 1.05rem;
}

/* ---------- Features / vault ---------- */
.vault {
  padding: 72px 16px;
}

.merge-rail {
  list-style: none;
  margin: 0 auto 40px;
  padding: 0;
  max-width: 1080px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.merge-rail__step {
  width: min(160px, 42vw);
  background: linear-gradient(180deg, #5a2496, #341060);
  border: 2px solid var(--gold);
  border-radius: 22px;
  padding: 18px 12px;
  text-align: center;
  box-shadow: 0 8px 0 #1a0830;
}

.merge-rail__step strong {
  display: block;
  font-family: var(--font-display);
  color: var(--gold-hi);
  margin: 8px 0 4px;
}

.merge-rail__step span:last-child {
  display: block;
  font-size: 0.82rem;
  color: #dcc8f5;
}

.merge-rail__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
  color: var(--ink);
}

.merge-rail__icon svg {
  width: 22px;
  height: 22px;
}

.merge-rail__step--prize {
  border-color: var(--lime);
  box-shadow: 0 8px 0 #1a0830, 0 0 18px rgba(126, 211, 33, 0.35);
}

.merge-rail__arrow {
  width: 28px;
  height: 8px;
  background: linear-gradient(90deg, var(--gold), var(--gold-hi));
  clip-path: polygon(0 0, 78% 0, 100% 50%, 78% 100%, 0 100%);
}

.ledger {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.ledger__row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(180deg, #542094, #3a1570);
  border: 2px solid var(--gold);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 0 #240a48;
}

.ledger__gem {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--ink);
}

.ledger__gem svg {
  width: 28px;
  height: 28px;
}

.ledger__gem--emerald { background: radial-gradient(circle at 30% 30%, #b6ff7a, #2f8a12); }
.ledger__gem--sapphire { background: radial-gradient(circle at 30% 30%, #9be7ff, #1578c8); }
.ledger__gem--amethyst { background: radial-gradient(circle at 30% 30%, #e0b4ff, #7a28c8); }
.ledger__gem--ruby { background: radial-gradient(circle at 30% 30%, #ffb0c8, #c81e58); }

.ledger__body h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold-hi);
}

.ledger__body p {
  margin: 0;
  color: #ead9ff;
  font-size: 0.92rem;
}

.chip {
  justify-self: end;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip--go {
  background: linear-gradient(180deg, #b6f25a, var(--lime-lo));
  color: #fff;
}

.chip--opt {
  background: linear-gradient(180deg, #c9c9d4, #6d6d7a);
  color: #1a1a22;
}

.chip--gold {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
  color: var(--ink);
}

/* ---------- Daily ritual ---------- */
.ritual {
  padding: 24px 16px 80px;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 28px;
}

.ritual__copy p:last-child {
  color: #ead9ff;
}

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

.ritual__beats li {
  position: relative;
  padding: 18px 18px 18px 88px;
  background: #2e1058;
  border: 2px solid #7a46b8;
  border-radius: 18px;
}

.ritual__num {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--gold);
}

.ritual__beats h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  color: var(--gold-hi);
}

.ritual__beats p {
  margin: 0;
  color: #ead9ff;
}

/* ---------- Rate track ---------- */
.rate {
  padding: 48px 16px 80px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(246, 209, 74, 0.12), transparent 55%);
}

.rate__board {
  max-width: 820px;
  margin: 0 auto 16px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 12px 20px;
  background: linear-gradient(180deg, #5a2496, #341060);
  border: 2px solid var(--gold);
  border-radius: 28px;
  position: relative;
}

.rate__board::before {
  content: "";
  position: absolute;
  left: 40px;
  right: 40px;
  top: 38px;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--gold) 0 10px, transparent 10px 18px);
  opacity: 0.45;
}

.rate__token {
  position: relative;
  z-index: 1;
  width: 56px;
  border: 0;
  background: transparent;
  color: var(--cream);
  display: grid;
  justify-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  font-family: inherit;
}

.rate__token i,
.rate__token svg {
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 50%;
  background: linear-gradient(180deg, #8a8a96, #4a4a56);
  color: #ececf2;
}

.rate__token.is-done i,
.rate__token.is-done svg {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
  color: var(--ink);
}

.rate__token.is-active i,
.rate__token.is-active svg {
  background: linear-gradient(180deg, #b6f25a, var(--lime-lo));
  color: #fff;
  box-shadow: 0 0 0 3px #fff, 0 0 16px var(--lime);
}

.rate__caption {
  text-align: center;
  color: #dcc8f5;
  max-width: 640px;
  margin: 0 auto 28px;
  min-height: 3.2em;
}

.rate__facts {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 860px;
  display: grid;
  gap: 12px;
}

.rate__facts li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  background: rgba(26, 8, 48, 0.55);
  border: 1px solid rgba(246, 209, 74, 0.28);
  border-radius: 16px;
}

.rate__facts svg {
  width: 22px;
  height: 22px;
  color: var(--gold);
  flex-shrink: 0;
  margin-top: 2px;
}

.rate__facts strong {
  display: block;
  color: var(--gold-hi);
}

.rate__facts span {
  color: #ead9ff;
  font-size: 0.92rem;
}

/* ---------- Screenshot showcase (podium + rack) ---------- */
.showcase {
  padding: 24px 16px 80px;
}

.showcase__stage {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  gap: 28px;
  align-items: end;
}

.showcase__podium {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.showcase__hero {
  position: relative;
  z-index: 11;
  border: 0;
  padding: 0;
  background: transparent;
  width: min(280px, 58vw);
}

.showcase__hero:focus-visible {
  outline: 3px solid var(--gold-hi);
  outline-offset: 6px;
  border-radius: 28px;
}

.phone--hero {
  width: 100%;
  margin: 0;
  box-shadow:
    0 0 0 4px var(--gold),
    0 0 0 10px rgba(90, 30, 140, 0.55),
    0 28px 50px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(246, 209, 74, 0.28);
}

.showcase__hero:hover .phone--hero {
  box-shadow:
    0 0 0 4px var(--gold-hi),
    0 0 0 10px rgba(90, 30, 140, 0.55),
    0 28px 50px rgba(0, 0, 0, 0.5),
    0 0 48px rgba(246, 209, 74, 0.45);
}

.showcase__dais {
  width: min(340px, 78vw);
  height: 28px;
  margin-top: -8px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #ff5a6a 0%, #8a1028 70%);
  box-shadow:
    0 10px 0 #4a0814,
    0 0 30px rgba(233, 30, 80, 0.35);
}

.showcase__plaque {
  margin: 16px 0 0;
  text-align: center;
}

.showcase__kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.showcase__plaque strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--gold-hi);
  text-shadow: 0 2px 0 #7a5608;
}

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

.showcase__tile {
  border: 2px solid rgba(246, 209, 74, 0.35);
  background: linear-gradient(180deg, #4a1a80, #2a0d52);
  border-radius: 16px;
  padding: 8px 6px 10px;
  color: var(--cream);
  display: grid;
  gap: 8px;
  justify-items: center;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.showcase__tile span {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #dcc8f5;
}

.showcase__tile:hover,
.showcase__tile:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(246, 209, 74, 0.28);
  outline: none;
}

.showcase__tile.is-active,
.showcase__tile[hidden] {
  display: none;
}

.phone--tile {
  width: 100%;
  max-width: 120px;
  margin: 0;
  border-width: 2px;
  border-radius: 16px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.phone--tile img {
  aspect-ratio: 576 / 1024;
  object-fit: contain;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 2, 24, 0.82);
}

.lightbox__frame {
  position: relative;
  z-index: 91;
  display: grid;
  justify-items: center;
  gap: 12px;
  max-height: calc(100svh - 32px);
}

.lightbox__title {
  margin: 0;
  font-family: var(--font-display);
  color: var(--gold-hi);
  text-shadow: 0 2px 0 #7a5608;
}

.phone--lightbox {
  width: min(360px, 78vw);
  max-height: calc(100svh - 96px);
  margin: 0;
}

.phone--lightbox img {
  width: 100%;
  height: auto;
  max-height: calc(100svh - 120px);
  object-fit: contain;
  aspect-ratio: 576 / 1024;
}

.lightbox .modal__x {
  position: absolute;
  top: -4px;
  right: -4px;
}

/* ---------- Lucky box download ---------- */
.lucky {
  padding: 20px 16px 96px;
}

.lucky__box {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 22px 26px;
  text-align: center;
  background: linear-gradient(180deg, #4db7ff 0%, #6b2ad4 48%, #4a1a8a 100%);
  border: 3px solid #c084fc;
  border-radius: 28px;
  box-shadow: 0 0 0 6px rgba(90, 30, 140, 0.5), 0 24px 50px rgba(0, 0, 0, 0.4);
}

.lucky__ribbon {
  display: inline-block;
  margin: 0 0 10px;
  padding: 8px 22px;
  background: linear-gradient(180deg, #ff5dad, var(--magenta-lo));
  border-radius: 8px 8px 18px 18px;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 6px 0 #7a0a42;
}

.lucky__copy {
  color: #fff;
  margin: 12px 0 18px;
}

.lucky__prizes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.lucky__prize {
  background: rgba(20, 6, 40, 0.45);
  border-radius: 16px;
  padding: 14px 8px;
  color: var(--gold-hi);
  font-weight: 800;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.lucky__prize svg {
  width: 28px;
  height: 28px;
}

.lucky__actions {
  display: grid;
  gap: 10px;
}

/* ---------- Footer ---------- */
.foot {
  padding: 0 16px 40px;
}

.foot__frame {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 22px 22px;
  border: 3px solid var(--gold-lo);
  border-radius: 28px 28px 18px 18px;
  background: linear-gradient(180deg, #3a1570, #1e0a3c);
  box-shadow: 0 0 30px rgba(246, 209, 74, 0.12);
}

.foot__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.foot__brand img {
  border-radius: 12px;
  border: 2px solid var(--gold);
}

.foot__brand strong {
  display: block;
  font-family: var(--font-display);
  color: var(--gold-hi);
}

.foot__brand span {
  color: #d7b8ff;
  font-size: 0.88rem;
}

.foot__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 16px;
}

.foot__legal a {
  color: var(--gold);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.foot__legal a:hover,
.foot__legal a:focus-visible {
  color: var(--gold-hi);
}

.foot__disclaimer {
  font-size: 0.82rem;
  color: #cbb6e8;
  margin: 0 0 12px;
}

.foot__copy {
  margin: 0;
  font-size: 0.82rem;
  color: #9d82c4;
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 2, 24, 0.72);
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 28px 22px 22px;
  text-align: center;
  background: linear-gradient(180deg, #57b8ff, #5b28c4);
  border: 3px solid #c084fc;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal__x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--magenta);
  color: #fff;
  display: grid;
  place-items: center;
}

.modal__kicker {
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal__body {
  color: #fff;
  margin: 10px 0 18px;
}

/* ---------- Breakpoints ---------- */
@media (min-width: 768px) {
  .nav-toggle,
  .drawer {
    display: none !important;
  }

  .level-node__label {
    opacity: 1;
  }

  .hud {
    padding-bottom: 28px;
  }

  .stage {
    padding-top: 28px;
  }

  .ritual {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: center;
  }

  .ledger__row {
    padding: 16px 20px;
  }

  .showcase__stage {
    grid-template-columns: minmax(240px, 0.85fr) minmax(0, 1.15fr);
    gap: 28px;
    align-items: center;
  }

  .showcase__hero {
    width: min(260px, 100%);
  }

  .showcase__rack {
    gap: 12px;
  }

  .phone--tile {
    max-width: 130px;
  }
}

@media (min-width: 1024px) {
  .hud__inner {
    gap: 20px;
  }

  .brand__name {
    font-size: 1.05rem;
  }

  .level-node {
    width: 46px;
    height: 46px;
  }

  .showcase__hero {
    width: min(300px, 100%);
  }

  .phone--tile {
    max-width: 148px;
  }

  .rate__token {
    width: 72px;
  }
}

@media (max-width: 767px) {
  .level-track {
    display: none;
  }

  .btn--cashout {
    padding: 10px 12px;
    font-size: 0.7rem;
  }

  .ledger__row {
    grid-template-columns: 52px 1fr;
    grid-template-rows: auto auto;
  }

  .ledger__gem {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }

  .chip {
    grid-column: 2;
    justify-self: start;
  }

  .merge-rail__arrow {
    display: none;
  }

  .rate__token span {
    font-size: 0.58rem;
  }

  .rate__token i,
  .rate__token svg {
    width: 36px;
    height: 36px;
    padding: 8px;
  }
}

@media (max-width: 374px) {
  .brand__copy {
    display: none;
  }
}

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

  .stage__rays,
  .atmosphere__sparkles {
    animation: none;
  }

  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@keyframes spin-rays {
  to {
    transform: rotate(360deg);
  }
}
