:root {
  --bg-main: #13121a;
  --bg-input: #313346;
  --bg-chip: #373952;

  --color-primary: #6842ff;
  --color-text: #ffffff;
  --color-muted: #8a8d9e;
  --color-yellow: #fbd648;

  --font-main: "Gabarito", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--color-text);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
}

/* ---- Header ----*/
.header {
  padding: 16px;
}

/* Search Bar */
.search-bar {
  position: relative;
  margin-bottom: 24px;
}

.search-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
}

.search-input {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 28px;
  padding: 16px 50px 16px 24px;
  color: var(--color-text);
  font-size: 15px;
  outline: none;
  font-weight: 500;
}

.search-input::placeholder {
  color: var(--color-muted);
}

/* Free Coins */
/* Daily Reward Banner Upgrade */
.daily-reward-banner {
  background: linear-gradient(135deg, #242239 0%, #3a2a62 100%);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
  box-shadow:
    0 12px 35px rgba(104, 66, 255, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.35);
  position: relative;
  overflow: hidden;
}

.daily-reward-banner::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(
    circle,
    rgba(255, 87, 172, 0.45) 0%,
    rgba(104, 66, 255, 0) 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

.banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.banner-text-group {
  flex: 1;
  text-align: left;
}

.banner-icon {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.6));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(3deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

.banner-title {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #ffea00, #ff9d00);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #ffea00; /* Fallback */
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 4px 15px rgba(255, 157, 0, 0.3);
}

.banner-subtitle {
  color: #d8d4e5;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 0;
}

.btn-claim-reward {
  position: relative;
  width: 100%;
  /* background: linear-gradient(90deg, #f93c8d, #6e3aed); */
  background: linear-gradient(90deg, #f99893 0%, #6842ff 100% 100%);
  color: white;
  border: none;
  padding: 16px 0;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(249, 60, 141, 0.4);
  text-transform: uppercase;
  display: flex;
  justify-content: center;
  align-items: center;
  transition:
    transform 0.1s,
    box-shadow 0.2s;
  z-index: 2;
}

.btn-claim-reward:active {
  transform: scale(0.96);
  box-shadow: 0 2px 10px rgba(249, 60, 141, 0.4);
}

.ad-badge {
  position: absolute;
  right: 16px;
  background-color: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 11px;
  font-weight: 900;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Category Pick-Up Box */
.category-pickup-box {
  background: linear-gradient(
    145deg,
    rgba(42, 43, 56, 0.8) 0%,
    rgba(26, 27, 34, 0.95) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 26px 20px;
  margin-bottom: 28px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.15);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.category-pickup-box::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 150px;
  height: 150px;
  background: radial-gradient(
    circle,
    rgba(104, 66, 255, 0.2) 0%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

.pickup-title {
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 22px;
  letter-spacing: -0.3px;
  position: relative;
  z-index: 1;
}

.pickup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.btn-pickup {
  background: rgba(104, 66, 255, 0.06);
  border: 1.5px solid rgba(167, 139, 250, 0.45);
  color: #d8d4e5;
  border-radius: 20px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-decoration: none;
  box-shadow: 0 0 0 1px rgba(104, 66, 255, 0.1) inset;
}

.btn-pickup span {
  font-size: 18px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-pickup:hover {
  background: rgba(104, 66, 255, 0.1);
  border-color: rgba(104, 66, 255, 0.3);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.btn-pickup:hover span {
  transform: scale(1.15) rotate(4deg);
}

.btn-pickup.active {
  background: linear-gradient(135deg, #f99893 0%, #6842ff 100%);
  color: white;
  border: none;
  box-shadow: 0 6px 20px rgba(104, 66, 255, 0.4);
  padding: 15px 17px; /* Compensating for the 1px border removal */
}

/* Game Grid */
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 16px 24px;
  background-color: var(--bg-main);
}

.game-card {
  border-radius: 24px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0c0d14 0%, #373952 100%);
  border: 1px solid #ffffff1a;
}

.card-image-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 0;
}

.game-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 16px;
  display: block;
}

.card-info {
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-info-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 0;
}

.users-pill {
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(
    90deg,
    rgba(104, 66, 255, 0.2) 0%,
    rgba(249, 152, 147, 0.2) 100%
  );
  border-radius: 16px;
  padding: 5px 8px;
  gap: 6px;
  color: #a49cb5;
  font-size: 11px;
  font-weight: 600;
}

.user-count {
  color: white;
  font-weight: 800;
}

.user-icon {
  width: 14px;
  height: 14px;
}

.game-title {
  font-size: 16px;
  font-weight: 800;
  color: white;
  text-align: center;
  line-height: 1.2;
}

.play-action-container {
  background-color: #0c0c11;
  border-radius: 20px;
  width: 100%;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid #1a1a22;
}

.entry-info {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0px;
}

.coin-tiny-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.coin-icon-tiny {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4));
}

.entry-fee {
  color: var(--color-yellow);
  font-size: 18px;
  font-weight: 800;
}

.entry-label {
  color: #8a8d9e;
  font-size: 14px;
  font-weight: 600;
}

.btn-play {
  width: 100%;
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 14px 0;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s;
}

.btn-play:active {
  transform: scale(0.96);
}

/* More Games */
.more-container {
  padding: 0 16px 32px;
}

.btn-more {
  width: 100%;
  background: #fecd3d;
  color: #111111;
  border: none;
  padding: 16px 0;
  border-radius: 28px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

/* Footer */
.footer {
  background: linear-gradient(180deg, #6c4af5 0%, #442aab 40%, #1a1a2e 100%);
  padding: 40px 24px 32px;
}

.footer-heading {
  font-size: 28px;
  font-weight: 900;
  color: white;
  margin-bottom: 24px;
  line-height: 1.2;
}

.footer-card {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 20px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 12px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom {
  text-align: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
}

.privacy-link {
  color: #8a8d9e;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(30, 31, 43, 0.9);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.modal-content {
  background: linear-gradient(135deg, #242239 0%, #3a2a62 100%);
  border-radius: 24px;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 12px 35px rgba(104, 66, 255, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.35);
  position: relative;
  overflow: hidden;
}

.modal-content::after {
  content: "";
  position: absolute;
  top: -40px;
  left: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(
    circle,
    rgba(255, 87, 172, 0.45) 0%,
    rgba(104, 66, 255, 0) 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

.modal-body {
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 1;
}

.oops-graphic {
  width: 100px;
  height: auto;
  margin-bottom: 24px;
  display: block;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.4));
}

.modal-title {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.4;
  margin-bottom: 16px;
  background: linear-gradient(90deg, #ffea00, #ff9d00);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #ffea00;
  text-shadow: 0 4px 15px rgba(255, 157, 0, 0.3);
}

.modal-coin {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin: 0 4px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4));
}

.modal-coin-text {
  color: var(--color-yellow);
  -webkit-text-fill-color: var(--color-yellow); /* override for inline text */
}

.modal-subtitle {
  color: #d8d4e5;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}

.modal-actions {
  background-color: rgba(0, 0, 0, 0.2);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-watch-ad {
  width: 100%;
  background: linear-gradient(90deg, #f99893 0%, #6842ff 100%);
  color: white;
  border: none;
  padding: 16px 0;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(249, 60, 141, 0.4);
  text-transform: uppercase;
  display: flex;
  justify-content: center;
  align-items: center;
  transition:
    transform 0.1s,
    box-shadow 0.2s;
  position: relative;
  z-index: 2;
}

.btn-watch-ad:active {
  transform: scale(0.96);
  box-shadow: 0 2px 10px rgba(249, 60, 141, 0.4);
}

.btn-skip {
  width: 100%;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  border: none;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
  z-index: 2;
}

.btn-skip:hover {
  color: white;
}

.hidden {
  display: none !important;
}

/* Desktop override */
@media (min-width: 600px) {
  body {
    max-width: 480px;
    margin: 0 auto;
    border-left: 1px solid #333;
    border-right: 1px solid #333;
    min-height: 100vh;
  }
}

/* Small Mobile Optimization */
@media (max-width: 380px) {
  .header {
    padding: 12px;
  }

  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
    gap: 8px;
    padding: 12px 16px;
  }

  .category-pickup-box {
    padding: 18px 14px;
    border-radius: 20px;
  }

  .pickup-title {
    font-size: 15px;
    margin-bottom: 16px;
  }

  .pickup-grid {
    gap: 8px;
  }

  .btn-pickup {
    padding: 12px 10px;
    font-size: 13px;
    border-radius: 16px;
  }

  .btn-pickup.active {
    padding: 13px 11px;
  }

  .btn-pickup span {
    font-size: 16px;
  }

  .game-card {
    padding: 5px;
  }

  .card-info-top {
    padding: 6px 0;
  }

  .game-title {
    font-size: 14px;
  }

  .users-pill {
    padding: 4px 8px;
    font-size: 10px;
    gap: 4px;
  }

  .user-icon {
    width: 12px;
    height: 12px;
  }

  .play-action-container {
    padding: 6px;
  }

  .btn-play {
    padding: 10px 0;
    font-size: 14px;
    border-radius: 10px;
  }

  .entry-fee {
    font-size: 15px;
  }

  .modal-content {
    max-width: 95%;
  }
}

.ad-container {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  margin-top: 10px;
  margin-bottom: 12px;
  color: #fff;
  text-align: center;
}

.ad-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--color-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

/* Preloader */
#preloader {
  position: fixed;
  inset: 0;
  background: rgba(19, 18, 26, 0.85);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  z-index: 9999;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

#preloader.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(104, 66, 255, 0.15);
  border-top: 4px solid transparent;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    var(--color-primary) 100%
  );
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 4px),
    #000 calc(100% - 4px)
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 4px),
    #000 calc(100% - 4px)
  );
  filter: drop-shadow(0 0 12px rgba(104, 66, 255, 0.5));
}

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

/* Toast */
.toast-message {
  display: none;
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #ffffff;
  color: #000;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px #0000001a;
  padding: 12px 10px;
  border-radius: 8px;
  font-size: 15px;
  z-index: 9999;
  max-width: 90vw;
  width: max-content;
  white-space: nowrap;
  transition: opacity 0.3s ease;
  text-align: center;
  text-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.toast-message.show {
  display: flex;
  animation: fadeOut 3s forwards;
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
