:root {
  --bg: #0c0a1a;
  --surface: #16132b;
  --surface-2: #1e1a3a;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f3fb;
  --text-dim: #a29dc2;
  --text-dimmer: #746f95;
  --accent: #7c5cff;
  --accent-2: #a78bfa;
  --accent-gradient: linear-gradient(135deg, #6a3ff0 0%, #9b5cf6 60%, #b968e0 100%);
  --gold: #ffb800;
  --danger: #ff4d5e;
  --success: #35c281;

  --cat-action: linear-gradient(135deg, #ff4d8d, #ff2d6b);
  --cat-adventure: linear-gradient(135deg, #4d7cff, #3a5cff);
  --cat-puzzle: linear-gradient(135deg, #35c281, #1fa868);
  --cat-sports: linear-gradient(135deg, #8b5cf6, #7c3aed);
  --cat-racing: linear-gradient(135deg, #ff9500, #ff6a00);
  --cat-arcade: linear-gradient(135deg, #a855f7, #7c3aed);
  --cat-strategy: linear-gradient(135deg, #5b6bff, #3f4cff);
  --cat-more: linear-gradient(135deg, #3a3660, #2c2a45);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --nav-height: 68px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(var(--nav-height) + 24px);
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 10px;
}
.topbar .brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: center;
}
.topbar .brand strong { font-size: 17px; font-weight: 700; }
.topbar .brand span { font-size: 9px; letter-spacing: 2px; color: var(--text-dim); }
.icon-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  position: relative;
  cursor: pointer;
}
.icon-btn .badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.back-btn { display: flex; align-items: center; gap: 10px; }
.back-btn .icon-btn { background: transparent; border: none; }

.logo-wrap { display: flex; align-items: center; gap: 8px; }
.logo-badge {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #7c5cff, #ff4d8d);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 13px; color: #fff; flex-shrink: 0;
}
.logo-text { font-weight: 900; font-size: 17px; letter-spacing: 0.5px; white-space: nowrap; }
.logo-text .play { color: #fff; }
.logo-text .win {
  background: linear-gradient(135deg, #7c5cff, #ff4d8d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.avatar-btn {
  width: 38px; height: 38px; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--accent); flex-shrink: 0; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Hero banner v2 (photo background) ---------- */
.hero-banner {
  margin: 14px 16px 0; border-radius: var(--radius-lg); overflow: hidden;
  position: relative; min-height: 380px; background-size: cover; background-position: center;
  background-color: var(--surface-2);
}
.hero-banner::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,8,20,0.1) 0%, rgba(10,8,20,0.5) 55%, rgba(6,5,14,0.94) 100%);
}
.hero-content { position: relative; z-index: 2; padding: 20px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 380px; }
.live-badge {
  display: inline-flex; align-items: center; gap: 6px; width: fit-content;
  background: rgba(220, 38, 38, 0.92); color: #fff; font-size: 11px; font-weight: 800;
  letter-spacing: 1px; padding: 6px 12px; border-radius: 999px; margin-bottom: 14px;
}
.live-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pw-pulse 1.4s infinite; }
@keyframes pw-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.hero-title { font-size: 32px; font-weight: 900; line-height: 1.05; text-transform: uppercase; margin: 0 0 14px; color: #fff; }
.hero-title .accent { color: var(--accent-2); display: block; }
.hero-prize-label { font-size: 12px; color: rgba(255,255,255,0.75); margin-bottom: 2px; }
.hero-prize-amount { font-size: 28px; font-weight: 900; color: var(--gold); margin-bottom: 14px; }
.hero-countdown { display: flex; gap: 8px; margin-bottom: 16px; }
.hero-countdown .box {
  background: rgba(20, 16, 35, 0.65); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; text-align: center; padding: 8px 12px; min-width: 52px;
}
.hero-countdown .num { font-size: 18px; font-weight: 800; color: #fff; }
.hero-countdown .label { font-size: 9px; color: rgba(255,255,255,0.7); text-transform: uppercase; }
.btn-play-now {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  background: var(--accent-gradient); color: #fff; font-weight: 800; font-size: 14px;
  padding: 13px 26px; border-radius: 12px; border: none;
}

/* ---------- Quick action grid ---------- */
.quick-action-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 16px 16px 4px; }
.quick-action-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 6px; text-align: center; }
.quick-action-tile .qa-icon { font-size: 24px; margin-bottom: 8px; }
.quick-action-tile .qa-label { font-size: 11.5px; font-weight: 600; color: var(--text); }

/* ---------- Continue playing ---------- */
.continue-card {
  margin: 8px 16px 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); display: flex; overflow: hidden;
}
.continue-card img { width: 130px; flex-shrink: 0; object-fit: cover; }
.continue-card .body { flex: 1; padding: 14px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.continue-card h3 { margin: 0 0 8px; font-size: 15px; }
.progress-track { background: var(--surface-2); border-radius: 999px; height: 6px; margin-bottom: 4px; overflow: hidden; }
.progress-fill { background: var(--accent-gradient); height: 100%; border-radius: 999px; }
.progress-pct { font-size: 11px; color: var(--accent-2); font-weight: 700; margin-bottom: 10px; }
.continue-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.continue-meta .lastplayed-label { font-size: 10.5px; color: var(--text-dimmer); }
.continue-meta .lastplayed-val { font-size: 12px; color: var(--text-dim); }
.btn-continue { background: var(--accent-gradient); color: #fff; font-weight: 700; font-size: 12.5px; padding: 10px 18px; border-radius: 8px; border: none; white-space: nowrap; }

/* ---------- Today's challenge ---------- */
.challenge-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 8px; }
.challenge-timer { display: flex; align-items: center; gap: 5px; color: var(--danger); font-size: 12.5px; font-weight: 700; }
.challenge-card {
  margin: 0 16px 16px; border-radius: var(--radius-lg); padding: 16px;
  background: linear-gradient(135deg, rgba(20,60,40,0.9), rgba(10,30,22,0.97));
  border: 1px solid rgba(53,194,129,0.25); display: flex; align-items: center; gap: 14px;
}
.challenge-icon { font-size: 34px; flex-shrink: 0; }
.challenge-body { flex: 1; min-width: 0; }
.challenge-body .lead { font-size: 12px; color: var(--text-dim); }
.challenge-body .title { font-weight: 800; font-size: 14.5px; margin: 1px 0 6px; }
.challenge-body .reward-label { font-size: 11.5px; color: var(--text-dim); }
.challenge-body .cashback { color: var(--gold); font-weight: 800; font-size: 15px; }
.challenge-side { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-challenge { background: var(--accent-gradient); color: #fff; font-weight: 700; font-size: 12px; padding: 9px 16px; border-radius: 8px; border: none; white-space: nowrap; }

/* ---------- HOT badge on game cards ---------- */
.game-card { position: relative; }
.game-card .hot-badge {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  background: var(--danger); color: #fff; font-size: 9px; font-weight: 800;
  padding: 3px 8px; border-radius: 6px; letter-spacing: 0.5px;
}

/* ---------- Section headers ---------- */
.section { padding: 18px 16px 4px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.section-head h2 { font-size: 17px; margin: 0; font-weight: 700; }
.view-all { font-size: 13px; color: var(--accent-2); font-weight: 600; }

/* ---------- Tournament banner ---------- */
.tournament-banner {
  margin: 14px 16px 0;
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--accent-gradient);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px -12px rgba(124, 92, 255, 0.55);
}
.tournament-banner .eyebrow {
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 4px;
}
.tournament-banner h1 {
  font-size: 24px; margin: 0 0 8px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.tournament-banner .prize {
  font-size: 26px; font-weight: 800; color: var(--gold);
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.tournament-banner .desc {
  font-size: 13px; color: rgba(255,255,255,0.85); max-width: 65%;
  margin-bottom: 16px;
}
.tournament-banner .art {
  position: absolute; right: -10px; bottom: -10px; width: 45%;
  opacity: 0.95;
}
.btn-cta {
  background: #fff; color: #5b2fd8; border: none;
  font-weight: 700; font-size: 14px;
  padding: 11px 22px; border-radius: 999px;
  display: inline-block;
}

.countdown {
  display: flex; gap: 10px; padding: 16px 16px 4px;
}
.countdown .box {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); text-align: center; padding: 10px 0;
}
.countdown .box .num { font-size: 20px; font-weight: 800; }
.countdown .box .label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

/* ---------- Horizontal card rail ---------- */
.rail { display: flex; gap: 14px; overflow-x: auto; padding: 2px 16px 10px; scrollbar-width: none; cursor: grab; }
.rail::-webkit-scrollbar { display: none; }
.rail.dragging { cursor: grabbing; user-select: none; }
.rail.dragging * { pointer-events: none; }
.game-card { flex: 0 0 120px; }
.game-card .thumb {
  width: 120px; aspect-ratio: 3 / 4; height: auto; border-radius: var(--radius-md);
  object-fit: cover; background: var(--surface-2);
  margin-bottom: 8px;
}
.game-card .title { font-size: 13.5px; font-weight: 700; margin-bottom: 2px; }
.game-card .meta { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; justify-content: space-between; }
.game-card .rating { color: var(--gold); font-weight: 700; display: flex; align-items: center; gap: 3px; }

.dots { display: flex; gap: 5px; justify-content: center; padding: 4px 0 6px; }
.dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--border); }
.dots span.active { background: var(--accent); width: 14px; border-radius: 4px; }

/* ---------- Categories grid ---------- */
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 0 16px 10px; }
.category-tile {
  border-radius: var(--radius-md); padding: 14px 8px; text-align: center;
  color: #fff; font-weight: 700; font-size: 12.5px;
}
.category-tile .cat-icon { font-size: 20px; margin-bottom: 6px; }
.category-tile .cat-count { font-size: 10px; font-weight: 500; opacity: 0.85; margin-top: 2px; }
.cat-action { background: var(--cat-action); }
.cat-adventure { background: var(--cat-adventure); }
.cat-puzzle { background: var(--cat-puzzle); }
.cat-sports { background: var(--cat-sports); }
.cat-racing { background: var(--cat-racing); }
.cat-arcade { background: var(--cat-arcade); }
.cat-strategy { background: var(--cat-strategy); }
.cat-more { background: var(--cat-more); color: var(--text-dim); }

/* ---------- Prizes ---------- */
.prize-row { display: flex; gap: 12px; padding: 0 16px 10px; }
.prize-card {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); text-align: center; padding: 14px 8px; position: relative;
}
.prize-rank {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold); color: #12101f; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.prize-card .prize-icon { font-size: 30px; margin: 10px 0 8px; }
.prize-card .prize-amount { color: var(--gold); font-weight: 800; font-size: 13px; }

/* ---------- List rows (winners, leaderboard) ---------- */
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
}
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface-2); object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border);
}
.list-row .name { font-weight: 700; font-size: 14px; }
.list-row .sub { font-size: 12px; color: var(--text-dim); }
.list-row .amount { color: var(--gold); font-weight: 800; font-size: 13.5px; margin-left: auto; }

.rank-badge {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.rank-1 { background: var(--gold); color: #12101f; }
.rank-2 { background: #c7c9d9; color: #12101f; }
.rank-3 { background: #cd7f32; color: #12101f; }
.rank-other { background: var(--surface-2); color: var(--text-dim); }
.list-row .points { margin-left: auto; font-weight: 800; font-size: 13.5px; color: var(--text); }

.period-pill {
  font-size: 12px; font-weight: 600; color: var(--accent-2);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px;
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 100%; max-width: 480px;
  background: rgba(17, 14, 32, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around;
  height: var(--nav-height);
  z-index: 40;
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; color: var(--text-dimmer); font-weight: 600;
  flex: 1;
}
.bottom-nav a.active { color: var(--accent-2); }
.bottom-nav .nav-icon { font-size: 18px; display: flex; align-items: center; justify-content: center; height: 19px; }
.bottom-nav .play-fab {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
  margin-top: -28px;
  box-shadow: 0 8px 20px -6px rgba(124, 92, 255, 0.7);
  border: 4px solid var(--bg);
}
.bottom-nav .play-fab-wrap { flex-direction: column; }

/* ---------- Game details / play screen ---------- */
.game-hero {
  position: relative; width: 100%; height: 320px;
  background: var(--surface-2);
  overflow: hidden;
}
.game-hero img { width: 100%; height: 100%; object-fit: cover; }
.hud {
  position: absolute; inset: 0; padding: 14px; display: flex; flex-direction: column; justify-content: space-between;
  pointer-events: none;
}
.hud-top { display: flex; justify-content: space-between; align-items: flex-start; }
.hud-pill { background: rgba(0,0,0,0.55); border-radius: 8px; padding: 4px 8px; font-size: 11px; font-weight: 700; }
.hud-speed { text-align: center; }
.hud-speed .val { font-size: 34px; font-weight: 800; color: #fff; }
.hud-speed .unit { font-size: 11px; vertical-align: super; }
.hud-controls { display: flex; align-items: center; gap: 14px; pointer-events: auto; }
.hud-ctrl-btn {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(20, 16, 40, 0.7); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px;
}

.game-info { padding: 16px; }
.game-info-head { display: flex; gap: 12px; }
.game-info-head img { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; }
.game-info-head h1 { font-size: 18px; margin: 0 0 2px; }
.game-info-head .meta { font-size: 13px; color: var(--text-dim); }
.game-info-head .meta .rating { color: var(--gold); font-weight: 700; }
.star-rating { display: flex; align-items: center; gap: 2px; margin-top: 4px; }
.star-rating .star { font-size: 14px; line-height: 1; }
.star-rating .star-filled { color: var(--gold); }
.star-rating .star-empty { color: var(--border); }
.star-rating .rating-value { color: var(--gold); font-weight: 700; margin-left: 4px; }
.star-rating .review-count { color: var(--text-dim); margin-left: 2px; }
.game-desc { font-size: 13.5px; color: var(--text-dim); line-height: 1.5; margin-top: 12px; }
.show-more { color: var(--accent-2); font-size: 13px; font-weight: 700; margin-top: 6px; display: inline-block; }

.action-row { display: flex; gap: 10px; padding: 14px 16px 4px; }
.action-row .icon-btn { width: 44px; height: 44px; }
.btn-report {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(255, 77, 94, 0.12); color: var(--danger);
  border: 1px solid rgba(255, 77, 94, 0.3);
  border-radius: var(--radius-sm); font-weight: 700; font-size: 13.5px;
}

.info-card {
  margin: 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
}
.info-card h3 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.info-card h3 .tag-icon {
  width: 26px; height: 26px; border-radius: 8px; background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.howto-step { display: flex; gap: 10px; font-size: 13px; color: var(--text-dim); margin-bottom: 10px; align-items: flex-start; }
.howto-step:last-child { margin-bottom: 0; }
.howto-step .dot { color: var(--accent-2); flex-shrink: 0; }

.leaderboard-card { margin: 8px 16px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.leaderboard-card .list-row { border-bottom: 1px solid var(--border); }
.leaderboard-card .list-row:last-child { border-bottom: none; }

/* ---------- Leaderboard: period switch ---------- */
.lb-period-switch {
  display: flex; gap: 4px; margin: 12px 16px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
}
.lb-period-opt {
  flex: 1; text-align: center; font-size: 12.5px; font-weight: 700;
  color: var(--text-dim); padding: 8px 6px; border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}
.lb-period-opt.active { background: var(--accent-gradient); color: #fff; box-shadow: 0 4px 12px -4px rgba(124,92,255,0.7); }

/* ---------- Leaderboard: top-3 podium ---------- */
.lb-podium {
  display: flex; align-items: flex-end; justify-content: center; gap: 10px;
  padding: 10px 16px 4px; margin-bottom: 6px;
}
.lb-place {
  flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center;
  text-align: center; position: relative; padding-top: 8px;
}
.lb-crown { font-size: 20px; margin-bottom: 2px; }
.lb-podium-avatar-wrap { position: relative; margin-bottom: 8px; }
.lb-podium-avatar {
  border-radius: 50%; object-fit: cover; background: var(--surface-2);
  border: 3px solid var(--border);
}
.lb-place-1 .lb-podium-avatar { width: 74px; height: 74px; border-color: var(--gold); }
.lb-place-2 .lb-podium-avatar { width: 60px; height: 60px; border-color: #c7c9d9; }
.lb-place-3 .lb-podium-avatar { width: 60px; height: 60px; border-color: #cd7f32; }
.lb-podium-rank {
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; color: #12101f;
  border: 2px solid var(--bg);
}
.lb-place-1 .lb-podium-rank { background: var(--gold); }
.lb-place-2 .lb-podium-rank { background: #c7c9d9; }
.lb-place-3 .lb-podium-rank { background: #cd7f32; }
.lb-podium-name { font-size: 12.5px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-podium-pts { font-size: 11.5px; color: var(--gold); font-weight: 800; margin-top: 1px; }
.lb-podium-bar {
  width: 100%; margin-top: 10px; border-radius: 10px 10px 0 0;
  background: var(--surface-2); border: 1px solid var(--border); border-bottom: none;
}
.lb-place-1 .lb-podium-bar { height: 54px; background: linear-gradient(180deg, rgba(255,184,0,0.35), var(--surface-2)); }
.lb-place-2 .lb-podium-bar { height: 36px; background: linear-gradient(180deg, rgba(199,201,217,0.3), var(--surface-2)); }
.lb-place-3 .lb-podium-bar { height: 26px; background: linear-gradient(180deg, rgba(205,127,50,0.3), var(--surface-2)); }

.lb-place.lb-me .lb-podium-avatar { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent-2), 0 0 16px 2px rgba(167,139,250,0.6); }
.lb-place.lb-me .lb-podium-name { color: var(--accent-2); }
.lb-place.lb-me .lb-podium-bar { box-shadow: 0 0 14px -2px rgba(167,139,250,0.7); border-color: var(--accent-2); }

/* ---------- Leaderboard: my-row highlight ---------- */
.lb-row.lb-me-row {
  background: linear-gradient(90deg, rgba(124,92,255,0.16), rgba(124,92,255,0.02));
  border-left: 3px solid var(--accent-2);
  margin-left: -1px;
}
.lb-row.lb-me-row .avatar { border-color: var(--accent-2); box-shadow: 0 0 10px -2px rgba(167,139,250,0.7); }
.lb-you-tag {
  display: inline-block; margin-left: 6px; font-size: 9.5px; font-weight: 800;
  color: #fff; background: var(--accent-gradient); padding: 2px 6px; border-radius: 999px;
  vertical-align: middle; letter-spacing: 0.5px;
}
.lb-you-tag-podium { margin-left: 0; margin-top: 2px; }
.lb-not-ranked {
  margin: 4px 16px 16px; padding: 12px 14px; text-align: center; font-size: 12.5px;
  color: var(--text-dim); background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}
.btn-full {
  display: block; text-align: center; margin: 4px 16px 16px;
  background: var(--accent-gradient); color: #fff; font-weight: 700; font-size: 14px;
  padding: 13px; border-radius: var(--radius-sm); border: none; width: calc(100% - 32px);
}
.btn-ghost {
  display: block; text-align: center; margin: 4px 16px 16px;
  background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 14px;
  padding: 13px; border-radius: var(--radius-sm); border: 1px solid var(--border); width: calc(100% - 32px);
}

/* ---------- Login modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(5, 4, 12, 0.7);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 100;
}
.modal-overlay.hidden { display: none; }
.modal-sheet {
  width: 100%; max-width: 480px; background: var(--surface);
  border-radius: 24px 24px 0 0; padding: 28px 22px 26px;
  border-top: 1px solid var(--border);
  text-align: center;
  animation: slide-up 0.25s ease-out;
}
@keyframes slide-up { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-sheet .close-x {
  position: absolute; right: 18px; top: 18px;
  background: var(--surface-2); border-radius: 50%; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center; border: none; color: var(--text);
}
.modal-sheet-inner { position: relative; }
.modal-icon {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--accent-2);
}
.modal-sheet h2 { font-size: 19px; margin: 0 0 6px; }
.modal-sheet p { font-size: 13.5px; color: var(--text-dim); margin: 0 0 20px; }
.phone-input-row { display: flex; gap: 8px; margin-bottom: 16px; }
.phone-input-row select {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 0 8px; font-size: 14px; font-weight: 700;
}
.phone-input-row input {
  flex: 1; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 0 14px; font-size: 14px;
}
.phone-input-row select, .phone-input-row input, .otp-input { height: 48px; }
.otp-input {
  width: 100%; text-align: center; letter-spacing: 10px; font-size: 20px; font-weight: 800;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); margin-bottom: 16px;
}
.modal-terms { font-size: 11.5px; color: var(--text-dimmer); margin-top: 16px; }
.modal-terms a { color: var(--accent-2); font-weight: 600; }
.form-error { color: var(--danger); font-size: 12.5px; margin: -8px 0 14px; }
.form-success { color: var(--success); font-size: 12.5px; margin: -8px 0 14px; }

/* ---------- Generic page (tournaments / leaderboard full / profile) ---------- */
.page-header { padding: 18px 16px 4px; }
.page-header h1 { font-size: 20px; margin: 0; }
.empty-state { text-align: center; padding: 60px 24px; color: var(--text-dim); }
.empty-state .emoji { font-size: 42px; margin-bottom: 10px; }

.profile-card {
  margin: 16px; padding: 24px 16px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.profile-avatar {
  width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 12px; object-fit: cover;
  border: 3px solid var(--accent);
}
.profile-card h2 { margin: 0 0 4px; font-size: 18px; }
.profile-card .phone { color: var(--text-dim); font-size: 13px; }
.stat-row { display: flex; gap: 10px; margin: 16px; }
.stat-box { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); text-align: center; padding: 14px 6px; }
.stat-box .val { font-size: 18px; font-weight: 800; color: var(--gold); }
.stat-box .lbl { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.menu-list { margin: 0 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.menu-list a, .menu-list button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 16px; border-bottom: 1px solid var(--border); background: none; border-left: none; border-right: none; border-top: none;
  color: var(--text); font-size: 14px; font-weight: 600;
}
.menu-list a:last-child, .menu-list button:last-child { border-bottom: none; }
.menu-list .chev { margin-left: auto; color: var(--text-dimmer); }

.tournament-full-card {
  margin: 0 16px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.tournament-full-card img { width: 100%; height: 130px; object-fit: cover; }
.tournament-full-card .body { padding: 14px; }
.tournament-full-card h3 { margin: 0 0 6px; font-size: 15.5px; }
.tournament-full-card .prize { color: var(--gold); font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.tournament-full-card .desc { color: var(--text-dim); font-size: 13px; margin-bottom: 10px; }

@media (min-width: 481px) {
  .app-shell { border-left: 1px solid var(--border); border-right: 1px solid var(--border); box-shadow: 0 0 60px rgba(0,0,0,0.5); }
}

/* =====================================================================
   WinZone additions: categories (SVG icons), login modal v2, quick
   action icon colors, game-details v2 (stats/rewards/footer actions),
   animations
   ===================================================================== */

/* ---------- Category tiles using generated SVG icons ---------- */
.cat-quiz { background: linear-gradient(135deg, #ec4899, #db2777); }
.category-tile img.cat-icon-img { width: 26px; height: 26px; margin: 0 auto 8px; display: block; }
.top-categories-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 0 16px 10px; }
.top-categories-grid .category-tile { padding: 14px 4px; }
.top-categories-grid .cat-label { font-size: 11px; }

/* ---------- Quick action icon color variants ---------- */
.quick-action-tile .qa-icon-img { width: 26px; height: 26px; margin: 0 auto 8px; }
.qa-gold { color: var(--gold); }
.qa-blue { color: #4d7cff; }
.qa-purple { color: #a855f7; }
.quick-action-tile:active,
.category-tile:active,
.game-card:active { transform: scale(0.96); transition: transform 0.12s ease; }
.quick-action-tile, .category-tile, .game-card, .continue-card, .challenge-card, .prize-card, .list-row {
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.quick-action-tile:hover, .category-tile:hover { box-shadow: 0 8px 20px -8px rgba(124,92,255,0.5); }
.game-card:hover .thumb, .continue-card:hover img { filter: brightness(1.05); }

/* ---------- Login modal v2 ---------- */
.modal-icon img { width: 34px; height: 34px; }
.phone-input-single { align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 12px; height: 48px; }
.phone-input-single .phone-prefix { font-size: 13px; font-weight: 700; color: var(--text-dim); margin-right: 8px; white-space: nowrap; }
.phone-input-single input { flex: 1; background: transparent; border: none; color: var(--text); font-size: 15px; letter-spacing: 0.5px; height: 100%; }
.phone-input-single input:focus { outline: none; }
.input-invalid { color: var(--danger) !important; }
.form-error.visible { display: block; margin: 10px 0 16px; }
.form-error:not(.visible) { display: none; }
.modal-animate-in .modal-sheet { animation: slide-up 0.28s cubic-bezier(0.16,1,0.3,1); }
.modal-overlay:not(.hidden) { animation: fade-in 0.2s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Game details v2 ---------- */
.hero-image-wrap { position: relative; width: 100%; height: 320px; overflow: hidden; background: var(--surface-2); }
.hero-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.hero-live-pill {
  position: absolute; top: 14px; left: 14px; display: flex; flex-direction: column; gap: 4px;
  background: rgba(10,8,20,0.6); backdrop-filter: blur(4px); border-radius: 10px; padding: 6px 10px;
}
.hero-live-pill .playing-now { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; color: #35c281; }
.hero-live-pill .playing-now .dot { width: 6px; height: 6px; border-radius: 50%; background: #35c281; animation: pw-pulse 1.4s infinite; }
.hero-live-pill .playing-label { font-size: 9px; color: var(--text-dim); letter-spacing: 1px; }
.hero-expand-btn {
  position: absolute; right: 14px; bottom: 14px; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(10,8,20,0.6); backdrop-filter: blur(4px); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.details-topbar-actions { display: flex; gap: 8px; }
.details-topbar-actions .icon-btn.is-favorited { color: var(--danger); border-color: var(--danger); }

.game-thumb-badge-wrap { position: relative; flex-shrink: 0; }
.game-thumb-badge-wrap img { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; }
.year-badge {
  position: absolute; bottom: -4px; left: -4px; background: var(--danger); color: #fff;
  font-size: 8.5px; font-weight: 800; padding: 2px 5px; border-radius: 5px;
}
.review-count { color: var(--text-dimmer); font-size: 12px; }

.stats-row { display: flex; gap: 10px; margin: 14px 16px; }
.stat-pill {
  flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 10px 8px; display: flex; align-items: center; gap: 8px;
}
.stat-pill .stat-icon { font-size: 16px; flex-shrink: 0; }
.stat-pill .stat-text { min-width: 0; }
.stat-pill .stat-label { font-size: 9.5px; color: var(--text-dimmer); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-pill .stat-value { font-size: 12.5px; font-weight: 800; color: var(--text); white-space: nowrap; }
.stat-pill.stat-gold .stat-value { color: var(--gold); }
.stat-pill.stat-danger .stat-value { color: var(--danger); }

.btn-play-now-full {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent-gradient); color: #fff; font-weight: 800; font-size: 15px;
  padding: 15px; border-radius: var(--radius-sm); border: none; margin: 4px 16px 0; width: calc(100% - 32px);
  box-shadow: 0 10px 24px -10px rgba(124,92,255,0.7);
}

.rewards-row { display: flex; gap: 10px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; }
.rewards-row::-webkit-scrollbar { display: none; }
.reward-card {
  flex: 0 0 90px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  text-align: center; padding: 14px 6px 10px; position: relative;
}
.reward-card .medal { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 50%; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.reward-card .medal.gold { background: var(--gold); color: #12101f; }
.reward-card .medal.silver { background: #c7c9d9; color: #12101f; }
.reward-card .medal.bronze { background: #cd7f32; color: #12101f; }
.reward-card .medal.other { background: var(--danger); color: #fff; }
.reward-card img { width: 34px; height: 34px; margin: 10px auto 6px; }
.reward-card .reward-name { font-size: 11.5px; font-weight: 700; }

/* ---------- Footer action bar (Game Details) ---------- */
.details-footer {
  display: flex; align-items: stretch; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); background: rgba(17,14,32,0.96);
}
.footer-action-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: none; color: var(--text-dim); font-size: 10.5px; font-weight: 600;
}
.footer-action-btn .fa-icon { font-size: 17px; }
.footer-action-btn.is-favorited { color: var(--danger); }
.btn-minimize {
  flex: 2; background: var(--danger); color: #fff; font-weight: 800; font-size: 13px;
  border: none; border-radius: var(--radius-sm); letter-spacing: 0.5px;
}

/* ---------- Animations ---------- */
@keyframes glow-pulse { 0%, 100% { box-shadow: 0 0 0 rgba(124,92,255,0.4); } 50% { box-shadow: 0 0 22px rgba(124,92,255,0.55); } }
.btn-cta, .btn-play-now, .btn-play-now-full { animation: glow-pulse 2.6s ease-in-out infinite; }
.section, .rail, .quick-action-grid, .top-categories-grid { animation: fade-in-up 0.4s ease both; }
@keyframes fade-in-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.app-shell.has-custom-footer { padding-bottom: 0; }

.game-desc {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.leaderboard-highlight { background: rgba(255,184,0,0.06); }

/* Recolor category tiles to match the WinZone "Top Categories" palette
   (Sports=blue, Quiz=pink, Racing=red, Puzzle=green, Arcade=purple) */
.cat-sports { background: linear-gradient(135deg, #4d7cff, #3a5cff); }
.cat-racing { background: linear-gradient(135deg, #ff4d5e, #dc2626); }

/* ===== Side Menu ===== */
.side-menu {
  position: fixed; left: 0; top: 0; width: 100%; max-width: 280px; height: 100vh;
  background: var(--surface); border-right: 1px solid var(--border); z-index: 999;
  display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform 0.3s ease;
}
.side-menu.hidden { transform: translateX(-100%); }
.side-menu:not(.hidden) { transform: translateX(0); }

.menu-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px; border-bottom: 1px solid var(--border);
}
.menu-header .menu-close { font-size: 18px; }

.menu-body {
  flex: 1; overflow-y: auto; padding: 12px 0;
}

.menu-item {
  display: block; padding: 12px 16px; color: var(--text); font-size: 14px;
  text-decoration: none; transition: background 0.15s ease;
}
.menu-item:hover { background: rgba(124,92,255,0.1); }

.menu-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 998;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.menu-overlay:not(.hidden) { opacity: 1; pointer-events: auto; }

hr { border: none; height: 1px; background: var(--border); }

/* Menu Toggle Button */
.menu-toggle {
  cursor: pointer;
  font-size: 20px !important;
  transition: transform 0.2s ease, background 0.2s ease;
}

.menu-toggle:hover {
  background: rgba(124,92,255,0.1) !important;
  transform: scale(1.05);
}

.menu-toggle:active {
  transform: scale(0.95);
}
