:root {
  --bg: #0f1120;
  --bg-alt: #171933;
  --card: #1e2142;
  --text: #f4f5fb;
  --text-muted: #a7abc9;
  --accent: #7c5cff;
  --accent-2: #ff5c9e;
  --border: #2a2d54;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3 {
  line-height: 1.2;
  font-weight: 700;
}

h2 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 40px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 17, 32, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav ul {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav ul a {
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
}

.nav ul a:hover {
  color: var(--text);
}

.nav-cta {
  display: inline-block;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 92, 255, 0.35);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--accent);
}

.btn-small {
  padding: 8px 18px;
  font-size: 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
}

.btn-small:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Hero */
.hero {
  padding: 120px 0 100px;
  text-align: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(124, 92, 255, 0.25), transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(255, 92, 158, 0.2), transparent 40%);
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 20px;
}

.hero p {
  max-width: 560px;
  margin: 0 auto 32px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.hero-controller {
  width: 84px;
  margin: 0 auto 12px;
}

.hero-controller svg {
  width: 100%;
  height: auto;
}

.wordmark {
  font-size: 3.4rem;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.wordmark-accent {
  background: linear-gradient(90deg, #2fd0ff, #c026ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  color: var(--text-muted);
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 28px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
  list-style: none;
  margin-bottom: 40px;
}

.badge-row li a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

.badge-row li a:hover {
  color: var(--text);
}

.badge-row svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.badge-row li:nth-child(1) svg { color: #2fd0ff; }
.badge-row li:nth-child(2) svg { color: #7c5cff; }
.badge-row li:nth-child(3) svg { color: #ff5c9e; }
.badge-row li:nth-child(4) svg { color: #3fd1c5; }

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* Games */
.games {
  padding: 100px 0;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.game-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.game-thumb {
  height: 140px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.thumb-1 { background: linear-gradient(135deg, #7c5cff, #3a2fb8); }
.thumb-2 { background: linear-gradient(135deg, #ff5c9e, #b8317f); }
.thumb-3 { background: linear-gradient(135deg, #3fd1c5, #1b8a80); }
.thumb-4 { background: linear-gradient(135deg, #ffb84c, #d97b1f); }

.game-card h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.game-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 18px;
  min-height: 66px;
}

/* Features */
.features {
  padding: 100px 0;
  background: var(--bg-alt);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  text-align: center;
}

.feature-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.feature h3 {
  margin-bottom: 10px;
}

.feature p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.section-lede {
  text-align: center;
  color: var(--text-muted);
  max-width: 520px;
  margin: -20px auto 48px;
}

/* Shop */
.shop {
  padding: 100px 0;
  background: var(--bg-alt);
}

.wallet {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 480px;
  margin: 0 auto 48px;
  padding: 20px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.wallet-coin {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd15c, #d9971f);
  color: #241a02;
}

.wallet-coin svg {
  width: 26px;
  height: 26px;
}

.wallet-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.wallet-label {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.wallet-value {
  font-size: 1.3rem;
  font-weight: 800;
}

.wallet-cta {
  padding: 10px 18px;
  font-size: 0.9rem;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.shop-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.shop-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.shop-thumb {
  height: 120px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.shop-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 8px;
}

.shop-card h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.shop-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 18px;
  min-height: 54px;
}

.shop-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shop-price {
  font-weight: 700;
  color: #ffd15c;
}

/* Leaderboards */
.leaderboards {
  padding: 100px 0;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 16px 20px;
  text-align: left;
}

.leaderboard-table thead {
  background: rgba(255, 255, 255, 0.03);
}

.leaderboard-table th {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.leaderboard-table tbody tr {
  border-top: 1px solid var(--border);
}

.leaderboard-table td:last-child {
  font-weight: 700;
  color: var(--accent);
}

.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.06);
}

.rank-1 { background: linear-gradient(135deg, #ffd15c, #d9971f); color: #241a02; }
.rank-2 { background: linear-gradient(135deg, #d7dbe6, #9ba1b5); color: #1a1c2b; }
.rank-3 { background: linear-gradient(135deg, #e2a464, #a95f24); color: #241a02; }

/* Challenges */
.challenges {
  padding: 100px 0;
  background: var(--bg-alt);
}

.challenge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.challenge-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.challenge-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.challenge-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
}

.tag-daily { background: rgba(47, 208, 255, 0.15); color: #2fd0ff; }
.tag-weekly { background: rgba(124, 92, 255, 0.15); color: #a48bff; }
.tag-event { background: rgba(255, 92, 158, 0.15); color: #ff5c9e; }

.challenge-reward {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.challenge-card h3 {
  margin-bottom: 8px;
}

.challenge-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
}

.progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* About */
.about {
  padding: 100px 0;
  text-align: center;
}

.about-content {
  max-width: 620px;
}

.about p {
  color: var(--text-muted);
  margin-top: 16px;
  font-size: 1.05rem;
}

.about-credit {
  margin-top: 28px !important;
  font-size: 0.9rem !important;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a:hover {
  color: var(--text);
}

/* Account nav + auth panel */
.nav-account {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-balance {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffd15c;
  white-space: nowrap;
}

.account-name {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.loading-note {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
}

.error-note {
  color: #ff8080;
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
}

.auth-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(10, 11, 22, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-panel.hidden {
  display: none;
}

.auth-panel-inner {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.auth-close:hover {
  color: var(--text);
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.auth-tab.active {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.auth-form input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.auth-form button {
  width: 100%;
  justify-content: center;
}

.auth-error {
  color: #ff8080;
  font-size: 0.82rem;
  margin: -6px 0 12px;
  min-height: 1em;
}

.auth-hint {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
  margin-top: 12px;
}

.auth-form.hidden {
  display: none;
}

/* Responsive */
@media (max-width: 720px) {
  .nav ul {
    display: none;
  }
  .hero h1 {
    font-size: 2.2rem;
  }
}
