/* ═══════════════════════════════════════════════════════════════
   Ruban Softwares — Gaming Section Design System
   Inherits brand from WorkPulse HR (test2): orange #e69829 + navy #102b45
   ═══════════════════════════════════════════════════════════════ */

/* ─── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  color: var(--rs-text);
  background: var(--rs-bg-page);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── Design Tokens ───────────────────────────────────────────── */
:root {
  --rs-primary:        #e69829;
  --rs-primary-hover:  #cb7c11;
  --rs-primary-soft:   #fff4e0;
  --rs-primary-glow:   rgba(230,152,41,.25);

  --rs-dark:           #102b45;
  --rs-dark-mid:       #1a3d5a;
  --rs-dark-deep:      #0d2035;

  --rs-bg-page:        #0f1117;
  --rs-bg-card:        #1a1d27;
  --rs-bg-card-hover:  #1f2336;
  --rs-bg-sidebar:     #0d1117;
  --rs-bg-input:       #12151e;

  --rs-border:         rgba(255,255,255,.08);
  --rs-border-light:   rgba(255,255,255,.04);

  --rs-text:           #e2e8f0;
  --rs-text-muted:     #94a3b8;
  --rs-text-dim:       #64748b;

  --rs-green:          #4ade80;
  --rs-red:            #f87171;
  --rs-yellow:         #fbbf24;
  --rs-blue:           #60a5fa;
  --rs-purple:         #c084fc;
  --rs-cyan:           #22d3ee;
  --rs-pink:           #f472b6;

  --game-children:     #4ade80;
  --game-adult:        #818cf8;
  --game-2d:           #f97316;
  --game-3d:           #06b6d4;

  --sidebar-w:         248px;
  --topbar-h:          60px;
  --rs-radius:         10px;
  --rs-radius-sm:      6px;
  --rs-radius-lg:      16px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.6);
  --shadow-glow:0 0 24px var(--rs-primary-glow);

  --transition: .2s ease;
}

/* ─── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

/* ═══════════════════════════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════════════════════════ */
.rs-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─────────────────────────────────────────────────── */
.rs-sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--rs-bg-sidebar);
  border-right: 1px solid var(--rs-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--rs-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--rs-primary), var(--rs-primary-hover));
  border-radius: var(--rs-radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--rs-primary-glow);
}
.sidebar-brand-text { line-height: 1.2; }
.sidebar-brand-name {
  font-size: .88rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.01em;
}
.sidebar-brand-tag {
  font-size: .65rem;
  color: var(--rs-primary);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Player card in sidebar */
.sidebar-player {
  padding: 14px 18px;
  border-bottom: 1px solid var(--rs-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: .85rem;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.15);
}
.sidebar-player-info { flex: 1; min-width: 0; }
.sidebar-player-name {
  font-size: .83rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-player-level {
  font-size: .7rem;
  color: var(--rs-primary);
  font-weight: 600;
}
.sidebar-xp-bar {
  height: 3px;
  background: rgba(255,255,255,.08);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}
.sidebar-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rs-primary), #fbbf24);
  border-radius: 2px;
  transition: width .6s ease;
}

/* Nav */
.sidebar-nav { flex: 1; padding: 10px 0; }
.nav-section-label {
  padding: 12px 18px 4px;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--rs-text-dim);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  font-size: .83rem;
  font-weight: 500;
  color: var(--rs-text-muted);
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}
.nav-link i { font-size: .95rem; width: 16px; text-align: center; }
.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.04);
}
.nav-link.active {
  color: var(--rs-primary);
  background: rgba(230,152,41,.08);
  border-left-color: var(--rs-primary);
  font-weight: 600;
}
.nav-link .nav-badge {
  margin-left: auto;
  background: var(--rs-primary);
  color: #000;
  font-size: .6rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--rs-border);
}
.sidebar-logout {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--rs-radius-sm);
  color: var(--rs-text-muted);
  font-size: .82rem;
  cursor: pointer;
  transition: all var(--transition);
}
.sidebar-logout:hover { color: var(--rs-red); background: rgba(248,113,113,.08); }

/* ─── Main ────────────────────────────────────────────────────── */
.rs-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Topbar ──────────────────────────────────────────────────── */
.rs-topbar {
  height: var(--topbar-h);
  background: rgba(13,17,23,.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rs-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-btn {
  width: 34px; height: 34px;
  border-radius: var(--rs-radius-sm);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--rs-border);
  color: var(--rs-text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: .9rem;
}
.topbar-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
.topbar-player-xp {
  display: flex; align-items: center; gap: 6px;
  background: rgba(230,152,41,.1);
  border: 1px solid rgba(230,152,41,.2);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: .75rem;
  font-weight: 700;
  color: var(--rs-primary);
}

/* ─── Content ─────────────────────────────────────────────────── */
.rs-content {
  flex: 1;
  padding: 28px 28px 40px;
}

/* ─── Flash Messages ──────────────────────────────────────────── */
.rs-flash {
  border-radius: var(--rs-radius);
  padding: .75rem 1.1rem;
  margin-bottom: 1.2rem;
  font-size: .87rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.rs-flash-success { background: rgba(74,222,128,.1); border-color: rgba(74,222,128,.2); color: var(--rs-green); }
.rs-flash-error   { background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.2); color: var(--rs-red); }
.rs-flash-info    { background: rgba(96,165,250,.1); border-color: rgba(96,165,250,.2); color: var(--rs-blue); }

/* ═══════════════════════════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--rs-bg-card);
  border: 1px solid var(--rs-border);
  border-radius: var(--rs-radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition);
}
.stat-card:hover {
  border-color: rgba(230,152,41,.3);
  background: var(--rs-bg-card-hover);
}
.stat-icon {
  width: 46px; height: 46px;
  border-radius: var(--rs-radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-info { flex: 1; min-width: 0; }
.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -.02em;
}
.stat-label {
  font-size: .73rem;
  color: var(--rs-text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   GAME LOBBY
   ═══════════════════════════════════════════════════════════════ */

/* ─── Featured Hero ───────────────────────────────────────────── */
.featured-section { margin-bottom: 28px; }
.featured-section-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--rs-text-dim);
  margin-bottom: 12px;
}
.featured-carousel {
  position: relative;
  height: 220px;
  border-radius: var(--rs-radius-lg);
  overflow: hidden;
  cursor: pointer;
}
.featured-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 36px;
  opacity: 0;
  transition: opacity .6s ease;
}
.featured-slide.active { opacity: 1; }
.featured-slide-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.featured-slide-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.7) 0%, transparent 70%);
}
.featured-content {
  position: relative;
  z-index: 1;
  flex: 1;
}
.featured-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.featured-title {
  font-size: 1.7rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.02em;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
  margin-bottom: 6px;
}
.featured-desc {
  font-size: .88rem;
  color: rgba(255,255,255,.7);
  margin-bottom: 16px;
}
.featured-icon {
  position: relative;
  z-index: 1;
  font-size: 5.5rem;
  opacity: .8;
  text-shadow: 0 4px 20px rgba(0,0,0,.5);
  animation: float 4s ease-in-out infinite;
  margin-left: 40px;
}
.featured-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}
.featured-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  cursor: pointer;
  transition: all .3s;
}
.featured-dot.active {
  background: var(--rs-primary);
  width: 20px;
  border-radius: 3px;
}

/* ─── Live Score Ticker ───────────────────────────────────────── */
.score-ticker {
  background: var(--rs-bg-card);
  border: 1px solid var(--rs-border);
  border-radius: var(--rs-radius);
  padding: 8px 16px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}
.ticker-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--rs-primary);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ticker-label::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--rs-primary);
  border-radius: 50%;
  animation: pulse-dot 1.4s ease-in-out infinite;
}
.ticker-track { flex: 1; overflow: hidden; }
.ticker-inner {
  display: flex;
  gap: 32px;
  animation: ticker-scroll 30s linear infinite;
  white-space: nowrap;
}
.ticker-item {
  font-size: .78rem;
  color: var(--rs-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.ticker-item strong { color: #fff; }
.ticker-item .ticker-score { color: var(--rs-primary); font-weight: 700; }

/* ─── Filter Bar ──────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-bar-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--rs-text-dim);
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-right: 4px;
}
.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  border: 1px solid var(--rs-border);
  background: transparent;
  color: var(--rs-text-muted);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
}
.filter-btn:hover {
  border-color: rgba(255,255,255,.2);
  color: #fff;
}
.filter-btn.active {
  background: var(--rs-primary);
  border-color: var(--rs-primary);
  color: #000;
  font-weight: 700;
}
.filter-btn .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.filter-btn .dot.children { background: var(--game-children); }
.filter-btn .dot.adults   { background: var(--game-adult); }

/* Search */
.filter-search {
  margin-left: auto;
  position: relative;
}
.filter-search input {
  background: var(--rs-bg-input);
  border: 1px solid var(--rs-border);
  border-radius: 20px;
  color: var(--rs-text);
  font-size: .82rem;
  padding: 6px 14px 6px 34px;
  width: 180px;
  outline: none;
  transition: all var(--transition);
}
.filter-search input:focus {
  border-color: var(--rs-primary);
  box-shadow: 0 0 0 3px var(--rs-primary-glow);
  width: 220px;
}
.filter-search input::placeholder { color: var(--rs-text-dim); }
.filter-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--rs-text-dim);
  font-size: .82rem;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   GAME CARDS GRID
   ═══════════════════════════════════════════════════════════════ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.game-card {
  background: var(--rs-bg-card);
  border: 1px solid var(--rs-border);
  border-radius: var(--rs-radius-lg);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  cursor: pointer;
  position: relative;
}
.game-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--card-accent, rgba(230,152,41,.4));
}
.game-card:hover .game-thumb-icon { transform: scale(1.15) rotate(5deg); }
.game-card:hover .btn-play { transform: translateY(0); opacity: 1; }

/* Thumbnail */
.game-thumb {
  height: 175px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-thumb-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.game-thumb-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.05) 0%, transparent 60%);
  z-index: 1;
}
.game-thumb-bg::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,.4));
  z-index: 2;
}

/* Per-game gradients */
.game-card[data-game="snake"]           .game-thumb-bg { background: linear-gradient(135deg,#052e16,#166534); }
.game-card[data-game="memory-match"]    .game-thumb-bg { background: linear-gradient(135deg,#2e1065,#6b21a8); }
.game-card[data-game="bubble-pop"]      .game-thumb-bg { background: linear-gradient(135deg,#083344,#0e7490); }
.game-card[data-game="math-quiz"]       .game-thumb-bg { background: linear-gradient(135deg,#1e3a5f,#1d4ed8); }
.game-card[data-game="dino-run"]        .game-thumb-bg { background: linear-gradient(135deg,#451a03,#92400e); }
.game-card[data-game="brick-breaker"]   .game-thumb-bg { background: linear-gradient(135deg,#3b0764,#7e22ce); }
.game-card[data-game="tetris"]          .game-thumb-bg { background: linear-gradient(135deg,#1e1b4b,#4338ca); }
.game-card[data-game="word-scramble"]   .game-thumb-bg { background: linear-gradient(135deg,#14532d,#15803d); }
.game-card[data-game="chess"]           .game-thumb-bg { background: linear-gradient(135deg,#1c1917,#44403c); }
.game-card[data-game="aim-trainer"]     .game-thumb-bg { background: linear-gradient(135deg,#4c0519,#be123c); }
.game-card[data-game="cube-runner-3d"]  .game-thumb-bg { background: linear-gradient(135deg,#0c0a1e,#1e1b4b); }
.game-card[data-game="space-shooter-3d"].game-thumb-bg { background: linear-gradient(135deg,#020617,#0f172a); }

/* Per-game accent border on hover */
.game-card[data-game="snake"]           { --card-accent: rgba(74,222,128,.4); }
.game-card[data-game="memory-match"]    { --card-accent: rgba(192,132,252,.4); }
.game-card[data-game="bubble-pop"]      { --card-accent: rgba(34,211,238,.4); }
.game-card[data-game="math-quiz"]       { --card-accent: rgba(96,165,250,.4); }
.game-card[data-game="dino-run"]        { --card-accent: rgba(251,191,36,.4); }
.game-card[data-game="brick-breaker"]   { --card-accent: rgba(232,121,249,.4); }
.game-card[data-game="tetris"]          { --card-accent: rgba(129,140,248,.4); }
.game-card[data-game="word-scramble"]   { --card-accent: rgba(134,239,172,.4); }
.game-card[data-game="chess"]           { --card-accent: rgba(168,162,158,.4); }
.game-card[data-game="aim-trainer"]     { --card-accent: rgba(251,113,133,.4); }
.game-card[data-game="cube-runner-3d"]  { --card-accent: rgba(6,182,212,.4); }
.game-card[data-game="space-shooter-3d"]{ --card-accent: rgba(139,92,246,.4); }

.game-thumb-icon {
  font-size: 4.5rem;
  position: relative;
  z-index: 3;
  transition: transform .3s ease;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.6));
  user-select: none;
}

/* Animated particle ring behind icon */
.game-thumb-ring {
  position: absolute;
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.1);
  z-index: 2;
  animation: ring-pulse 3s ease-in-out infinite;
}
.game-thumb-ring-2 {
  width: 140px; height: 140px;
  animation-delay: .7s;
  border-color: rgba(255,255,255,.05);
}

/* Badges on card */
.game-dim-badge {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 4;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 12px;
}
.badge-2d { background: rgba(249,115,22,.2); color: #f97316; border: 1px solid rgba(249,115,22,.3); }
.badge-3d { background: rgba(6,182,212,.2); color: #06b6d4; border: 1px solid rgba(6,182,212,.3); }

.game-badge-corner {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 4;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 12px;
}
.badge-hot  { background: rgba(239,68,68,.85); color: #fff; }
.badge-new  { background: rgba(34,197,94,.85); color: #fff; }

/* Play button hover overlay */
.game-play-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.4);
  opacity: 0;
  transition: opacity .25s ease;
}
.game-card:hover .game-play-overlay { opacity: 1; }
.play-circle {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--rs-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  color: #000;
  transform: scale(.8);
  transition: transform .25s ease;
  box-shadow: 0 4px 20px var(--rs-primary-glow);
}
.game-card:hover .play-circle { transform: scale(1); }

/* Card body */
.game-card-body {
  padding: 14px 16px 12px;
}
.game-card-title {
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.game-card-desc {
  font-size: .78rem;
  color: var(--rs-text-muted);
  line-height: 1.45;
  margin-bottom: 10px;
}
.game-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.badge-audience {
  font-size: .63rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: .03em;
}
.badge-audience.children { background: rgba(74,222,128,.15); color: var(--game-children); }
.badge-audience.adults   { background: rgba(129,140,248,.15); color: var(--game-adult); }
.badge-audience.all      { background: rgba(230,152,41,.15); color: var(--rs-primary); }
.badge-category {
  font-size: .63rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  color: var(--rs-text-muted);
}

/* Card footer */
.game-card-footer {
  padding: 10px 16px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--rs-border);
}
.btn-play {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  border-radius: var(--rs-radius-sm);
  background: linear-gradient(135deg, var(--rs-primary), var(--rs-primary-hover));
  color: #000;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .02em;
  transition: all var(--transition);
  border: none;
  cursor: pointer;
}
.btn-play:hover {
  background: linear-gradient(135deg, #fbbf24, var(--rs-primary));
  box-shadow: 0 4px 12px var(--rs-primary-glow);
  transform: translateY(-1px);
}
.play-count {
  font-size: .7rem;
  color: var(--rs-text-dim);
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

/* No results */
.games-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--rs-text-muted);
}
.games-empty i { font-size: 3rem; margin-bottom: 12px; display: block; opacity: .4; }

/* ═══════════════════════════════════════════════════════════════
   LEADERBOARD TABLE
   ═══════════════════════════════════════════════════════════════ */
.lb-card {
  background: var(--rs-bg-card);
  border: 1px solid var(--rs-border);
  border-radius: var(--rs-radius);
  overflow: hidden;
}
.lb-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--rs-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lb-card-title {
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hr-table {
  width: 100%;
  border-collapse: collapse;
}
.hr-table thead tr {
  background: rgba(255,255,255,.03);
}
.hr-table th {
  padding: .7rem 1.1rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--rs-text-dim);
  text-align: left;
  white-space: nowrap;
}
.hr-table td {
  padding: .8rem 1.1rem;
  font-size: .84rem;
  color: var(--rs-text);
  border-bottom: 1px solid var(--rs-border-light);
}
.hr-table tr:last-child td { border-bottom: none; }
.hr-table tbody tr:hover td { background: rgba(255,255,255,.02); }

/* Rank badges */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  font-size: .72rem;
  font-weight: 800;
}
.rank-1 { background: linear-gradient(135deg,#fbbf24,#f59e0b); color: #000; }
.rank-2 { background: linear-gradient(135deg,#94a3b8,#64748b); color: #fff; }
.rank-3 { background: linear-gradient(135deg,#cd7f32,#b45309); color: #fff; }
.rank-n { background: rgba(255,255,255,.06); color: var(--rs-text-muted); }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: .55rem 1.3rem;
  border-radius: var(--rs-radius-sm);
  background: linear-gradient(135deg, var(--rs-primary), var(--rs-primary-hover));
  color: #000;
  font-size: .84rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-primary:hover {
  box-shadow: 0 4px 14px var(--rs-primary-glow);
  transform: translateY(-1px);
}
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: .52rem 1.2rem;
  border-radius: var(--rs-radius-sm);
  background: transparent;
  color: var(--rs-primary);
  font-size: .84rem;
  font-weight: 600;
  border: 1px solid rgba(230,152,41,.4);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-outline:hover {
  background: rgba(230,152,41,.08);
  border-color: var(--rs-primary);
}
.btn-ghost {
  display: inline-flex; align-items: center; gap: 7px;
  padding: .52rem 1.1rem;
  border-radius: var(--rs-radius-sm);
  background: rgba(255,255,255,.05);
  color: var(--rs-text-muted);
  font-size: .84rem;
  font-weight: 600;
  border: 1px solid var(--rs-border);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--rs-text-muted);
  margin-bottom: .4rem;
  letter-spacing: .02em;
}
.form-control {
  width: 100%;
  background: var(--rs-bg-input);
  border: 1.5px solid var(--rs-border);
  border-radius: var(--rs-radius-sm);
  color: var(--rs-text);
  font-size: .88rem;
  padding: .6rem .85rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}
.form-control:focus {
  border-color: var(--rs-primary);
  box-shadow: 0 0 0 3px var(--rs-primary-glow);
}
.form-control::placeholder { color: var(--rs-text-dim); }

/* ═══════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════ */
.modal-content {
  background: var(--rs-bg-card);
  border: 1px solid var(--rs-border);
  border-radius: var(--rs-radius-lg);
}
.modal-header {
  background: var(--rs-dark);
  border-bottom: 1px solid var(--rs-border);
  padding: 1rem 1.4rem;
  border-radius: var(--rs-radius-lg) var(--rs-radius-lg) 0 0;
}
.modal-title { font-size: .97rem; font-weight: 700; color: #fff; }
.btn-close-white { filter: invert(1) grayscale(1); }
.modal-body { padding: 1.4rem; }
.modal-footer {
  padding: .9rem 1.4rem;
  border-top: 1px solid var(--rs-border);
  background: rgba(255,255,255,.02);
  border-radius: 0 0 var(--rs-radius-lg) var(--rs-radius-lg);
}

/* ═══════════════════════════════════════════════════════════════
   AUTH PAGES (login / register)
   ═══════════════════════════════════════════════════════════════ */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  background: var(--rs-bg-page);
}
.auth-left {
  width: 42%;
  background: linear-gradient(160deg, var(--rs-dark) 0%, var(--rs-dark-deep) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 50px;
  position: relative;
  overflow: hidden;
}
.auth-left::before {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--rs-primary-glow), transparent 70%);
  top: -80px; right: -80px;
}
.auth-left::after {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6,182,212,.15), transparent 70%);
  bottom: -60px; left: -40px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  position: relative;
  z-index: 1;
}
.auth-brand-logo {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--rs-primary), var(--rs-primary-hover));
  border-radius: var(--rs-radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 16px var(--rs-primary-glow);
}
.auth-brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}
.auth-brand-tag { font-size: .7rem; color: var(--rs-primary); font-weight: 600; }
.auth-heading {
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  letter-spacing: -.02em;
}
.auth-heading span { color: var(--rs-primary); }
.auth-sub {
  color: rgba(255,255,255,.55);
  font-size: .88rem;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}
.auth-perks { position: relative; z-index: 1; }
.auth-perk {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
  font-size: .84rem;
  color: rgba(255,255,255,.7);
}
.auth-perk i { color: var(--rs-primary); font-size: .9rem; }

.auth-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 50px;
}
.auth-form-box {
  width: 100%;
  max-width: 400px;
}
.auth-form-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}
.auth-form-sub {
  font-size: .84rem;
  color: var(--rs-text-muted);
  margin-bottom: 28px;
}

/* ═══════════════════════════════════════════════════════════════
   PROFILE PAGE
   ═══════════════════════════════════════════════════════════════ */
.profile-header {
  background: linear-gradient(135deg, var(--rs-dark), var(--rs-dark-mid));
  border: 1px solid var(--rs-border);
  border-radius: var(--rs-radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  border: 3px solid rgba(255,255,255,.2);
  flex-shrink: 0;
}
.profile-info h1 { font-size: 1.3rem; font-weight: 800; color: #fff; }
.profile-info p  { color: var(--rs-text-muted); font-size: .84rem; }
.profile-level-badge {
  background: var(--rs-primary);
  color: #000;
  font-size: .72rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 12px;
  margin-left: 10px;
}
.profile-stats {
  margin-left: auto;
  display: flex;
  gap: 28px;
}
.profile-stat { text-align: center; }
.profile-stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.profile-stat-lbl {
  font-size: .7rem;
  color: var(--rs-text-muted);
  font-weight: 500;
  margin-top: 2px;
}
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.achievement-card {
  background: var(--rs-bg-card);
  border: 1px solid var(--rs-border);
  border-radius: var(--rs-radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.achievement-card.earned { border-color: rgba(230,152,41,.3); }
.achievement-card.locked { opacity: .4; filter: grayscale(1); }
.achievement-icon { font-size: 1.6rem; }
.achievement-title { font-size: .82rem; font-weight: 700; color: #fff; }
.achievement-desc  { font-size: .72rem; color: var(--rs-text-muted); }
.achievement-xp    { font-size: .7rem; color: var(--rs-primary); font-weight: 700; margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════
   DIFFICULTY SELECTOR (on play.php)
   ═══════════════════════════════════════════════════════════════ */
.diff-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.diff-btn {
  flex: 1;
  padding: 8px;
  border-radius: var(--rs-radius-sm);
  border: 1px solid var(--rs-border);
  background: transparent;
  color: var(--rs-text-muted);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.diff-btn:hover, .diff-btn.active { background: rgba(230,152,41,.1); border-color: var(--rs-primary); color: var(--rs-primary); }
.diff-btn[data-diff="hard"].active { background: rgba(248,113,113,.1); border-color: var(--rs-red); color: var(--rs-red); }

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.8); }
}
@keyframes ring-pulse {
  0%, 100% { transform: scale(1); opacity: .4; }
  50%       { transform: scale(1.15); opacity: .1; }
}
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes score-pop {
  0%   { transform: scale(.5); opacity: 0; }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes confetti-fall {
  to { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.animate-in { animation: fade-in .4s ease forwards; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 991px) {
  .rs-sidebar { transform: translateX(-100%); transition: transform .3s ease; }
  .rs-sidebar.open { transform: translateX(0); }
  .rs-main { margin-left: 0; }
  .rs-content { padding: 20px; }
  .auth-left { display: none; }
  .profile-header { flex-direction: column; align-items: flex-start; }
  .profile-stats { margin-left: 0; }
  .featured-icon { display: none; }
}
@media (max-width: 600px) {
  .games-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .featured-carousel { height: 180px; }
  .featured-title { font-size: 1.2rem; }
  .filter-bar { gap: 5px; }
  .filter-btn { font-size: .72rem; padding: 5px 10px; }
  .filter-search { display: none; }
}

/* ─── Utility ─────────────────────────────────────────────────── */
.text-muted { color: var(--rs-text-muted) !important; }
.text-primary { color: var(--rs-primary) !important; }
.text-white { color: #fff !important; }
.fw-bold { font-weight: 700 !important; }
.fw-bolder { font-weight: 800 !important; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: 1rem; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
