.games-page {
  --games-magenta: #e1147a;
  --games-magenta-dark: #be123c;
  --games-magenta-hover: #c20e66;
  --games-blush: #fff1f2;
  --games-blush-border: #fecdd3;
  --games-purple: #7c3aed;
  --games-purple-bg: #f5f3ff;
  --games-purple-border: #ddd6fe;
  --games-green: #10b981;
  --games-green-bg: #ecfdf5;
  --games-green-border: #a7f3d0;
  --games-amber: #f59e0b;
  --games-amber-bg: #fffbeb;
  --games-amber-border: #fde68a;
  --games-blue: #0284c7;
  --games-blue-bg: #f0f9ff;
  --games-blue-border: #bae6fd;
  --games-slate-900: #0f172a;
  --games-slate-800: #1e293b;
  --games-slate-700: #334155;
  --games-slate-600: #475569;
  --games-slate-500: #64748b;
  --games-slate-400: #94a3b8;
  --games-slate-200: #e2e8f0;
  --games-slate-100: #f1f5f9;
  --games-slate-50: #f8fafc;
}

.games-content {
  max-width: 440px;
  margin: 0 auto;
  padding: 14px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wallet-strip-card {
  background: linear-gradient(135deg, #fce4f0 0%, #f3e8ff 100%);
  border-radius: 16px;
  padding: 14px 16px;
  color: #171217;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 14px rgba(192, 38, 211, 0.08);
  border: 1px solid rgba(192, 38, 211, 0.12);
  flex-shrink: 0;
}

.wallet-left span {
  font-size: 10px;
  font-weight: 700;
  color: #918793;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: block;
}

.wallet-left strong {
  font-size: 17px;
  font-weight: 800;
  color: #171217;
}

.btn-topup-wallet {
  background: var(--games-magenta);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--games-slate-400);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--games-slate-200);
  border-radius: 12px;
  padding: 10px 12px 10px 36px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--games-slate-900);
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--games-magenta);
  box-shadow: 0 0 0 3px rgba(225, 20, 122, 0.1);
}

.filter-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  min-height: 36px;
  padding: 2px 2px 4px;
  scrollbar-width: none;
  flex-shrink: 0;
}
.filter-strip::-webkit-scrollbar { display: none; }

.filter-chip {
  padding: 6px 14px;
  background: #ffffff;
  border: 1.5px solid var(--games-slate-200);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--games-slate-700);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.filter-chip:hover { border-color: var(--games-blush-border); }

.filter-chip.active {
  background: var(--games-magenta);
  color: #ffffff;
  border-color: var(--games-magenta);
  box-shadow: 0 3px 10px rgba(225, 20, 122, 0.25);
}

.meta-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  padding: 2px 2px 0;
  flex-shrink: 0;
}

.meta-stats-row strong { color: var(--games-slate-900); font-weight: 800; }

.meta-instant { color: var(--games-green); font-weight: 700; }

.game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.game-tile-card {
  background: #ffffff;
  border: 1px solid var(--games-slate-200);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}

.game-tile-card:hover {
  border-color: var(--games-blush-border);
  transform: translateY(-2px);
}

.game-badge-server {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: inline-block;
  margin-bottom: 6px;
  width: fit-content;
}

.game-badge-server.global { background: var(--games-blue-bg); color: var(--games-blue); border: 1px solid var(--games-blue-border); }
.game-badge-server.brazil { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.game-badge-server.sea { background: var(--games-green-bg); color: var(--games-green); border: 1px solid var(--games-green-border); }

.game-avatar-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.game-tile-card h3 {
  font-size: 13px;
  font-weight: 800;
  color: var(--games-slate-900);
  line-height: 1.25;
  margin-bottom: 2px;
}

.game-tile-card span.type {
  font-size: 10.5px;
  color: var(--games-slate-400);
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}

.game-tile-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--games-slate-100);
  padding-top: 6px;
  margin-top: auto;
}

.game-tile-bottom span.from {
  font-size: 10px;
  font-weight: 600;
  color: var(--games-slate-400);
}

.game-tile-bottom strong.price {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--games-magenta);
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--games-slate-400);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  grid-column: span 2;
}

/* Modal */
.games-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 1200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: gamesFadeIn 0.2s ease-in-out;
}

.games-modal-overlay.open { display: flex; }

.games-modal-sheet {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 16px 16px 0 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
  animation: gamesSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.games-modal-header { display: flex; justify-content: space-between; align-items: center; }
.games-modal-title { font-size: 15px; font-weight: 800; color: var(--games-slate-900); }

.games-modal-close {
  background: var(--games-slate-100);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--games-slate-600);
  font-weight: 700;
}

.game-hero-banner {
  background: var(--games-purple-bg);
  border: 1px solid var(--games-purple-border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-hero-banner .icon { font-size: 24px; }
.game-hero-banner h4 { font-size: 13.5px; font-weight: 800; color: var(--games-slate-900); }
.game-hero-banner p { font-size: 11px; color: var(--games-purple); font-weight: 600; }

.section-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--games-slate-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.id-input-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.text-input {
  width: 100%;
  background: var(--games-slate-50);
  border: 1.5px solid var(--games-slate-200);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--games-slate-900);
  outline: none;
}

.text-input:focus { border-color: var(--games-magenta); background: #ffffff; }

.gamer-validation-box {
  background: var(--games-green-bg);
  border: 1px solid var(--games-green-border);
  border-radius: 8px;
  padding: 8px 12px;
  display: none;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
}

.gamer-validation-box.open { display: flex; }

.gamer-validation-box span.lbl { color: var(--games-slate-600); font-weight: 600; }
.gamer-validation-box strong.tag { color: var(--games-green); font-weight: 800; }

.bundle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.bundle-card-btn {
  background: var(--games-slate-50);
  border: 1.5px solid var(--games-slate-200);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.bundle-card-btn.active {
  background: var(--games-blush);
  border-color: var(--games-magenta);
}

.bundle-card-btn strong.amount {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--games-slate-900);
  display: flex;
  align-items: center;
  gap: 4px;
}

.bundle-card-btn span.bonus {
  font-size: 10px;
  font-weight: 700;
  color: var(--games-green);
}

.bundle-card-btn strong.price {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--games-magenta);
  margin-top: 4px;
}

.games-modal-receipt {
  background: var(--games-slate-50);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
}

.receipt-row { display: flex; justify-content: space-between; color: var(--games-slate-600); }

.receipt-title { color: var(--games-slate-900); }

.receipt-instant { color: var(--games-green); font-weight: 700; }

.receipt-row.total {
  border-top: 1px dashed var(--games-slate-200);
  padding-top: 8px;
  font-weight: 800;
  font-size: 13.5px;
  color: var(--games-slate-900);
}

.receipt-total { color: var(--games-magenta); }

.btn-confirm-topup {
  background: var(--games-magenta);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 13px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(225, 20, 122, 0.28);
}

.btn-confirm-topup:hover { background: var(--games-magenta-hover); }

@keyframes gamesFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes gamesSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

@media (min-width: 1024px) {
  .games-page .games-content { max-width: none; }
  .games-page .wallet-strip-card { display: none; }
  .games-page .game-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
  .games-page .games-modal-overlay { align-items: center; }
  .games-page .games-modal-sheet { border-radius: 18px; box-shadow: 0 24px 70px rgba(15, 23, 42, .25); }
}
/* v2.0: Loading spinner + dynamic fields */
@keyframes gamesSpin { to { transform: rotate(360deg); } }
.sms-loading-spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--games-slate-200);
  border-top-color: var(--games-magenta);
  border-radius: 50%;
  animation: gamesSpin 0.7s linear infinite;
}
.dynamic-field { width: 100%; }
