:root {
  color-scheme: dark;
  --bg: #0d0b1e;
  --bg-2: #15122e;
  --panel: #1c1840;
  --panel-2: #241f52;
  --line: #3b3480;
  --ink: #f4ecd8;
  --muted: #a9a2c9;
  --gold: #ffcc33;
  --gold-dark: #c88a12;
  --wood: #8a4f24;
  --danger: #ff6b6b;
  --ok: #4ade80;

  --common: #c9c3b6;
  --uncommon: #4ade80;
  --rare: #38bdf8;
  --epic: #c084fc;
  --legendary: #ffcc33;

  --pixel: "Press Start 2P", ui-monospace, monospace;
  --body: "VT323", ui-monospace, monospace;
  --shadow: 0 4px 0 #000;
  --radius: 0;
  --gutter: 16px;
  --max: 1120px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% -10%, #2a2266 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.012) 3px 4px),
    var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 22px;
  line-height: 1.35;
  -webkit-font-smoothing: none;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--gold); }
code { font-family: var(--body); background: var(--bg-2); padding: 0 6px; border: 1px solid var(--line); }
h1, h2, h3 { font-family: var(--pixel); font-weight: 400; line-height: 1.5; margin: 0 0 .6em; }
h1 { font-size: clamp(18px, 4.6vw, 34px); }
h2 { font-size: clamp(16px, 3.4vw, 24px); color: var(--gold); text-shadow: 3px 3px 0 #000; }
h3 { font-size: 13px; }
p { margin: 0 0 1em; }
.gold { color: var(--gold); }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 19px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


/* ---------- Buttons ---------- */
.btn {
  --b: var(--gold);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--pixel); font-size: 12px; line-height: 1;
  padding: 14px 18px; min-height: 44px;
  color: #1a1000; background: var(--b); border: 0; cursor: pointer; text-decoration: none;
  box-shadow: inset -4px -4px 0 var(--gold-dark), inset 4px 4px 0 #fff3b0, 0 0 0 3px #000;
  transition: transform .06s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(2px); }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.btn[disabled] { filter: grayscale(1) brightness(.6); cursor: not-allowed; transform: none; }
.btn-ghost { background: var(--panel-2); color: var(--ink); box-shadow: inset -4px -4px 0 #15122e, inset 4px 4px 0 #3b3480, 0 0 0 3px #000; }
.btn-small { font-size: 10px; padding: 10px 12px; min-height: 40px; }
.btn-big { font-size: 14px; padding: 18px 24px; width: 100%; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
  padding: 10px var(--gutter);
  background: rgba(13, 11, 30, .92); backdrop-filter: blur(6px);
  border-bottom: 3px solid #000;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--pixel); font-size: 12px; color: var(--gold); text-decoration: none; text-shadow: 2px 2px 0 #000; }
.brand-chest { width: 28px; }
.nav-links { display: none; gap: 20px; }
.nav-links a { color: var(--ink); text-decoration: none; font-size: 22px; }
.nav-links a:hover { color: var(--gold); }
@media (min-width: 860px) { .nav-links { display: flex; } }

/* ---------- Layout ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 64px 0 24px; scroll-margin-top: 70px; }
.section-lede { color: var(--muted); max-width: 60ch; }
.panel, .card {
  background: var(--panel); padding: 20px;
  box-shadow: inset -4px -4px 0 #120f2b, inset 4px 4px 0 #2e2866, 0 0 0 3px #000, 6px 6px 0 #000;
}

/* ---------- Hero ---------- */
.hero { display: grid; gap: 28px; padding: 40px 0 16px; align-items: center; }
.eyebrow { font-family: var(--pixel); font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.lede { font-size: 24px; color: #ddd5f4; max-width: 44ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-art { position: relative; display: grid; place-items: center; min-height: 260px; }
.hero-chest { width: min(320px, 80vw); animation: bob 2.6s ease-in-out infinite; filter: drop-shadow(8px 8px 0 #000); }
.hero-chest .chest-glow rect { fill: var(--gold); opacity: .25; }
.hero-coins span { position: absolute; width: 26px; animation: float 3s ease-in-out infinite; }
.hero-coins span:nth-child(1) { left: 12%; top: 18%; }
.hero-coins span:nth-child(2) { right: 14%; top: 8%; animation-delay: -1s; width: 20px; }
.hero-coins span:nth-child(3) { right: 8%; bottom: 14%; animation-delay: -2s; }
.stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0; }
.stats div { background: var(--bg-2); padding: 12px 14px; box-shadow: 0 0 0 3px #000; }
.stats dt { font-family: var(--pixel); font-size: 9px; color: var(--muted); margin-bottom: 6px; }
.stats dd { margin: 0; font-size: 30px; color: var(--gold); }
@media (min-width: 860px) {
  .hero { grid-template-columns: 1.1fr .9fr; padding-top: 72px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
}

@keyframes bob { 50% { transform: translateY(-10px); } }
@keyframes float { 50% { transform: translateY(-14px) rotate(8deg); } }

/* ---------- Story ---------- */
.story-grid { display: grid; gap: 20px; }
.story-grid h3 { color: var(--gold); }
@media (min-width: 760px) { .story-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Play ---------- */
.play-grid { display: grid; gap: 24px; }
@media (min-width: 900px) { .play-grid { grid-template-columns: 1fr 1.1fr; } }
.wallet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 22px; word-break: break-all; }
.dot { width: 12px; height: 12px; background: var(--danger); box-shadow: 0 0 0 2px #000; flex: none; }
.dot.on { background: var(--ok); }
.steps { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 14px; }
.steps li { display: grid; gap: 8px; padding: 14px; background: var(--bg-2); box-shadow: 0 0 0 3px #000; }
.steps li strong { font-family: var(--pixel); font-size: 11px; font-weight: 400; }
.steps li span { color: var(--muted); font-size: 20px; }
.steps li.done strong::after { content: " ✓"; color: var(--ok); }
.step-val { font-style: normal; color: var(--gold); font-size: 20px; }
.step-val:empty { display: none; }
.stake-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stake-row input {
  flex: 1 1 140px; min-width: 0; min-height: 40px; padding: 6px 10px;
  font: inherit; color: var(--ink); background: #0a0817; border: 0; box-shadow: inset 0 0 0 3px var(--line);
}
.stake-row input:focus { outline: none; box-shadow: inset 0 0 0 3px var(--gold); }
.keys-box { display: flex; align-items: center; gap: 16px; padding: 14px; background: #0a0817; box-shadow: 0 0 0 3px #000; }
.keys-icon { width: 54px; flex: none; }
.keys-count { font-family: var(--pixel); font-size: 22px; color: var(--gold); }
.keys-sub { color: var(--muted); font-size: 19px; }

.chest-panel { display: grid; gap: 16px; align-content: start; text-align: center; }
.chest-stage {
  --tier: var(--gold);
  position: relative; display: grid; place-items: center; min-height: 280px;
  background: radial-gradient(circle at 50% 60%, #2a2266 0%, #0a0817 70%);
  box-shadow: inset 0 0 0 3px #000; overflow: hidden;
}
.stage-chest { width: min(280px, 72vw); filter: drop-shadow(6px 6px 0 #000); }
.chest-status { min-height: 2.7em; margin: 0; color: #ddd5f4; }

.chest-svg .chest-lid { transform-box: fill-box; transform-origin: 0% 100%; transition: transform .45s cubic-bezier(.3,1.6,.5,1); }
.chest-svg .chest-glow rect, .chest-svg .chest-rays rect { fill: var(--tier, var(--gold)); }
.chest-svg .chest-glow { opacity: 0; transition: opacity .3s; }
.chest-svg .chest-rays { opacity: 0; transform-origin: 8px 5px; transform-box: view-box; }

.chest-stage[data-state="shaking"] .stage-chest { animation: shake .35s steps(2) infinite; }
.chest-stage[data-state="rolling"] .stage-chest { animation: shake .18s steps(2) infinite; }
.chest-stage[data-state="rolling"] .chest-glow { opacity: .6; animation: pulse .6s steps(3) infinite; }
.chest-stage[data-state="open"] .chest-lid { transform: translate(-1px, -5px) rotate(-28deg); }
.chest-stage[data-state="open"] .chest-glow { opacity: 1; }
.chest-stage[data-state="open"] .chest-rays { opacity: .55; animation: spin 6s linear infinite; }
.chest-stage[data-state="open"] { background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--tier) 35%, transparent) 0%, #0a0817 70%); }

@keyframes shake { 0% { transform: translate(-3px, 0) rotate(-2deg); } 100% { transform: translate(3px, -2px) rotate(2deg); } }
@keyframes pulse { 50% { opacity: .2; } }
@keyframes spin { to { transform: rotate(360deg); } }

.sparkles { position: absolute; inset: 0; pointer-events: none; }
.sparkles i { position: absolute; width: 8px; height: 8px; background: var(--tier); box-shadow: 0 0 0 2px #000; animation: burst 1.1s ease-out forwards; }
@keyframes burst { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }

.reveal { padding: 16px; background: #0a0817; box-shadow: 0 0 0 3px var(--tier, var(--gold)), 0 0 24px color-mix(in srgb, var(--tier, var(--gold)) 50%, transparent); animation: pop .4s cubic-bezier(.3,1.6,.5,1); }
.reveal p { margin: 0 0 6px; }
.reveal-rarity { font-family: var(--pixel); font-size: 10px; color: var(--tier); }
.reveal-name { font-family: var(--pixel); font-size: 15px; }
.reveal-amount { font-size: 40px; color: var(--gold); }
.reveal-meta { color: var(--muted); font-size: 18px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

.player-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.player-stats div { background: var(--bg-2); padding: 8px; box-shadow: 0 0 0 3px #000; }
.player-stats dt { font-family: var(--pixel); font-size: 8px; color: var(--muted); }
.player-stats dd { margin: 4px 0 0; font-size: 24px; }

.fuel-box { display: grid; gap: 8px; margin-top: 16px; padding: 14px; background: #0a0817; box-shadow: 0 0 0 3px #000; }
.fuel-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fuel-head strong { font-family: var(--pixel); font-size: 10px; font-weight: 400; align-self: center; }
.fuel-head span { color: var(--gold); font-size: 20px; }
.fuel-bar { height: 12px; background: var(--bg-2); box-shadow: 0 0 0 2px #000; }
.fuel-bar span { display: block; height: 100%; width: 0; background: var(--danger); transition: width .4s; }
.fuel-bar span.ok { background: var(--ok); }
.fuel-note { margin: 0; color: var(--muted); font-size: 18px; }

/* ---------- Tiers ---------- */
.tiers { display: grid; gap: 16px; }
@media (min-width: 640px) { .tiers { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .tiers { grid-template-columns: repeat(5, 1fr); } }
.tier { --tier: var(--common); position: relative; display: grid; gap: 8px; padding: 18px 16px; background: var(--panel); box-shadow: inset 0 6px 0 var(--tier), 0 0 0 3px #000, 6px 6px 0 #000; }
.tier-chest { width: 84px; margin: 4px auto 6px; }
.tier .chest-svg .chest-lid { transform: translate(-1px, -3px) rotate(-16deg); }
.tier .chest-glow { opacity: 1 !important; }
.tier-rarity { font-family: var(--pixel); font-size: 9px; color: var(--tier); }
.tier-name { font-family: var(--pixel); font-size: 11px; line-height: 1.5; }
.tier-reward { font-size: 30px; color: var(--gold); }
.tier-loot { color: var(--muted); font-size: 19px; }
.odds { height: 12px; background: #0a0817; box-shadow: 0 0 0 2px #000; }
.odds span { display: block; height: 100%; background: var(--tier); }
.odds-label { font-size: 20px; }

.t-common { --tier: var(--common); }
.t-uncommon { --tier: var(--uncommon); }
.t-rare { --tier: var(--rare); }
.t-epic { --tier: var(--epic); }
.t-legendary { --tier: var(--legendary); }

/* ---------- Leaderboard ---------- */
.lb-grid { display: grid; gap: 24px; }
@media (min-width: 900px) { .lb-grid { grid-template-columns: 1.3fr 1fr; } }
.lb-table { width: 100%; border-collapse: collapse; font-size: 21px; }
.lb-table th { font-family: var(--pixel); font-size: 9px; color: var(--muted); text-align: left; padding: 6px 4px; font-weight: 400; }
.lb-table td { padding: 8px 4px; border-top: 2px dashed var(--line); }
.lb-table td:nth-child(3), .lb-table th:nth-child(3), .lb-table td:nth-child(4), .lb-table th:nth-child(4) { text-align: right; }
.lb-table tr.me td { color: var(--gold); }
.rank-1 { color: var(--legendary); } .rank-2 { color: #e5e7eb; } .rank-3 { color: #f59e0b; }
.feed { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.feed li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; background: var(--bg-2); box-shadow: inset 4px 0 0 var(--tier, var(--line)); font-size: 20px; }
.feed li a { color: inherit; text-decoration: none; }
.feed .amt { color: var(--tier); white-space: nowrap; }

/* ---------- Tokenomics ---------- */
.tok-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 800px) { .tok-grid { grid-template-columns: 300px 1fr; } }
.donut {
  width: min(280px, 76vw); aspect-ratio: 1; margin: 0 auto; display: grid; place-items: center;
  background: conic-gradient(var(--rare) 0 50%, var(--gold) 50% 75%, var(--uncommon) 75% 85%, var(--epic) 85% 95%, var(--common) 95% 100%);
  -webkit-mask: radial-gradient(circle, transparent 0 40%, #000 40.5%);
  mask: radial-gradient(circle, transparent 0 40%, #000 40.5%);
  position: relative;
}
.donut-wrap { position: relative; width: min(280px, 76vw); margin: 0 auto; }
.donut-wrap .donut { width: 100%; }
.donut-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-family: var(--pixel); font-size: 22px; filter: drop-shadow(3px 3px 0 #000); }
.donut-label small { display: block; margin-top: 8px; font-size: 10px; color: var(--muted); }
.tok-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tok-list li { display: grid; grid-template-columns: 18px 64px 1fr; gap: 4px 12px; align-items: baseline; padding: 12px; background: var(--panel); box-shadow: 0 0 0 3px #000; }
.tok-list i { width: 16px; height: 16px; background: var(--c); box-shadow: 0 0 0 2px #000; align-self: center; }
.tok-list b { font-family: var(--pixel); font-size: 12px; font-weight: 400; color: var(--gold); }
.tok-list span { grid-column: 2 / -1; color: var(--muted); font-size: 19px; }

/* ---------- How ---------- */
.how { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 18px; counter-reset: s; }
@media (min-width: 760px) { .how { grid-template-columns: repeat(4, 1fr); } }
.how li { position: relative; padding: 18px; background: var(--panel); box-shadow: 0 0 0 3px #000, 6px 6px 0 #000; }
.how-n { display: inline-grid; place-items: center; width: 36px; height: 36px; margin-bottom: 10px; font-family: var(--pixel); font-size: 14px; color: #1a1000; background: var(--gold); box-shadow: 0 0 0 3px #000; }
.how p { color: var(--muted); margin: 0; }
.verify ul { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; }
.verify a { word-break: break-all; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; }
.faq details { background: var(--panel); box-shadow: 0 0 0 3px #000; }
.faq summary { cursor: pointer; padding: 16px 18px; font-family: var(--pixel); font-size: 11px; line-height: 1.6; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "▶ "; color: var(--gold); }
.faq details[open] summary::before { content: "▼ "; }
.faq p { padding: 0 18px 16px; margin: 0; color: #ddd5f4; }

/* ---------- Footer ---------- */
.footer { max-width: var(--max); margin: 64px auto 0; padding: 28px var(--gutter) 48px; border-top: 3px dashed var(--line); text-align: center; }

/* ---------- Dialog & toasts ---------- */
.dialog { max-width: min(420px, calc(100vw - 32px)); width: 100%; padding: 22px; color: var(--ink); background: var(--panel); border: 0; box-shadow: 0 0 0 3px #000, 8px 8px 0 #000; }
.dialog::backdrop { background: rgba(5, 4, 15, .75); }
.dialog form { display: grid; gap: 14px; }
.dialog h2 { font-size: 14px; }
.wallet-list { display: grid; gap: 10px; }
.wallet-option { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; font: inherit; color: var(--ink); background: var(--bg-2); border: 0; box-shadow: 0 0 0 3px #000; cursor: pointer; text-align: left; }
.wallet-option:hover, .wallet-option:focus-visible { box-shadow: 0 0 0 3px var(--gold); outline: none; }
.wallet-option img { width: 32px; height: 32px; }
.wallet-option small { display: block; color: var(--muted); font-size: 17px; }
.wallet-none { display: grid; gap: 10px; }

.toasts { position: fixed; z-index: 50; left: 50%; bottom: 16px; transform: translateX(-50%); display: grid; gap: 10px; width: min(440px, calc(100vw - 32px)); }
.toast { padding: 12px 14px; background: var(--panel-2); box-shadow: 0 0 0 3px #000, 4px 4px 0 #000; font-size: 20px; animation: pop .25s; }
.toast.ok { box-shadow: 0 0 0 3px var(--ok), 4px 4px 0 #000; }
.toast.err { box-shadow: 0 0 0 3px var(--danger), 4px 4px 0 #000; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Solana edition ---------- */
.top-sticky { position: sticky; top: 0; z-index: 30; }
.top-sticky .nav { position: static; }
.risk-bar {
  background: #ff9f43; color: #1a0e00; text-align: center;
  font-size: 19px; line-height: 1.25; padding: 6px var(--gutter);
  border-bottom: 3px solid #000;
}
.risk-bar b { font-weight: 400; text-decoration: underline; }
.cta-risk { margin: 12px 0 0; color: #ffb877; font-size: 19px; }
.buy-grid { display: grid; gap: 24px; }
@media (min-width: 900px) { .buy-grid { max-width: 720px; } }
.how-buy { margin: 0 0 18px; padding-left: 1.2em; display: grid; gap: 10px; }
.how-buy code.mint { display: inline-block; margin-top: 6px; word-break: break-all; color: var(--gold); }
.warn-panel { box-shadow: inset 0 6px 0 #ff9f43, 0 0 0 3px #000, 6px 6px 0 #000; }
.warn-panel h3 { color: #ffb877; }
.warn-panel ul, .risk-list { margin: 0; padding-left: 1.1em; display: grid; gap: 8px; }
.warn-panel b, .risk-list b { color: #ffb877; font-weight: 400; }
.holder-box { padding: 14px; margin-bottom: 14px; background: #0a0817; box-shadow: 0 0 0 3px #000; }
.holder-amount { font-family: var(--pixel); font-size: 18px; color: var(--gold); }
.holder-sub { color: var(--muted); font-size: 19px; }
.wallet-panel .btn { width: 100%; margin-bottom: 14px; }
.stats dd.up { color: var(--ok); }
.stats dd.down { color: var(--danger); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.facts li { display: grid; gap: 2px; padding: 10px 12px; background: var(--panel); box-shadow: 0 0 0 3px #000; }
.facts b { font-family: var(--pixel); font-size: 10px; font-weight: 400; color: var(--muted); }
.facts span { word-break: break-all; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 20px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--gold); }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.btn[aria-disabled="true"] { filter: grayscale(1) brightness(.6); pointer-events: none; }
.wallet-option { font-size: 22px; }
