/* style/index.css */
:root {
  --primary-color: #8B0000; /* Deep Red */
  --secondary-color: #FFD700; /* Gold */
  --text-color-dark: #333333;
  --text-color-light: #ffffff;
  --bg-dark: #111;
  --bg-light: #f1f3f5;
  --border-color: #e4e4e4;
}

.page-index {
  font-family: 'Arial', sans-serif;
  color: var(--text-color-light); /* Body is dark, so use light text */
  background-color: var(--bg-dark); /* Inherited from shared.css */
}

/* 🚨 Fixed Nav Bar Spacing - Desktop */
.page-index__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  padding-top: 180px; /* Desktop: Adjust based on actual nav height */
  background: linear-gradient(135deg, var(--primary-color), #4a0000);
  color: var(--text-color-light);
}

.page-index__hero-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.page-index__hero-image {
  width: 100%;
  margin-bottom: 30px;
}

.page-index__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  object-fit: cover;
}

.page-index__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  padding: 0 20px;
}

.page-index__hero-title {
  font-size: 3.2em;
  font-weight: bold;
  margin-bottom: 20px;
  color: var(--secondary-color);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

.page-index__hero-description {
  font-size: 1.3em;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto 40px auto;
  color: var(--text-color-light);
}

.page-index__cta-button {
  display: inline-block;
  padding: 18px 45px;
  background: var(--secondary-color);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 50px;
  font-size: 1.2em;
  font-weight: bold;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.page-index__cta-button:hover {
  background: #FFEB3B;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
}

/* Game Leaderboard Section */
.page-index__game-leaderboard-section {
  padding: 60px 20px;
  background: var(--bg-light);
  color: var(--text-color-dark);
}

.page-index__page-title {
  font-size: 2.5em;
  font-weight: bold;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 50px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.page-index__game-leaderboard {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-index__game-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 20px;
  display: flex;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.page-index__game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.page-index__game-card-segment {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  position: relative;
}

.page-index__game-card-segment:not(:first-child)::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 1px;
  background-color: var(--border-color);
}

.page-index__segment-1 {
  flex-basis: 150px;
  min-width: 120px;
  padding-left: 0;
  padding-right: 20px;
}

.page-index__rank-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-color-light);
  font-size: 1.1em;
  font-weight: bold;
  position: absolute;
  top: -10px;
  left: -10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.page-index__rank-1 {
  background: linear-gradient(135deg, #FFD700, #FFA500); /* Gold */
}
.page-index__rank-2 {
  background: linear-gradient(135deg, #C0C0C0, #A0A0A0); /* Silver */
}
.page-index__rank-3 {
  background: linear-gradient(135deg, #CD7F32, #B87333); /* Bronze */
}
.page-index__rank-badge:not(.page-index__rank-1):not(.page-index__rank-2):not(.page-index__rank-3) {
  background: linear-gradient(135deg, #ff6b35, #ff8c42); /* Orange for others */
}

.page-index__game-icon {
  max-width: 100px;
  height: auto;
  display: block;
  border-radius: 8px;
  object-fit: contain;
  margin-top: 15px;
}

.page-index__segment-2 {
  flex: 1;
  text-align: center;
}

.page-index__game-name {
  font-size: 1.5em;
  font-weight: bold;
  color: var(--text-color-dark);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.page-index__game-name-link {
  color: var(--text-color-dark);
  text-decoration: none;
  transition: color 0.3s ease, text-decoration 0.3s ease;
}

.page-index__game-name-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.page-index__game-description {
  font-size: 0.95em;
  color: var(--text-color-dark);
  font-weight: bold;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.page-index__game-description a {
  color: #0066cc;
  font-weight: bold;
  text-decoration: none;
}

.page-index__game-description a:hover {
  color: #004499;
  text-decoration: underline;
}

.page-index__segment-3 {
  flex-basis: 180px;
  min-width: 150px;
  text-align: center;
}

.page-index__game-rating {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.page-index__stars {
  color: var(--secondary-color);
  font-size: 1.2em;
  margin-right: 5px;
  font-weight: bold;
}

.page-index__rating-number {
  font-size: 1.1em;
  font-weight: bold;
  color: var(--primary-color);
}

.page-index__promotion-text {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.page-index__promotion-link {
  color: #0066cc;
  font-size: 0.9em;
  text-decoration: none;
  font-weight: bold;
  margin-right: 5px;
}

.page-index__promotion-link:hover {
  text-decoration: underline;
  color: #004499;
}

.page-index__hot-badge {
  background: #dc3545;
  color: var(--text-color-light);
  font-size: 0.7em;
  padding: 3px 8px;
  border-radius: 5px;
  font-weight: bold;
}

.page-index__segment-4 {
  flex-basis: 220px;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 0;
}

.page-index__btn-download, .page-index__btn-review {
  display: block;
  width: 100%;
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 0.95em;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.page-index__btn-download {
  background: var(--primary-color);
  color: var(--text-color-light);
}

.page-index__btn-download:hover {
  background: #6a0000;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.page-index__btn-review {
  background: var(--secondary-color);
  color: var(--primary-color);
}

.page-index__btn-review:hover {
  background: #FFEB3B;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Brand Review Content Section */
.page-index__review-content-section {
  padding: 60px 20px;
  background: var(--bg-light);
  color: var(--text-color-dark);
}

.page-index__review-content-container {
  max-width: 1400px;
  margin: 0 auto;
}

.page-index__review-content-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 40px;
}

.page-index__review-title {
  font-size: 2.2em;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 24px;
  text-align: center;
}

.page-index__review-subtitle {
  font-size: 1.5em;
  font-weight: bold;
  color: var(--text-color-dark);
  margin-top: 30px;
  margin-bottom: 15px;
}

.page-index__review-body {
  color: var(--text-color-dark);
  line-height: 1.7;
}

.page-index__review-body p {
  margin-bottom: 16px;
  font-size: 1.05em;
}

.page-index__review-body a {
  color: #0066cc;
  text-decoration: none;
}

.page-index__review-body a:hover {
  text-decoration: underline;
  color: #004499;
}

.page-index__keyword {
  font-weight: bold;
  color: var(--primary-color);
}

/* General Section Styling */
.page-index__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.page-index__section-title {
  font-size: 2.2em;
  font-weight: bold;
  text-align: center;
  margin-bottom: 20px;
  color: var(--secondary-color);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.page-index__section-description {
  font-size: 1.1em;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px auto;
  line-height: 1.6;
  color: var(--text-color-light);
}

/* Homepage Introduction Section */
.page-index__intro-section {
  padding: 80px 0;
  background: var(--primary-color);
  color: var(--text-color-light);
}

.page-index__intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.page-index__intro-item {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  transition: transform 0.3s ease, background 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-index__intro-item:hover {
  transform: translateY(-8px);
  background: rgba(0, 0, 0, 0.3);
}

.page-index__intro-image {
  max-width: 250px; /* Increased size */
  height: auto;
  margin: 0 auto 20px auto;
  display: block;
  border-radius: 8px;
  object-fit: cover;
}

.page-index__intro-subtitle {
  font-size: 1.4em;
  font-weight: bold;
  margin-bottom: 15px;
  color: var(--secondary-color);
}

.page-index__intro-item p {
  font-size: 1em;
  line-height: 1.6;
  color: var(--text-color-light);
}

/* Core Games Section */
.page-index__core-games-section {
  padding: 80px 0;
  background: var(--bg-light);
  color: var(--text-color-dark);
}

.page-index__core-games-section .page-index__section-title,
.page-index__core-games-section .page-index__section-description {
  color: var(--text-color-dark);
}

.page-index__game-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.page-index__game-category-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 30px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.page-index__game-category-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.page-index__category-image {
  max-width: 100%;
  height: 200px; /* Fixed height for consistency */
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
}

.page-index__category-title {
  font-size: 1.5em;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.page-index__category-title a {
  color: var(--primary-color);
  text-decoration: none;
}

.page-index__category-title a:hover {
  text-decoration: underline;
}

.page-index__game-category-card p {
  font-size: 1em;
  line-height: 1.6;
  color: var(--text-color-dark);
  flex-grow: 1;
  margin-bottom: 20px;
}

.page-index__category-button {
  display: inline-block;
  padding: 12px 25px;
  background: var(--secondary-color);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 50px;
  font-weight: bold;
  transition: all 0.3s ease;
  margin-top: auto;
}

.page-index__category-button:hover {
  background: #FFEB3B;
  transform: translateY(-2px);
}

/* Promotions Section */
.page-index__promotions-section {
  padding: 80px 0;
  background: linear-gradient(135deg, #4a0000, var(--primary-color));
  color: var(--text-color-light);
}

.page-index__promotions-section .page-index__section-title,
.page-index__promotions-section .page-index__section-description {
  color: var(--text-color-light);
}

.page-index__promotions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.page-index__promotion-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  transition: transform 0.3s ease, background 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.page-index__promotion-card:hover {
  transform: translateY(-8px);
  background: rgba(255, 255, 255, 0.15);
}

.page-index__promotion-image {
  max-width: 100%;
  height: 180px; /* Fixed height */
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
}

.page-index__promotion-title {
  font-size: 1.4em;
  font-weight: bold;
  color: var(--secondary-color);
  margin-bottom: 15px;
}

.page-index__promotion-card p {
  font-size: 1em;
  line-height: 1.6;
  color: var(--text-color-light);
  flex-grow: 1;
  margin-bottom: 20px;
}

.page-index__promotion-button {
  display: inline-block;
  padding: 12px 25px;
  background: var(--secondary-color);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 50px;
  font-weight: bold;
  transition: all 0.3s ease;
  margin-top: auto;
}

.page-index__promotion-button:hover {
  background: #FFEB3B;
  transform: translateY(-2px);
}

/* Blog Section */
.page-index__blog-section {
  padding: 80px 0;
  background: var(--bg-light);
  color: var(--text-color-dark);
}

.page-index__blog-section .page-index__section-title,
.page-index__blog-section .page-index__section-description {
  color: var(--text-color-dark);
}

.page-index__blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.page-index__blog-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.page-index__blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.page-index__blog-image {
  width: 100%;
  height: 220px; /* Fixed height for blog images */
  object-fit: cover;
}

.page-index__blog-content {
  padding: 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.page-index__blog-title {
  font-size: 1.3em;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 15px;
  line-height: 1.4;
}

.page-index__blog-title a {
  color: var(--primary-color);
  text-decoration: none;
}

.page-index__blog-title a:hover {
  text-decoration: underline;
}

.page-index__blog-excerpt {
  font-size: 0.95em;
  line-height: 1.6;
  color: var(--text-color-dark);
  flex-grow: 1;
  margin-bottom: 20px;
}

.page-index__blog-readmore {
  display: inline-block;
  color: #0066cc;
  text-decoration: none;
  font-weight: bold;
  margin-top: auto;
}

.page-index__blog-readmore:hover {
  text-decoration: underline;
  color: #004499;
}

/* 🚨 Mobile Responsive Design */
@media (max-width: 768px) {
  .page-index__hero-section {
    padding-top: 160px !important; /* Mobile: Adjust based on actual nav height */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-index__hero-title {
    font-size: 2em;
  }

  .page-index__hero-description {
    font-size: 1em;
  }

  .page-index__cta-button {
    padding: 15px 30px;
    font-size: 1em;
  }

  .page-index__page-title {
    font-size: 1.8em;
    margin-bottom: 30px;
  }

  .page-index__game-leaderboard-section,
  .page-index__review-content-section,
  .page-index__intro-section,
  .page-index__core-games-section,
  .page-index__promotions-section,
  .page-index__blog-section {
    padding: 40px 15px;
  }

  /* 🚨 Mobile Image Responsiveness */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-index__section,
  .page-index__card,
  .page-index__container,
  .page-index__intro-item,
  .page-index__game-category-card,
  .page-index__promotion-card,
  .page-index__blog-card,
  .page-index__review-content-card {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-index__game-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 15px;
  }

  .page-index__game-card-segment {
    width: 100%;
    padding: 10px 0;
    align-items: center;
  }

  .page-index__game-card-segment:not(:first-child)::before {
    display: none;
  }

  .page-index__segment-1 {
    flex-basis: auto;
    min-width: unset;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 10px;
  }

  .page-index__rank-badge {
    position: static;
    margin-right: 10px;
    width: 32px;
    height: 32px;
    font-size: 0.9em;
  }

  .page-index__game-icon {
    max-width: 80px;
    height: auto;
    margin-top: 0;
  }

  .page-index__segment-2 {
    text-align: center;
    padding: 10px 0;
  }

  .page-index__game-name {
    font-size: 1.3em;
  }

  .page-index__game-description {
    font-size: 0.9em;
  }

  .page-index__segment-3 {
    flex-basis: auto;
    min-width: unset;
    padding: 10px 0;
  }

  .page-index__segment-4 {
    flex-basis: auto;
    min-width: unset;
    padding: 10px 0;
  }

  .page-index__btn-download, .page-index__btn-review {
    font-size: 0.85em;
    padding: 10px 10px;
    white-space: normal;
    word-wrap: break-word;
  }

  .page-index__review-content-card {
    padding: 25px;
  }

  .page-index__review-title {
    font-size: 1.8em;
  }

  .page-index__review-subtitle {
    font-size: 1.2em;
  }

  .page-index__review-body p {
    font-size: 0.95em;
  }

  .page-index__section-title {
    font-size: 1.8em;
  }

  .page-index__section-description {
    font-size: 1em;
  }

  .page-index__intro-item,
  .page-index__game-category-card,
  .page-index__promotion-card,
  .page-index__blog-card {
    padding: 20px;
  }

  .page-index__intro-image {
    max-width: 180px;
  }

  .page-index__category-image,
  .page-index__promotion-image,
  .page-index__blog-image {
    height: 150px; /* Adjust height for mobile */
  }

  .page-index__category-title,
  .page-index__promotion-title,
  .page-index__blog-title {
    font-size: 1.2em;
  }

  .page-index__category-button,
  .page-index__promotion-button,
  .page-index__blog-readmore {
    font-size: 0.9em;
    padding: 10px 20px;
  }
}

/* Ensure contrast for dark background sections */
.page-index__dark-section .page-index__section-title,
.page-index__dark-section .page-index__section-description,
.page-index__dark-section h3,
.page-index__dark-section p,
.page-index__dark-section .page-index__keyword {
  color: var(--text-color-light);
}

.page-index__dark-section .page-index__promotion-button {
  background: var(--secondary-color);
  color: var(--primary-color);
}

.page-index__dark-section .page-index__promotion-button:hover {
  background: #FFEB3B;
}

/* Ensure contrast for light background sections */
.page-index__light-bg .page-index__section-title,
.page-index__light-bg .page-index__section-description,
.page-index__light-bg h3,
.page-index__light-bg p,
.page-index__light-bg .page-index__keyword {
  color: var(--text-color-dark);
}

.page-index__light-bg .page-index__category-button,
.page-index__light-bg .page-index__blog-readmore {
  background: var(--secondary-color);
  color: var(--primary-color);
}

.page-index__light-bg .page-index__category-button:hover,
.page-index__light-bg .page-index__blog-readmore:hover {
  background: #FFEB3B;
}