/* style/game-rules.css */

/* Custom colors from requirements */
:root {
  --page-game-rules-bg: #08160F;
  --page-game-rules-card-bg: #11271B;
  --page-game-rules-text-main: #F2FFF6;
  --page-game-rules-text-secondary: #A7D9B8;
  --page-game-rules-border: #2E7A4E;
  --page-game-rules-glow: #57E38D;
  --page-game-rules-gold: #F2C14E;
  --page-game-rules-divider: #1E3A2A;
  --page-game-rules-deep-green: #0A4B2C;
  --page-game-rules-button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
}

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

.page-game-rules__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 20px 60px; /* Small top padding, larger bottom for content separation */
  overflow: hidden;
}

.page-game-rules__image-wrapper {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.page-game-rules__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.page-game-rules__hero-content {
  max-width: 900px;
  margin-top: 40px;
  padding: 0 20px;
}

.page-game-rules__main-title {
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 700;
  color: var(--page-game-rules-text-main);
  margin-bottom: 20px;
  line-height: 1.2;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.page-game-rules__description {
  font-size: 1.1rem;
  color: var(--page-game-rules-text-secondary);
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-game-rules__btn-primary {
  display: inline-block;
  padding: 15px 30px;
  background: var(--page-game-rules-button-gradient);
  color: var(--page-game-rules-text-main);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 50px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  border: none;
}

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

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

.page-game-rules__dark-section {
  background-color: var(--page-game-rules-card-bg);
}

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

.page-game-rules__section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  color: var(--page-game-rules-text-main);
  margin-bottom: 40px;
  font-weight: 700;
}

.page-game-rules__sub-title {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  color: var(--page-game-rules-gold);
  margin-top: 40px;
  margin-bottom: 20px;
  font-weight: 600;
}

.page-game-rules__text-block {
  font-size: 1rem;
  color: var(--page-game-rules-text-secondary);
  margin-bottom: 20px;
  text-align: left;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-game-rules__content-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  margin: 40px auto 20px auto;
  max-width: 800px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* FAQ Section */
.page-game-rules__faq-section {
  background-color: var(--page-game-rules-bg);
}

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

.page-game-rules__faq-item {
  background-color: var(--page-game-rules-card-bg);
  border: 1px solid var(--page-game-rules-border);
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  color: var(--page-game-rules-text-main);
  text-align: left;
}

.page-game-rules__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--page-game-rules-text-main);
  background-color: var(--page-game-rules-deep-green);
  border-bottom: 1px solid var(--page-game-rules-divider);
  transition: background-color 0.3s ease;
}

.page-game-rules__faq-question:hover {
  background-color: #135c36; /* Slightly darker green */
}

/* For details tag */
.page-game-rules__faq-item summary {
  list-style: none;
}

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

.page-game-rules__faq-toggle {
  font-size: 1.8rem;
  line-height: 1;
  margin-left: 15px;
  color: var(--page-game-rules-gold);
}

.page-game-rules__faq-answer {
  padding: 20px 25px;
  font-size: 1rem;
  color: var(--page-game-rules-text-secondary);
  line-height: 1.6;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

/* For details tag, the answer is shown natively */
.page-game-rules__faq-item[open] .page-game-rules__faq-answer {
  max-height: 2000px; /* Arbitrarily large value to allow content to expand */
  transition: max-height 0.5s ease-in;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .page-game-rules__hero-section {
    padding: 10px 15px 40px;
  }

  .page-game-rules__hero-content {
    margin-top: 30px;
    padding: 0 15px;
  }

  .page-game-rules__main-title {
    font-size: 2rem;
  }

  .page-game-rules__description {
    font-size: 1rem;
  }

  .page-game-rules__btn-primary {
    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 15px;
  }

  .page-game-rules__container {
    padding: 0 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

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

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

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

  /* Image responsiveness */
  .page-game-rules img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-game-rules__image-wrapper,
  .page-game-rules__hero-image,
  .page-game-rules__content-image {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* FAQ */
  .page-game-rules__faq-question {
    padding: 15px 20px;
    font-size: 1rem;
  }

  .page-game-rules__faq-toggle {
    font-size: 1.5rem;
  }

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