:root {
  --primary-color: #FF8C1A;
  --secondary-color: #FFA53A;
  --button-gradient: linear-gradient(180deg, #FFA53A 0%, #D96800 100%);
  --card-bg: #17191F;
  --background-color: #0D0E12;
  --text-main: #FFF3E6;
  --border-color: #A84F0C;
  --glow-color: #FFB04D;
  --deep-orange: #D96800;
}

.page-index {
  color: var(--text-main); /* Default text color for dark background */
  background-color: var(--background-color); /* Ensure consistency if body bg is not fully opaque */
  padding-bottom: 48px; /* Space for winner ticker */
}

/* Page-level section styling */
.page-index__section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 0 16px;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.page-index__section-title {
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
  color: var(--text-main);
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.page-index__view-more {
  font-size: 0.85rem;
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

/* --- Module 0 / 1: Home Hero / Game Trial (PC 3-column & Mobile 1-column) --- */

/* PC ≥1024px (3-column, 300px height) - Must be exact as specified */
@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; /* 10px top padding for initial spacing */
    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 {
    color: rgba(255,255,255,.75);
    font-size: 0.8rem;
    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; /* Specific red as per requirement */
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
  }
  .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-box;
  }
  .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; /* Fallback for iframe background */
  }
}

/* Mobile/Tablet ≤1023px (Game trial only, 1024/768 aspect ratio) - Must be exact as specified */
@media (max-width: 1023px) {
  .page-index__home-hero {
    display: block !important; /* Override grid for mobile */
    grid-template-columns: none !important;
    padding: 10px 12px 16px; /* Adjusted padding for mobile */
    max-width: 100%;
    height: auto !important;
    max-height: none !important;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .page-index__hero-brand,
  .page-index__hero-jackpot {
    display: none !important; /* Hide side columns on mobile/tablet */
  }
  .page-index__game-trial {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important; /* Prevent iframe scrollbar from leaking */
    margin: 0 auto;
    padding: 0 0 12px !important; /* Adjusted padding */
    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; /* Ensure shell also hides overflow */
    box-sizing: border-box;
  }
  .page-index__game-trial-topbar,
  .page-index__game-trial-bottombar {
    display: none !important; /* Hide top/bottom bars on mobile/tablet */
  }
  .page-index__game-trial-viewport {
    position: relative;
    width: 100%;
    flex: none !important;
    aspect-ratio: 1024 / 768; /* Specific aspect ratio for game */
    min-height: 240px; /* Minimum height to prevent too small viewport */
    max-height: none !important;
    overflow: hidden; /* Ensure viewport hides overflow */
    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; /* Ensure iframe itself hides overflow */
  }
  .page-index__game-trial-overlay {
    position: absolute;
    inset: 0;
    z-index: 5 !important; /* Overlay must be above iframe */
    pointer-events: auto !important;
  }
  .page-index__game-trial-start {
    position: relative;
    z-index: 6 !important; /* Start button must be above overlay */
    pointer-events: auto !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
  }
}

/* Common Game Trial Shell & Overlay styles */
.page-index__game-trial-shell {
  border: 1px solid rgba(212,175,55,.45);
  border-radius: 10px;
  overflow: hidden;
  background: #0a1628; /* Dark background for the shell */
}
.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,.75);
}
.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); /* Purple gradient */
  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-bet, .page-index__game-trial-ctrl {
  cursor: default; /* Make controls appear non-interactive for demo */
}
.page-index__game-trial {
  max-width: 720px; /* Max width for mobile-first approach, overridden by PC media query */
  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;
  transition: opacity 0.3s ease;
}
.page-index__game-trial-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none !important; /* Ensure it's fully hidden */
}
.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, #ffd54f, #ff9800); color: #1a1a1a; font-weight: 700;
  box-shadow: 0 0 20px rgba(255,193,7,.45);
  font-size: 1rem;
}

/* Reward Modal styles */
.page-index__reward-modal {
  position: fixed; inset: 0; z-index: 10000; /* Highest z-index */
  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 var(--border-color); /* Gold border */
  background: #1a1208; /* Dark background */
  text-align: center;
  box-shadow: 0 0 30px rgba(255,193,7,.3);
}
.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;
  display: flex; align-items: center; justify-content: center;
}
.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: var(--text-main);
  margin: 0 0 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;
  font-weight: 700;
  font-size: 1rem;
}
.page-index__reward-modal-claim {
  background: linear-gradient(180deg, #ffe082, #ffb300); color: #1a1a1a;
}
.page-index__reward-modal-retry {
  background: #2a2218; color: #fff; border: 1px solid var(--border-color);
}

/* --- Module 2: Promo Strip --- */
.page-index__promo-strip {
  position: relative;
  z-index: 1;
  margin-top: 16px; /* Minimum margin-top as per requirement */
  margin-bottom: 0;
  box-sizing: border-box;
}
.page-index__promo-strip-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Mobile 4 columns, no scroll */
  gap: 6px;
  overflow-x: hidden; /* Prevent horizontal scroll */
  padding: 0 8px 12px;
  max-width: 720px; /* Constrain mobile track width */
  margin: 0 auto;
  box-sizing: border-box;
}