:root {
  --bg: #08090a;
  --bg-2: #101216;
  --panel: rgba(255,255,255,0.022);
  --ink: #eef0f4;
  --muted: rgba(238,240,244,0.52);
  --faint: rgba(238,240,244,0.28);
  --amber: #f5a623;
  --amber-2: #ffc759;
  --cool: #6fb7d4;
  --line: rgba(180,190,210,0.13);
  --line-soft: rgba(255,255,255,0.06);
  --good: #5fd6a0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink);
  font-family: 'Space Grotesk', sans-serif; line-height: 1.5;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(245,166,35,0.3); color: #fff; }
h1,h2,h3,h4 { font-family: 'Bricolage Grotesque','Space Grotesk',sans-serif; }
img { display: block; }
.amber { color: var(--amber); }

/* Background */
.bg { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 14% 18%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 70% 22%, rgba(255,220,180,0.5), transparent),
    radial-gradient(1px 1px at 44% 60%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 88% 54%, rgba(255,255,255,0.4), transparent);
  background-repeat: no-repeat; opacity: 0.6;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 10%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 10%, #000, transparent 75%);
}
.glow { position: absolute; border-radius: 50%; filter: blur(120px); }
.glow-amber { width: 600px; height: 600px; top: -240px; left: 50%; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(245,166,35,0.14), transparent 70%);
  animation: drift 16s ease-in-out infinite alternate; }
.glow-cool { width: 460px; height: 460px; bottom: -160px; right: -120px;
  background: radial-gradient(circle, rgba(111,183,212,0.08), transparent 70%);
  animation: drift 22s ease-in-out infinite alternate-reverse; }
@keyframes drift { 0%{opacity:.6;transform:translateX(-50%) scale(1)} 100%{opacity:1;transform:translateX(-48%) scale(1.12)} }
.noise { position: absolute; inset: 0; opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* Nav */
nav {
  position: sticky; top: 0; z-index: 50; height: 72px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px,4vw,40px);
  background: rgba(8,9,10,0.72); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { width: 28px; height: 28px; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: 0.14em; color: var(--ink); }
.nav-links { display: flex; gap: 26px; position: absolute; left: 50%; transform: translateX(-50%); }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-actions { display: flex; gap: 10px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 100px;
  padding: 9px 15px; cursor: pointer; transition: all .2s;
}
.chip-btn:hover { border-color: var(--amber); color: var(--amber-2); }
.chip-btn.connected { border-color: rgba(95,214,160,0.4); color: var(--good); background: rgba(95,214,160,0.06); }
.btn-amber.connected, .btn-ghost.connected { position: relative; }
.btn-ghost.connected { border-color: rgba(95,214,160,0.4); color: var(--good); background: rgba(95,214,160,0.06); }

/* Buttons */
.btn-amber {
  font-family: inherit; font-size: 15px; font-weight: 600; color: #1a1206;
  background: linear-gradient(180deg, var(--amber-2), var(--amber));
  border: none; border-radius: 100px; padding: 14px 28px; cursor: pointer;
  box-shadow: 0 8px 26px rgba(245,166,35,0.28); transition: transform .2s, box-shadow .2s;
}
.btn-amber:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(245,166,35,0.4); }
.btn-ghost {
  font-family: inherit; font-size: 15px; font-weight: 600; color: var(--ink);
  background: transparent; border: 1px solid var(--line); border-radius: 100px;
  padding: 14px 26px; cursor: pointer; transition: all .2s;
}
.btn-ghost:hover { border-color: var(--amber); background: rgba(245,166,35,0.06); }
.btn-soon {
  font-family: inherit; font-size: 14px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--faint); background: rgba(255,255,255,0.02);
  border: 1px dashed var(--line); border-radius: 100px; padding: 14px 26px;
  cursor: not-allowed;
}
.full { width: 100%; }

/* Hero */
.hero {
  position: relative; text-align: center;
  padding: clamp(70px,12vh,120px) 24px clamp(50px,8vh,80px);
  display: flex; flex-direction: column; align-items: center;
}
.hero-orb {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,166,35,0.12), transparent 65%);
  filter: blur(40px); z-index: -1;
}
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.26em; color: var(--amber-2); margin-bottom: 22px; }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.hero h1 { font-size: clamp(40px,7vw,80px); font-weight: 800; letter-spacing: -0.02em; line-height: 1; margin-bottom: 22px; }
.hero-sub { font-size: clamp(15px,1.6vw,18px); color: var(--muted); max-width: 540px; line-height: 1.65; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }
.hero-note { font-size: 12px; color: var(--faint); }

/* Sections */
.section { padding: clamp(50px,8vh,90px) 24px; }
.container { max-width: 1100px; margin: 0 auto; }
.sec-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 30px; flex-wrap: wrap; }
.sec-title h2 { font-size: clamp(26px,3.6vw,40px); font-weight: 700; letter-spacing: -0.01em; }
.sec-hint { font-size: 13px; color: var(--faint); letter-spacing: 0.04em; }
.lead { font-size: clamp(15px,1.7vw,19px); color: var(--muted); max-width: 640px; line-height: 1.6; margin-bottom: 26px; }

/* Dashboard */
.stat-cards { display: grid; grid-template-columns: repeat(5,1fr); gap: 14px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 16px;
  padding: 22px 20px; display: flex; flex-direction: column; gap: 10px;
}
.stat-card.glow-card { border-color: rgba(245,166,35,0.25); box-shadow: 0 0 30px rgba(245,166,35,0.06); }
.sc-label { font-size: 12px; color: var(--faint); letter-spacing: 0.06em; text-transform: uppercase; }
.sc-value { font-family: 'Bricolage Grotesque',sans-serif; font-size: clamp(22px,2.6vw,30px); font-weight: 700; letter-spacing: -0.01em; }
.sc-value small { font-size: 13px; font-weight: 500; color: var(--muted); }
.level-bar { margin-top: 20px; }
.lb-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.lb-track { height: 8px; background: rgba(255,255,255,0.05); border-radius: 100px; overflow: hidden; }
.lb-fill { height: 100%; background: linear-gradient(90deg, var(--amber), var(--amber-2)); border-radius: 100px; box-shadow: 0 0 12px rgba(245,166,35,0.5); }

/* Games */
.games-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.game-card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 20px; padding: 26px; }
.gc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.gc-head h3 { font-size: 22px; font-weight: 600; }
.gc-tag { font-size: 12px; font-weight: 600; color: var(--amber-2); background: rgba(245,166,35,0.1); border: 1px solid rgba(245,166,35,0.2); padding: 5px 12px; border-radius: 100px; }
.gc-desc { font-size: 14px; color: var(--muted); margin-bottom: 22px; }

/* Wheel */
.wheel-wrap { position: relative; width: 220px; height: 220px; margin: 0 auto 18px; }
.wheel-pointer { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); z-index: 3;
  width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 18px solid var(--amber); filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.wheel {
  width: 100%; height: 100%; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.08);
  background: conic-gradient(
    #15171c 0deg 45deg, #1d2027 45deg 90deg, #15171c 90deg 135deg, #1d2027 135deg 180deg,
    #15171c 180deg 225deg, #1d2027 225deg 270deg, #15171c 270deg 315deg, #1d2027 315deg 360deg);
  position: relative; transition: transform 4s cubic-bezier(0.16,1,0.3,1);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.6), 0 0 30px rgba(245,166,35,0.08);
}
.wheel::before { content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: repeating-conic-gradient(rgba(245,166,35,0.5) 0deg 0.4deg, transparent 0.4deg 45deg); opacity: 0.5; }
.wheel-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 54px; height: 54px; border-radius: 50%; background: var(--bg-2); border: 2px solid var(--amber);
  display: flex; align-items: center; justify-content: center; z-index: 2; }
.wheel-center img { width: 60%; opacity: 0.9; }
.wheel-result { text-align: center; min-height: 24px; font-weight: 600; color: var(--amber-2); margin-bottom: 14px; }

/* Slots */
.slots { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 14px; }
.reel { height: 96px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; position: relative; }
.reel::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 14px 18px -10px #000, inset 0 -14px 18px -10px #000; pointer-events: none; }
.reel-strip { display: flex; flex-direction: column; transition: transform 0.1s linear; }
.reel-cell { height: 96px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.reel-cell svg { width: 46px; height: 46px; color: var(--amber-2); filter: drop-shadow(0 0 8px rgba(245,166,35,0.25)); }
.slot-result { text-align: center; min-height: 22px; font-weight: 600; color: var(--amber-2); margin-bottom: 14px; }
.payouts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.payouts span { font-size: 12px; color: var(--muted); background: rgba(255,255,255,0.03); border: 1px solid var(--line-soft); padding: 5px 10px; border-radius: 8px; }
.payouts b { color: var(--amber-2); }

/* Missions */
.mission-groups { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.mission-col { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 18px; padding: 22px; }
.mc-title { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber-2); margin-bottom: 16px; }
.mission { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 13px 0; border-top: 1px solid var(--line-soft); }
.mission:first-of-type { border-top: none; }
.m-name { font-size: 14px; }
.m-pts { font-size: 14px; font-weight: 700; color: var(--amber-2); font-family: 'Bricolage Grotesque',sans-serif; }
.m-state { font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 100px; cursor: pointer; border: 1px solid var(--line); color: var(--ink); transition: all .2s; }
.m-state:hover { border-color: var(--amber); }
.m-state.done { color: var(--good); border-color: rgba(95,214,160,0.3); background: rgba(95,214,160,0.07); cursor: default; }
.m-state.claim { color: #1a1206; background: var(--amber); border-color: var(--amber); }
.m-state.locked { color: var(--faint); border-style: dashed; cursor: default; }

/* Leaderboard */
.tabs { display: flex; gap: 6px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 100px; padding: 4px; }
.tab { font-family: inherit; font-size: 13px; font-weight: 600; color: var(--muted); background: transparent; border: none; padding: 8px 16px; border-radius: 100px; cursor: pointer; transition: all .2s; }
.tab.active { color: #1a1206; background: var(--amber); }
.board { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 18px; overflow: hidden; }
.board-row { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 12px; padding: 15px 22px; border-top: 1px solid var(--line-soft); }
.board-row.head { border-top: none; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.r-rank { font-family: 'Bricolage Grotesque',sans-serif; font-weight: 700; color: var(--muted); }
.r-user { font-weight: 500; }
.r-pts { font-family: 'Bricolage Grotesque',sans-serif; font-weight: 700; }
.board-row.top1 .r-rank { color: var(--amber-2); }
.board-row.top1 .r-pts, .board-row.top2 .r-pts, .board-row.top3 .r-pts { color: var(--amber-2); }
.board-row.me { background: rgba(245,166,35,0.07); border-top: 1px solid rgba(245,166,35,0.2); }
.board-row.me .r-user { color: var(--amber-2); }
.board.empty { padding: 56px 24px; }
.board-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.be-ico { font-size: 34px; opacity: 0.8; }
.board-empty p { color: var(--muted); font-size: 15px; }
.soon-badge { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: var(--amber-2); padding: 9px 20px; border: 1px dashed rgba(245,166,35,0.4); border-radius: 100px; }

/* Rewards */
.reward-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.reward-card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 16px; padding: 26px 22px; display: flex; align-items: center; gap: 16px; transition: all .3s; }
.reward-card:hover { border-color: var(--line); transform: translateY(-4px); background: rgba(245,166,35,0.03); }
.rc-ico { font-size: 22px; color: var(--amber-2); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: rgba(245,166,35,0.08); border: 1px solid rgba(245,166,35,0.2); border-radius: 12px; }
.reward-card h4 { font-size: 17px; font-weight: 600; }

/* Referral */
.referral-box { background: linear-gradient(135deg, rgba(245,166,35,0.06), var(--panel)); border: 1px solid rgba(245,166,35,0.18); border-radius: 22px; padding: 36px; display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.rb-text h2 { font-size: clamp(24px,3vw,34px); margin-bottom: 10px; }
.rb-text .lead { margin-bottom: 0; }
.rb-link { display: flex; gap: 10px; flex: 1; min-width: 280px; }
.rb-link input { flex: 1; background: var(--bg-2); border: 1px solid var(--line); border-radius: 100px; padding: 14px 20px; color: var(--ink); font-family: inherit; font-size: 14px; outline: none; }

/* Footer */
footer { text-align: center; padding: 60px 24px; border-top: 1px solid var(--line-soft); margin-top: 40px; }
.footer-logo { width: 32px; height: 32px; object-fit: contain; opacity: 0.55; margin: 0 auto 16px; }
.footer-note { max-width: 540px; margin: 0 auto 12px; font-size: 12px; color: var(--faint); line-height: 1.6; }
.footer-fine { font-size: 12px; color: var(--faint); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(0.16,1,0.3,1), transform .7s cubic-bezier(0.16,1,0.3,1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .glow, .wheel { animation: none; }
}

/* Responsive */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .stat-cards { grid-template-columns: repeat(2,1fr); }
  .games-grid { grid-template-columns: 1fr; }
  .mission-groups { grid-template-columns: 1fr; }
  .reward-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 540px) {
  .stat-cards { grid-template-columns: 1fr; }
  .reward-grid { grid-template-columns: 1fr; }
  .nav-actions .chip-btn { padding: 8px 12px; font-size: 12px; }
  .referral-box { padding: 26px; }
}
