/* =========================================================
   SAM TOPUP — New UI (2026)
   - Single design system (no duplicates)
   - Works with Bootstrap 5.3 color modes (data-bs-theme)
   - RTL friendly
   ========================================================= */

/* ---------- Design Tokens ---------- */
:root{
  --sam-radius: 18px;
  --sam-radius-sm: 14px;

  --sam-accent: #3b82f6;
  --sam-accent-2: #a855f7;
  --sam-success: #22c55e;
  --sam-warning: #f59e0b;

  --sam-border-dark: rgba(148, 163, 184, .20);
  --sam-border-light: rgba(15, 23, 42, .10);

  --sam-surface-dark: rgba(2, 6, 23, .55);
  --sam-surface-dark-2: rgba(15, 23, 42, .78);

  --sam-surface-light: rgba(255,255,255,.76);
  --sam-surface-light-2: rgba(255,255,255,.92);

  --sam-shadow-dark: 0 18px 55px rgba(0,0,0,.35);
  --sam-shadow-light: 0 18px 55px rgba(2,6,23,.10);

  /* hint for inputs/scrollbars */
  color-scheme: dark;
}

:root[data-theme="light"]{
  color-scheme: light;
}



/* ---------- Bootstrap color overrides (Fix: light mode too white) ---------- */
:root[data-bs-theme="light"]{
  --bs-body-bg: #f5f6f8;
  --bs-body-bg-rgb: 245,246,248;
  --bs-body-color: #0f172a;
  --bs-body-color-rgb: 15,23,42;

  --bs-secondary-color: rgba(15,23,42,.68);
  --bs-tertiary-color: rgba(15,23,42,.55);

  --bs-border-color: rgba(15,23,42,.12);
  --bs-tertiary-bg: #ffffff;
}
:root[data-bs-theme="dark"]{
  --bs-body-bg: #050814;
  --bs-body-bg-rgb: 5,8,20;
  --bs-body-color: #e5e7eb;
  --bs-body-color-rgb: 229,231,235;

  --bs-secondary-color: rgba(229,231,235,.70);
  --bs-tertiary-color: rgba(229,231,235,.55);

  --bs-border-color: rgba(148,163,184,.18);
  --bs-tertiary-bg: rgba(15,23,42,.60);
}

/* ---------- Base ---------- */
html, body{ height: 100%; }
body{
  font-family: 'Tajawal', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
}

/* Soft background glow */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .55;
  background:
    radial-gradient(900px 550px at 90% -10%, color-mix(in srgb, var(--sam-accent) 24%, transparent), transparent 60%),
    radial-gradient(850px 520px at 10% 0%, color-mix(in srgb, var(--sam-accent-2) 18%, transparent), transparent 55%);
}

/* Links */
a{ text-decoration: none; }
a:hover{ text-decoration: none; }

/* ---------- Surfaces / Cards ---------- */
.neo-card,
.card,
.modal-content,
.dropdown-menu{
  border-radius: var(--sam-radius);
  border: 1px solid var(--bs-border-color);
  background: color-mix(in srgb, var(--bs-body-bg) 84%, transparent);
  box-shadow: var(--sam-shadow-dark);
}

:root[data-theme="light"] .neo-card,
:root[data-theme="light"] .card,
:root[data-theme="light"] .modal-content,
:root[data-theme="light"] .dropdown-menu{
  box-shadow: var(--sam-shadow-light);
  background: color-mix(in srgb, var(--bs-body-bg) 92%, transparent);
}

.neo-link{ color: inherit; }
.neo-link:hover{ color: inherit; transform: translateY(-1px); }

/* ---------- Navbar ---------- */
.topup-nav{
  width: min(1200px, 94%);
  margin: 14px auto 10px;
  padding: 10px 14px;
  border-radius: 22px;
  border: 1px solid var(--bs-border-color);
  background: color-mix(in srgb, var(--bs-body-bg) 86%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: var(--sam-shadow-dark);
}

:root[data-theme="light"] .topup-nav{
  box-shadow: var(--sam-shadow-light);
}

.navbar-brand-wrapper{
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo-orbit{
  width: 28px; height: 28px;
  border-radius: 999px;
  border: 1px solid var(--bs-border-color);
  background: color-mix(in srgb, var(--bs-body-bg) 78%, transparent);
  display:flex; align-items:center; justify-content:center;
  position: relative;
}
.logo-orbit-core{
  width: 10px; height: 10px; border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #fff, color-mix(in srgb, var(--sam-accent-2) 75%, #000 0%));
  box-shadow: 0 0 18px color-mix(in srgb, var(--sam-accent-2) 55%, transparent);
}
.logo-orbit-satellite{
  position: absolute;
  width: 6px; height: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--sam-accent) 85%, #fff 15%);
  left: 3px; top: 5px;
  box-shadow: 0 0 14px color-mix(in srgb, var(--sam-accent) 50%, transparent);
}
.topup-brand-text{
  font-weight: 900;
  letter-spacing: .4px;
  background: linear-gradient(110deg, var(--sam-accent), var(--sam-accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Nav links */
.topup-nav .nav-link{
  color: var(--bs-body-color) !important;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  transition: .18s ease;
}
.topup-nav .nav-link:hover{
  background: color-mix(in srgb, var(--sam-accent) 12%, transparent);
  color: var(--bs-body-color) !important;
  transform: translateY(-1px);
}

/* logout */
.nav-logout{
  color: color-mix(in srgb, var(--sam-warning) 90%, var(--bs-body-color)) !important;
}
.nav-logout:hover{
  background: color-mix(in srgb, var(--sam-warning) 14%, transparent);
}

/* Theme toggle button inside nav */
a.nav-link[data-theme-toggle]{
  width: 48px;
  height: 48px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items:center;
  justify-content:center;
  border: 1px solid var(--bs-border-color);
  background: color-mix(in srgb, var(--bs-body-bg) 82%, transparent);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--sam-accent) 18%, transparent);
}

/* Mobile nav (custom toggle used in header.php) */
#mainNav{
  transition: .18s ease;
}
@media (max-width: 991.98px){
  #mainNav{
    display: none;
    margin-top: 10px;
    padding: 10px;
    border-radius: var(--sam-radius);
    border: 1px solid var(--bs-border-color);
    background: color-mix(in srgb, var(--bs-body-bg) 90%, transparent);
    box-shadow: var(--sam-shadow-dark);
  }
  #mainNav.show{ display: block; }
  .topup-nav .navbar-nav{ gap: 6px; }
  .topup-nav .nav-link{ text-align: center; }
}

/* ---------- Buttons ---------- */
.btn-gradient{
  background: linear-gradient(135deg, var(--sam-accent), var(--sam-accent-2));
  border: 0;
  color: #fff !important;
  font-weight: 800;
  border-radius: 999px;
  padding: .55rem 1.15rem;
  box-shadow: 0 14px 34px color-mix(in srgb, var(--sam-accent-2) 22%, transparent);
}
.btn-gradient:hover{
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.btn-neo{
  background: linear-gradient(135deg, color-mix(in srgb, var(--sam-accent) 85%, #fff 0%), color-mix(in srgb, var(--sam-accent-2) 85%, #fff 0%));
  border: 0;
  color:#fff !important;
  border-radius: 14px;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--sam-accent) 18%, transparent);
}

/* ---------- Hero ---------- */
.hero-section{
  padding-top: 6px;
  padding-bottom: 8px;
}
.bg-gradient-hero{
  background: color-mix(in srgb, var(--sam-accent) 20%, transparent) !important;
  border: 1px solid var(--bs-border-color);
  color: var(--bs-body-color) !important;
  border-radius: 999px;
}

.hero-title{
  font-weight: 900;
  line-height: 1.2;
}
.hero-subtitle{
  color: color-mix(in srgb, var(--bs-body-color) 70%, transparent);
}
.hero-stats .hero-stat{
  border: 1px solid var(--bs-border-color);
  border-radius: var(--sam-radius-sm);
  padding: 10px 12px;
  background: color-mix(in srgb, var(--bs-body-bg) 86%, transparent);
}
.hero-stat-number{ font-weight: 900; }
.hero-stat-label{ color: color-mix(in srgb, var(--bs-body-color) 65%, transparent); font-size: .85rem; }

/* Slider */
.hero-slider-card{
  position: relative;
  overflow: hidden;
  border-radius: var(--sam-radius);
  border: 1px solid var(--bs-border-color);
  box-shadow: var(--sam-shadow-dark);
}
:root[data-theme="light"] .hero-slider-card{ box-shadow: var(--sam-shadow-light); }
.hero-slider-img{ height: 360px; object-fit: cover; }
@media (max-width: 576px){
  .hero-slider-img{ height: 260px; }
}
.hero-slider-overlay{
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.68));
}
.carousel-caption-custom{
  position:absolute;
  bottom: 14px;
  right: 14px;
  left: 14px;
  padding: 14px;
  border-radius: var(--sam-radius);
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  color: #fff;
}

/* ---------- Quick links ---------- */
.quick-link-card{ border-radius: 22px; }

/* ---------- Game/Offer cards ---------- */
.game-card, .offer-card{
  border-radius: var(--sam-radius);
  border: 1px solid var(--bs-border-color);
  overflow: hidden;
  background: color-mix(in srgb, var(--bs-body-bg) 88%, transparent);
  transition: .18s ease;
}
.game-card:hover, .offer-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 18px 45px color-mix(in srgb, var(--sam-accent) 12%, transparent);
}
.game-img, .offer-img{ height: 150px; object-fit: cover; width: 100%; }
@media (max-width: 576px){ .game-img, .offer-img{ height: 120px; } }

/* ---------- Game details (game.php?id=) ---------- */
.game-details-image-wrapper{
  width: 320px;
  max-width: 100%;
  flex: 0 0 auto;
}
.game-details-img{
  width: 100%;
  height: 280px;
  /* عرض صورة اللعبة بدون تشويه (مفيد للّوجوهات والصور الطولية) */
  object-fit: contain;
  padding: 12px;
  background: color-mix(in srgb, var(--bs-body-bg) 86%, rgba(0,0,0,.08));
  border-radius: var(--sam-radius);
  border: 1px solid var(--bs-border-color);
  box-shadow: 0 18px 45px rgba(0,0,0,.18);
}
@media (max-width: 576px){
  .game-details-image-wrapper{ width: 100%; }
  .game-details-img{ height: 220px; }
}

/* ---------- Forms ---------- */
.form-control, .form-select{
  border-radius: 14px;
  background: color-mix(in srgb, var(--bs-body-bg) 92%, transparent);
  border: 1px solid var(--bs-border-color);
  color: var(--bs-body-color);
}
.form-control:focus, .form-select:focus{
  box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--sam-accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--sam-accent) 55%, var(--bs-border-color));
}

/* ---------- Notifications dropdown ---------- */
.notif-bell-btn{
  position: relative;
  background: transparent;
  border: none;
  color: var(--bs-body-color) !important;
  font-size: 1.2rem;
  padding: 4px 6px;
}
.notif-dot{
  position: absolute;
  top: 4px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239,68,68,0.9);
}
.notif-count{
  position: absolute;
  top: -4px;
  left: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.notif-dropdown{
  position: absolute;
  top: 130%;
  left: 0;
  transform: translateX(-10%);
  min-width: 260px;
  background: color-mix(in srgb, var(--bs-body-bg) 92%, transparent);
  border-radius: var(--sam-radius);
  border: 1px solid var(--bs-border-color);
  box-shadow: var(--sam-shadow-dark);
  padding: 6px 0;
  display: none;
  z-index: 10000;
}
:root[data-theme="light"] .notif-dropdown{ box-shadow: var(--sam-shadow-light); }
.notif-dropdown-header{
  padding: 8px 12px;
  font-size: .9rem;
  font-weight: 800;
  border-bottom: 1px solid var(--bs-border-color);
}
.notif-item{
  display:block;
  padding: 10px 12px;
  font-size: .86rem;
  color: var(--bs-body-color);
  border-bottom: 1px solid color-mix(in srgb, var(--bs-border-color) 70%, transparent);
}
.notif-item:hover{ background: color-mix(in srgb, var(--sam-accent) 10%, transparent); }
.notif-item.empty{ opacity: .75; }
.notif-title{ font-weight: 800; }
.notif-meta{ font-size: .78rem; opacity: .8; }
.notif-footer{ padding: 8px 12px; font-size: .82rem; }

/* ---------- Footer ---------- */
.footer-neo{
  width: min(1200px, 94%);
  margin: 0 auto 20px;
  border-radius: 22px;
  border: 1px solid var(--bs-border-color);
  background: color-mix(in srgb, var(--bs-body-bg) 88%, transparent);
  box-shadow: var(--sam-shadow-dark);
}
:root[data-theme="light"] .footer-neo{ box-shadow: var(--sam-shadow-light); }
.footer-icon{
  display:inline-flex;
  width: 42px; height: 42px;
  align-items:center; justify-content:center;
  border-radius: 999px;
  border: 1px solid var(--bs-border-color);
  color: var(--bs-body-color);
  background: color-mix(in srgb, var(--bs-body-bg) 88%, transparent);
  margin: 0 4px;
}
.footer-icon:hover{ transform: translateY(-1px); }

/* ---------- Widgets (verify + help bot) ---------- */
.verify-float-btn{
  position: fixed;
  top: var(--verify-top, 92px);
  left: 18px;
  z-index: 1055;
  border: 1px solid var(--bs-border-color);
  background: linear-gradient(135deg, color-mix(in srgb, var(--sam-warning) 40%, transparent), color-mix(in srgb, var(--sam-accent) 12%, transparent));
  color: var(--bs-body-color);
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: var(--sam-shadow-dark);
}
:root[data-theme="light"] .verify-float-btn{ box-shadow: var(--sam-shadow-light); }

.help-bot-fab{
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 1055;
  width: 54px; height: 54px;
  border-radius: 999px;
  border: 1px solid var(--bs-border-color);
  background: linear-gradient(135deg, color-mix(in srgb, var(--sam-accent) 20%, transparent), color-mix(in srgb, var(--sam-accent-2) 18%, transparent));
  color: var(--bs-body-color);
  box-shadow: var(--sam-shadow-dark);
}
:root[data-theme="light"] .help-bot-fab{ box-shadow: var(--sam-shadow-light); }


/* ---------- Admin Navbar ---------- */
.admin-nav{
  width: min(1200px, 94%);
  margin: 14px auto 10px;
  padding: 10px 14px;
  border-radius: 22px;
  border: 1px solid var(--bs-border-color);
  background: color-mix(in srgb, var(--bs-body-bg) 86%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: var(--sam-shadow-dark);
  position: sticky;
  top: 10px;
  z-index: 1030;
}
:root[data-theme="light"] .admin-nav{ box-shadow: var(--sam-shadow-light); }
.admin-nav .nav-link{ color: var(--bs-body-color) !important; border-radius: 999px; padding: 8px 14px; font-weight: 700; }
.admin-nav .nav-link:hover{ background: color-mix(in srgb, var(--sam-accent) 12%, transparent); transform: translateY(-1px); }

.admin-nav .navbar-toggler{
  border: 1px solid var(--bs-border-color);
  border-radius: 14px;
  padding: 8px 10px;
}
.admin-nav .navbar-toggler:focus{ box-shadow: 0 0 0 3px color-mix(in srgb, var(--sam-accent) 18%, transparent); }


/* ---------- Home banners ---------- */
.banner-img{ aspect-ratio: 16/7; object-fit: cover; }

/* ---------- Contact card ---------- */
.contact-card{
  border: 1px solid var(--bs-border-color);
  border-radius: var(--sam-radius);
  background: color-mix(in srgb, var(--bs-body-bg) 88%, transparent);
}

/* ---------- Login box ---------- */
.login-box{
  position: fixed;
  bottom: 86px;
  right: 18px;
  z-index: 1055;
  min-width: 190px;
  padding: 10px 12px;
  border-radius: var(--sam-radius);
  border: 1px solid var(--bs-border-color);
  background: color-mix(in srgb, var(--bs-body-bg) 90%, transparent);
  box-shadow: var(--sam-shadow-dark);
}
:root[data-theme="light"] .login-box{ box-shadow: var(--sam-shadow-light); }
@media (max-width: 576px){
  .login-box{
    right: 50%;
    transform: translateX(50%);
    bottom: 80px;
  }
}

/* ---------- Onboarding bot ---------- */
.onboard-bot{
  position: fixed;
  bottom: 86px;
  left: 18px;
  z-index: 1055;
}
.bot-bubble{
  display:flex;
  gap: 12px;
  align-items:flex-start;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: var(--sam-radius);
  border: 1px solid var(--bs-border-color);
  background: color-mix(in srgb, var(--bs-body-bg) 92%, transparent);
  box-shadow: var(--sam-shadow-dark);
  backdrop-filter: blur(10px);
  position: relative;
}
:root[data-theme="light"] .bot-bubble{ box-shadow: var(--sam-shadow-light); }
.bot-tail{
  position:absolute;
  bottom:-9px;
  left: 26px;
  width: 18px; height: 18px;
  background: color-mix(in srgb, var(--bs-body-bg) 92%, transparent);
  border-left: 1px solid var(--bs-border-color);
  border-bottom: 1px solid var(--bs-border-color);
  transform: rotate(45deg);
}
.bot-avatar{
  width: 44px; height: 44px;
  border-radius: 16px;
  border: 1px solid var(--bs-border-color);
  background: linear-gradient(135deg, color-mix(in srgb, var(--sam-accent) 16%, transparent), color-mix(in srgb, var(--sam-accent-2) 14%, transparent));
  position: relative;
  flex: 0 0 44px;
}
.bot-eye{
  position:absolute;
  top: 16px;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--bs-body-color);
  opacity: .75;
}
.eye-l{ left: 12px; }
.eye-r{ right: 12px; }
.bot-text{ flex: 1; }
.bot-title{ font-weight: 900; }
.bot-msg{ opacity: .85; line-height: 1.45; }

@media (max-width: 576px){
  .onboard-bot{ left: 12px; right: 12px; bottom: 80px; }
  .bot-bubble{ max-width: calc(100vw - 24px); }
}



/* =========================================================
   Fresh Components (2026 refresh)
   ========================================================= */

/* ---------- Navbar (mobile polish) ---------- */
.topup-nav .navbar-toggler{
  border: 1px solid var(--bs-border-color);
  border-radius: 14px;
  padding: 8px 10px;
}
.topup-nav .navbar-toggler:focus{ box-shadow: 0 0 0 3px color-mix(in srgb, var(--sam-accent) 18%, transparent); }
.topup-nav .navbar-collapse{
  border-top: 1px solid color-mix(in srgb, var(--bs-border-color) 70%, transparent);
  margin-top: 10px;
  padding-top: 10px;
}
@media (min-width: 992px){
  .topup-nav .navbar-collapse{
    border-top: 0; margin-top: 0; padding-top: 0;
  }
}

/* ---------- Banner / Carousel (fixed height, no jumping) ---------- */
#homeBanners{
  border-radius: var(--sam-radius);
  overflow: hidden;
}
#homeBanners .carousel-item{
  height: 240px;
}
#homeBanners .banner-img{
  width: 100%;
  height: 240px;
  object-fit: cover;
}
@media (max-width: 576px){
  #homeBanners .carousel-item{ height: 160px; }
  #homeBanners .banner-img{ height: 160px; }
}

/* Banner caption readability (light/dark) */
#homeBanners .carousel-caption{
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--bs-body-bg) 55%, transparent);
  backdrop-filter: blur(10px);
  text-align: start;
}
#homeBanners .carousel-caption h5{
  margin: 0;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
}
:root[data-bs-theme="light"] #homeBanners .carousel-caption{
  background: color-mix(in srgb, #fff 78%, transparent);
}
:root[data-bs-theme="light"] #homeBanners .carousel-caption h5{
  color: #111;
  text-shadow: none;
}

/* ---------- "كيف تتم عملية الشحن" cards ---------- */
.how-it-works .step-box{
  position: relative;
  padding: 16px 16px 18px;
  border-radius: var(--sam-radius);
  border: 1px solid var(--bs-border-color);
  background: color-mix(in srgb, var(--bs-body-bg) 88%, transparent);
  box-shadow: var(--sam-shadow-dark);
}
:root[data-bs-theme="light"] .how-it-works .step-box{ box-shadow: var(--sam-shadow-light); }
.how-it-works .step-number{
  width: 66px;
  height: 66px;
  font-size: 1.25rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 900;
  margin-bottom: 10px;
  background: color-mix(in srgb, var(--sam-accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--sam-accent) 35%, transparent);
}

/* ---------- Category/game description excerpt ---------- */
.neo-desc{
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Game package cards ---------- */
.game-card{
  border-radius: var(--sam-radius);
  background: color-mix(in srgb, var(--bs-body-bg) 86%, transparent);
  border: 1px solid var(--bs-border-color);
  box-shadow: var(--sam-shadow-dark);
  transition: transform .18s ease, box-shadow .18s ease;
}
:root[data-bs-theme="light"] .game-card{ box-shadow: var(--sam-shadow-light); }
.game-card:hover{
  transform: translateY(-2px);
}
.game-card .card-title{
  font-weight: 900;
}
.game-card .badge{
  border-radius: 999px;
}

/* ---------- Chat (remove hard-coded colors, support light/dark) ---------- */
.chat-page-wrapper{
  width: min(1200px, 94%);
  margin: 10px auto 24px;
}
.chat-container{
  display:flex;
  gap: 12px;
  min-height: calc(100vh - 180px);
  border-radius: var(--sam-radius);
  border: 1px solid var(--bs-border-color);
  overflow: hidden;
  background: color-mix(in srgb, var(--bs-body-bg) 82%, transparent);
}
.chat-sidebar{
  width: 32%;
  min-width: 260px;
  background: color-mix(in srgb, var(--bs-body-bg) 72%, transparent);
  border-left: 1px solid color-mix(in srgb, var(--bs-border-color) 85%, transparent);
  display:flex;
  flex-direction:column;
}
.chat-sidebar-header{
  padding: 12px 14px;
  font-size: 1rem;
  font-weight: 900;
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-bottom: 1px solid color-mix(in srgb, var(--bs-border-color) 85%, transparent);
}
.chat-search{
  padding: 10px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--bs-border-color) 85%, transparent);
}
.chat-list{
  flex:1;
  overflow:auto;
  padding: 8px;
}
.chat-item{
  cursor:pointer;
  border-radius: 16px;
  padding: 10px 12px;
  border: 1px solid transparent;
  transition: background .15s ease, transform .15s ease;
}
.chat-item:hover{
  background: color-mix(in srgb, var(--sam-accent) 10%, transparent);
  transform: translateY(-1px);
}
.chat-item.active{
  background: color-mix(in srgb, var(--sam-accent) 16%, transparent);
  border-color: color-mix(in srgb, var(--sam-accent) 30%, transparent);
}
.chat-item-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.chat-last-msg{
  color: var(--bs-secondary-color);
  font-size: .85rem;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chat-main{
  flex:1;
  display:flex;
  flex-direction:column;
  min-width: 0;
}
.chat-header{
  padding: 12px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--bs-border-color) 85%, transparent);
}
.chat-messages{
  flex:1;
  overflow:auto;
  padding: 14px;
}
.chat-bubble{
  max-width: min(640px, 92%);
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid var(--bs-border-color);
  margin-bottom: 10px;
}
.chat-bubble.user{
  margin-left: auto;
  background: color-mix(in srgb, var(--sam-accent) 16%, transparent);
  border-color: color-mix(in srgb, var(--sam-accent) 32%, transparent);
}
.chat-bubble.admin{
  margin-right: auto;
  background: color-mix(in srgb, var(--bs-tertiary-bg) 70%, transparent);
}
.chat-input-area{
  border-top: 1px solid color-mix(in srgb, var(--bs-border-color) 85%, transparent);
  padding: 10px 12px;
  display:flex;
  gap: 10px;
}
.chat-input-area .chat-input{
  flex:1;
}
@media (max-width: 768px){
  .chat-container{ flex-direction: column; }
  .chat-sidebar{ width: 100%; min-width: 0; border-left: 0; border-bottom: 1px solid color-mix(in srgb, var(--bs-border-color) 85%, transparent); }
}


/* Chat message bubbles generated by JS */
.msg{
  max-width: min(640px, 92%);
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid var(--bs-border-color);
  margin-bottom: 10px;
  position: relative;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-user{
  margin-left: auto;
  background: color-mix(in srgb, var(--sam-accent) 16%, transparent);
  border-color: color-mix(in srgb, var(--sam-accent) 32%, transparent);
}
.msg-admin{
  margin-right: auto;
  background: color-mix(in srgb, var(--bs-tertiary-bg) 70%, transparent);
}
.msg-time{
  margin-top: 6px;
  font-size: .75rem;
  color: var(--bs-secondary-color);
  opacity: .9;
}


/* ===================== Home: Categories block ===================== */
.cat-block{
  background: var(--neo-surface);
  border: 1px solid var(--bs-border-color);
  border-radius: 22px;
  padding: 16px;
  box-shadow: var(--neo-shadow);
  height: 100%;
  transition: transform .18s ease, box-shadow .18s ease;
}

.cat-block:hover{
  transform: translateY(-2px);
}

.cat-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.cat-meta{
  color: var(--bs-secondary-color);
  font-size: .85rem;
  margin-top: 2px;
}

.cat-mini-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.mini-item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
  color: inherit;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.mini-item:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0,0,0,.10);
  border-color: rgba(99,102,241,.35);
}

.mini-item img{
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.05);
}

.mini-name{
  font-weight: 700;
  font-size: .92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Search box on home (sections) */
.games-search .form-control{
  border-radius: 999px;
  border: 1px solid var(--bs-border-color);
  background: var(--neo-surface);
  color: var(--bs-body-color);
}
.games-search .form-control::placeholder{ color: var(--bs-secondary-color); }

/* ===================== Home: Section title ===================== */
.section-title{
  font-weight: 800;
  letter-spacing: .2px;
}

/* Simple reveal animation (optional) */
.fade-slide{
  opacity: 1;
  transform: none;
}

/* ===================== Home: Points card ===================== */
.points-badge{
  border: 1px solid var(--bs-border-color);
  border-radius: 18px;
  background: var(--neo-surface);
  box-shadow: var(--neo-shadow);
  padding: 14px;
}
.points-label{ color: var(--bs-secondary-color); font-size: .9rem; }
.points-value{ font-weight: 900; font-size: 1.6rem; line-height: 1; margin-top: 4px; }

/* Mobile tweaks */
@media (max-width: 575.98px){
  /* Mobile: turn categories into a smooth horizontal slider */
  .cat-mini-grid{
    display: flex;
    grid-template-columns: unset;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .cat-mini-grid::-webkit-scrollbar{ height: 6px; }

  .mini-item{
    min-width: 240px;
    scroll-snap-align: start;
  }

  .mini-item img{ width: 56px; height: 56px; }
  .neo-icon{ width: 60px; height: 60px; font-size: 1.75rem; }
  .neo-thumb{ width: 72px; height: 72px; }
  .how-it-works .step-number{ width: 56px; height: 56px; font-size: 1.15rem; }
}


/* ===================== Shared: Small UI atoms ===================== */
.neo-icon{
  width: 68px;
  height: 68px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  color: var(--neo-accent);
  font-size: 1.95rem;
  flex-shrink: 0;
}

.neo-thumb{
  width: 78px;
  height: 78px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,.08);
  flex-shrink: 0;
}
