/* =========================================== */
/*    HOME PAGE - CLEAN DASHBOARD THEME        */
/* =========================================== */

/* Site purpose — hero band + cards (readability + audit copy) */
.home-intro {
  padding: 0;
}

.home-intro-surface {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    165deg,
    rgba(108, 93, 211, 0.09) 0%,
    rgba(245, 246, 250, 0.95) 42%,
    var(--color-bg-primary) 100%
  );
  border-bottom: 1px solid rgba(108, 93, 211, 0.06);
  padding: clamp(1.1rem, 4vw, 1.8rem) 0;
}

.home-intro-inner {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
}

.home-intro-slogan {
  margin: 0 0 1rem;
  text-align: center;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.2;
  font-weight: 800;
  color: var(--color-text-primary, #fff);
  letter-spacing: -0.02em;
}

.home-intro-hero {
  text-align: left;
  max-width: 42rem;
}

.home-intro-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5a4cb4;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.85rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(108, 93, 211, 0.2);
  border-radius: var(--radius-full);
  box-shadow: 0 1px 3px rgba(17, 20, 45, 0.06);
}

.home-intro-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-secondary, #ff754c);
  flex-shrink: 0;
}

.home-intro-heading {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 0.65rem;
  color: #3c22cd;
  letter-spacing: -0.02em;
}

.home-intro-brand {
  font-weight: 800;
  color: #2d1a9e;
}

.home-intro-purpose {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--color-text-primary);
  margin: 0;
  max-width: 38rem;
}

/* Meta / SEO paragraph — contained “info strip”, not a grey wall */
.home-intro-meta-wrap {
  margin-top: 0;
  padding: 1rem 1.15rem;
  background:
    radial-gradient(circle at 0% 0%, rgba(108, 93, 211, 0.18), rgba(108, 93, 211, 0) 55%),
    linear-gradient(180deg, rgba(108, 93, 211, 0.06), rgba(255, 255, 255, 0.97));
  border: 1px solid rgba(108, 93, 211, 0.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  box-shadow: 0 4px 20px rgba(17, 20, 45, 0.05);
  width: min(760px, 100%);
  margin-left: auto;
  margin-right: auto;
  position: relative;
  overflow: hidden;
}

.home-intro-meta-wrap::before {
  content: "";
  position: absolute;
  left: -48px;
  top: -48px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle at center, rgba(108, 93, 211, 0.28), rgba(108, 93, 211, 0) 62%);
  pointer-events: none;
}

.home-intro-meta-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(108, 93, 211, 0.0), rgba(108, 93, 211, 0.35), rgba(108, 93, 211, 0.0));
  pointer-events: none;
}

.home-intro-meta-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6c5dd3;
  margin: 0 0 0.55rem;
  line-height: 1.2;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(108, 93, 211, 0.08);
  border: 1px solid rgba(108, 93, 211, 0.16);
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.home-intro-meta-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary, #6c5dd3);
  box-shadow: 0 0 0 4px rgba(108, 93, 211, 0.12);
  flex-shrink: 0;
}

.home-intro-lead {
  font-size: 0.93rem;
  line-height: 1.6;
  color: #4a4d66;
  margin: 0;
  max-width: 72ch;
  overflow-wrap: anywhere;
  width: 100%;
  position: relative;
  z-index: 1;
  font-weight: 500;
}

/* Long-form copy — elevated card */
.home-site-purpose {
  margin-top: 1.25rem;
  padding: 1.35rem 1.4rem;
  text-align: left;
  background: var(--color-bg-card);
  border: 1px solid rgba(108, 93, 211, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(17, 20, 45, 0.06);
}

.home-site-purpose-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 1rem;
  line-height: 1.3;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(228, 228, 228, 0.9);
}

.home-site-purpose-title i {
  color: #6c5dd3;
  font-size: 1.1rem;
  opacity: 0.95;
}

.home-site-purpose-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.home-site-purpose-body p {
  font-size: 0.9375rem;
  line-height: 1.68;
  color: #4a4d66;
  margin: 0;
}

.home-site-purpose a {
  color: #5a4cb4;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(90, 76, 180, 0.35);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.home-site-purpose a:hover {
  color: #3c22cd;
  border-bottom-color: rgba(60, 34, 205, 0.55);
}

.home-site-name {
  font-weight: 700;
  color: var(--color-text-primary);
}

@media (max-width: 640px) {
  .home-intro-eyebrow {
    font-size: 0.65rem;
    padding: 0.3rem 0.65rem;
    letter-spacing: 0.03em;
  }

  .home-intro-meta-wrap {
    padding: 0.85rem 0.9rem;
    gap: 0.35rem;
  }

  .home-intro-meta-label {
    font-size: 0.66rem;
    padding: 0.28rem 0.65rem;
    margin-bottom: 0.45rem;
  }

  .home-intro-meta-wrap::before {
    left: -56px;
    top: -56px;
    width: 140px;
    height: 140px;
  }

  .home-intro-lead {
    font-size: 0.82rem;
    line-height: 1.55;
  }

  .home-site-purpose {
    padding: 1.1rem 1rem;
  }
}

/* 1. PAGE HEADER */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  position: relative;
  padding: 0;
}

.page-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0;
  color: #3c22cd;
  background: none;
  -webkit-text-fill-color: initial;
  text-shadow: none;
}

.module-header-actions {
  margin-left: auto;
  white-space: nowrap;
}

.module-link-more {
  display: inline-block;
  padding: 6px 16px;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition-fast);
}

.module-link-more:hover {
  background: var(--color-primary-hover);
}

.page-header-desc {
  margin-top: 8px;
  margin-bottom: var(--spacing-xl);
}

/* Header Search Input */
.header-search-container {
    display: flex;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    width: 300px;
}

.search-input-wrapper input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border-radius: 20px;
    border: 1px solid #e4e4e4;
    background: #ffffff;
    font-size: 0.9rem;
    color: var(--color-text-primary);
    transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(108, 93, 211, 0.1);
}

.search-input-wrapper .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #808191;
    pointer-events: auto;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}

.search-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(108, 93, 211, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 700px;
    width: 100%;
}

.no-results-container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 700px;
    width: 100%;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* 2. SECTION TITLES AND STYLES */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-lg);
  text-align: left;
  position: relative;
  padding-bottom: 0;
  color: var(--color-text-primary);
  text-shadow: none;
}

.section-title::after {
  display: none;
}

/* 3. SECTION STYLING */
.section-introduction,
.section-featured,
.section-arcade,
.section-multiplayer,
.section-strategy,
.section-idle-games,
.section-casual-games,
.section-all-games,
.section-popular-categories,
.section-about-platform {
  padding: 0 0 var(--spacing-2xl);
  background: transparent; /* Let body background show */
  border: none;
}

/* 4. FILTER CONTROLS */
.filter-controls {
  display: none; /* Hide old filter controls if present */
}

/* 5. GAME GRID AND CARDS */
.section-main-games {
  /* Default accents (used by featured/secondary + periodic accents) */
  --featured-rgb: 108, 93, 211; /* purple */
  --secondary-rgb: 63, 140, 255; /* blue */
  --accent3-rgb: 40, 167, 69; /* green */
}

.section-main-games--theme-0 {
  --featured-rgb: 108, 93, 211;
  --secondary-rgb: 63, 140, 255;
  --accent3-rgb: 40, 167, 69;
}

.section-main-games--theme-1 {
  --featured-rgb: 255, 77, 154; /* pink */
  --secondary-rgb: 0, 194, 179; /* teal */
  --accent3-rgb: 255, 117, 76; /* orange */
}

.section-main-games--theme-2 {
  --featured-rgb: 0, 163, 255; /* cyan */
  --secondary-rgb: 123, 97, 255; /* violet */
  --accent3-rgb: 181, 247, 0; /* lime */
}

.grid-games {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* Force 5 columns */
  gap: 24px;
}

/* Second module: alternate but stable spacing/ratios (no grid count change) */
.section-main-games--second .grid-games {
  gap: 18px;
}

.section-main-games--second .container-image {
  padding-bottom: 68%;
}

.section-main-games--second .container-game-info {
  padding: 8px 12px;
  gap: 2px;
}

.section-main-games--second .title-game {
  font-size: 0.98rem;
  font-weight: 800;
}

.section-main-games--second .brief-comment-game {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Mosaic layout: multi-column flow (puzzle-like) */
.grid-games--mosaic {
  /* Keep the main grid columns; vary card heights for a mosaic feel */
  display: grid;
  grid-auto-flow: row dense;
}

.grid-games--mosaic .card-game {
  width: 100%;
  break-inside: auto;
  margin: 0;
  background: rgba(255, 255, 255, 0.96);
  border-width: 1px;
  border-color: rgba(0, 0, 0, 0.04);
  box-shadow: 0 10px 24px rgba(17, 20, 45, 0.06);
  border-radius: 16px;
  height: auto;
}

/* Default mosaic image height (overrides the aspect-ratio padding) */
.grid-games--mosaic .container-image {
  padding-bottom: 0;
  height: 190px;
  margin: 0;
  width: 100%;
}

.grid-games--mosaic .brief-comment-game {
  -webkit-line-clamp: 1;
}

.grid-games--mosaic .card-game:hover {
  border-radius: 16px;
}

/* Responsive adjustments for the grid */
@media (max-width: 1200px) {
  .grid-games {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 992px) {
  .grid-games {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .section-main-games .grid-games,
  .section-tag-games .grid-games {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .container {
      padding: 0 20px;
  }

  .card-game {
      border-radius: 8px;
  }

  .container-image {
      margin: 1px;
      width: calc(100% - 2px);
      border-radius: 6px;
  }

  .container-game-info {
      padding: 8px 6px;
      gap: 2px;
  }

  .title-game {
      font-size: 0.9rem;
      margin-bottom: 0;
      line-height: 1.3;
  }

  .container-game-info .game-star {
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      white-space: nowrap;
      font-size: 0.78rem;
      line-height: 1;
  }

  .container-game-info .game-star i,
  .container-game-info .game-star span,
  .container-game-info .game-star .star-icon {
      flex-shrink: 0;
  }

  
  .game-genre-text {
      font-size: 9px;
  }

  /* Extra reductions */
  .section-introduction,
  .section-featured,
  .section-arcade,
  .section-multiplayer,
  .section-strategy,
  .section-idle-games,
  .section-casual-games,
  .section-all-games,
  .section-popular-categories,
  .section-about-platform {
    padding-bottom: 15px;
  }
  
  .page-header {
      flex-wrap: nowrap; /* 防止换行 */
      gap: 10px;
  }
  
  .page-header h2 {
      white-space: nowrap; /* 强制标题不换行 */
      font-size: 1.1rem;
  }

  .search-input-wrapper {
      width: 150px; /* 移动端减小搜索框宽度 */
  }

  .search-input-wrapper input {
      padding: 8px 32px 8px 12px;
      font-size: 0.8rem;
  }

  .search-input-wrapper .search-icon {
      right: 12px;
      font-size: 12px;
  }

  .section-title {
      margin-bottom: 8px;
      font-size: 1.1rem;
  }

  .pagination-container {
      margin-top: 20px;
      gap: 4px;
  }

  .pagination-btn {
      min-width: 32px;
      height: 32px;
      font-size: 14px;
  }
}

@media (max-width: 480px) {
  .section-main-games .grid-games,
  .section-tag-games .grid-games {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* Module header spacing (keep consistent across modules) */
.module-description {
  margin-top: 6px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  max-width: 78ch;
}
/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding-bottom: 20px;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-card);
    color: var(--color-text-primary);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.pagination-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--color-bg-tertiary);
}

/* 6. GAME CARD COMPONENT */
.card-game {
  background: transparent; /* Remove white background */
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  border: 4px solid transparent; /* Prepare for border */
  cursor: pointer;
  box-shadow: none; /* Remove shadow */
  height: 100%;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  position: relative;
  padding: 0; /* Remove padding to make content touch borders */
}

.card-game:hover {
  transform: none; /* Remove lift animation */
  box-shadow: none; /* Remove shadow */
  border-color: #c8c1f1; /* Add border color on hover */
  border-radius: 20px; /* Ensure 20px border radius matches radius-lg */
}

.card-game::before {
  display: none;
}

/* Featured / Secondary cards inside each module grid */
.card-game--featured {
  grid-column: span 1; /* keep grid density; featured is visual, not layout */
}

.card-game--secondary {
  grid-column: span 1;
}

.card-game--featured:not(.card-game--mosaic-tall):not(.card-game--mosaic-wide) .container-image {
  padding-bottom: 75%;
}

.card-game--secondary:not(.card-game--mosaic-tall):not(.card-game--mosaic-wide) .container-image {
  padding-bottom: 75%;
}

/* Mosaic ratio variations (affects card height in column flow) */
.card-game--mosaic-tall .container-image {
  padding-bottom: 0;
  height: 190px;
}

.card-game--mosaic-wide .container-image {
  padding-bottom: 0;
  height: 190px;
}

.card-game--featured .container-game-info {
  padding: 12px 16px;
  gap: 3px;
  background: linear-gradient(
    180deg,
    rgba(var(--featured-rgb), 0.06) 0%,
    rgba(var(--featured-rgb), 0.02) 100%
  );
  border-top: 1px solid rgba(var(--featured-rgb), 0.12);
}

.card-game--featured .title-game {
  font-size: 1.06rem;
  font-weight: 800;
  white-space: nowrap;
}

.card-game--featured:hover {
  border-color: rgba(var(--featured-rgb), 0.55);
}

.card-game--featured {
  border-color: rgba(var(--featured-rgb), 0.28);
  box-shadow: 0 10px 28px rgba(var(--featured-rgb), 0.12);
  border-radius: var(--radius-lg);
}

.card-game--featured .container-image::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 52%;
  background: linear-gradient(
    180deg,
    rgba(var(--featured-rgb), 0) 0%,
    rgba(var(--featured-rgb), 0.18) 55%,
    rgba(var(--featured-rgb), 0.26) 100%
  );
  pointer-events: none;
}

.card-game--featured .container-image::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(var(--featured-rgb), 0.95);
  box-shadow: 0 0 0 6px rgba(var(--featured-rgb), 0.14);
  pointer-events: none;
}

.card-game--secondary {
  border-color: rgba(var(--secondary-rgb), 0.18);
}

.card-game--secondary:hover {
  border-color: rgba(var(--secondary-rgb), 0.35);
}

.card-game--secondary .title-game {
  color: rgba(var(--secondary-rgb), 0.95);
}

.card-game--secondary .container-game-info {
  background: linear-gradient(
    180deg,
    rgba(var(--secondary-rgb), 0.05) 0%,
    rgba(var(--secondary-rgb), 0.015) 100%
  );
  border-top: 1px solid rgba(var(--secondary-rgb), 0.11);
}

.card-game--secondary .container-image::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44%;
  background: linear-gradient(
    180deg,
    rgba(var(--secondary-rgb), 0) 0%,
    rgba(var(--secondary-rgb), 0.14) 55%,
    rgba(var(--secondary-rgb), 0.18) 100%
  );
  pointer-events: none;
}

.card-game--secondary .container-image::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(var(--secondary-rgb), 0.95);
  box-shadow: 0 0 0 5px rgba(var(--secondary-rgb), 0.12);
  pointer-events: none;
}

/* Accent card (mosaic-accent) - template-driven, not nth-child repeat */
.card-game--mosaic-accent {
  border-color: rgba(var(--accent3-rgb), 0.22);
  box-shadow: 0 10px 28px rgba(var(--accent3-rgb), 0.10);
  border-radius: var(--radius-lg);
}

.card-game--mosaic-accent .title-game {
  color: rgba(var(--accent3-rgb), 0.95);
  font-weight: 700;
}

.card-game--mosaic-accent .container-image {
  padding-bottom: 0;
  height: 190px;
}

.card-game--mosaic-accent .container-image::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background: linear-gradient(
    180deg,
    rgba(var(--accent3-rgb), 0) 0%,
    rgba(var(--accent3-rgb), 0.16) 55%,
    rgba(var(--accent3-rgb), 0.22) 100%
  );
  pointer-events: none;
}

.card-game--mosaic-accent .container-image::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(var(--accent3-rgb), 0.95);
  box-shadow: 0 0 0 5px rgba(var(--accent3-rgb), 0.12);
  pointer-events: none;
}

@media (max-width: 768px) {
  .card-game--featured {
    grid-column: span 1;
  }

  .card-game--featured .container-image {
    padding-bottom: 75%;
  }

  .card-game--secondary .container-image {
    padding-bottom: 75%;
  }

  /* On small screens, normalize mosaic ratios to keep layout readable */
  .card-game--mosaic-tall .container-image {
    padding-bottom: 0;
    height: 170px;
  }

  .card-game--mosaic-wide .container-image {
    padding-bottom: 0;
    height: 150px;
  }

  .card-game--mosaic-accent .container-image {
    padding-bottom: 0;
    height: 160px;
  }
}

.container-image {
  position: relative;
  width: 100%;
  padding-bottom: 75%; /* 4:3 Aspect Ratio */
  min-height: 0;
  max-height: none;
  overflow: hidden;
  border-radius: 16px; /* Slightly smaller radius for inner image */
  margin: 4px; /* Space for the border */
  width: calc(100% - 8px); /* Adjust width to account for margin */
}

.game-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.container-game-info {
  /* Standard info block below image (masonry-friendly) */
  margin-top: 0;
  margin-left: 0;
  margin-right: 0;
  padding: 10px 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: none;
  border-radius: 0;
  position: static;
  z-index: auto;
}

/* Mosaic variety: different overlay depths */
.card-game--mosaic-tall .container-game-info {
  margin-top: 0;
}

.card-game--mosaic-wide .container-game-info {
  margin-top: 0;
}

.card-game--mosaic-accent .container-game-info {
  margin-top: 0;
  background: rgba(var(--accent3-rgb), 0.045);
}

.title-game {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: left;
  line-height: 1.4;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Keep grid density; reduce text height for non-featured cards */
.card-game:not(.card-game--featured) .brief-comment-game {
  -webkit-line-clamp: 2;
}

.game-genre-text {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-align: left;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-main-games .game-star {
  color: #ffb300;
}

.section-main-games .game-star i,
.section-main-games .game-star span {
  color: #ffb300;
}

.card-game:hover .title-game {
  text-shadow: none;
}

.container-game-rating {
  display: none; /* Hide rating for cleaner look */
}

.container-game-genre {
  margin-top: auto;
}

.tag-genre {
  background: transparent;
  color: var(--color-text-secondary);
  padding: 0;
  border-radius: 0;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: capitalize;
  border: none;
}

.badge-featured {
  top: 20px;
  right: 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* 7. HERO SECTION */
.hero {
  background: transparent;
  padding: 0 0 var(--spacing-xl);
  margin-top: 0;
  display: block;
}

/* 8. LOAD MORE BUTTON */
.container-load-more {
  text-align: center;
  margin-top: var(--spacing-xl);
}

.button-load-more {
  padding: 12px 30px;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

.button-load-more:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* 9. CATEGORIES */
.categories-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

.category-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: none;
  box-shadow: var(--shadow-sm);
  gap: 16px;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.category-icon {
  font-size: 2.5rem;
  filter: none;
}

.category-card h3 {
  font-size: 1.1rem;
  color: var(--color-text-primary);
}

.category-card:hover h3 {
  color: var(--color-primary);
  text-shadow: none;
}

.category-card p {
  display: none;
}

/* 10. ABOUT SECTION */
.section-about-platform {
  background: var(--color-bg-card);
  margin: 0 -30px -40px; /* Stretch to edges of main content */
  padding: 40px 30px;
  border-top: 1px solid var(--color-border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.about-header h2 {
  color: var(--color-text-primary);
  text-shadow: none;
}

.header-line {
  background: var(--color-primary);
  box-shadow: none;
}

.about-feature {
  background: var(--color-bg-primary);
  border: none;
  box-shadow: none;
}

.about-feature:hover {
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.about-text-group h3 {
  color: var(--color-text-primary);
  text-shadow: none;
}

/* NEW: TOP CAROUSELS STYLES */
.top-carousels-section {
  padding-top: 30px;
  padding-bottom: 30px;
}

.top-carousels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.carousel-card {
    height: 220px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.carousel-card:hover {
    transform: translateY(-5px);
}

.carousel-content {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-item {
    position: relative;
    display: none;
    width: 100%;
    height: 100%;
}

.carousel-item:first-child {
    display: block;
}

.carousel-item::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56%;
    background: linear-gradient(180deg, rgba(8, 11, 28, 0) 0%, rgba(8, 11, 28, 0.88) 100%);
    pointer-events: none;
    z-index: 2;
}

.carousel-item-info {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 4;
    padding: 0;
}

.carousel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Cover bottom part */
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 6;
    pointer-events: none;
    /* Gradient handled by specific ID selectors below */
}

/* Seasonal Picks - Purple Gradient */
#carousel-seasonal .carousel-overlay {
    background: linear-gradient(160deg, rgba(203, 93, 255, 0) 40%, rgba(29, 65, 190, 0.6)), linear-gradient(1turn, rgba(203, 93, 255, 0.5) 21%, rgba(29, 65, 190, 0) 66%), linear-gradient(1turn, rgba(255, 255, 255, 0.1) 21%, rgba(29, 65, 190, 0) 100%);
}

/* Valentine's Day - Pink Gradient */
#carousel-valentine .carousel-overlay {
   background: linear-gradient(160deg, rgba(203, 93, 255, 0) 40%, rgba(29, 65, 190, 0.6)), linear-gradient(1turn, rgba(203, 93, 255, 0.5) 21%, rgba(29, 65, 190, 0) 66%), linear-gradient(1turn, rgba(255, 255, 255, 0.1) 21%, rgba(29, 65, 190, 0) 100%);
}

/* Best New - Blue Gradient */
#carousel-best .carousel-overlay {
    background: linear-gradient(160deg, rgba(203, 93, 255, 0) 40%, rgba(29, 65, 190, 0.6)), linear-gradient(1turn, rgba(203, 93, 255, 0.5) 21%, rgba(29, 65, 190, 0) 66%), linear-gradient(1turn, rgba(255, 255, 255, 0.1) 21%, rgba(29, 65, 190, 0) 100%);
}


.carousel-title {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 2px rgba(0, 0, 0, 0.95);
    width: 180px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carousel-item-info .game-star {
    margin-top: 6px;
    color: #ffd54f;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9), 0 0 2px rgba(0, 0, 0, 0.95);
    font-weight: 700;
}

.carousel-item-info .game-star i,
.carousel-item-info .game-star span {
    color: #ffd54f;
}

.carousel-nav {
    display: flex;
    gap: 8px;
    margin-left: auto;
    pointer-events: auto;
}

.nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-primary);
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: white;
    transform: scale(1.1);
}

.nav-btn i {
    font-size: 0.8rem;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .tags-sidebar {
    display: none !important;
  }
  .tags-sidebar.active {
    display: flex !important;
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .main-content {
    padding: 20px 20px 0;
  }
  
  .top-carousels-grid {
      grid-template-columns: 1fr;
  }
}

/* COLLECTIONS SECTION */
.collections-section {
    padding-top: 40px;
    padding-bottom: 40px;
}

.collections-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 20px;
}

.collection-card {
    position: relative;
    height: 180px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: inherit;
    text-decoration: none;
}

.collection-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    z-index: 1;
}
.collection-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%);
    /* This gradient will be overridden by specific styles */
}

/* Card Specific Styles (Gradients) */
.style-exclusive .collection-content {
    background: linear-gradient(180deg, rgba(82, 107, 255, 0) 0%, rgba(68, 48, 230, 0.9) 100%);
}

.style-hot .collection-content {
    background: linear-gradient(180deg, rgba(255, 117, 85, 0) 0%, rgba(212, 53, 22, 0.9) 100%);
}

.style-brain .collection-content {
    background: linear-gradient(180deg, rgba(63, 206, 158, 0) 0%, rgba(13, 161, 107, 0.9) 100%);
}

.style-purchase .collection-content {
    background: linear-gradient(180deg, rgba(160, 97, 255, 0) 0%, rgba(95, 43, 226, 0.9) 100%);
}


.collection-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.collection-info h3 {
    color: white;
    margin: 0 10px 0 0;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    /* 不超过两行展示，超过部分省略号 */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.collection-count {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
}

.collection-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Specific button colors based on image if needed, but white glassmorphism looks clean */
.style-exclusive .collection-btn { background: #4e3ae2; border-color: transparent; }
.style-hot .collection-btn { background: #3b28cc; border-color: transparent; } /* Using blue/purple as seen in image for contrast? Or red? Image has blue buttons for all */
.style-brain .collection-btn { background: #3b28cc; border-color: transparent; }
.style-purchase .collection-btn { background: #3b28cc; border-color: transparent; }

/* Override button style to match image (solid blue/purple) */
.collection-btn {
    background: #4C35E0; /* Deep Blue/Purple */
    border: none;
    backdrop-filter: none;
}

.collection-btn:hover {
    background: #6a55e6; /* Lighter shade on hover */
    transform: translateX(2px);
}

.collection-btn i {
    font-size: 0.7rem;
}

/* Responsive for Collections */
@media (max-width: 992px) {
    .collections-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .collections-grid {
        grid-template-columns: 1fr;
    }
}

/* Final Mobile Overrides */
@media (max-width: 768px) {
  .main-content {
      padding: 0 !important;
  }
}

/* Unified single-line truncation for game titles in lists */
.game-title,
.title-game,
.title-similar-game,
.card-title,
.sidebar-game-title,
.recommended-name,
.new-game-title {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-info,
.container-game-info,
.sidebar-game-info,
.card-content,
.recommended-info,
.game-meta {
  min-width: 0;
}

