.page-game-rules {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-main, #333333);
  background-color: var(--background-color, #F5F7FA);
}

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

.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, body handles header offset */
  min-height: 500px;
}

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

.page-game-rules__hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.5); /* Darken image for text readability */
}

.page-game-rules__hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  color: #ffffff;
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.4); /* Semi-transparent overlay for text */
  border-radius: 8px;
}

.page-game-rules__main-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
}

.page-game-rules__intro-text {
  font-size: 1.1rem;
  margin-bottom: 30px;
  color: #f0f0f0;
}

.page-game-rules__cta-button {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-game-rules__btn-primary {
  background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%);
  color: #ffffff;
  border: none;
}

.page-game-rules__btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  opacity: 0.9;
}

.page-game-rules__btn-secondary {
  background: #ffffff;
  color: #E53935;
  border: 2px solid #E53935;
}

.page-game-rules__btn-secondary:hover {
  background: #f0f0f0;
  color: #FF5A4F;
  border-color: #FF5A4F;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

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

.page-game-rules__section-title {
  font-size: 2.2rem;
  margin-bottom: 30px;
  color: #E53935;
  font-weight: 700;
}

.page-game-rules__sub-title {
  font-size: 1.8rem;
  margin-top: 40px;
  margin-bottom: 20px;
  color: #E53935;
  font-weight: 600;
}

.page-game-rules__text-block {
  font-size: 1.05rem;
  margin-bottom: 20px;
  color: var(--text-main, #333333);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-game-rules__link {
  color: #E53935;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.page-game-rules__link:hover {
  color: #FF5A4F;
  text-decoration: underline;
}

/* Background Colors */
.page-game-rules__dark-section {
  background-color: #E53935;
  color: #ffffff;
}

.page-game-rules__dark-section .page-game-rules__section-title,
.page-game-rules__dark-section .page-game-rules__sub-title,
.page-game-rules__dark-section .page-game-rules__text-block {
  color: #ffffff;
}

.page-game-rules__light-bg {
  background-color: #F5F7FA;
  color: var(--text-main, #333333);
}

.page-game-rules__card {
  background-color: #FFFFFF;
  color: var(--text-main, #333333);
  border: 1px solid #E0E0E0;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Grid Layout for sections */
.page-game-rules__grid-layout {
  display: flex;
  align-items: center;
  gap: 40px;
  text-align: left;
}

.page-game-rules__grid-layout--reverse {
  flex-direction: row-reverse;
}

.page-game-rules__content-block,
.page-game-rules__image-block {
  flex: 1;
}

.page-game-rules__image-item {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

/* Game Cards */
.page-game-rules__game-cards-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-game-rules__game-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.page-game-rules__card-title {
  font-size: 1.4rem;
  color: #E53935;
  margin-bottom: 15px;
  font-weight: 600;
}

.page-game-rules__card-text {
  font-size: 0.95rem;
  color: var(--text-main, #333333);
  flex-grow: 1;
  margin-bottom: 20px;
}

/* FAQ Section */
.page-game-rules__faq-list {
  margin-top: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-game-rules__faq-item {
  background-color: #FFFFFF;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  text-align: left;
}

.page-game-rules__faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.15rem;
  font-weight: 600;
  color: #E53935;
  cursor: pointer;
  list-style: none;
  outline: none;
}

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

.page-game-rules__faq-question:hover {
  background-color: #FFF3F3; /* Light hover effect */
}

.page-game-rules__faq-qtext {
  flex-grow: 1;
  padding-right: 15px;
}

.page-game-rules__faq-toggle {
  font-size: 1.5rem;
  line-height: 1;
  color: #E53935;
  transition: transform 0.3s ease;
}

.page-game-rules__faq-item[open] .page-game-rules__faq-toggle {
  transform: rotate(45deg); /* Change + to X or similar */
}

.page-game-rules__faq-answer {
  padding: 0 25px 20px;
  font-size: 1rem;
  color: var(--text-main, #333333);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-game-rules__grid-layout {
    flex-direction: column;
    text-align: center;
  }

  .page-game-rules__grid-layout--reverse {
    flex-direction: column;
  }

  .page-game-rules__image-block {
    order: -1; /* Move image above content for better flow on smaller screens */
  }

  .page-game-rules__section-title {
    font-size: 1.8rem;
  }

  .page-game-rules__sub-title {
    font-size: 1.5rem;
  }

  .page-game-rules__main-title {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
  }
}

@media (max-width: 768px) {
  .page-game-rules {
    font-size: 16px;
    line-height: 1.6;
  }

  .page-game-rules__container {
    padding: 15px;
  }

  .page-game-rules__hero-section {
    padding: 40px 15px;
    padding-top: 10px !important;
    min-height: 400px;
  }

  .page-game-rules__hero-content {
    padding: 15px;
  }

  .page-game-rules__main-title {
    font-size: clamp(1.5rem, 7vw, 2.2rem);
    margin-bottom: 15px;
  }

  .page-game-rules__intro-text {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  .page-game-rules__cta-button {
    padding: 12px 25px;
    font-size: 1rem;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

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

  .page-game-rules__section-title {
    font-size: 1.6rem;
    margin-bottom: 20px;
  }

  .page-game-rules__sub-title {
    font-size: 1.3rem;
    margin-top: 30px;
    margin-bottom: 15px;
  }

  .page-game-rules__text-block {
    font-size: 0.95rem;
  }

  /* Image responsiveness */
  .page-game-rules img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-game-rules__image-block,
  .page-game-rules__game-card,
  .page-game-rules__card,
  .page-game-rules__section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important; /* Ensure no overflow */
  }

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

  .page-game-rules__card-image {
    height: 180px;
  }

  .page-game-rules__faq-item summary {
    padding: 15px 20px;
    font-size: 1rem;
  }

  .page-game-rules__faq-answer {
    padding: 0 20px 15px;
    font-size: 0.9rem;
  }
}

/* Ensure no CSS filter on images */
.page-game-rules img {
  filter: none; /* Reset any potential filter */
}

/* Specific adjustment for hero image filter to ensure text contrast */
.page-game-rules__hero-image {
  filter: brightness(0.5);
}