/* style/game-bai.css */
:root {
  --primary-color: #C61F1F;
  --secondary-color: #E53030;
  --card-bg: #2A1212;
  --background-color-page: #140C0C;
  --text-main-color: #FFF1E8;
  --border-color: #6A1E1E;
  --gold-color: #F3C54D;
  --deep-red-color: #7E0D0D;
}

.page-game-bai {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main-color); /* Main text color for the page */
  background-color: var(--background-color-page); /* Page background from custom colors */
}

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

.page-game-bai__section-title {
  font-size: 2.5em;
  color: var(--gold-color);
  text-align: center;
  margin-bottom: 20px;
  font-weight: bold;
  line-height: 1.2;
}

.page-game-bai__section-description {
  font-size: 1.1em;
  color: var(--text-main-color);
  text-align: center;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-game-bai h3 {
  font-size: 1.8em;
  color: var(--gold-color);
  margin-top: 30px;
  margin-bottom: 15px;
  line-height: 1.3;
}

.page-game-bai p {
  margin-bottom: 15px;
  color: var(--text-main-color);
}

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

.page-game-bai li {
  margin-bottom: 8px;
  color: var(--text-main-color);
}

.page-game-bai strong {
  color: var(--gold-color);
}

/* Hero Carousel Section */
.page-game-bai__hero-carousel-section {
  position: relative;
  padding-top: 10px; /* Offset for fixed header, as body handles main padding-top */
  margin-bottom: 40px;
}

.page-game-bai__hero-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.page-game-bai__hero-slide {
  display: none;
  position: relative;
  width: 100%;
}

.page-game-bai__hero-slide.is-active {
  display: block;
}

.page-game-bai__hero-slide img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.page-game-bai__hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #ffffff;
  max-width: 80%;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
}

.page-game-bai__hero-title {
  font-size: 3.2em;
  color: var(--gold-color);
  margin-bottom: 10px;
  font-weight: bold;
  line-height: 1.2;
}

.page-game-bai__hero-description {
  font-size: 1.3em;
  margin-bottom: 20px;
  color: #f0f0f0;
}

.page-game-bai__hero-button {
  display: inline-block;
  padding: 12px 30px;
  background: linear-gradient(180deg, #FFB04A 0%, #D86A14 100%);
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-game-bai__hero-button:hover {
  background: linear-gradient(180deg, #e09b3f 0%, #b85a10 100%);
}

.page-game-bai__hero-slider-prev,
.page-game-bai__hero-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  border: none;
  padding: 15px;
  cursor: pointer;
  font-size: 1.5em;
  z-index: 10;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.page-game-bai__hero-slider-prev:hover,
.page-game-bai__hero-slider-next:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.page-game-bai__hero-slider-prev {
  left: 10px;
}

.page-game-bai__hero-slider-prev::before {
  content: '‹';
}

.page-game-bai__hero-slider-next {
  right: 10px;
}

.page-game-bai__hero-slider-next::before {
  content: '›';
}

/* Guide Section (Five Cards) */
.page-game-bai__guide-section {
  padding: 40px 0;
  margin-bottom: 40px;
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.page-game-bai__guide-grid {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.page-game-bai__guide-card {
  flex: 0 0 calc(20% - 12px); /* 5 cards per row with gap */
  max-width: calc(20% - 12px);
  text-align: center;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.page-game-bai__guide-card a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.page-game-bai__guide-card img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 250 / 350; /* Fixed aspect ratio for vertical images */
  object-fit: cover;
}

/* Vertical offset for guide cards */
.page-game-bai__guide-card--pos-1 {
  padding-top: 50px;
}

.page-game-bai__guide-card--pos-2 {
  padding-top: 25px;
}

.page-game-bai__guide-card--pos-4 {
  padding-top: 25px;
}

.page-game-bai__guide-card--pos-5 {
  padding-top: 50px;
}

.page-game-bai__guide-card:hover {
  transform: translateY(-10px);
}

/* Main Content Section */
.page-game-bai__content-section {
  padding: 40px 0;
  margin-bottom: 40px;
}

.page-game-bai__home-content-box {
  max-width: 91%;
  margin: 0 auto;
  padding: 10px 16px;
  border: 5px solid var(--border-color);
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(126, 13, 13, 0.5); /* Deep Red shadow */
  height: 700px; /* Fixed height for desktop */
  background-color: var(--card-bg);
  color: var(--text-main-color);
}

.page-game-bai__home-content-inner {
  height: 100%;
  overflow-y: auto; /* Scrollable content on desktop */
  padding-right: 15px; /* Space for scrollbar */
  box-sizing: border-box;
}

/* Scrollbar styling for home-content-inner */
.page-game-bai__home-content-inner::-webkit-scrollbar {
  width: 8px;
}

.page-game-bai__home-content-inner::-webkit-scrollbar-track {
  background: var(--card-bg);
  border-radius: 10px;
}

.page-game-bai__home-content-inner::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

.page-game-bai__home-content-inner::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* Game Showcase Section */
.page-game-bai__game-showcase-section {
  padding: 40px 0;
  margin-bottom: 40px;
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

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

.page-game-bai__game-card {
  background-color: #2A1212; /* Using card-bg */
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  text-align: center;
  padding-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.page-game-bai__game-trial-frame {
  border: none;
  width: 100%;
  height: 300px;
  display: block;
  margin-bottom: 15px;
}

.page-game-bai__game-title {
  font-size: 1.5em;
  color: var(--gold-color);
  margin-bottom: 15px;
  padding: 0 15px;
}

/* Blog Section */
.page-game-bai__blog-section {
  padding: 40px 0;
  margin-bottom: 40px;
}

.page-game-bai__blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 cards per row */
  gap: 30px;
}

.page-game-bai__blog-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.page-game-bai__blog-card:hover {
  transform: translateY(-5px);
}

.page-game-bai__blog-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-game-bai__blog-image {
  width: 100%;
  height: 200px; /* Fixed height for blog images */
  object-fit: cover;
  display: block;
}

.page-game-bai__blog-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.page-game-bai__blog-title {
  font-size: 1.4em;
  color: var(--gold-color);
  margin-bottom: 10px;
  line-height: 1.3;
}

.page-game-bai__blog-meta {
  font-size: 0.9em;
  color: #aaa;
  margin-bottom: 10px;
}

.page-game-bai__blog-excerpt {
  font-size: 1em;
  color: var(--text-main-color);
  flex-grow: 1;
}

/* CTA Section */
.page-game-bai__cta-section {
  padding: 60px 0;
  text-align: center;
  background-color: var(--deep-red-color); /* Deep Red background for contrast */
  color: #ffffff; /* White text for contrast */
  border-top: 1px solid var(--border-color);
}

.page-game-bai__cta-section .page-game-bai__section-title,
.page-game-bai__cta-section .page-game-bai__section-description {
  color: #ffffff; /* Ensure white text on dark background */
}

.page-game-bai__cta-group {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.page-game-bai__cta-group--center {
  margin-top: 40px;
}

.page-game-bai__cta-button {
  display: inline-block;
  padding: 14px 35px;
  background: linear-gradient(180deg, #FFB04A 0%, #D86A14 100%);
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  font-size: 1.1em;
  transition: background 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-game-bai__cta-button:hover {
  background: linear-gradient(180deg, #e09b3f 0%, #b85a10 100%);
  transform: translateY(-2px);
}

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

.page-game-bai__btn-primary:hover {
  background: linear-gradient(180deg, #e09b3f 0%, #b85a10 100%);
}

.page-game-bai__btn-secondary {
  background: transparent;
  color: var(--gold-color);
  border: 2px solid var(--gold-color);
}

.page-game-bai__btn-secondary:hover {
  background: rgba(243, 197, 77, 0.1);
  color: #ffffff;
}

/* General image styling */
.page-game-bai img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-game-bai__hero-title {
    font-size: 2.5em;
  }

  .page-game-bai__hero-description {
    font-size: 1.1em;
  }

  .page-game-bai__guide-card {
    flex: 0 0 calc(33.333% - 10px); /* 3 cards per row */
    max-width: calc(33.333% - 10px);
  }

  .page-game-bai__guide-card--pos-1, .page-game-bai__guide-card--pos-5,
  .page-game-bai__guide-card--pos-2, .page-game-bai__guide-card--pos-4 {
    padding-top: 0;
  }

  .page-game-bai__blog-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 cards per row */
  }
}

@media (max-width: 768px) {
  .page-game-bai__container {
    padding: 0 10px;
  }

  .page-game-bai__section-title {
    font-size: 2em;
  }

  .page-game-bai h3 {
    font-size: 1.5em;
  }

  /* Hero Carousel Section - Mobile */
  .page-game-bai__hero-carousel-section {
    padding-top: 10px !important;
    margin-bottom: 20px;
  }

  .page-game-bai__hero-content {
    max-width: 90%;
    padding: 15px;
  }

  .page-game-bai__hero-title {
    font-size: 1.8em;
    line-height: 1.3;
  }

  .page-game-bai__hero-description {
    font-size: 1em;
    margin-bottom: 15px;
  }

  .page-game-bai__hero-button {
    padding: 10px 20px;
    font-size: 1em;
  }

  .page-game-bai__hero-slider-prev,
  .page-game-bai__hero-slider-next {
    width: 40px;
    height: 40px;
    padding: 10px;
    font-size: 1.2em;
  }

  /* Guide Section - Mobile (上二下三) */
  .page-game-bai__guide-section {
    padding: 20px 0;
    margin-bottom: 20px;
  }

  .page-game-bai__guide-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* Base grid for flexible column spans */
    gap: 10px;
  }

  .page-game-bai__guide-card {
    padding-top: 0 !important; /* Reset padding for mobile */
    flex: none; /* Remove flex sizing */
    max-width: 100%;
  }

  .page-game-bai__guide-card--pos-1,
  .page-game-bai__guide-card--pos-2 {
    grid-column: span 3; /* First two cards span 3 columns each (2 per row) */
  }

  .page-game-bai__guide-card--pos-3,
  .page-game-bai__guide-card--pos-4,
  .page-game-bai__guide-card--pos-5 {
    grid-column: span 2; /* Last three cards span 2 columns each (3 per row) */
  }

  .page-game-bai__guide-card img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Main Content Section - Mobile */
  .page-game-bai__content-section {
    padding: 20px 0;
    margin-bottom: 20px;
  }

  .page-game-bai__home-content-box {
    max-width: 100%;
    height: auto; /* Auto height for mobile */
    padding: 10px;
  }

  .page-game-bai__home-content-inner {
    height: auto; /* Auto height for mobile */
    overflow: visible; /* No scrollbar for mobile */
    padding-right: 0;
  }

  /* Game Showcase Section - Mobile */
  .page-game-bai__game-showcase-section {
    padding: 20px 0;
    margin-bottom: 20px;
  }

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

  /* Blog Section - Mobile */
  .page-game-bai__blog-section {
    padding: 20px 0;
    margin-bottom: 20px;
  }

  .page-game-bai__blog-grid {
    grid-template-columns: 1fr; /* 1 card per row */
    gap: 20px;
  }

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

  /* CTA Section - Mobile */
  .page-game-bai__cta-section {
    padding: 40px 0;
  }

  .page-game-bai__cta-group {
    flex-direction: column;
    gap: 15px;
    padding: 0 15px;
  }

  .page-game-bai__cta-button,
  .page-game-bai__btn-primary,
  .page-game-bai__btn-secondary,
  .page-game-bai a[class*="button"],
  .page-game-bai 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;
  }

  /* General image and container responsiveness for mobile */
  .page-game-bai img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-game-bai__section,
  .page-game-bai__card,
  .page-game-bai__container,
  .page-game-bai__cta-buttons,
  .page-game-bai__button-group,
  .page-game-bai__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-game-bai__cta-group {
    flex-wrap: wrap !important;
  }
}

@media (max-width: 480px) {
  .page-game-bai__hero-title {
    font-size: 1.5em;
  }
  .page-game-bai__hero-description {
    font-size: 0.9em;
  }
  .page-game-bai__guide-grid {
    grid-template-columns: 1fr; /* Single column for very small screens */
  }
  .page-game-bai__guide-card--pos-1,
  .page-game-bai__guide-card--pos-2,
  .page-game-bai__guide-card--pos-3,
  .page-game-bai__guide-card--pos-4,
  .page-game-bai__guide-card--pos-5 {
    grid-column: span 6; /* All cards span full width */
  }
  .page-game-bai__blog-grid {
    grid-template-columns: 1fr;
  }
}