/* Custom Colors */
:root {
  --sh88-primary-color: #11A84E;
  --sh88-secondary-color: #22C768;
  --sh88-button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
  --sh88-card-bg: #11271B;
  --sh88-background: #08160F;
  --sh88-text-main: #F2FFF6;
  --sh88-text-secondary: #A7D9B8;
  --sh88-border: #2E7A4E;
  --sh88-glow: #57E38D;
  --sh88-gold: #F2C14E;
  --sh88-divider: #1E3A2A;
  --sh88-deep-green: #0A4B2C;
}

.page-game-rules {
  font-family: 'Arial', sans-serif;
  color: var(--sh88-text-main);
  background-color: var(--sh88-background);
}

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

.page-game-rules__section {
  padding: 60px 0;
}

.page-game-rules__dark-bg {
  background-color: var(--sh88-background);
  color: var(--sh88-text-main);
}

.page-game-rules__light-bg {
  background-color: #f8f8f8;
  color: #333333;
}

.page-game-rules__card-bg {
  background-color: var(--sh88-card-bg);
  color: var(--sh88-text-main);
  border: 1px solid var(--sh88-border);
}

.page-game-rules__section-title {
  font-size: 36px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 40px;
  color: var(--sh88-gold);
}

.page-game-rules__sub-title {
  font-size: 24px;
  font-weight: 600;
  margin-top: 30px;
  margin-bottom: 15px;
  color: var(--sh88-gold);
}

.page-game-rules__paragraph {
  font-size: 18px;
  line-height: 1.6;
  text-align: center;
  max-width: 900px;
  margin: 0 auto 30px;
  color: var(--sh88-text-secondary);
}

.page-game-rules__hero-section {
  padding-top: 10px; /* Small top padding, body handles --header-offset */
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 600px;
}

.page-game-rules__hero-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.page-game-rules__hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.5);
}

.page-game-rules__hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  padding: 40px 20px;
  color: var(--sh88-text-main);
}

.page-game-rules__main-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--sh88-gold);
}

.page-game-rules__description {
  font-size: 20px;
  margin-bottom: 30px;
  line-height: 1.5;
  color: var(--sh88-text-secondary);
}

.page-game-rules__btn-primary,
.page-game-rules__btn-secondary {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  transition: all 0.3s ease;
  cursor: pointer;
  box-sizing: border-box;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
}

.page-game-rules__btn-primary {
  background: var(--sh88-button-gradient);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 15px rgba(42, 209, 111, 0.4);
}

.page-game-rules__btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(42, 209, 111, 0.6);
}

.page-game-rules__btn-secondary {
  background-color: transparent;
  color: var(--sh88-primary-color);
  border: 2px solid var(--sh88-primary-color);
}

.page-game-rules__btn-secondary:hover {
  background-color: var(--sh88-primary-color);
  color: #ffffff;
  transform: translateY(-2px);
}

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

.page-game-rules__card {
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.page-game-rules__card-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--sh88-gold);
}

.page-game-rules__card p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--sh88-text-secondary);
}

.page-game-rules__game-rules-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 40px;
}

.page-game-rules__rule-card {
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.page-game-rules__rule-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
}

.page-game-rules__rule-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--sh88-gold);
}

.page-game-rules__rule-details {
  list-style: none;
  padding: 0;
  margin-bottom: 25px;
  text-align: left;
  width: 100%;
}

.page-game-rules__rule-details li {
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 8px;
  color: var(--sh88-text-secondary);
  position: relative;
  padding-left: 25px;
}

.page-game-rules__rule-details li::before {
  content: '•';
  color: var(--sh88-primary-color);
  font-weight: bold;
  display: inline-block;
  width: 1em;
  margin-left: -1em;
  position: absolute;
  left: 0;
}

.page-game-rules__content-wrapper {
  display: flex;
  align-items: center;
  gap: 50px;
  margin-top: 40px;
}

.page-game-rules__content-wrapper:nth-child(even) {
  flex-direction: row-reverse;
}

.page-game-rules__content-image {
  width: 50%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
  min-width: 200px;
}

.page-game-rules__text-content {
  width: 50%;
}

.page-game-rules__text-content p {
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 20px;
  color: var(--sh88-text-secondary);
  text-align: left;
}

.page-game-rules__faq-section {
  background-color: #f0f0f0;
  color: #333333;
}

.page-game-rules__faq-section .page-game-rules__section-title {
  color: #333333;
}

details.page-game-rules__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  background: #fff;
}

details.page-game-rules__faq-item summary.page-game-rules__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background-color 0.3s ease;
}

details.page-game-rules__faq-item summary.page-game-rules__faq-question::-webkit-details-marker {
  display: none;
}

details.page-game-rules__faq-item summary.page-game-rules__faq-question:hover {
  background: #f5f5f5;
}

.page-game-rules__faq-qtext {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: #333333;
}

.page-game-rules__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  color: var(--sh88-primary-color);
  flex-shrink: 0;
  margin-left: 15px;
  width: 28px;
  text-align: center;
}

details.page-game-rules__faq-item .page-game-rules__faq-answer {
  padding: 0 20px 20px;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
  color: #555555;
}

.page-game-rules__faq-answer p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  text-align: left;
}

.page-game-rules__cta-section {
  text-align: center;
  padding: 80px 0;
  background-color: var(--sh88-deep-green);
}

.page-game-rules__cta-section .page-game-rules__section-title {
  color: var(--sh88-gold);
}

.page-game-rules__cta-section .page-game-rules__paragraph {
  color: var(--sh88-text-secondary);
}

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

/* General image and button responsive styles */
.page-game-rules img {
  max-width: 100%;
  height: auto;
  display: block;
}

.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%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-game-rules__section,
.page-game-rules__card,
.page-game-rules__container {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* Media Queries for Mobile */
@media (max-width: 1024px) {
  .page-game-rules__section-title {
    font-size: 32px;
  }
  .page-game-rules__hero-content {
    padding: 30px 15px;
  }
  .page-game-rules__main-title {
    font-size: clamp(28px, 4.5vw, 40px);
  }
  .page-game-rules__description {
    font-size: 18px;
  }
  .page-game-rules__card-grid {
    gap: 20px;
  }
  .page-game-rules__game-rules-list {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
  }
  .page-game-rules__content-wrapper {
    flex-direction: column;
    gap: 30px;
  }
  .page-game-rules__content-wrapper:nth-child(even) {
    flex-direction: column;
  }
  .page-game-rules__content-image,
  .page-game-rules__text-content {
    width: 100%;
  }
  .page-game-rules__text-content p,
  .page-game-rules__rule-details li {
    text-align: left;
  }
  .page-game-rules__cta-buttons {
    flex-direction: column;
    gap: 15px;
    padding: 0 20px;
  }
  .page-game-rules__btn-primary,
  .page-game-rules__btn-secondary {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .page-game-rules__section {
    padding: 40px 0;
  }
  .page-game-rules__container {
    padding: 0 15px;
  }
  .page-game-rules__section-title {
    font-size: 28px;
    margin-bottom: 30px;
  }
  .page-game-rules__paragraph {
    font-size: 16px;
    margin-bottom: 20px;
  }
  .page-game-rules__hero-section {
    min-height: 400px;
    padding-top: 10px;
  }
  .page-game-rules__hero-content {
    padding: 20px 10px;
  }
  .page-game-rules__main-title {
    font-size: clamp(24px, 7vw, 36px);
  }
  .page-game-rules__description {
    font-size: 16px;
  }
  .page-game-rules__card-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .page-game-rules__rule-card {
    padding: 20px;
  }
  .page-game-rules__rule-image {
    height: 200px;
  }
  .page-game-rules__rule-title {
    font-size: 20px;
  }
  .page-game-rules__rule-details li {
    font-size: 15px;
  }
  .page-game-rules__sub-title {
    font-size: 20px;
  }
  .page-game-rules__text-content p {
    font-size: 15px;
  }
  details.page-game-rules__faq-item summary.page-game-rules__faq-question { padding: 15px; }
  .page-game-rules__faq-qtext { font-size: 15px; }
  .page-game-rules__faq-toggle { font-size: 20px; width: 24px; }
  details.page-game-rules__faq-item .page-game-rules__faq-answer { padding: 0 15px 15px; }

  /* Mandatory responsive styles for images and containers */
  .page-game-rules img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-game-rules__section,
  .page-game-rules__card,
  .page-game-rules__container,
  .page-game-rules__hero-section,
  .page-game-rules__general-principles,
  .page-game-rules__specific-rules,
  .page-game-rules__dispute-resolution,
  .page-game-rules__additional-terms,
  .page-game-rules__faq-section,
  .page-game-rules__cta-section,
  .page-game-rules__card-grid,
  .page-game-rules__game-rules-list,
  .page-game-rules__content-wrapper,
  .page-game-rules__rule-card,
  .page-game-rules__text-content {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Mandatory responsive styles for 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;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-game-rules__cta-buttons,
  .page-game-rules__button-group,
  .page-game-rules__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    flex-wrap: wrap !important;
    gap: 10px;
    flex-direction: column;
  }

  /* Specific media queries for modules not present on this page, but required in CSS output */
  /* Banner __hero-section (already covered above with general hero rules) */
  /* Three-link buttons __access-links (not present on this page, general button rules apply) */
  /* Five-entry points __category-lobby (not present on this page, but if it were) */
  .page-game-rules__category-lobby__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-game-rules__category-card-link img {
    aspect-ratio: 1/1;
    width: 100%;
    object-fit: contain;
    border: none;
    box-shadow: none;
  }
  /* Blog slider __blog-slider (not present on this page, but if it were) */
  .page-game-rules__blog-slider-track {
    scroll-snap-type: x mandatory;
    overflow-x: auto;
  }
  .page-game-rules__blog-slider-track::-webkit-scrollbar {
    display: none;
  }
  .page-game-rules__post-item {
    flex: 0 0 calc(100% - 30px);
    margin-right: 15px;
    scroll-snap-align: start;
  }
  .page-game-rules__blog-slider-nav {
    display: flex;
    justify-content: center;
    margin-top: 20px;
  }
  .page-game-rules__blog-slider-prev,
  .page-game-rules__blog-slider-next {
    display: block;
  }
}

/* Ensure color contrast for specific elements */
.page-game-rules__general-principles .page-game-rules__card {
  background: #ffffff; /* Override to light background for better contrast */
  color: #333333;
}
.page-game-rules__general-principles .page-game-rules__card-title {
  color: var(--sh88-primary-color);
}
.page-game-rules__general-principles .page-game-rules__card p {
  color: #555555;
}

.page-game-rules__faq-section {
  background-color: #f0f0f0;
  color: #333333;
}
.page-game-rules__faq-section .page-game-rules__section-title {
  color: #333333;
}
.page-game-rules__faq-qtext {
  color: #333333;
}