/* style/game-rules.css */
/* 
 * Body padding-top is handled by shared.css for --header-offset.
 * This page should NOT add additional padding-top using --header-offset.
 */

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

/* General styles for the page content */
.page-game-rules {
  font-family: 'Arial', sans-serif;
  color: var(--text-main); /* Default text color for the page */
  background-color: var(--background-color-page); /* Page background from custom palette */
  line-height: 1.6;
  padding-bottom: 40px; /* Ensure space before footer */
}

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

/* Hero Section */
.page-game-rules__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding-bottom: 60px; /* Space between image and content */
  padding-top: 10px; /* Small top padding, body handles header offset */
  background-color: var(--background-color-page); /* Ensure consistent background */
}

.page-game-rules__hero-image-wrapper {
  width: 100%;
  max-width: 1920px; /* Max width for the image */
  margin-bottom: 40px; /* Space between image and text */
  position: relative;
  z-index: 1; /* Ensure image is below any potential overlay (though none should exist) */
}

.page-game-rules__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  min-height: 200px; /* Minimum image size */
}

.page-game-rules__hero-content {
  position: relative; /* Not absolutely positioned to overlap image */
  z-index: 2;
  max-width: 800px;
  padding: 0 20px;
  box-sizing: border-box;
}

.page-game-rules__main-title {
  font-size: clamp(2.2rem, 4vw, 3.5rem); /* Responsive font size */
  color: var(--text-main);
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: 20px;
}

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

.page-game-rules__cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

.page-game-rules__btn-primary,
.page-game-rules__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Allow long words to break */
  box-sizing: border-box;
  max-width: 100%; /* Ensure button doesn't overflow */
}

.page-game-rules__btn-primary {
  background: var(--button-gradient);
  color: #ffffff; /* White text on dark gradient */
  border: none;
}

.page-game-rules__btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.page-game-rules__btn-secondary {
  background: transparent;
  color: var(--main-color); /* Green text */
  border: 2px solid var(--border-color); /* Green border */
}

.page-game-rules__btn-secondary:hover {
  background: var(--main-color);
  color: #ffffff;
}

/* Section general styles */
.page-game-rules__section {
  padding: 60px 0;
  background-color: var(--card-bg); /* Dark green background for sections */
  color: var(--text-main); /* Light text on dark background */
  margin-bottom: 20px;
}

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

.page-game-rules__section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  color: var(--gold-color); /* Gold color for section titles */
  text-align: center;
  margin-bottom: 40px;
  font-weight: bold;
}

.page-game-rules__sub-title {
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  color: var(--main-color); /* Main green for sub-titles */
  margin-top: 30px;
  margin-bottom: 20px;
  font-weight: bold;
}

.page-game-rules__heading-small {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  color: var(--text-main); /* Main text color for smaller headings */
  margin-top: 25px;
  margin-bottom: 15px;
  font-weight: 600;
}

.page-game-rules p {
  margin-bottom: 15px;
  font-size: 1rem;
  color: var(--text-main);
}

.page-game-rules p a {
  color: var(--glow-color); /* Green link color */
  text-decoration: underline;
}

.page-game-rules ul {
  list-style-type: disc;
  margin-left: 20px;
  margin-bottom: 15px;
  color: var(--text-main);
}

.page-game-rules li {
  margin-bottom: 8px;
  font-size: 1rem;
  color: var(--text-main);
}

/* Image specific styles */
.page-game-rules__image-wrapper {
  margin: 30px 0;
  text-align: center;
}

.page-game-rules__content-image {
  width: 100%;
  height: auto;
  max-width: 800px; /* Constrain content images */
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  min-width: 200px; /* Minimum image size */
  min-height: 200px;
}

/* FAQ Section */
.page-game-rules__faq {
  background-color: var(--background-color-page);
  padding: 60px 0;
  color: var(--text-main);
}

.page-game-rules__faq-list {
  max-width: 900px;
  margin: 0 auto;
}

.page-game-rules__faq-item {
  background-color: var(--card-bg); /* Dark green background for FAQ items */
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  color: var(--text-main);
}

.page-game-rules__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--text-main);
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--divider-color); /* Subtle divider */
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none;   /* Safari */
  -khtml-user-select: none;    /* Konqueror HTML */
  -moz-user-select: none;      /* Old versions of Firefox */
  -ms-user-select: none;       /* Internet Explorer/Edge */
  user-select: none;           /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */
}

.page-game-rules__faq-item[open] .page-game-rules__faq-question {
  border-bottom: 1px solid var(--border-color); /* Active border */
}

.page-game-rules__faq-question::-webkit-details-marker, /* Hide default marker */
.page-game-rules__faq-question::marker {
  display: none;
}

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

.page-game-rules__faq-toggle {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--glow-color); /* Green toggle icon */
}

.page-game-rules__faq-answer {
  padding: 0 20px 20px;
  font-size: 1rem;
  color: var(--text-secondary); /* Lighter text for answers */
}

.page-game-rules__faq-answer p {
  margin-bottom: 10px;
}

.page-game-rules__faq-answer a {
  color: var(--glow-color);
  text-decoration: underline;
}

/* Responsive styles */
@media (max-width: 1024px) {
  .page-game-rules__hero-content {
    padding: 0 30px;
  }
}

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

  .page-game-rules__hero-section {
    padding-bottom: 40px;
    padding-top: 10px !important; /* body handles --header-offset, this is small decoration */
  }

  .page-game-rules__main-title {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
    margin-bottom: 15px;
  }

  .page-game-rules__description {
    font-size: 1rem;
    margin-bottom: 25px;
  }

  .page-game-rules__cta-buttons {
    flex-direction: column;
    gap: 15px;
    padding: 0 15px; /* Add padding to container of buttons */
  }

  .page-game-rules__btn-primary,
  .page-game-rules__btn-secondary {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 20px;
    font-size: 1rem;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

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

  .page-game-rules__section-title {
    font-size: clamp(1.5rem, 7vw, 2rem);
    margin-bottom: 30px;
  }

  .page-game-rules__sub-title {
    font-size: clamp(1.2rem, 6vw, 1.8rem);
    margin-top: 25px;
    margin-bottom: 15px;
  }

  .page-game-rules__heading-small {
    font-size: clamp(1.1rem, 5vw, 1.5rem);
    margin-top: 20px;
    margin-bottom: 10px;
  }

  /* Mobile image responsiveness */
  .page-game-rules img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
    min-width: 200px;
    min-height: 200px;
  }
  
  .page-game-rules__section,
  .page-game-rules__card,
  .page-game-rules__container,
  .page-game-rules__image-wrapper,
  .page-game-rules__faq-list {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

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

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