.page-index {
  font-family: Arial, sans-serif;
  color: #1F2D3D;
  background: #F4F7FB;
}

.page-index__container {
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 15px;
  box-sizing: border-box;
}

.page-index__section-title {
  font-size: 2.2em;
  font-weight: 700;
  text-align: center;
  color: #1F2D3D;
  margin-bottom: 30px;
  margin-top: 60px;
  line-height: 1.3;
}

.page-index__content-subtitle {
  font-size: 1.6em;
  font-weight: 600;
  color: #2F6BFF;
  margin-top: 30px;
  margin-bottom: 15px;
}

.page-index__content-text,
.page-index__feature-text,
.page-index__post-excerpt {
  font-size: 1em;
  line-height: 1.7;
  color: #333333;
  margin-bottom: 1em;
  text-align: justify;
}

.page-index__link {
  color: #2F6BFF;
  text-decoration: none;
}

.page-index__link:hover {
  text-decoration: underline;
}

/* Buttons styles */
.page-index__btn-primary,
.page-index__btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
  max-width: 100%;
}

.page-index__btn-primary {
  background: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%);
  color: #ffffff;
  border: none;
}

.page-index__btn-primary:hover {
  box-shadow: 0 5px 15px rgba(47, 107, 255, 0.4);
  transform: translateY(-2px);
}

.page-index__btn-secondary {
  background: #ffffff;
  color: #2F6BFF;
  border: 2px solid #2F6BFF;
}

.page-index__btn-secondary:hover {
  background: #f0f5ff;
  box-shadow: 0 5px 15px rgba(47, 107, 255, 0.2);
  transform: translateY(-2px);
}

.page-index__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* Module 1: Hero Section */
.page-index__hero-section {
  padding-top: 10px; /* Small top padding, body handles header offset */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.page-index__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

/* Module 2: Access Links */
.page-index__access-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 1250px;
  margin: 30px auto;
  padding: 0 15px;
  box-sizing: border-box;
}

.page-index__btn-access-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 10px;
  background: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%);
  color: #ffffff;
  border-radius: 10px;
  font-size: 1.2em;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(47, 107, 255, 0.2);
  white-space: normal;
  word-wrap: break-word;
  max-width: 100%;
}

.page-index__btn-access-link:hover {
  box-shadow: 0 8px 20px rgba(47, 107, 255, 0.4);
  transform: translateY(-3px);
  background: linear-gradient(180deg, #6FA3FF 0%, #4A8BFF 100%);
}

/* Module 3: Brand Intro */
.page-index__brand-intro {
  max-width: 1250px;
  margin: 0 auto;
  padding: 20px 15px;
  box-sizing: border-box;
  text-align: center;
}

.page-index__main-title {
  font-size: clamp(2em, 3.5vw, 2.8em);
  font-weight: 800;
  color: #1F2D3D;
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-index__intro-text {
  font-size: 1.1em;
  color: #333333;
  max-width: 900px;
  margin: 0 auto 40px auto;
  line-height: 1.8;
  text-align: justify;
}

.page-index__intro-link {
  color: #2F6BFF;
  text-decoration: none;
  font-weight: 600;
}

.page-index__intro-link:hover {
  text-decoration: underline;
}

/* Module 4: Game Lobby Entry */
.page-index__category-lobby {
  padding: 40px 0;
}

.page-index__category-lobby__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 15px;
  box-sizing: border-box;
}

.page-index__category-card {
  display: block;
  border: none;
  box-shadow: none;
  outline: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.page-index__category-card-link {
  display: block;
  border: none;
  box-shadow: none;
  outline: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin: 0;
  transition: transform 0.3s ease;
}

.page-index__category-card-link:hover {
  transform: translateY(-5px);
}

.page-index__category-card-link img {
  aspect-ratio: 1 / 1;
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

/* Game Descriptions Section */
.page-index__game-descriptions {
  padding: 60px 0;
}

.page-index__content-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.page-index__content-block {
  background: #ffffff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.page-index__content-block p {
  margin-bottom: 0;
}

/* Promotions Section */
.page-index__promotions-section {
  padding: 60px 0;
  background: #e9f0ff; /* Light blue background for promotions */
  text-align: center;
}

.page-index__promotions-section .page-index__section-title {
  color: #2F6BFF;
}

/* Why Choose Us Section */
.page-index__why-choose-us {
  padding: 60px 0;
}

.page-index__features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 40px;
}

.page-index__feature-item {
  background: #ffffff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.page-index__feature-title {
  font-size: 1.4em;
  font-weight: 700;
  color: #2F6BFF;
  margin-bottom: 15px;
}

.page-index__feature-item p {
  margin-bottom: 0;
}

/* Module 5: Blog Card Slider */
.page-index__blog-slider {
  padding: 60px 0;
}

.page-index__slider-wrapper {
  position: relative;
  max-width: 1250px;
  margin: 40px auto;
  padding: 0 15px;
  box-sizing: border-box;
}

.page-index__blog-slider-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.page-index__blog-slider-track::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.page-index__post-item {
  flex: 0 0 calc(33.333% - 11px); /* 3 items with 16px gap */
  scroll-snap-align: start;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.page-index__post-item:hover {
  transform: translateY(-5px);
}

.page-index__post-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.page-index__image-cover {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
}

.page-index__image-cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  max-width: 100%;
  height: auto;
}

.page-index__post-content {
  padding: 20px;
  position: relative;
}

.page-index__post-title {
  font-size: 1.2em;
  font-weight: 700;
  color: #1F2D3D;
  margin-bottom: 10px;
  line-height: 1.4;
}

.page-index__post-excerpt {
  font-size: 0.95em;
  color: #333333;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 15px;
}

.page-index__post-date {
  font-size: 0.85em;
  color: #666666;
  display: block;
  text-align: right;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(47, 107, 255, 0.8);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.3s ease;
}

.page-index__blog-slider-prev:hover,
.page-index__blog-slider-next:hover {
  background: #2F6BFF;
}

.page-index__blog-slider-prev {
  left: -5px;
}

.page-index__blog-slider-next {
  right: -5px;
}

/* CTA Final Section */
.page-index__cta-final {
  padding: 60px 0;
  background: #2F6BFF;
  color: #ffffff;
  text-align: center;
}

.page-index__cta-final .page-index__section-title {
  color: #ffffff;
}

.page-index__cta-final .page-index__content-text {
  color: #e0eaff;
  max-width: 800px;
  margin: 0 auto 40px auto;
}

.page-index__cta-final .page-index__btn-primary {
  background: #ffffff;
  color: #2F6BFF;
}

.page-index__cta-final .page-index__btn-primary:hover {
  background: #f0f5ff;
  box-shadow: 0 5px 15px rgba(255, 255, 255, 0.4);
}

.page-index__cta-final .page-index__btn-secondary {
  background: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
}

.page-index__cta-final .page-index__btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 5px 15px rgba(255, 255, 255, 0.4);
}

/* About rm88 Section */
.page-index__about-rm88 {
  padding: 60px 0;
}

.page-index__about-rm88 .page-index__content-text {
  max-width: 900px;
  margin: 0 auto;
}

.page-index__about-link {
  color: #2F6BFF;
  text-decoration: none;
  font-weight: 600;
}

.page-index__about-link:hover {
  text-decoration: underline;
}

/* Responsive Styles */

/* Mobile-first approach, so only overrides for larger screens are needed. */
/* However, the requirements mandate specific media queries for mobile. */

@media (max-width: 1024px) {
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .page-index__content-grid {
    grid-template-columns: 1fr;
  }

  .page-index__features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-index__post-item {
    flex: 0 0 calc(50% - 8px); /* 2 items with 16px gap */
  }
}

@media (max-width: 849px) {
  .page-index__hero-image img {
    object-fit: contain !important;
    aspect-ratio: unset !important;
    max-height: none !important;
  }
}

@media (max-width: 768px) {
  .page-index__section-title {
    font-size: 1.8em;
    margin-top: 40px;
    margin-bottom: 20px;
  }

  .page-index__content-subtitle {
    font-size: 1.4em;
  }

  .page-index__intro-text,
  .page-index__content-text,
  .page-index__feature-text,
  .page-index__post-excerpt {
    font-size: 0.95em;
    line-height: 1.6;
  }

  /* General image responsiveness for all .page-index img */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* General container responsiveness */
  .page-index__container,
  .page-index__hero-section,
  .page-index__access-links,
  .page-index__brand-intro,
  .page-index__category-lobby,
  .page-index__game-descriptions,
  .page-index__promotions-section,
  .page-index__why-choose-us,
  .page-index__blog-slider,
  .page-index__cta-final,
  .page-index__about-rm88,
  .page-index__content-block,
  .page-index__feature-item,
  .page-index__post-item {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Module 1: Hero Section (padding-top is already small, no change needed) */

  /* Module 2: Access Links */
  .page-index__access-links {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 20px 15px;
  }

  .page-index__btn-access-link {
    padding: 15px 10px;
    font-size: 1.1em;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Module 3: Brand Intro */
  .page-index__brand-intro {
    padding: 15px;
  }

  .page-index__main-title {
    font-size: 2.2em;
  }

  /* Module 4: Game Lobby Entry */
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0;
  }

  .page-index__category-card-link img {
    aspect-ratio: 1 / 1;
    width: 100%;
    object-fit: contain;
  }

  /* Game Descriptions Section */
  .page-index__game-descriptions {
    padding: 40px 0;
  }

  .page-index__content-grid {
    gap: 20px;
  }

  .page-index__content-block {
    padding: 20px;
  }

  /* Promotions Section */
  .page-index__promotions-section {
    padding: 40px 0;
  }

  /* Why Choose Us Section */
  .page-index__why-choose-us {
    padding: 40px 0;
  }

  .page-index__features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-index__feature-item {
    padding: 20px;
  }

  /* Module 5: Blog Card Slider */
  .page-index__blog-slider {
    padding: 40px 0;
  }

  .page-index__slider-wrapper {
    margin-top: 20px;
    padding: 0 10px;
  }

  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    width: 30px;
    height: 30px;
    font-size: 1.2em;
  }

  .page-index__blog-slider-prev {
    left: -10px;
  }

  .page-index__blog-slider-next {
    right: -10px;
  }

  .page-index__post-item {
    flex: 0 0 85%; /* 1 item visible */
  }

  .page-index__post-title {
    font-size: 1.1em;
  }

  .page-index__post-excerpt {
    font-size: 0.9em;
  }

  .page-index__post-date {
    font-size: 0.8em;
  }

  /* CTA Final Section */
  .page-index__cta-final {
    padding: 40px 0;
  }

  .page-index__cta-final .page-index__btn-primary,
  .page-index__cta-final .page-index__btn-secondary {
    width: 100% !important;
    max-width: 100% !important;
    margin: 5px 0;
  }

  .page-index__cta-buttons {
    flex-direction: column !important;
    gap: 10px;
    padding: 0 15px;
  }

  /* About rm88 Section */
  .page-index__about-rm88 {
    padding: 40px 0;
  }
}

@media (max-width: 549px) {
  .page-index__category-lobby__grid {
    grid-template-columns: 1fr 1fr;
  }
}