/* Prism — dark gaming aesthetic: Slotomania meets Discord.
   Mobile-first, gem/crystal currency visuals, premium feel.
   No Tailwind — raw CSS only. */

/* ─── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --bg-deep:     #0b0b18;
  --bg-card:     #13132a;
  --bg-card-alt: #1a1a35;
  --border:      rgba(255,255,255,0.07);
  --text-primary:#e8e8f8;
  --text-muted:  #7a7a9a;
  --gem-yellow:  #f7c948;
  --gem-cyan:    #00d4ff;
  --gem-purple:  #b96eff;
  --accent:      var(--gem-cyan);
  --radius:      12px;
  --radius-sm:   8px;
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
  min-height: 100dvh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; font: inherit; }

/* ─── App shell ──────────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.app-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  height: 52px;
  background: rgba(11,11,24,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.app-logo {
  display: flex; align-items: center; gap: 6px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.logo-gem { font-size: 1.4rem; }
.logo-text {
  background: linear-gradient(135deg, var(--gem-cyan), var(--gem-purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.header-right { display: flex; align-items: center; gap: 10px; }

/* ─── Currency badge ─────────────────────────────────────────────────────── */
.currency-badge {
  display: flex; align-items: center; gap: 5px;
  background: rgba(247,201,72,0.1);
  border: 1px solid rgba(247,201,72,0.25);
  border-radius: 20px;
  padding: 4px 10px;
  font-weight: 600;
  color: var(--gem-yellow);
  font-size: 0.85rem;
}
.currency-icon { font-size: 0.9rem; }

/* ─── Avatar ─────────────────────────────────────────────────────────────── */
.avatar-btn { display: block; }
.avatar-img, .avatar-initials {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gem-cyan);
}
.avatar-initials {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card-alt);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gem-cyan);
}

/* ─── Main content ───────────────────────────────────────────────────────── */
.app-main { flex: 1; padding-bottom: 76px; }

.page {
  padding: 20px 16px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}
.page-header { margin-bottom: 16px; }
.page-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
}

/* ─── Bottom nav ─────────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-around;
  height: 64px;
  background: rgba(11,11,24,0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 0 4px;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; flex: 1;
  color: var(--text-muted);
  font-size: 0.68rem;
  transition: color 0.2s;
  padding: 8px 4px;
}
.nav-item--active, .nav-item:hover { color: var(--gem-cyan); }
.nav-icon { font-size: 1.3rem; }

/* ─── Home page ──────────────────────────────────────────────────────────── */
.home-page {
  min-height: calc(100dvh - 52px - 64px);
  display: flex; flex-direction: column; gap: 24px;
  padding: 24px 16px;
  max-width: 480px;
  margin: 0 auto;
}
.hero-section {
  text-align: center;
  padding: 32px 16px 24px;
  background: linear-gradient(160deg, #1a1040 0%, #0d0d24 100%);
  border-radius: 20px;
  border: 1px solid rgba(185,110,255,0.2);
  position: relative;
  overflow: hidden;
}
.hero-gem-bg {
  position: absolute; top: -20px; right: -10px;
  font-size: 120px; opacity: 0.04;
  pointer-events: none;
}
.hero-title {
  font-family: 'Syne', sans-serif;
  font-size: 3rem; font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--gem-cyan) 0%, var(--gem-purple) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.hero-sub { color: var(--text-muted); font-size: 1rem; margin-bottom: 16px; }
.hero-gems-row { margin-bottom: 16px; }
.hero-gem-chip {
  display: inline-block;
  background: rgba(247,201,72,0.12);
  border: 1px solid rgba(247,201,72,0.3);
  color: var(--gem-yellow);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 20px;
}

/* ─── Auth section ───────────────────────────────────────────────────────── */
.auth-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
}
.auth-tabs {
  display: flex; gap: 0;
  margin-bottom: 16px;
  background: var(--bg-card-alt);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.auth-tab {
  flex: 1; padding: 8px;
  background: none; color: var(--text-muted);
  border-radius: 6px;
  font-size: 0.9rem; font-weight: 500;
  transition: all 0.2s;
}
.auth-tab--active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.form-input {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--gem-cyan); }
.form-error { color: #ff6b6b; font-size: 0.8rem; }
.auth-divider {
  text-align: center; color: var(--text-muted);
  font-size: 0.8rem; margin: 12px 0;
  display: flex; align-items: center; gap: 8px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.btn-discord {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px;
  background: #5865F2;
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.9rem;
  transition: opacity 0.2s;
}
.btn-discord:hover { opacity: 0.9; }

/* ─── Features strip ────────────────────────────────────────────────────── */
.features-strip {
  display: flex; justify-content: space-around;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px 8px;
}
.feature-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.feature-icon { font-size: 1.4rem; }
.feature-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%; padding: 12px;
  background: linear-gradient(135deg, var(--gem-cyan), var(--gem-purple));
  color: #fff; font-weight: 700; font-size: 0.95rem;
  border-radius: var(--radius-sm);
  transition: opacity 0.2s, transform 0.1s;
}
.btn-primary:hover:not(:disabled) { opacity: 0.9; }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  width: 100%; padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary); font-weight: 500;
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}
.btn-secondary:hover { border-color: var(--gem-cyan); }
.btn-ghost {
  padding: 10px 16px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.85rem; border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--text-muted); }
.guest-btn {
  background: transparent; border: 1px solid rgba(185,110,255,0.4);
  color: var(--gem-purple); margin-bottom: 8px;
  width: 100%; padding: 10px;
  font-size: 0.9rem; font-weight: 500;
}
.guest-btn:hover { background: rgba(185,110,255,0.1); }

/* ─── Games page ─────────────────────────────────────────────────────────── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}
.game-card:hover { border-color: rgba(0,212,255,0.3); transform: translateY(-2px); }
.game-card--locked { opacity: 0.55; }
.game-card-icon { font-size: 2rem; }
.game-card-title { font-size: 0.85rem; font-weight: 700; }
.game-card-desc { font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; }
.game-badge-soon {
  font-size: 0.68rem; font-weight: 700;
  background: rgba(122,122,154,0.2); color: var(--text-muted);
  padding: 3px 8px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.btn-sm { padding: 6px 14px; font-size: 0.8rem; width: auto; }

/* ─── Hunt page ─────────────────────────────────────────────────────────── */
.hunt-page { display: flex; flex-direction: column; gap: 20px; }
.hunt-arena {
  background: linear-gradient(160deg, #150f30, #0d0d24);
  border: 1px solid rgba(185,110,255,0.25);
  border-radius: 20px;
  padding: 24px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center;
}
.hunt-cost { color: var(--text-muted); font-size: 0.85rem; }
.balance-hint { margin-left: 8px; color: var(--gem-yellow); }
.hunt-btn {
  width: 100%; max-width: 280px;
  padding: 16px 24px;
  font-size: 1.1rem; font-weight: 700;
  background: linear-gradient(135deg, #b96eff, #6c4ae0);
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(185,110,255,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.hunt-btn:hover:not(:disabled) {
  transform: scale(1.03);
  box-shadow: 0 6px 28px rgba(185,110,255,0.55);
}
.hunt-btn--hunting {
  animation: pulse-gem 1s ease-in-out infinite;
  background: linear-gradient(135deg, #6c4ae0, #9a6eff);
}
@keyframes pulse-gem {
  0%,100% { box-shadow: 0 4px 20px rgba(185,110,255,0.4); }
  50%      { box-shadow: 0 4px 40px rgba(185,110,255,0.7); }
}
.hunt-btn--disabled { opacity: 0.4; cursor: not-allowed; }
.hunt-warning { font-size: 0.82rem; color: #ff6b6b; }
.hunt-warning a { color: var(--gem-cyan); text-decoration: underline; }
.hunt-result {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 32px;
  text-align: center;
  border: 1px solid var(--border);
  animation: pop-in 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes pop-in {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.hunt-result--legendary { border-color: rgba(247,201,72,0.5); box-shadow: 0 0 30px rgba(247,201,72,0.2); }
.hunt-result--epic      { border-color: rgba(185,110,255,0.4); }
.result-creature { font-size: 3rem; margin-bottom: 6px; }
.result-rarity { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gem-cyan); }
.result-message { font-weight: 700; font-size: 1.1rem; color: var(--text-primary); }
.hunt-result--legendary .result-message { color: var(--gem-yellow); }
.hunt-result--epic .result-message      { color: var(--gem-purple); }

.collection-preview { margin-top: 4px; }
.collection-preview h3 { font-family: 'Syne', sans-serif; font-size: 1rem; margin-bottom: 6px; }
.collection-hint { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 12px; }
.creature-slots {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.creature-slot {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.creature-slot--empty {
  background: var(--bg-card-alt);
  border: 1px dashed rgba(255,255,255,0.1);
  color: var(--text-muted);
  font-size: 1rem;
}

/* ─── Profile page ───────────────────────────────────────────────────────── */
.profile-page { display: flex; flex-direction: column; gap: 20px; }
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
}
.profile-avatar-wrap { margin-bottom: 4px; }
.profile-avatar, .profile-avatar-placeholder {
  width: 72px; height: 72px; border-radius: 50%;
  border: 3px solid var(--gem-cyan);
}
.profile-avatar { object-fit: cover; }
.profile-avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card-alt);
  font-size: 1.8rem; font-weight: 700; color: var(--gem-cyan);
}
.profile-username { font-family: 'Syne', sans-serif; font-size: 1.3rem; font-weight: 700; }
.profile-email { color: var(--text-muted); font-size: 0.82rem; }
.profile-stats {
  display: flex; justify-content: center; gap: 20px;
  margin-top: 12px; width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.stat-block { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat-icon { font-size: 1.2rem; }
.stat-value { font-size: 1rem; font-weight: 700; }
.stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.profile-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-discord-outline {
  width: 100%; padding: 10px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.85rem; border-radius: var(--radius-sm);
  cursor: not-allowed; opacity: 0.5;
}

/* ─── Leaderboard page ──────────────────────────────────────────────────── */
.leaderboard-page { padding-bottom: 24px; }
.leaderboard-list { display: flex; flex-direction: column; gap: 6px; }
.leaderboard-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
}
.leaderboard-row--top { border-color: rgba(247,201,72,0.2); }
.leaderboard-rank { width: 28px; text-align: center; font-size: 1rem; }
.rank-medal { font-size: 1.2rem; }
.leaderboard-user { display: flex; align-items: center; gap: 8px; flex: 1; }
.lb-avatar, .lb-avatar-placeholder {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
}
.lb-avatar { object-fit: cover; }
.lb-avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card-alt);
  font-size: 0.75rem; font-weight: 700; color: var(--text-muted);
}
.lb-username { font-weight: 500; }
.leaderboard-balance { color: var(--gem-yellow); font-weight: 600; }

/* ─── Shop page ─────────────────────────────────────────────────────────── */
.shop-page { display: flex; flex-direction: column; gap: 20px; }
.shop-intro { color: var(--text-muted); font-size: 0.88rem; line-height: 1.5; }
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.shop-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
  position: relative;
}
.shop-card--highlight {
  border-color: rgba(247,201,72,0.35);
  background: linear-gradient(160deg, #1f1a10, var(--bg-card));
}
.shop-badge {
  position: absolute; top: -8px;
  background: var(--gem-yellow); color: #0b0b18;
  font-size: 0.65rem; font-weight: 800; padding: 3px 8px;
  border-radius: 10px; text-transform: uppercase; letter-spacing: 0.05em;
}
.shop-gems-icon { font-size: 1.8rem; }
.shop-gems-amount { font-size: 1.3rem; font-weight: 800; color: var(--gem-yellow); }
.shop-price { font-size: 0.82rem; color: var(--text-muted); }
.shop-note { color: var(--text-muted); font-size: 0.75rem; text-align: center; }

/* ─── Mobile responsive ──────────────────────────────────────────────────── */
@media (min-width: 480px) {
  .games-grid { grid-template-columns: repeat(3, 1fr); }
  .shop-grid   { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 360px) {
  .games-grid { grid-template-columns: 1fr; }
  .shop-grid   { grid-template-columns: repeat(2, 1fr); }
}