@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
  --bg: #0d1117;
  --card: #161b22;
  --border: #30363d;
  --green: #14F195;
  --purple: #9945FF;
  --text: #e6edf3;
  --muted: #8b949e;
  --dirt: #2d1a0e;
  --pixel: 'Press Start 2P', monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--pixel);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Nav ── */
nav {
  background: #0d1117;
  border-bottom: 2px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 200;
}
.nav-logo {
  font-family: var(--pixel);
  font-size: 10px;
  color: var(--green);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-logo img { width: 22px; height: 22px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  font-family: sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: var(--green); }
#nav-wallet-btn {
  font-family: sans-serif;
  font-size: 13px;
  font-weight: 700;
  background: var(--purple);
  color: #fff;
  border: none;
  padding: 7px 14px;
  cursor: pointer;
  border-radius: 4px;
  transition: opacity 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
#nav-wallet-btn:hover { opacity: 0.85; }
#nav-wallet-btn.connected { background: var(--green); color: #000; }

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: 2px solid var(--border);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  padding: 4px 9px;
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ── Mobile nav ── */
@media (max-width: 600px) {
  .nav-logo { font-size: 13px; }
  .nav-logo img { width: 26px; height: 26px; }
  .hamburger { display: block; }
  #nav-wallet-btn { font-size: 12px; padding: 6px 10px; margin-left: auto; }

  /* Hide links by default; show as dropdown when .open */
  .nav-links {
    display: none;
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    background: #0d1117;
    border-bottom: 2px solid var(--border);
    flex-direction: column;
    padding: 8px 0;
    gap: 0;
    z-index: 199;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    font-size: 15px;
    padding: 14px 24px;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-links a:last-child { border-bottom: none; }
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
}
.hero-dino {
  font-size: 80px;
  display: block;
  margin-bottom: 20px;
  animation: hop 0.8s ease-in-out infinite alternate;
}
@keyframes hop {
  from { transform: translateY(0); }
  to { transform: translateY(-12px); }
}
.hero h1 {
  font-size: 20px;
  color: var(--green);
  margin-bottom: 12px;
  line-height: 1.4;
}
.hero p {
  font-family: sans-serif;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Buttons ── */
.btn {
  font-family: var(--pixel);
  font-size: 9px;
  padding: 12px 24px;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  display: inline-block;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--green); color: #000; }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: var(--purple); color: #fff; }
.btn-secondary:hover { opacity: 0.85; }
.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--green); color: var(--green); }
.btn-sm { font-size: 8px; padding: 8px 16px; }
.btn-lg { font-size: 11px; padding: 14px 32px; }

/* ── Mode cards ── */
.mode-cards {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 20px 40px;
}
.mode-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 28px 24px;
  width: 280px;
  text-align: center;
  transition: border-color 0.2s;
}
.mode-card:hover { border-color: var(--green); }
.mode-card.featured { border-color: var(--purple); }
.mode-icon { font-size: 36px; margin-bottom: 12px; }
.mode-card h3 { font-size: 10px; color: var(--green); margin-bottom: 10px; }
.mode-card p { font-family: sans-serif; font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.mode-badge {
  font-size: 7px;
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--purple);
  color: #fff;
  display: inline-block;
  margin-bottom: 12px;
}
.mode-badge.free { background: var(--green); color: #000; }

/* ── Section ── */
.section { padding: 40px 20px; }
.section-title {
  font-size: 10px;
  color: var(--purple);
  margin-bottom: 24px;
  text-align: center;
}

/* ── Pricing ── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  max-width: 680px;
  margin: 0 auto;
}
.price-item {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 14px 12px;
  text-align: center;
}
.price-item .score-range {
  font-family: sans-serif;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.price-item .price {
  font-family: var(--pixel);
  font-size: 11px;
  color: var(--green);
  margin-bottom: 6px;
  display: block;
}
.price-item .per {
  font-family: sans-serif;
  font-size: 12px;
  color: var(--muted);
}

/* ── Game page ── */
#game-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* HUD */
#game-hud {
  background: #0d1117;
  border-bottom: 2px solid var(--border);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
#hud-logo { font-size: 8px; color: var(--green); text-decoration: none; }
#mode-badge {
  font-size: 9px;
  padding: 3px 10px;
  border-radius: 3px;
  background: var(--green);
  color: #000;
  white-space: nowrap;
}
#mode-badge.comp { background: var(--purple); color: #fff; }
#lives-display { font-size: 10px; color: #e74c3c; white-space: nowrap; }
#score-display { font-size: 12px; color: var(--green); margin: 0 auto; }
#hi-score { font-size: 9px; color: var(--muted); white-space: nowrap; }
#theme-toggle {
  font-family: sans-serif;
  font-size: 12px;
  font-weight: 600;
  background: var(--card);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 5px 12px;
  cursor: pointer;
  border-radius: 4px;
  white-space: nowrap;
}
#hud-wallet-btn {
  font-family: sans-serif;
  font-size: 11px;
  font-weight: 600;
  background: var(--purple);
  color: #fff;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 4px;
}
#hud-wallet-btn.connected { background: var(--green); color: #000; font-size: 10px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Game canvas area */
#game-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #0d1117;
  overflow: hidden;
}
#game-canvas {
  image-rendering: pixelated;
  border: 2px solid var(--border);
  max-width: 100%;
  max-height: 100%;
}

/* Overlays */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  gap: 14px;
  padding: 20px;
}
.overlay.hidden { display: none; }
.overlay h2 { font-size: 16px; color: var(--green); }
.overlay h3 { font-size: 10px; color: var(--text); }
.overlay p { font-family: sans-serif; font-size: 13px; color: var(--muted); text-align: center; }
.overlay .score-big { font-size: 20px; color: var(--green); }

.mode-select { display: flex; gap: 10px; }
.mode-opt {
  font-family: var(--pixel);
  font-size: 7px;
  padding: 8px 16px;
  background: var(--card);
  border: 2px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s;
}
.mode-opt.active { border-color: var(--green); color: var(--green); }
.mode-opt.comp-opt.active { border-color: var(--purple); color: var(--purple); }

.overlay-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.hint { font-size: 6px; color: var(--muted); }

/* Buy lives panel */
#buy-panel { display: none; flex-direction: column; gap: 10px; align-items: center; width: 100%; max-width: 340px; }
#buy-panel.visible { display: flex; }
#buy-panel .buy-title { font-size: 8px; color: var(--purple); }
.buy-btn {
  font-family: var(--pixel);
  font-size: 7px;
  width: 100%;
  padding: 10px;
  background: var(--card);
  border: 2px solid var(--purple);
  color: var(--text);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}
.buy-btn:hover { background: var(--purple); }
.buy-btn.starter { border-color: var(--green); }
.buy-btn.starter:hover { background: var(--green); color: #000; }

/* ── Leaderboard ── */
.lb-header {
  text-align: center;
  padding: 40px 20px 24px;
}
.lb-header h1 { font-size: 14px; color: var(--green); margin-bottom: 8px; }
.lb-header p { font-family: sans-serif; font-size: 14px; color: var(--muted); }

.pool-card {
  background: var(--card);
  border: 2px solid var(--purple);
  border-radius: 8px;
  max-width: 500px;
  margin: 0 auto 32px;
  padding: 20px;
  text-align: center;
}
.pool-card .pool-label { font-family: sans-serif; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.pool-card .pool-amount { font-family: var(--pixel); font-size: 18px; color: var(--green); }
.pool-prizes { display: flex; gap: 16px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.prize-item { text-align: center; }
.prize-item .rank { font-family: sans-serif; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.prize-item .pct { font-family: var(--pixel); font-size: 10px; color: var(--purple); }

.lb-table-wrap { max-width: 600px; margin: 0 auto; padding: 0 20px 40px; }
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th { font-family: sans-serif; font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px 12px; text-align: left; border-bottom: 2px solid var(--border); }
.lb-table td { font-family: sans-serif; font-size: 14px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.lb-table tr:hover td { background: rgba(255,255,255,0.03); }
.rank-1 td { color: #FFD700; }
.rank-2 td { color: #C0C0C0; }
.rank-3 td { color: #CD7F32; }
.wallet-short { font-family: sans-serif; font-size: 13px; color: var(--muted); }

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--card);
  border: 2px solid var(--green);
  color: var(--text);
  font-size: 8px;
  padding: 10px 20px;
  border-radius: 6px;
  transition: transform 0.3s;
  z-index: 999;
  white-space: nowrap;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ── Footer ── */
.site-footer {
  background: var(--card);
  border-top: 2px solid var(--border);
  padding: 24px 20px;
  text-align: center;
}
.footer-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.footer-links a { font-family: sans-serif; font-size: 13px; color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--green); }
.footer-copy { font-family: sans-serif; font-size: 12px; color: #555; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .hero h1 { font-size: 13px; }
  .mode-cards { padding: 0 12px 32px; }
  .mode-card { width: 100%; }
  #game-hud { padding: 6px 10px; gap: 8px; }
  #score-display { font-size: 8px; }
}
