/* ============================================
   Ludo Star - Premium CSS Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&display=swap');

:root {
  --primary: #7c3aed;
  --primary-dark: #5b21b6;
  --primary-light: #a78bfa;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --gold: #fbbf24;
  --success: #10b981;
  --danger: #ef4444;
  --info: #3b82f6;
  --bg-dark: #1a0a2e;
  --bg-card: rgba(255,255,255,0.06);
  --bg-card-hover: rgba(255,255,255,0.1);
  --border: rgba(255,255,255,0.12);
  --text: #ffffff;
  --text-muted: rgba(255,255,255,0.55);
  --glass: rgba(255,255,255,0.07);
  --glass-border: rgba(255,255,255,0.15);
  --red-color: #ef4444;
  --green-color: #22c55e;
  --blue-color: #3b82f6;
  --yellow-color: #eab308;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Poppins', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  user-select: none;
}

body {
  background: linear-gradient(135deg, #1a0a2e 0%, #2d1060 50%, #1a0a2e 100%);
  min-height: 100vh;
  overflow-y: auto;
}

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 2px; }

/* ===================== APP WRAPPER ===================== */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* ===================== SCREENS ===================== */
.screen {
  display: none;
  min-height: 100vh;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}
.screen.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===================== LOADING SCREEN ===================== */
#loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a0a2e, #3b1f6e);
}

.loading-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.logo-glow {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  box-shadow: 0 0 60px rgba(124, 58, 237, 0.6), 0 0 120px rgba(245, 158, 11, 0.3);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 60px rgba(124,58,237,0.6), 0 0 120px rgba(245,158,11,0.3); transform: scale(1); }
  50% { box-shadow: 0 0 80px rgba(124,58,237,0.9), 0 0 160px rgba(245,158,11,0.5); transform: scale(1.03); }
}

.loading-title {
  font-size: 32px;
  font-weight: 900;
  background: linear-gradient(135deg, #fff, var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.loading-sub { color: var(--text-muted); font-size: 14px; }

.loading-bar {
  width: 200px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.loading-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  animation: loading-anim 2s ease-in-out infinite;
}

@keyframes loading-anim {
  0% { width: 0%; }
  50% { width: 80%; }
  100% { width: 100%; }
}

/* ===================== TOP BAR ===================== */
.top-bar {
  padding: 12px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, transparent 100%);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.top-bar-left { display: flex; align-items: center; gap: 10px; }

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  overflow: hidden;
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 13px; font-weight: 700; color: #fff; line-height: 1.2; }
.user-level { font-size: 10px; color: var(--gold); }

.top-bar-right { display: flex; align-items: center; gap: 8px; }

.coin-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
}

.notif-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-dark);
  display: none;
}
.notif-dot.show { display: block; }

/* ===================== BOTTOM NAV ===================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(20, 8, 45, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 8px 0 12px;
  z-index: 1000;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.nav-icon {
  width: 26px;
  height: 26px;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-item.active .nav-label { color: var(--primary-light); }
.nav-item.active .nav-icon { transform: scale(1.15); }

.nav-item:active { transform: scale(0.95); }

.nav-badge {
  position: absolute;
  top: 0;
  right: calc(50% - 18px);
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

/* Play Button (center nav) */
.nav-play {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 4px 20px rgba(124,58,237,0.5);
  margin-top: -16px;
  flex: none;
  cursor: pointer;
  transition: transform 0.2s;
}
.nav-play:active { transform: scale(0.92); }

/* ===================== SCROLL CONTENT ===================== */
.scroll-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 80px;
}

/* ===================== GLASS CARDS ===================== */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  padding: 16px;
}

.glass-card-dark {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

/* ===================== HOME SCREEN ===================== */
.home-banner {
  margin: 8px 16px;
  padding: 20px;
  background: linear-gradient(135deg, #4f1d96, #7c3aed);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-banner::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,0.07);
  border-radius: 50%;
}

.home-banner::after {
  content: '';
  position: absolute;
  bottom: -40px; right: 40px;
  width: 80px; height: 80px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.banner-text h2 { font-size: 20px; font-weight: 800; }
.banner-text p { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 2px; }

.banner-claim-btn {
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  z-index: 1;
  white-space: nowrap;
  transition: transform 0.15s;
}
.banner-claim-btn:active { transform: scale(0.95); }

.section-title {
  font-size: 15px;
  font-weight: 700;
  padding: 12px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}
.section-title span { font-size: 12px; color: var(--primary-light); font-weight: 500; cursor: pointer; }

/* ===================== GAME MODE CARDS ===================== */
.game-modes {
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mode-card {
  border-radius: var(--radius);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
  min-height: 130px;
  justify-content: center;
}

.mode-card:active { transform: scale(0.97); }

.mode-card.online {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  border: 1px solid rgba(59,130,246,0.4);
}
.mode-card.team {
  background: linear-gradient(135deg, #065f46, #10b981);
  border: 1px solid rgba(16,185,129,0.4);
}
.mode-card.bot {
  background: linear-gradient(135deg, #7c2d12, #ea580c);
  border: 1px solid rgba(234,88,12,0.4);
}
.mode-card.private {
  background: linear-gradient(135deg, #4c1d95, #7c3aed);
  border: 1px solid rgba(124,58,237,0.4);
}

.mode-icon { font-size: 40px; }
.mode-name { font-size: 13px; font-weight: 700; text-align: center; }
.mode-players { font-size: 10px; color: rgba(255,255,255,0.7); }

.mode-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--gold);
  color: #000;
  font-size: 8px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 8px;
}

/* ===================== ROOM CARDS ===================== */
.rooms-scroll {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.room-card {
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.15s;
  border: 1px solid;
}
.room-card:active { transform: scale(0.98); }

.room-card.beginner { background: linear-gradient(135deg, rgba(16,185,129,0.15), rgba(16,185,129,0.05)); border-color: rgba(16,185,129,0.3); }
.room-card.classic { background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(59,130,246,0.05)); border-color: rgba(59,130,246,0.3); }
.room-card.pro { background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.05)); border-color: rgba(245,158,11,0.3); }
.room-card.vip { background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(168,85,247,0.05)); border-color: rgba(168,85,247,0.3); }

.room-info { display: flex; flex-direction: column; gap: 2px; }
.room-name { font-size: 14px; font-weight: 700; }
.room-entry { font-size: 11px; color: var(--text-muted); }

.room-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.room-prize { font-size: 12px; font-weight: 700; color: var(--gold); }

.play-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s;
}
.play-btn:active { transform: scale(0.95); }

/* ===================== MATCHMAKING SCREEN ===================== */
.matchmaking-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
}
.matchmaking-overlay.show { display: flex; }

.mm-title { font-size: 22px; font-weight: 800; }
.mm-sub { font-size: 13px; color: var(--text-muted); }

.mm-avatars {
  display: flex;
  align-items: center;
  gap: 20px;
}

.mm-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: rgba(124,58,237,0.2);
  overflow: hidden;
}

.mm-vs {
  font-size: 24px;
  font-weight: 900;
  color: var(--gold);
  animation: mm-pulse 1s infinite;
}

@keyframes mm-pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(0.9)} }

.mm-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(124,58,237,0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.mm-cancel-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--border);
  color: #fff;
  border-radius: 20px;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ===================== GAME BOARD ===================== */
#game-screen {
  background: #1a0a2e;
  padding-bottom: 0 !important;
}

.game-header {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.3);
}

.game-players {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-player {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 20px;
  border: 2px solid transparent;
  transition: border-color 0.3s;
}
.game-player.active-turn { border-color: var(--gold); background: rgba(251,191,36,0.1); }

.gp-avatar { width: 28px; height: 28px; border-radius: 50%; font-size: 16px; overflow: hidden; }
.gp-name { font-size: 11px; font-weight: 600; }
.gp-color {
  width: 10px; height: 10px;
  border-radius: 50%;
}

.board-wrapper {
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ludo-board {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  position: relative;
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
  border: 3px solid #4a1080;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

/* Ludo board cells */
.board-cell {
  border: 0.5px solid rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  position: relative;
}

.board-cell.red-home { background: #ffcccc; }
.board-cell.green-home { background: #ccffcc; }
.board-cell.blue-home { background: #cce0ff; }
.board-cell.yellow-home { background: #fffacc; }
.board-cell.red-path { background: #ff4444; }
.board-cell.green-path { background: #44bb44; }
.board-cell.blue-path { background: #4488ff; }
.board-cell.yellow-path { background: #ffdd00; }
.board-cell.center { background: linear-gradient(135deg, #ff4444 0% 25%, #44bb44 25% 50%, #4488ff 50% 75%, #ffdd00 75%); }
.board-cell.safe { background: rgba(255,255,255,0.8); }
.board-cell.safe::after { content: '⭐'; font-size: 7px; position: absolute; }
.board-cell.home-base { background: inherit; border-radius: 50%; width: 60%; height: 60%; }

/* Pieces on board */
.piece {
  width: 70%;
  height: 70%;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  position: absolute;
  z-index: 5;
}
.piece:active { transform: scale(1.2); }
.piece.red { background: radial-gradient(circle at 35% 35%, #ff6b6b, #cc0000); }
.piece.green { background: radial-gradient(circle at 35% 35%, #6bff6b, #00aa00); }
.piece.blue { background: radial-gradient(circle at 35% 35%, #6b9fff, #0044cc); }
.piece.yellow { background: radial-gradient(circle at 35% 35%, #ffef6b, #ccaa00); }
.piece.moveable { animation: piece-pulse 0.7s infinite; cursor: pointer; }
@keyframes piece-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(255,255,255,0.4)} 50%{box-shadow:0 0 0 5px rgba(255,255,255,0.1)} }

/* Dice Section */
.dice-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(0,0,0,0.2);
}

.dice-container { cursor: pointer; }

.dice {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #fff, #ddd);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.5);
  transition: transform 0.1s;
  border: 2px solid rgba(255,255,255,0.5);
  user-select: none;
}
.dice:active { transform: scale(0.9) rotate(-5deg); }
.dice.rolling { animation: dice-roll 0.4s ease; }
@keyframes dice-roll {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(15deg) scale(1.1); }
  50% { transform: rotate(-15deg) scale(0.95); }
  75% { transform: rotate(8deg) scale(1.05); }
  100% { transform: rotate(0deg) scale(1); }
}

.roll-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  color: #fff;
  border-radius: 24px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(124,58,237,0.4);
  transition: transform 0.15s;
}
.roll-btn:active { transform: scale(0.95); }
.roll-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Chat in game */
.game-chat {
  max-height: 100px;
  overflow-y: auto;
  padding: 6px 16px;
}

.chat-msg {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.chat-msg-name { font-size: 10px; font-weight: 700; color: var(--primary-light); }
.chat-msg-text { font-size: 10px; color: var(--text-muted); }

.quick-chats {
  display: flex;
  gap: 6px;
  padding: 6px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.quick-chats::-webkit-scrollbar { display: none; }

.quick-chat-btn {
  white-space: nowrap;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  color: #fff;
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ===================== PROFILE SCREEN ===================== */
.profile-hero {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, rgba(124,58,237,0.2), transparent);
}

.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  background: rgba(124,58,237,0.3);
  position: relative;
}

.premium-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--gold);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 2px solid var(--bg-dark);
}

.profile-name { font-size: 20px; font-weight: 800; }
.profile-id { font-size: 11px; color: var(--text-muted); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 16px;
}

.stat-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value { font-size: 22px; font-weight: 800; color: var(--gold); }
.stat-label { font-size: 10px; color: var(--text-muted); font-weight: 500; }

/* ===================== LEADERBOARD ===================== */
.leaderboard-header {
  padding: 16px;
  text-align: center;
  background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(245,158,11,0.1));
  margin: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(245,158,11,0.2);
}
.lb-title { font-size: 18px; font-weight: 800; }
.lb-sub { font-size: 11px; color: var(--text-muted); }

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding: 16px;
}

.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.podium-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 3px solid;
  overflow: hidden;
}
.podium-item:nth-child(1) .podium-avatar { border-color: #c0c0c0; }
.podium-item:nth-child(2) .podium-avatar { width: 68px; height: 68px; border-color: var(--gold); font-size: 34px; }
.podium-item:nth-child(3) .podium-avatar { border-color: #cd7f32; }

.podium-stand {
  width: 64px;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.podium-item:nth-child(1) .podium-stand { height: 50px; background: rgba(192,192,192,0.3); }
.podium-item:nth-child(2) .podium-stand { height: 70px; background: rgba(251,191,36,0.3); width: 72px; }
.podium-item:nth-child(3) .podium-stand { height: 40px; background: rgba(205,127,50,0.3); }

.podium-name { font-size: 10px; font-weight: 600; text-align: center; max-width: 64px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium-pts { font-size: 9px; color: var(--gold); }

.lb-list { padding: 0 16px; display: flex; flex-direction: column; gap: 6px; }

.lb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.lb-rank { font-size: 13px; font-weight: 700; color: var(--text-muted); min-width: 24px; }
.lb-rank.top3 { color: var(--gold); }
.lb-avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; font-size: 20px; display: flex; align-items: center; justify-content: center; background: rgba(124,58,237,0.3); }
.lb-info { flex: 1; }
.lb-name { font-size: 13px; font-weight: 600; }
.lb-wins { font-size: 10px; color: var(--text-muted); }
.lb-points { font-size: 14px; font-weight: 700; color: var(--gold); }

/* ===================== SHOP SCREEN ===================== */
.shop-hero {
  margin: 12px 16px;
  padding: 20px;
  background: linear-gradient(135deg, #4f1d96, #7c2d12);
  border-radius: var(--radius-lg);
  text-align: center;
}
.shop-hero h2 { font-size: 22px; font-weight: 800; }
.shop-hero p { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 4px; }

.coin-packages { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }

.package-card {
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.15s;
  border: 1px solid;
  position: relative;
  overflow: hidden;
}
.package-card:active { transform: scale(0.98); }

.package-card.popular::before {
  content: '🔥 BEST VALUE';
  position: absolute;
  top: 0; right: 0;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 0 var(--radius) 0 8px;
}

.pkg-icon { font-size: 40px; }
.pkg-info { flex: 1; }
.pkg-coins { font-size: 18px; font-weight: 800; color: var(--gold); }
.pkg-label { font-size: 11px; color: var(--text-muted); }
.pkg-price {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* Colors for packages */
.package-card:nth-child(1) { background: linear-gradient(135deg, rgba(16,185,129,0.1), transparent); border-color: rgba(16,185,129,0.3); }
.package-card:nth-child(2) { background: linear-gradient(135deg, rgba(59,130,246,0.1), transparent); border-color: rgba(59,130,246,0.3); }
.package-card:nth-child(3) { background: linear-gradient(135deg, rgba(245,158,11,0.1), transparent); border-color: rgba(245,158,11,0.3); }
.package-card:nth-child(4) { background: linear-gradient(135deg, rgba(168,85,247,0.1), transparent); border-color: rgba(168,85,247,0.3); }
.package-card:nth-child(5) { background: linear-gradient(135deg, rgba(239,68,68,0.1), transparent); border-color: rgba(239,68,68,0.3); }
.package-card:nth-child(6) { background: linear-gradient(135deg, rgba(251,191,36,0.1), transparent); border-color: rgba(251,191,36,0.3); }

/* ===================== FRIENDS SCREEN ===================== */
.search-bar {
  margin: 12px 16px;
  position: relative;
}
.search-bar input {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 10px 16px 10px 40px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.search-bar input:focus { border-color: var(--primary); }
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.friend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  transition: background 0.15s;
}
.friend-item:active { background: rgba(255,255,255,0.05); }

.friend-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: rgba(124,58,237,0.3);
  position: relative;
}

.online-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 10px; height: 10px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid var(--bg-dark);
}

.friend-info { flex: 1; }
.friend-name { font-size: 13px; font-weight: 600; }
.friend-status { font-size: 10px; color: var(--text-muted); }

.friend-actions { display: flex; gap: 6px; }
.friend-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s;
}
.friend-btn:active { transform: scale(0.9); }
.friend-btn.accept { background: rgba(16,185,129,0.2); color: var(--success); }
.friend-btn.decline { background: rgba(239,68,68,0.2); color: var(--danger); }
.friend-btn.invite { background: rgba(124,58,237,0.2); color: var(--primary-light); }

/* ===================== WALLET SCREEN ===================== */
.wallet-balance {
  margin: 12px 16px;
  padding: 24px;
  background: linear-gradient(135deg, #4f1d96, #7c3aed);
  border-radius: var(--radius-lg);
  text-align: center;
}
.wallet-balance-label { font-size: 12px; color: rgba(255,255,255,0.7); }
.wallet-balance-amount { font-size: 36px; font-weight: 900; color: var(--gold); margin: 4px 0; }
.wallet-balance-sub { font-size: 11px; color: rgba(255,255,255,0.6); }

.wallet-actions {
  display: flex;
  gap: 10px;
  padding: 0 16px;
}

.wallet-action-btn {
  flex: 1;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
}
.wallet-action-btn .wa-icon { font-size: 22px; }
.wallet-action-btn .wa-label { font-size: 11px; font-weight: 600; }

.tx-list { padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }

.tx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.tx-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.tx-icon.win { background: rgba(16,185,129,0.2); }
.tx-icon.loss { background: rgba(239,68,68,0.2); }
.tx-icon.deposit { background: rgba(59,130,246,0.2); }
.tx-icon.bonus { background: rgba(245,158,11,0.2); }

.tx-info { flex: 1; }
.tx-desc { font-size: 12px; font-weight: 600; }
.tx-date { font-size: 10px; color: var(--text-muted); }
.tx-amount { font-size: 14px; font-weight: 700; }
.tx-amount.positive { color: var(--success); }
.tx-amount.negative { color: var(--danger); }

/* ===================== SPIN WHEEL ===================== */
.spin-section {
  padding: 0 16px 16px;
}
.spin-wheel-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.spin-wheel {
  width: 220px;
  height: 220px;
  position: relative;
}

.spin-wheel svg {
  width: 100%;
  height: 100%;
  transition: transform 3s cubic-bezier(0.17,0.67,0.12,0.99);
}

.spin-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  color: #fff;
  border-radius: 24px;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
  transition: transform 0.15s;
}
.spin-btn:active { transform: scale(0.95); }
.spin-btn:disabled { opacity: 0.5; }

/* ===================== NOTIFICATIONS ===================== */
.notif-list { padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  transition: background 0.2s;
}
.notif-item.unread { background: rgba(124,58,237,0.1); border-color: rgba(124,58,237,0.2); }

.notif-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.notif-info { flex: 1; }
.notif-title { font-size: 13px; font-weight: 700; }
.notif-msg { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.notif-time { font-size: 9px; color: var(--text-muted); margin-top: 4px; }

/* ===================== MODALS ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 800;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.show { display: flex; }

.modal {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(180deg, #2d1060, #1a0a2e);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-top: 1px solid var(--border);
  padding: 20px;
  animation: slideUp 0.3s ease;
  max-height: 80vh;
  overflow-y: auto;
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-handle {
  width: 36px; height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.modal-title { font-size: 18px; font-weight: 800; margin-bottom: 16px; }

.modal-input {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  margin-bottom: 12px;
  transition: border-color 0.2s;
  text-align: center;
  letter-spacing: 4px;
  font-size: 20px;
  font-weight: 700;
}
.modal-input:focus { border-color: var(--primary); }

.modal-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s;
}
.modal-btn:active { transform: scale(0.98); }

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================== TOAST NOTIFICATIONS ===================== */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: calc(100% - 32px);
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(20,8,45,0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease;
  backdrop-filter: blur(10px);
  pointer-events: auto;
}
@keyframes toastIn { from{opacity:0;transform:translateY(-10px)} to{opacity:1;transform:translateY(0)} }
.toast.success { border-color: rgba(16,185,129,0.4); }
.toast.error { border-color: rgba(239,68,68,0.4); }
.toast.info { border-color: rgba(59,130,246,0.4); }
.toast-icon { font-size: 20px; }
.toast-text { font-size: 13px; font-weight: 600; flex: 1; }

/* ===================== EMPTY STATE ===================== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-text { font-size: 14px; }

/* ===================== DIVIDER ===================== */
.divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

/* ===================== TABS ===================== */
.tabs {
  display: flex;
  padding: 0 16px;
  gap: 6px;
  margin-bottom: 8px;
}
.tab {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
  font-family: inherit;
}
.tab.active {
  background: rgba(124,58,237,0.25);
  border-color: rgba(124,58,237,0.4);
  color: var(--primary-light);
}

/* ===================== REWARD CARDS ===================== */
.reward-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 16px;
}

.reward-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s;
}
.reward-card:active { transform: scale(0.95); }
.reward-card .r-icon { font-size: 30px; }
.reward-card .r-name { font-size: 10px; font-weight: 600; color: var(--text-muted); }
.reward-card .r-amount { font-size: 13px; font-weight: 700; color: var(--gold); }
.reward-card .r-status { font-size: 9px; }
.reward-card.claimed { opacity: 0.5; }
.reward-card.available { border-color: var(--gold); background: rgba(251,191,36,0.08); }

/* ===================== UTILITY ===================== */
.hidden { display: none !important; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.fw-700 { font-weight: 700; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.px-16 { padding: 0 16px; }

/* ===================== ADMIN PANEL STYLES ===================== */
.admin-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px;
}
.admin-stat {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-stat-icon { font-size: 24px; }
.admin-stat-value { font-size: 22px; font-weight: 800; color: var(--gold); }
.admin-stat-label { font-size: 10px; color: var(--text-muted); }

.admin-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.admin-user-info { flex: 1; }
.admin-user-name { font-size: 13px; font-weight: 600; }
.admin-user-meta { font-size: 10px; color: var(--text-muted); }
.admin-actions { display: flex; gap: 4px; }

.admin-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 10px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}
.admin-btn.danger { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); color: var(--danger); }
.admin-btn.success { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.3); color: var(--success); }
