:root {
  /* 7-11 Official Branding */
  --header-green: #006a4e;
  --accent-yellow: #fdb913;
  --accent-orange: #ff8200;
  --accent-red: #da291c;
  
  /* Layout Colors (Crucial Correction) */
  --sidebar-bg: #e2e2d0; /* A more accurate light beige/gray from the image */
  --center-bg: #fdfdf5;  /* Very light cream/white */
  --global-bg: #f4f3e6;  /* Closer to the image's background */
  
  --text-dark: #333;
  --border-green: #008f6b;
  
  /* Dimensions */
  --sidebar-width: 420px;
  --container-max: 1300px;
  --header-height: 60px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  background-color: var(--global-bg);
  line-height: 1.4;
  overflow-x: hidden; /* Prevent horizontal scroll */
  padding-bottom: 80px; /* Space for the fixed footer nav */
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Header & Marquee */
.header {
  height: var(--header-height);
  background-color: var(--header-green);
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 101; /* Higher than footer if they overlap */
}

.play-now-header-btn {
  background: linear-gradient(180deg, var(--accent-yellow) 0%, var(--accent-orange) 100%);
  color: var(--header-green);
  text-decoration: none;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 6px 18px;
  border-radius: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.3);
}

.play-now-header-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px var(--accent-yellow);
  color: #000;
}

.play-now-header-btn:active {
  transform: scale(0.95);
}

.marquee-gold {
  background-color: var(--accent-yellow);
  height: 30px;
  display: flex;
  align-items: center;
  overflow: hidden;
  font-weight: 800;
  font-size: 0.8rem;
}

.marquee-text {
  white-space: nowrap;
  animation: scroll 20s linear infinite;
  padding-left: 100%;
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* 3-Column Proportions */
.main-wrapper {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
  grid-template-rows: auto 1fr; /* Rows for the mobile-top banner on desktop */
  min-height: calc(100vh - 90px);
  width: 100%;
  align-items: stretch;
  overflow: hidden;
}

.promo-mobile-top {
  grid-column: 1;
  grid-row: 1;
  background-color: var(--sidebar-bg);
  padding: 15px 15px 0;
  display: none; /* Mobile Only: Hidden on Desktop */
}

.promo-desktop-sidebar {
  display: block; /* Desktop Only: Shown in Sidebar */
}

.sidebar.section-left {
  grid-column: 1;
  grid-row: 2;
  padding-top: 5px; /* Reduced since banner is above it */
}

.center-content {
  grid-column: 2;
  grid-row: 1 / span 2;
  background-color: var(--center-bg);
  padding: 15px 25px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  max-width: 100%;
}

.sidebar.section-right {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.sidebar {
  background-color: var(--sidebar-bg);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 100%;
  min-width: 0; /* Safety for grid overflow */
}

/* Placeholder Styling */
.placeholder-box {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-weight: bold;
  font-size: 0.8rem;
  text-align: center;
  padding: 20px;
}

.placeholder-img {
  background-color: #ddd;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ticker-box {
  background: #fff;
  height: 220px;
  border-top: 5px solid var(--accent-red);
  overflow: hidden;
  position: relative;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.ticker-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px dashed #eee;
  font-size: 0.7rem;
  font-weight: 700;
  color: #333;
  align-items: center;
}

.ticker-row span:nth-child(2) {
  color: #da291c; /* RM Color */
  flex: 1;
  text-align: center;
}

.ticker-row span:nth-child(1) {
  flex: 1.2;
}

.ticker-row span:nth-child(3) {
  flex: 1;
  text-align: right;
  color: #006a4e; /* Game Color */
}

/* Updated Hero Slider Styles */
.hero-slider {
  position: relative;
  border-radius: 15px;
  border: 4px solid #000;
  width: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: #f4f0e4;
}

.slider-container {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
}

.slider-container img {
  min-width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.3); /* Subtle background for visibility */
  border: none;
  cursor: pointer;
  width: 45px;
  height: 45px;
  padding: 5px;
  border-radius: 50%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.slider-btn:hover {
  background: rgba(0,0,0,0.6);
}

.slider-btn img {
  width: 100%;
}

.banner-img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

/* Auth Page Styles (Login/Register) */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  padding: 20px;
}

.auth-card {
  background: #fff;
  border: 4px solid var(--border-green);
  border-radius: 20px;
  padding: 30px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.auth-card h2 {
  text-align: center;
  color: var(--header-green);
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: #555;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid #eee;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--border-green);
}

.auth-btn {
  width: 100%;
  padding: 12px;
  background: var(--header-green);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 10px;
}

.auth-btn:hover {
  filter: brightness(1.2);
}

.auth-links {
  margin-top: 15px;
  text-align: center;
  font-size: 0.8rem;
}

.auth-links a {
  color: var(--accent-orange);
  text-decoration: none;
  font-weight: 700;
}

.game-grid-wrap {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.game-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  position: relative;
  text-align: center;
  min-width: 0; /* Critical for grid shrinking */
}

.game-card span {
  position: absolute;
  top: 5px;
  right: 10px;
  font-weight: 800;
  font-size: 0.6rem;
}

.game-card img {
  width: 100%;
  border-radius: 0;
  display: block;
}

.game-card-skeleton {
  aspect-ratio: 1/1;
  border: 4px solid var(--border-green);
  border-radius: 20px;
  background: #fff;
}

/* Check-in Grid */
.checkin-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-top: 10px;
}

.day-box {
  background: #fff;
  border: 1px solid #ddd;
  height: 40px;
  border-radius: 4px;
}

/* Game Category Navigation Cards */
.category-nav {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 10px 5px 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.category-nav::-webkit-scrollbar {
  display: none;
}

.cat-card {
  position: relative;
  min-width: 82px;
  height: 82px;
  background: #fdfdf5;
  border: 2px solid #006a4e;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 8px;
  gap: 4px;
  text-decoration: none;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.cat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.cat-card.active {
  background: #12b189; /* The specific vibrant green from screenshot */
  border-color: #0c8c6d;
}

.cat-card img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  margin-bottom: auto;
  padding-top: 10px;
}

.cat-label {
  font-size: 0.6rem;
  font-weight: 800;
  color: #006a4e;
  text-transform: uppercase;
  line-height: 1;
}

.cat-card.active .cat-label {
  color: #fff;
  text-shadow: 1px 1px 0 #da291c, -1px -1px 0 #da291c, 1px -1px 0 #da291c, -1px 1px 0 #da291c, 0 2px 4px rgba(0,0,0,0.3);
  letter-spacing: 0.2px;
}

/* Badges & Overlays */
.cat-badge-new {
  position: absolute;
  top: 0;
  right: 0;
  background: #006a4e;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 900;
  padding: 3px 12px;
  border-radius: 0 18px 0 10px;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: -2px 2px 4px rgba(0,0,0,0.1);
}

.cat-badge-ratio {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 0.7rem;
  font-weight: 900;
  color: #333;
  letter-spacing: -0.5px;
}

/* Footer Nav (Persistent Bottom) */
.footer-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 70px;
  background-color: var(--header-green);
  border-top: 4px solid var(--accent-orange);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex: 1;
  flex-direction: column; /* Stack icon above text */
  align-items: center;
  justify-content: center;
  text-decoration: none;
  height: 100%;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  gap: 5px;
}

.nav-item img {
  height: 24px; /* Fixed height for icons */
  width: auto;
  object-fit: contain;
}

.nav-icon-symbol {
  font-size: 34px;
  line-height: 1;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
}

.nav-item svg {
  width: 32px;
  height: 32px;
  display: block;
}

/* Base Footer Classes - DEFINED BEFORE MEDIA QUERIES */
.footer-main {
  background: #f5f0e0;
  border-top: 2px solid #ddd;
  padding: 30px 20px 20px;
}

.footer-container {
  max-width: 900px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px 40px;
}

.footer-section {
  display: flex;
  flex-direction: column;
}

.footer-full-width {
  grid-column: 1 / -1;
}

.footer-heading {
  font-weight: 900;
  font-size: 0.85rem;
  margin: 0 0 12px;
  letter-spacing: 1px;
  color: #333;
  text-transform: uppercase;
}

.footer-banner {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Mobile Responsiveness - ALL MEDIA QUERIES AT BOTTOM */
@media (max-width: 1024px) {
  .main-wrapper {
    display: flex;
    flex-direction: column;
  }

  .promo-mobile-top {
    display: block !important;
    order: -2 !important; /* Force to absolute top */
    width: 100% !important;
    padding: 10px 10px 0 !important;
    background: transparent !important;
    box-sizing: border-box !important;
  }

  .promo-desktop-sidebar {
    display: none !important;
  }

  .sidebar.section-right {
    order: -1 !important;
  }

  .sidebar.section-left {
    order: 0 !important;
  }

  .center-content {
    order: 1 !important;
    padding-left: 10px;
    padding-right: 10px;
  }

  /* Reset grid specific properties */
  .sidebar, .center-content {
    grid-column: auto !important;
    grid-row: auto !important;
    width: 100%;
  }

  .hero-slider {
    aspect-ratio: 2 / 1 !important;
    border-width: 2px !important;
    margin: 10px -10px !important; /* Margin top/bottom, negative sides to fill width */
    width: calc(100% + 20px) !important;
    border-radius: 0 !important;
  }

  .slider-btn {
    width: 32px !important;
    height: 32px !important;
  }

  /* Adjust header for mobile */
  .header {
    height: 90px !important;
  }

  .header-content img {
    height: 55px !important;
  }
  
  .play-now-header-btn {
    padding: 8px 20px;
    font-size: 0.9rem;
    border-radius: 25px;
  }

  /* Increase Bottom Nav size for mobile */
  .footer-nav {
    height: 95px !important;
    border-top-width: 6px !important;
  }

  .nav-item img {
    height: 38px !important;
  }

  .nav-icon-symbol {
    font-size: 40px !important;
    height: 38px !important;
  }

  .nav-item svg {
    width: 40px !important;
    height: 40px !important;
  }

  .nav-item span {
    font-size: 0.88rem !important;
    margin-top: 5px;
    white-space: nowrap;
    text-align: center;
  }

  /* Mobile Footer Stacking */
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 30px;
  }

  .footer-section {
    align-items: center;
    text-align: center;
  }

  .footer-banner {
    max-width: 280px; /* Scale down for smaller phones */
  }

  .footer-full-width {
    grid-column: auto !important;
  }

  /* Game Grid Responsive */
  .game-grid-wrap {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px;
  }
}
