* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f1012;
  color: #f3f4f6;
  line-height: 1.45;
  min-height: 100vh;
  padding-bottom: 76px;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.container,
.page-wrap,
.page-container {
  width: 100%;
}

/* Header */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #15171b;
  border-bottom: 1px solid #2a2d33;
}

.top-bar-brand {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #e5e7eb;
}

.login-btn {
  text-decoration: none;
  border: 1px solid #3a3f47;
  background: #20242a;
  color: #f3f4f6;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.login-btn:hover {
  background: #2a2f37;
}

.notify-icon {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  position: relative;
}

.notify-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.notify-icon .dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  display: none;
}

.wallet-top {
  gap: 8px;
}

#walletTopAmount {
  color: #f9fafb;
  font-size: 13px;
  font-weight: 700;
}

/* Hero */
.slider {
  width: calc(100% - 24px);
  margin: 12px auto;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #2a2d33;
  background: #181b20;
}

.slider-inner {
  position: relative;
  height: 184px;
}

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.slide.active {
  opacity: 1;
}

.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px;
  background: linear-gradient(to top, rgba(15, 16, 18, 0.84), rgba(15, 16, 18, 0.45));
}

.hero-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.4px;
}

.hero-subtitle {
  margin: 8px 0 12px;
  color: #d1d5db;
  font-size: 11px;
}

.hero-cta {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #3a3f47;
  background: #20242a;
  color: #f9fafb;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}

/* Features */
.features {
  margin: 0 12px 14px;
  padding: 12px;
  background: #15171b;
  border: 1px solid #2a2d33;
  border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.feature-row {
  text-decoration: none;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 82px;
  border-radius: 10px;
  border: 1px solid #2f333a;
  background: #1b1f25;
  padding: 10px 6px;
}

.feature-item img {
  width: 24px;
  height: 24px;
  margin-bottom: 6px;
}

.feature-item span {
  font-size: 11px;
  font-weight: 600;
  color: #e5e7eb;
  text-align: center;
}

/* Categories & game cards */
.category-list {
  display: grid;
  gap: 12px;
  padding: 0 12px;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.category-header h3 {
  margin: 0;
  font-size: 15px;
  color: #f3f4f6;
}

.category-count {
  font-size: 11px;
  color: #cbd5e1;
  background: #1f242b;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #303641;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.game-grid a {
  text-decoration: none;
}

.game-item {
  position: relative;
  text-align: center;
  min-height: 134px;
  border-radius: 12px;
  border: 1px solid #2b3038;
  background: #161a20;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.game-item img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 8px;
}

.game-item p {
  margin: 0;
  color: #f3f4f6;
  font-size: 13px;
  font-weight: 700;
}

.badge {
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  font-size: 10px;
  padding: 2px 7px;
  background: #374151;
  color: #fff;
  font-weight: 700;
}

#trending,
#hot,
#new {
  background: #374151;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #15171b;
  border-top: 1px solid #2a2d33;
}

.nav-bar {
  text-decoration: none;
}

.nav-btn {
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 600;
}

.nav-btn img {
  width: 21px;
  height: 21px;
  margin-bottom: 4px;
  opacity: 0.72;
}

.nav-btn.active {
  color: #f3f4f6;
}

.nav-btn.active img {
  opacity: 1;
}

/* Generic cards */
.card {
  background: #15171b;
  border: 1px solid #2a2d33;
  border-radius: 12px;
  padding: 14px;
}

.page-title {
  margin: 0;
  color: #f3f4f6;
  font-size: 20px;
  font-weight: 700;
}

/* Notifications/status */
.status-message {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.status-message.error {
  background: rgba(127, 29, 29, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(185, 28, 28, 0.5);
}

.status-message.success {
  background: rgba(20, 83, 45, 0.24);
  color: #86efac;
  border: 1px solid rgba(22, 101, 52, 0.5);
}

.status-message.info {
  background: rgba(30, 58, 138, 0.25);
  color: #93c5fd;
  border: 1px solid rgba(30, 64, 175, 0.5);
}

/* Redeem modal */
#redeemModal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  z-index: 500;
  padding: 12px;
}

.redeem-card {
  width: min(360px, 100%);
  background: #15171b;
  border: 1px solid #2a2d33;
  border-radius: 12px;
  padding: 16px;
}

.redeem-card h3 {
  margin: 0 0 6px;
  color: #f3f4f6;
}

.redeem-card p {
  margin: 0 0 10px;
  color: #cbd5e1;
  font-size: 13px;
}

.redeem-card input {
  width: 100%;
  border: 1px solid #3a3f47;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  background: #111318;
  color: #f9fafb;
}

.redeem-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.redeem-actions button {
  flex: 1;
  border: 1px solid #3a3f47;
  border-radius: 8px;
  background: #20242a;
  color: #f3f4f6;
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
}

.redeem-confirm {
  background: #f3f4f6;
  color: #0f1012;
  border-color: #f3f4f6;
}

/* Footer */
.footer {
  margin: 20px 12px 84px;
  padding: 14px;
  border: 1px solid #2a2d33;
  border-radius: 12px;
  background: #15171b;
  text-align: center;
}

.footer h4 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #f3f4f6;
}

.social-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.social-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #363b44;
  background: #1d2128;
}

.social-btn img {
  width: 18px;
  height: 18px;
}

.contact-info,
.footer p,
.email-link {
  font-size: 12px;
  color: #cbd5e1;
}

.email-link {
  text-decoration: underline;
}

/* Popup + loader */
.custom-popup {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  display: none;
  background: #111318;
  color: #f3f4f6;
  border: 1px solid #2a2d33;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
}

.popup-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  z-index: 700;
}

.popup-overlay.active {
  display: flex;
}

.popup-content {
  width: min(360px, calc(100% - 24px));
  background: #15171b;
  border: 1px solid #2a2d33;
  border-radius: 12px;
  padding: 14px;
  color: #f3f4f6;
}

.close-btn {
  float: right;
  border: none;
  background: transparent;
  color: #d1d5db;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.social-buttons-popup {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid #363b44;
  border-radius: 8px;
  background: #1e232a;
  color: #f3f4f6;
  text-decoration: none;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
}

.btn img {
  width: 16px;
  height: 16px;
}

#loader,
.page-loader {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 16, 18, 0.82);
  z-index: 900;
}

.page-loader.active {
  display: flex;
}

.spinner,
.loader-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #3a3f47;
  border-top-color: #f3f4f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

a.loading {
  pointer-events: none;
  opacity: 0.7;
}

@media (max-width: 420px) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
