* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: #1d1a49;
  font-family: Arial, sans-serif;
  color: #f5f7ff;
}

.main-wrapper {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  background: #1d1a49;
}

@media (min-width: 425px) {
  .main-wrapper {
    border-left: 1px solid #3d3a67;
    border-right: 1px solid #3d3a67;
    max-width: 425px;
  }
}

.main-content {
  padding: 12px;
}

@media (min-width: 425px) {
  .main-content {
    padding: 12px 12px;
  }
}

.search-box {
  display: flex;
  overflow: hidden;
  border-radius: 50px;
  background: #2b285c;
  border: 1px solid #4f4b82;
  margin-bottom: 14px;
  width: 100%;
  min-width: 0;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px;
  font-size: 14px;
  background: transparent;
  color: #ffffff;
  min-width: 0;
  width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}

.search-input::-webkit-scrollbar {
  height: 4px;
}

.search-input::-webkit-scrollbar-track {
  background: #2b285c;
  border-radius: 2px;
}

.search-input::-webkit-scrollbar-thumb {
  background: #3478ff;
  border-radius: 2px;
}

.search-input::placeholder {
  color: #b7b9d3;
}

.search-btn {
  width: 52px;
  flex-shrink: 0;
  border: none;
  background: #3478ff;
  color: white;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.search-btn:hover {
  opacity: 0.9;
}

.ads-container {
  width: calc(100% + 24px);
  margin-left: -12px;
  margin-right: -12px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 5px 0;
  border: 1px solid #49466a;
  border-left: none;
  border-right: none;
}

.ad-label {
  text-align: center;
  font-size: 10px;
  letter-spacing: 3px;
  color: #a7acd8;
  margin-bottom: 8px;
}

.ad-unit-wrapper {
  width: 100%;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-unit-wrapper ins.adsbygoogle {
  display: block;
  width: 100%;
  min-height: 250px;
  background: transparent;
}

@media (max-width: 424px) {
  .ad-unit-wrapper {
    min-height: 280px;
  }

  .ad-unit-wrapper ins.adsbygoogle {
    min-height: 280px;
  }
}

@media (min-width: 425px) and (max-width: 768px) {
  .ad-unit-wrapper {
    min-height: 90px;
  }

  .ad-unit-wrapper ins.adsbygoogle {
    min-height: 90px;
  }
}

.card {
  background: #2a2758;
  border-radius: 18px;
  border: 1px solid #49466a;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.card-title {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 14px;
}

.discover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid #3c3967;
  font-size: 16px;
  color: #f2f4ff;
  cursor: pointer;
  transition: 0.2s;
}

.discover-item:hover {
  color: #7fb3ff;
}

.discover-item:last-child {
  border-bottom: none;
}

.coin-card {
  position: relative;
  background: #2a2758;
  border-radius: 18px;
  border: 1px solid #49466a;
  padding: 16px;
  text-align: center;
  margin-bottom: 14px;
}

.coin-ad-label {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: #7f83a8;
  pointer-events: none;
}

.coin-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 12px;
}

.coin-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.earn-coins-btn {
  width: 100%;
  border: none;
  background: linear-gradient(135deg, #3478ff, #245eea);
  color: white;
  border-radius: 999px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.15s,
    background 0.15s,
    box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(52, 120, 255, 0.3);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.earn-coins-btn span {
  letter-spacing: 1px;
}

@media (hover: hover) {
  .earn-coins-btn:hover {
    box-shadow: 0 6px 18px rgba(52, 120, 255, 0.45);
  }
}

.earn-coins-btn:active {
  transform: scale(0.96);
  background: linear-gradient(135deg, #245eea, #1c4ec5);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.btn-coin-icon {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.play-btn,
.more-btn {
  width: 100%;
  border: none;
  background: linear-gradient(135deg, #3478ff, #245eea);
  color: white;
  border-radius: 999px;
  padding: 13px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.25s;
  box-shadow: 0 4px 12px rgba(52, 120, 255, 0.3);
}

.play-btn:hover,
.more-btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.category-title-sec {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
}

.category-title {
  color: #f1f4ff;
  font-size: 16px;
  font-weight: 500;
  margin: 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.category-btn {
  border: 1px solid #5f8fff;
  background: #221f4d;
  color: #ffffff;
  border-radius: 999px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .category-btn:hover {
    background: #3478ff;
    border-color: #3478ff;
  }
}

.category-btn:active {
  background: #221f4d;
  border-color: #5f8fff;
}

.category-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.game-card {
  background: #2a2758;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #49466a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.25s,
    box-shadow 0.25s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.game-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #1d1a49;
}

.game-content {
  padding: 10px;
  text-align: center;
}

.game-title {
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

.game-users {
  color: #42d96b;
  font-size: 12px;
  margin-bottom: 4px;
}

.game-entry {
  color: #c7cae8;
  font-size: 13px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.entry-coin-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.play-btn {
  padding: 11px;
  font-size: 13px;
}

.more-btn {
  margin-top: 16px;
}

.about-section {
  padding: 20px 6px;
  background: #2a2758;
  border-radius: 18px;
  border: 1px solid #49466a;
  text-align: center;
  margin: 14px 0px;
}

.about-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 16px;
}

.about-text {
  color: #cfd2f1;
  line-height: 1.8;
  font-size: 15px;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
}

footer {
  background: linear-gradient(to top, #0a0c12, #161338);
  border-top: 1px solid #3d3a67;
  padding: 20px 14px;
  width: 100%;
}

.copyright a {
  color: #009cff;
  text-decoration: none;
  font-weight: 500;
}

.footer-links {
  display: flex;
  justify-content: space-evenly;
  margin-bottom: 16px;
}

.footer-links a {
  text-decoration: none;
  color: #f1f3ff;
  font-size: 14px;
  transition: 0.2s;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
}

.footer-links a:hover {
  color: #7fb3ff;
}

.copyright {
  text-align: center;
  color: #aeb3da;
  font-size: 13px;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
}

.loading-spinner {
  text-align: center;
  padding: 40px;
  color: #a7acd8;
  font-size: 14px;
  grid-column: span 2;
}

.error-message {
  text-align: center;
  padding: 40px;
  color: #ff6b6b;
  font-size: 14px;
  grid-column: span 2;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 12px;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
}

.error-message p {
  margin-bottom: 15px;
}

.retry-btn {
  background: linear-gradient(135deg, #3478ff, #245eea);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  margin-top: 15px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.retry-btn:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

.no-games {
  text-align: center;
  padding: 40px;
  color: #a7acd8;
  font-size: 14px;
  grid-column: span 2;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  word-wrap: break-word;
  word-break: break-all;
  overflow-wrap: break-word;
  max-width: 100%;
}

.sticky-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(to top, #0a0c12, #161338);
  padding: 12px 12px 8px 12px;
  border-bottom: 1px solid #3d3a67;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  width: 100%;
  overflow: hidden;
}

.header-category-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
  border-radius: 20px;
  border: 1px solid #3d3a67;
  margin: 10px 10px 0;
}

.header-category-icon {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.sticky-header .search-box {
  margin-bottom: 0;
}

#games-section {
  scroll-margin-top: 80px;
}

html {
  scroll-behavior: smooth;
}

@media (max-width: 380px) {
  .game-title {
    font-size: 14px;
  }
  .game-entry {
    font-size: 12px;
  }
}

@media (max-width: 424px) {
  .main-content {
    padding: 12px;
  }

  .sticky-header {
    width: 100%;
    padding: 10px;
  }

  #games-section {
    scroll-margin-top: 70px;
  }
}

@media (min-width: 425px) {
  body {
    display: flex;
    justify-content: center;
  }

  .main-wrapper {
    max-width: 425px;
    border-left: 1px solid #3d3a67;
    border-right: 1px solid #3d3a67;
  }

  .main-content {
    max-width: 425px;
    margin: 0 auto;
    padding: 12px;
  }

  footer {
    max-width: 425px;
    margin: 0 auto;
    border-left: 1px solid #3d3a67;
    border-right: 1px solid #3d3a67;
    border-bottom: 1px solid #3d3a67;
  }

  .sticky-header {
    max-width: 425px;
    margin: 0 auto;
    left: 0;
    right: 0;
    padding: 12px 12px 8px 12px;
  }

  .main-content {
    padding: 12px 12px;
  }
}
