/* Base styles for page-index (dark theme) */
.page-index {
  background-color: var(--bg-color, #0d0d0d);
  color: #f0f0f0;
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

/* Common spacing for sections */
.page-index section, .page-index div[class*="__section"] {
  padding: 16px;
}

/* PC Layout (min-width: 1024px) */
@media (min-width: 1024px) {
  .page-index__home-hero {
    display: grid;
    grid-template-columns: 26% 48% 26%;
    gap: 16px;
    align-items: stretch;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 16px 24px;
    box-sizing: border-box;
    background: transparent;
    border: none;
  }
  .page-index__hero-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 300px;
    max-height: 300px;
    overflow: hidden;
    border: none;
    background: transparent;
    padding: 0;
    box-sizing: border-box;
  }
  .page-index__hero-brand-title {
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
    line-height: 1.25;
    font-weight: 800;
    background: linear-gradient(180deg, #ffe082, #ff9800);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0 0 12px;
  }
  .page-index__hero-brand-lead {
    color: rgba(255,255,255,.88);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0 0 16px;
  }
  .page-index__hero-brand-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .page-index__hero-brand-trust li {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: rgba(255,255,255,.8);
  }
  .page-index__hero-jackpot {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    height: 300px;
    max-height: 300px;
    box-sizing: border-box;
    border: 1px solid rgba(212,175,55,.45);
    border-radius: 12px;
    padding: 16px 12px;
    background: #120c06;
    overflow: hidden;
  }
  .page-index__hero-jackpot-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,.7);
    margin: 0;
  }
  .page-index__hero-jackpot-amount {
    font-size: clamp(1rem, 1.6vw, 1.45rem);
    font-weight: 800;
    color: #ffd54f;
    margin: 8px 0;
    line-height: 1.2;
  }
  .page-index__hero-jackpot-gift {
    font-size: 0.75rem;
    color: #4caf50;
    margin: 0;
  }
  .page-index__hero-jackpot-claim {
    display: block;
    margin-top: 16px;
    padding: 14px 12px;
    border-radius: 8px;
    background: #c62828 !important;
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
  }
  .page-index__game-trial {
    max-width: none !important;
    width: 100%;
    height: 300px;
    max-height: 300px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
  }
  .page-index__game-trial-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 300px;
    box-sizing: border-sizing;
  }
  .page-index__game-trial-viewport {
    flex: 1;
    min-height: 0;
    position: relative;
    width: 100%;
  }
  .page-index__game-trial-frame {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: none;
    background: #1a1a2e;
  }

  /* Promo Strip PC */
  .page-index__promo-strip {
    max-width: 1280px;
    margin: 16px auto 0;
    padding: 0 16px 24px;
  }
  .page-index__promo-strip-track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    overflow-x: hidden;
    padding: 0;
  }
  .page-index__promo-card {
    flex: none;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 10px;
    padding: 14px 12px;
  }
  .page-index__promo-card-media {
    flex: 0 0 38%;
    max-width: 38%;
  }
  .page-index__promo-card-media img {
    max-width: 100%;
    max-height: none;
    margin: 0;
  }
  .page-index__promo-card-body {
    flex: 1;
    min-width: 0;
  }
  .page-index__promo-card-title {
    font-size: 0.85rem;
  }
  .page-index__promo-card-line {
    font-size: 0.72rem;
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }
  .page-index__promo-card-btn {
    display: inline-block;
    width: auto;
    margin-top: 10px;
    padding: 8px 14px;
    font-size: 0.7rem;
  }

  /* Hot Games PC */
  .page-index__hot-games {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px 32px;
  }
  .page-index__hot-games-grid {
    max-width: none;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
  }
  .page-index__hot-games-item {
    border: 1px solid rgba(212,175,55,.35);
    border-radius: 10px;
    overflow: hidden;
    padding-bottom: 10px;
    text-decoration: none;
    color: inherit;
    text-align: center;
    background: #1a1208;
  }
  .page-index__hot-games-item img {
    width: 100%;
    display: block;
  }
  .page-index__hot-games-name {
    font-size: 0.85rem;
    margin: 8px 8px 0;
    text-align: center;
    color: #ffd54f;
    font-weight: 700;
  }
  .page-index__hot-games-rtp {
    display: block;
    font-size: 0.75rem;
    color: #4caf50;
    margin: 4px 8px;
    text-align: center;
  }
  .page-index__hot-games-desc {
    font-size: 0.7rem;
    margin: 0 8px;
    opacity: 0.85;
    text-align: center;
    line-height: 1.4;
    color: rgba(255,255,255,.7);
  }

  /* Brand Intro hidden on PC */
  .page-index__brand-intro {
    display: none;
  }
}

/* Mobile/Tablet Layout (max-width: 1023px) - Game Trial Reset */
@media (max-width: 1023px) {
  .page-index__home-hero {
    display: block !important;
    grid-template-columns: none !important;
    height: auto !important;
    max-height: none !important;
    overflow-x: hidden;
    box-sizing: border-box;
    padding: 10px 12px 16px;
  }
  .page-index__hero-brand,
  .page-index__hero-jackpot {
    display: none !important;
  }
  .page-index__game-trial {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
    margin: 0 auto;
    padding: 0 0 12px !important;
    box-sizing: border-box;
  }
  .page-index__game-trial-shell {
    display: flex;
    flex-direction: column;
    height: auto !important;
    max-height: none !important;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }
  .page-index__game-trial-topbar,
  .page-index__game-trial-bottombar {
    display: none !important;
  }
  .page-index__game-trial-viewport {
    position: relative;
    width: 100%;
    flex: none !important;
    aspect-ratio: 1024 / 768;
    min-height: 240px;
    max-height: none !important;
    overflow: hidden;
    box-sizing: border-box;
  }
  .page-index__game-trial-frame {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    max-width: 100%;
    border: none;
    z-index: 1;
    overflow: hidden;
  }
  .page-index__game-trial-overlay {
    position: absolute;
    inset: 0;
    z-index: 5 !important;
    pointer-events: auto !important;
  }
  .page-index__game-trial-start {
    position: relative;
    z-index: 6 !important;
    pointer-events: auto !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
  }
}

/* Mobile Layout (max-width: 768px) - Specific rules for other modules */
@media (max-width: 768px) {
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__section,
  .page-index__card,
  .page-index__container,
  .page-index__promo-strip,
  .page-index__hot-games,
  .page-index__brand-intro {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Promo Strip Mobile */
  .page-index__promo-strip-track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    overflow-x: hidden;
    padding: 0;
  }
  .page-index__promo-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
    border: 1px solid rgba(212,175,55,.45);
    border-radius: 10px;
    padding: 8px 4px;
    background: #1a1208;
    box-sizing: border-box;
  }
  .page-index__promo-card-media {
    width: 100%;
    margin-bottom: 6px;
  }
  .page-index__promo-card-media img {
    max-width: 100%;
    
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
  }
  .page-index__promo-card-title {
    margin: 0 0 4px;
    font-size: clamp(0.55rem, 2.8vw, 0.72rem);
    line-height: 1.2;
    font-weight: 700;
    color: #ffd54f;
  }
  .page-index__promo-card-line {
    margin: 0 0 2px;
    font-size: clamp(0.5rem, 2.2vw, 0.62rem);
    color: rgba(255,255,255,.82);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .page-index__promo-card-btn {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 5px 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffe082, #ffb300);
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 700;
    font-size: clamp(0.5rem, 2.2vw, 0.65rem);
    text-align: center;
    box-sizing: border-box;
    max-width: 100% !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Hot Games Mobile */
  .page-index__hot-games-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 12px;
  }
  .page-index__hot-games-title {
    font-size: 1.2rem;
    color: #ffd54f;
    margin: 0;
  }
  .page-index__hot-games-view-more {
    font-size: 0.8rem;
    color: rgba(255,255,255,.7);
    text-decoration: none;
  }
  .page-index__hot-games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 720px;
    margin: 0 auto;
    padding: 0;
  }
  .page-index__hot-games-item {
    display: block;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    border-radius: 10px;
    background: #1a1208;
  }
  .page-index__hot-games-item img {
    width: 100%;
    height: auto;
    display: block;
  }
  .page-index__hot-games-name,
  .page-index__hot-games-rtp,
  .page-index__hot-games-desc {
    display: none;
  }

  /* Brand Intro Mobile */
  .page-index__brand-intro {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 15px;
    box-sizing: border-box;
    display: block;
  }
  .page-index__brand-intro-title {
    font-size: 1.2rem;
    color: #ffd54f;
    margin-bottom: 16px;
    text-align: center;
  }
  .page-index__brand-intro p {
    font-size: 0.9rem;
    color: rgba(255,255,255,.85);
    margin-bottom: 12px;
  }
  .page-index__brand-intro-trust-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
  }
  .page-index__brand-intro-trust-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #4caf50;
    margin-bottom: 8px;
  }
  .page-index__brand-intro-trust-icon {
    font-size: 1.2em;
    color: #ffd54f;
  }

  /* Buttons responsive */
  .page-index__cta-button,
  .page-index__btn-primary,
  .page-index__btn-secondary,
  .page-index a[class*="button"],
  .page-index 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;
  }
  .page-index__cta-buttons,
  .page-index__button-group,
  .page-index__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    flex-wrap: wrap !important;
    gap: 10px;
  }
  .page-index__cta-buttons {
    display: flex;
    flex-direction: column;
  }
}

/* General Game Trial Styles */
.page-index__game-trial-shell {
  border: 1px solid rgba(212,175,55,.45);
  border-radius: 10px;
  overflow: hidden;
  background: #0a1628;
}
.page-index__game-trial-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; font-size: 0.75rem; background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.8);
}
.page-index__game-trial-top-jackpot {
  color: #ffd54f;
  font-weight: 700;
}
.page-index__game-trial-top-promo {
  padding: 4px 10px; border-radius: 6px;
  background: linear-gradient(90deg, #7b1fa2, #9c27b0);
  color: #fff; text-decoration: none; font-size: 0.7rem; white-space: nowrap;
}
.page-index__game-trial-viewport { position: relative; width: 100%; isolation: isolate; }
.page-index__game-trial-frame {
  display: block; width: 100%; border: none; background: #1a1a2e;
  position: relative; z-index: 1;
}
.page-index__game-trial-bottombar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; font-size: 0.7rem; background: rgba(0,0,0,.4); color: rgba(255,255,255,.75);
}
.page-index__game-trial {
  max-width: 720px; margin: 0 auto; padding: 0 0 16px; box-sizing: border-box;
}
.page-index__game-trial-overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55);
  pointer-events: auto;
}
.page-index__game-trial-overlay.is-hidden {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}
.page-index__game-trial-start {
  position: relative; z-index: 6;
  padding: 14px 32px; border-radius: 999px; border: none; cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  background: linear-gradient(180deg, #ffe082, #ff9800); color: #1a1a1a; font-weight: 700;
  box-shadow: 0 0 20px rgba(255,193,7,.45);
}

/* Reward Modal Styles */
.page-index__reward-modal {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
}
.page-index__reward-modal[hidden] { display: none; }
.page-index__reward-modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.72);
}
.page-index__reward-modal-card {
  position: relative; z-index: 1; width: 90vw; max-width: 360px;
  padding: 28px 20px; border-radius: 20px;
  border: 2px solid #d4af37; background: #1a1208; text-align: center;
}
.page-index__reward-modal-close {
  position: absolute; top: 8px; right: 10px; z-index: 2;
  width: 36px; height: 36px; padding: 0; border: none; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff; font-size: 22px; line-height: 1;
  cursor: pointer; pointer-events: auto; touch-action: manipulation;
}
.page-index__reward-modal-close:hover {
  background: rgba(255,255,255,.22);
}
.page-index__reward-modal-brand {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(180deg, #ffe082, #ff9800);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 8px;
}
.page-index__reward-modal-subtitle {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 20px;
}
.page-index__reward-modal-claim,
.page-index__reward-modal-retry {
  display: block; width: 100%; margin-top: 12px; padding: 14px;
  border-radius: 999px; text-align: center; text-decoration: none; box-sizing: border-box;
}
.page-index__reward-modal-claim {
  background: linear-gradient(180deg, #ffe082, #ffb300); color: #1a1a1a; font-weight: 700;
}
.page-index__reward-modal-retry {
  background: #2a2218; color: #fff; border: 1px solid #d4af37;
}

/* Promo Strip General */
.page-index__promo-strip {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  margin-bottom: 0;
  box-sizing: border-box;
}
.page-index__promo-strip-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  overflow-x: hidden;
  padding: 0 8px 12px;
  box-sizing: border-box;
}

/* Hot Games General */
.page-index__hot-games {
  padding: 16px;
}
.page-index__hot-games-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.page-index__hot-games-title {
  font-size: 1.5rem;
  color: #ffd54f;
  margin: 0;
}
.page-index__hot-games-view-more {
  color: #6FA3FF;
  text-decoration: none;
  font-weight: 600;
}
.page-index__hot-games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}

/* Winner Ticker */
.page-index__winner-ticker {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: linear-gradient(90deg, #c62828, #d32f2f, #c62828);
  color: #fff;
  padding: 8px 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.85rem;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}
.page-index__winner-ticker-track {
  display: flex;
  animation: ticker-scroll 20s linear infinite;
}
.page-index__winner-ticker-item {
  flex-shrink: 0;
  padding: 0 15px;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}
.page-index__winner-ticker-item.is-active {
  opacity: 1;
}
.page-index__winner-name {
  font-weight: 700;
  color: #ffd54f;
}
.page-index__winner-amount {
  font-weight: 700;
  color: #fff;
}
@keyframes ticker-scroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Body padding for fixed ticker */
body {
  padding-bottom: 48px;
}

/* Contrast Fixes */
.page-index__dark-bg {
  color: #ffffff;
  background: #2F6BFF;
}
.page-index__light-bg {
  color: #333333;
  background: #ffffff;
}
.page-index__medium-bg {
  color: #000000;
  background: #6FA3FF;
}
.page-index__content-area, .page-index__text-block {
  color: #f0f0f0;
  background: var(--bg-color, #0d0d0d);
}
.page-index p, .page-index li {
  color: rgba(255,255,255,.85);
}
.page-index__card {
  background: #1a1208;
  color: #f0f0f0;
  border: 1px solid rgba(212,175,55,.45);
}
.page-index__dark-section {
  background: #2F6BFF;
  color: #ffffff;
}
.page-index__btn-primary {
  background: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%);
  color: #ffffff;
  border: 2px solid transparent;
}
.page-index__btn-secondary {
  background: #ffffff;
  color: #2F6BFF;
  border: 2px solid #2F6BFF;
}
.page-index__contrast-fix {
  background: #ffffff !important;
  color: #333333 !important;
  border: 1px solid #e0e0e0 !important;
}
.page-index__text-contrast-fix {
  color: #333333 !important;
  text-shadow: none !important;
}