.page-game-rules {
  background-color: var(--background-color, #08160F); /* Default to #08160F if --background-color is not set by shared */
  color: var(--text-main, #F2FFF6); /* Default to #F2FFF6 */
  font-family: Arial, sans-serif;
  line-height: 1.6;
  padding-bottom: 60px; /* Add some padding at the bottom above footer */
}

/* Hero Section */
.page-game-rules__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 60px 20px;
  padding-top: 10px; /* Small top padding as per rules */
  background-color: #08160F; /* Ensure dark background for hero */
}

.page-game-rules__hero-image-wrapper {
  width: 100%;
  max-height: 500px; /* Limit height for hero image */
  overflow: hidden;
  position: relative;
  margin-bottom: 30px; /* Space between image and content */
}

.page-game-rules__hero-image {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

.page-game-rules__hero-content {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin: 0 auto;
  color: #F2FFF6; /* Ensure light text on dark background */
}

.page-game-rules__main-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem); /* Responsive H1 font size */
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  color: #F2C14E; /* Gold color for main title */
  text-shadow: 0 0 10px rgba(242, 193, 78, 0.5); /* Subtle glow */
}

.page-game-rules__intro-text {
  font-size: 1.2rem;
  margin-bottom: 30px;
  color: #A7D9B8; /* Secondary text color */
}

/* General Section Styling */
.page-game-rules__section {
  padding: 60px 20px;
  background-color: #08160F; /* Default background for sections */
  color: #F2FFF6;
}

.page-game-rules__section:nth-of-type(even) {
  background-color: #11271B; /* Alternate background for better visual separation */
}

.page-game-rules__container {
  max-width: 1200px;
  margin: 0 auto;
}

.page-game-rules__section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 30px;
  text-align: center;
  color: #F2C14E; /* Gold for section titles */
  position: relative;
  padding-bottom: 15px;
}

.page-game-rules__section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #2AD16F, transparent);
  border-radius: 2px;
}

.page-game-rules p {
  margin-bottom: 1em;
  color: #F2FFF6; /* Main text color */
}

.page-game-rules a {
  color: #57E38D; /* Glow color for links */
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-game-rules a:hover {
  color: #2AD16F; /* Darker green on hover */
  text-decoration: underline;
}

/* Buttons */
.page-game-rules__btn-primary,
.page-game-rules__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  box-sizing: border-box;
  max-width: 100%; /* Ensure responsiveness */
  white-space: normal; /* Allow text wrap */
  word-wrap: break-word; /* Allow text wrap */
}

.page-game-rules__btn-primary {
  background: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
  color: #F2FFF6;
  border: 2px solid transparent;
  box-shadow: 0 4px 15px rgba(42, 209, 111, 0.4);
}

.page-game-rules__btn-primary:hover {
  background: linear-gradient(180deg, #13994A 0%, #2AD16F 100%);
  box-shadow: 0 6px 20px rgba(42, 209, 111, 0.6);
  transform: translateY(-2px);
}

.page-game-rules__btn-secondary {
  background: transparent;
  color: #57E38D;
  border: 2px solid #2E7A4E; /* Border color */
  margin-left: 20px;
}

.page-game-rules__btn-secondary:hover {
  background-color: #0A4B2C; /* Deep Green on hover */
  color: #F2FFF6;
  border-color: #57E38D;
  transform: translateY(-2px);
}

/* Images in content */
.page-game-rules__image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 30px auto;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  min-width: 200px; /* Min size requirement */
  min-height: 200px; /* Min size requirement */
  object-fit: cover;
}

/* Rule List */
.page-game-rules__rule-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-game-rules__rule-item {
  background-color: #11271B;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  border: 1px solid #2E7A4E;
}

.page-game-rules__rule-heading {
  font-size: 1.5rem;
  color: #F2C14E;
  margin-bottom: 15px;
  position: relative;
  padding-left: 25px;
}

.page-game-rules__rule-heading::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #57E38D;
  font-size: 1.2em;
  top: 0;
}

/* Game Category Cards */
.page-game-rules__game-categories .page-game-rules__container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.page-game-rules__game-category-card {
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  border: 1px solid #2E7A4E;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.page-game-rules__game-category-card.page-game-rules__dark-bg {
  background-color: #11271B;
  color: #F2FFF6;
}

.page-game-rules__game-category-card.page-game-rules__light-bg {
  background-color: #0A4B2C; /* Using Deep Green as a lighter alternative within the palette for contrast */
  color: #F2FFF6;
}

.page-game-rules__card-image {
  width: 100%;
  height: 200px; /* Fixed height for consistency */
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
  min-width: 200px; /* Min size requirement */
  min-height: 200px; /* Min size requirement */
}

.page-game-rules__card-title {
  font-size: 1.6rem;
  color: #F2C14E;
  margin-bottom: 15px;
}

.page-game-rules__game-category-card p {
  color: #A7D9B8;
  margin-bottom: 20px;
  flex-grow: 1; /* Pushes button to bottom */
}

/* Dispute Resolution List */
.page-game-rules__dispute-steps {
  list-style: none;
  padding: 0;
  margin-top: 30px;
}

.page-game-rules__dispute-steps li {
  background-color: #11271B;
  border-left: 4px solid #57E38D;
  padding: 15px 20px;
  margin-bottom: 15px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  color: #F2FFF6;
}

.page-game-rules__dispute-steps li strong {
  color: #F2C14E;
}

/* CTA Section */
.page-game-rules__cta-section {
  text-align: center;
  padding: 80px 20px;
  background-color: #0A4B2C; /* Deep Green background for strong CTA */
  color: #F2FFF6;
  border-top: 1px solid #2E7A4E;
}

.page-game-rules__cta-title {
  font-size: clamp(2rem, 4vw, 3rem);
  color: #F2C14E;
  margin-bottom: 20px;
}

.page-game-rules__cta-description {
  font-size: 1.1rem;
  max-width: 800px;
  margin: 0 auto 40px auto;
  color: #A7D9B8;
}

.page-game-rules__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
  width: 100%; /* Ensure container takes full width */
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* FAQ Section */
.page-game-rules__faq-list {
  margin-top: 40px;
}

.page-game-rules__faq-item {
  background-color: #11271B;
  border: 1px solid #2E7A4E;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
}

.page-game-rules__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.2rem;
  font-weight: 600;
  color: #F2C14E;
  cursor: pointer;
  background-color: #11271B;
  transition: background-color 0.3s ease;
}

.page-game-rules__faq-question:hover {
  background-color: #0A4B2C; /* Deep Green on hover */
}

.page-game-rules__faq-item[open] > .page-game-rules__faq-question {
  background-color: #0A4B2C;
  color: #F2C14E;
}

.page-game-rules__faq-toggle {
  font-size: 1.5rem;
  line-height: 1;
  color: #57E38D;
  margin-left: 15px;
}

.page-game-rules__faq-answer {
  padding: 0 25px 20px 25px;
  font-size: 1rem;
  color: #A7D9B8;
  line-height: 1.5;
}

/* Details element default style reset */
.page-game-rules__faq-item summary {
  list-style: none; /* Remove default marker */
}
.page-game-rules__faq-item summary::-webkit-details-marker {
  display: none; /* Remove default marker for Webkit browsers */
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-game-rules__hero-section {
    padding: 40px 20px;
    padding-top: 10px;
  }
  .page-game-rules__main-title {
    font-size: clamp(2rem, 4.5vw, 3rem);
  }
  .page-game-rules__intro-text {
    font-size: 1.1rem;
  }
}

@media (max-width: 768px) {
  .page-game-rules__hero-section {
    padding: 30px 15px;
    padding-top: 10px !important; /* body already has padding-top */
  }
  .page-game-rules__hero-image-wrapper {
    max-height: 300px;
    margin-bottom: 20px;
  }
  .page-game-rules__main-title {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
    margin-bottom: 15px;
  }
  .page-game-rules__intro-text {
    font-size: 1rem;
    margin-bottom: 25px;
  }

  .page-game-rules__section {
    padding: 40px 15px;
  }
  .page-game-rules__section-title {
    font-size: clamp(1.5rem, 6vw, 2.2rem);
    margin-bottom: 25px;
  }

  /* Images */
  .page-game-rules img {
    max-width: 100% !important;
    width: 100% !important; /* Added width: 100% for images to prevent overflow */
    height: auto !important;
    display: block !important;
  }

  /* Containers for images/content */
  .page-game-rules__section,
  .page-game-rules__card,
  .page-game-rules__container,
  .page-game-rules__rule-item,
  .page-game-rules__game-category-card,
  .page-game-rules__faq-item,
  .page-game-rules__cta-content {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important; /* Ensure no overflow */
  }

  /* Buttons */
  .page-game-rules__btn-primary,
  .page-game-rules__btn-secondary,
  .page-game-rules a[class*="button"],
  .page-game-rules a[class*="btn"] {
    max-width: 100% !important;
    width: 100% !important; /* Ensure buttons take full width */
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding: 12px 20px !important;
    margin-left: 0 !important; /* Remove margin-left for secondary button */
  }

  .page-game-rules__cta-buttons {
    flex-direction: column !important; /* Stack buttons vertically */
    gap: 15px !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-game-rules__rule-list {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-game-rules__game-categories .page-game-rules__container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-game-rules__card-image {
    height: 180px; /* Adjust height for mobile */
  }

  .page-game-rules__faq-question {
    font-size: 1.1rem;
    padding: 15px 20px;
  }

  .page-game-rules__faq-answer {
    padding: 0 20px 15px 20px;
  }
}