@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,300&display=swap');

/* ─── TOKENS ─── */
:root {
  --bg-base:        #0d1117;
  --bg-surface:     #131923;
  --bg-raised:      #1a2333;
  --bg-card:        #1e2a3a;
  --bg-hover:       #243040;

  --border:         #2a3a50;
  --border-bright:  #3a5070;

  --blue-dim:       #1e3a5f;
  --blue-mid:       #2563a8;
  --blue-bright:    #3b82f6;
  --blue-glow:      #60a5fa;

  --gold:           #f59e0b;
  --gold-bright:    #fbbf24;
  --gold-dim:       #92400e;

  --green:          #10b981;
  --red:            #ef4444;

  --text-primary:   #e2eaf5;
  --text-secondary: #8ba3bf;
  --text-muted:     #4a6080;

  --font-display:   'Cinzel', serif;
  --font-body:      'DM Sans', sans-serif;

  --radius-sm:      6px;
  --radius-md:      12px;
  --radius-lg:      20px;
  --radius-xl:      32px;

  --shadow-card:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow:    0 0 40px rgba(59,130,246,0.15);
  --shadow-gold:    0 0 30px rgba(245,158,11,0.2);

  --transition:     0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.6;
}

/* ─── BACKGROUND TEXTURE ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(37,99,168,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(245,158,11,0.06) 0%, transparent 50%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 40px,
      rgba(255,255,255,0.012) 40px,
      rgba(255,255,255,0.012) 41px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 60px,
      rgba(255,255,255,0.008) 60px,
      rgba(255,255,255,0.008) 61px
    );
  pointer-events: none;
  z-index: 0;
}

main, .page-wrap { position: relative; z-index: 1; }

/* ─── TYPOGRAPHY ─── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

a { color: var(--blue-glow); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-bright); }

/* ─── LAYOUT ─── */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-wrap {
  padding-top: 80px;
  min-height: 100vh;
}

/* ─── NAVBAR ─── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 70px;
  z-index: 100;
  display: flex;
  align-items: center;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 16px rgba(245,158,11,0.4);
}

.nav-logo span.accent { color: var(--gold); }

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

.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 7px;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-raised);
}

.nav-links a.active { color: var(--gold); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ─── BALANCE CHIP ─── */
.balance-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px 6px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold-bright);
}

.balance-chip .coin-icon { font-size: 16px; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled { opacity: 0.4; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue-mid), var(--blue-bright));
  color: #fff;
  box-shadow: 0 2px 16px rgba(59,130,246,0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(59,130,246,0.45);
  color: #fff;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: #1a1000;
  box-shadow: 0 2px 16px rgba(245,158,11,0.3);
}
.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(245,158,11,0.45);
  color: #1a1000;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-raised);
  color: var(--text-primary);
  border-color: var(--border-bright);
}

.btn-sm { padding: 7px 16px; font-size: 0.82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-icon { padding: 10px; border-radius: var(--radius-sm); }

/* ─── CARDS ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all var(--transition);
}

.card:hover { border-color: var(--border-bright); }

.card-glow {
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.card-gold-glow {
  box-shadow: var(--shadow-card), var(--shadow-gold);
  border-color: var(--gold-dim);
}

/* ─── GAME CARD ─── */
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none;
  display: block;
  position: relative;
}

.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(59,130,246,0.05));
  opacity: 0;
  transition: opacity var(--transition);
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--blue-mid);
  box-shadow: var(--shadow-card), 0 0 40px rgba(59,130,246,0.12);
}

.game-card:hover::before { opacity: 1; }

.game-card-thumb {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}

.game-card-body {
  padding: 20px;
}

.game-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.game-card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.game-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.tag-blue  { background: rgba(59,130,246,0.15); color: var(--blue-glow); }
.tag-gold  { background: rgba(245,158,11,0.15);  color: var(--gold-bright); }
.tag-green { background: rgba(16,185,129,0.15);  color: var(--green); }
.tag-red   { background: rgba(239,68,68,0.15);   color: var(--red); }

/* ─── HERO ─── */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 100px;
  padding: 5px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 24px;
}

.hero-title {
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text-primary) 40%, var(--blue-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ─── STATS ROW ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 60px;
}

.stat-block {
  background: var(--bg-surface);
  padding: 24px;
  text-align: center;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-value.gold { color: var(--gold); }
.stat-value.blue { color: var(--blue-glow); }

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ─── SECTION ─── */
.section { margin-bottom: 64px; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::after {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  margin-left: 4px;
}

/* ─── GAMES GRID ─── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

/* ─── FORM ELEMENTS ─── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.form-input::placeholder { color: var(--text-muted); }

/* ─── ALERTS / NOTICES ─── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-error  { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.3);  color: #fca5a5; }
.alert-success{ background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.alert-info   { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; }

/* ─── DIVIDER ─── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 24px 0;
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ─── AVATAR ─── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
  overflow: hidden;
}

.avatar-sm  { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-md  { width: 44px; height: 44px; font-size: 0.95rem; }
.avatar-lg  { width: 72px; height: 72px; font-size: 1.4rem; }
.avatar-xl  { width: 100px; height: 100px; font-size: 2rem; }

/* ─── LEADERBOARD ROW ─── */
.lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.lb-row:hover { background: var(--bg-raised); }

.lb-rank {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.lb-rank.gold-rank   { color: var(--gold); }
.lb-rank.silver-rank { color: #9ca3af; }
.lb-rank.bronze-rank { color: #b45309; }

.lb-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.92rem;
}

.lb-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gold-bright);
}

/* ─── FOOTER ─── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 32px 0;
  margin-top: 80px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

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

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

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

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

/* ─── MOBILE NAV TOGGLE ─── */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    top: 70px; left: 0; right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px;
    gap: 4px;
  }

  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 16px; }

  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

  .hero { padding: 40px 0 30px; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(245,158,11,0.3); }
  50%       { box-shadow: 0 0 40px rgba(245,158,11,0.6); }
}

@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.animate-fade-up { animation: fadeUp 0.5s ease both; }
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue-mid); }