@import url('https://fonts.googleapis.com/css2?family=Battambang:wght@400;700;900&family=Inter:wght@400;500;600;700;800&display=swap');

/* ========== CSS Variables / Design Tokens ========== */
:root {
  --bg: hsl(220, 20%, 8%);
  --bg-card: hsl(220, 18%, 12%);
  --bg-secondary: hsl(220, 18%, 18%);
  --bg-muted: hsl(220, 15%, 20%);
  --bg-input: hsl(220, 18%, 15%);

  --fg: hsl(45, 100%, 50%);
  --fg-muted: hsl(45, 30%, 60%);
  --fg-white: hsl(0, 0%, 100%);
  --fg-white-80: hsla(0, 0%, 100%, 0.8);
  --fg-white-60: hsla(0, 0%, 100%, 0.6);

  --primary: hsl(45, 100%, 50%);
  --primary-fg: hsl(220, 20%, 8%);
  --primary-10: hsla(45, 100%, 50%, 0.1);
  --primary-20: hsla(45, 100%, 50%, 0.2);
  --primary-30: hsla(45, 100%, 50%, 0.3);
  --primary-50: hsla(45, 100%, 50%, 0.5);

  --border: hsl(45, 50%, 25%);
  --border-30: hsla(45, 50%, 25%, 0.3);
  --border-50: hsla(45, 50%, 25%, 0.5);

  --wc-red: hsl(0, 80%, 50%);
  --green: hsl(142, 71%, 45%);
  --destructive: hsl(0, 84%, 60%);

  --radius: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;

  --shadow-gold: 0 4px 20px -4px hsla(45, 100%, 50%, 0.5);
  --shadow-gold-lg: 0 8px 30px -4px hsla(45, 100%, 50%, 0.6);
  --shadow-card: 0 4px 20px -4px hsla(45, 100%, 50%, 0.15), 0 0 40px -10px hsla(45, 100%, 50%, 0.1);
}

/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', 'Battambang', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.font-khmer { font-family: 'Battambang', cursive; }

/* ========== Layout ========== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

/* ========== Typography ========== */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.2; }

.text-gradient-gold {
  background-image: linear-gradient(135deg, hsl(45, 100%, 50%) 0%, hsl(45, 100%, 70%) 50%, hsl(45, 100%, 50%) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }

.text-fg { color: var(--fg); }
.text-muted { color: var(--fg-muted); }
.text-white { color: var(--fg-white); }
.text-primary { color: var(--primary); }

.leading-relaxed { line-height: 1.75; }

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  white-space: nowrap;
}

.btn-cta {
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1.125rem;
  background: linear-gradient(135deg, var(--primary) 0%, hsl(45, 100%, 40%) 100%);
  color: var(--primary-fg);
  box-shadow: var(--shadow-gold);
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold-lg);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1.125rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--primary-fg);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--fg);
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  border: 1px solid var(--border-50);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}
.btn-secondary:hover { border-color: var(--primary-30); }

/* Shimmer */
.shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, hsla(45, 100%, 70%, 0.3) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ========== Cards ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-50);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  transition: border-color 0.3s ease;
}
.card:hover { border-color: var(--primary-30); }

.card-premium {
  background: linear-gradient(180deg, hsl(220, 18%, 14%) 0%, hsl(220, 18%, 10%) 100%);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

/* ========== Badges ========== */
.wc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--wc-red) 0%, hsl(0, 80%, 40%) 100%);
  color: white;
  box-shadow: 0 2px 10px hsla(0, 80%, 50%, 0.3);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--primary);
  color: var(--primary-fg);
}

.badge-hot {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, hsl(0, 80%, 55%) 0%, hsl(30, 100%, 50%) 100%);
  color: white;
  animation: pulse 1.5s ease-in-out infinite;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: var(--bg-secondary);
  font-size: 0.75rem;
  color: var(--fg-muted);
}

/* ========== Header ========== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid var(--border);
  background: hsla(220, 20%, 8%, 0.95);
  backdrop-filter: blur(12px);
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}
.header-logo img { height: 2.5rem; width: auto; }
.header-nav { display: none; align-items: center; gap: 0.25rem; }
.header-nav a {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  transition: color 0.2s;
  border-radius: var(--radius);
}
.header-nav a:hover, .header-nav a.active { color: var(--primary); }

.header-actions { display: none; align-items: center; gap: 1rem; }
.mobile-menu-btn {
  display: flex;
  padding: 0.5rem;
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
}
.mobile-menu-btn svg { width: 1.5rem; height: 1.5rem; }

@media (min-width: 768px) {
  .header-nav, .header-actions { display: flex; }
  .mobile-menu-btn { display: none; }
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 1rem;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--fg-muted);
  border-radius: var(--radius);
  transition: all 0.2s;
}
.mobile-menu a:hover { color: var(--primary); background: var(--bg-secondary); }
.mobile-menu .mobile-actions {
  margin-top: 1rem;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ========== Hero ========== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 4rem 0;
}
.hero-bg {
  position: absolute;
  inset: 0;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-bg .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, hsla(220, 20%, 8%, 0.3), hsla(220, 20%, 8%, 0.6), var(--bg));
}
.hero-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 56rem;
  margin: 0 auto;
}
@media (min-width: 768px) { .hero { padding: 6rem 0; } }
@media (min-width: 1024px) { .hero { padding: 8rem 0; } }

/* ========== Stats Row ========== */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin: 2.5rem 0;
}
.stat { text-align: center; }
.stat-value { font-size: 1.875rem; font-weight: 700; }
.stat-label { font-size: 0.875rem; color: var(--fg-muted); }
@media (min-width: 768px) { .stat-value { font-size: 2.25rem; } }

/* ========== Grid Layouts ========== */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
.grid-6 { grid-template-columns: repeat(3, 1fr); }

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-6 { grid-template-columns: repeat(6, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ========== Section Spacing ========== */
.section { padding: 4rem 0; }
.section-sm { padding: 3rem 0; }
.section-bg { background: var(--bg-card); }
.section-border { border-top: 1px solid var(--border-30); }

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-header h2 { margin-bottom: 0.75rem; }
.section-header p { color: var(--fg-muted); max-width: 40rem; margin: 0 auto; }

/* ========== Game Category Card ========== */
.game-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-50);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  transition: all 0.3s ease;
  display: block;
}
.game-card:hover {
  border-color: var(--primary-50);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}
.game-card-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  background: var(--primary-10);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--primary);
}
.game-card h3 { font-size: 1.125rem; margin-bottom: 0.25rem; }
.game-card .subtitle { font-size: 0.75rem; color: var(--fg-muted); margin-bottom: 0.5rem; }
.game-card p { font-size: 0.875rem; color: var(--fg-muted); }

/* ========== Featured Games Carousel ========== */
.carousel {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 1rem;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel-item {
  flex: 0 0 85%;
  scroll-snap-align: start;
}
@media (min-width: 768px) { .carousel-item { flex: 0 0 48%; } }
@media (min-width: 1024px) { .carousel-item { flex: 0 0 32%; } }

.featured-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--primary-20);
  transition: all 0.3s ease;
  display: block;
}
.featured-card:hover { border-color: var(--primary-50); box-shadow: 0 10px 40px -10px var(--primary-10); }
.featured-card .aspect {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.featured-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.featured-card:hover img { transform: scale(1.1); }
.featured-card .card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.2), transparent);
}
.featured-card .card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
}
.featured-card .card-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
}
.featured-card .card-rating {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: rgba(0,0,0,0.6);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 700;
}

/* ========== World Cup Banner ========== */
.wc-banner {
  position: relative;
  border-radius: var(--radius-2xl);
  overflow: hidden;
}
.wc-banner .wc-bg {
  position: absolute;
  inset: 0;
}
.wc-banner .wc-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wc-banner .wc-bg .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.9), rgba(0,0,0,0.7), transparent);
}
.wc-banner .wc-content {
  position: relative;
  z-index: 10;
  padding: 3rem 1.5rem;
  max-width: 36rem;
}
@media (min-width: 768px) { .wc-banner .wc-content { padding: 4rem 3rem; } }

/* ========== Provider Grid ========== */
.provider-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border-50);
  transition: all 0.3s ease;
}
.provider-item:hover { border-color: var(--primary-50); background: var(--bg-card); }
.provider-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: var(--primary-10);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

/* ========== Payment Methods ========== */
.payment-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border-50);
  transition: border-color 0.3s;
}
.payment-item:hover { border-color: var(--primary-30); }

/* ========== Testimonials ========== */
.testimonial-card {
  position: relative;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-50);
  border-radius: var(--radius-xl);
  transition: border-color 0.3s;
}
.testimonial-card:hover { border-color: var(--primary-30); }
.testimonial-quote {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: var(--primary-20);
  font-size: 2rem;
}
.star-row { display: flex; gap: 0.125rem; margin-bottom: 1rem; color: var(--primary); }
.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: var(--primary-20);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.875rem;
}

/* ========== FAQ Accordion ========== */
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s;
}
.faq-question:hover { color: var(--primary); }
.faq-question .chevron {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  color: var(--fg-muted);
}
.faq-item.open .faq-question .chevron { transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq-item.open .faq-answer {
  max-height: 500px;
  padding: 0 1.5rem 1rem;
}
.faq-answer p {
  color: var(--fg-muted);
  font-size: 0.875rem;
  line-height: 1.75;
}

/* ========== SEO Content Block ========== */
.seo-content {
  max-width: 56rem;
  margin: 0 auto;
}
.seo-content h2 { margin-bottom: 1.5rem; }
.seo-content h3 {
  font-size: 1.25rem;
  color: var(--fg);
  margin: 2rem 0 1rem;
}
.seo-content p {
  color: var(--fg-muted);
  margin-bottom: 1rem;
  line-height: 1.75;
}
.seo-content .disclaimer {
  margin-top: 2rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: hsla(220, 18%, 18%, 0.5);
  border: 1px solid var(--border);
  font-size: 0.875rem;
}

/* ========== App Download Section ========== */
.app-section {
  background: linear-gradient(135deg, var(--primary-10), var(--bg), var(--primary-10));
}
.app-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 768px) { .app-grid { grid-template-columns: 1fr 1fr; } }
.feature-list { list-style: none; }
.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}
.feature-list li::before {
  content: '✓';
  color: var(--primary);
  font-weight: 700;
}

/* ========== Footer ========== */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 3rem 0;
}
.footer-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 3rem;
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-brand p { color: var(--fg-muted); font-size: 0.875rem; margin: 1rem 0; max-width: 24rem; }
.footer-section h3 {
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--fg);
}
.footer-section h3 span { font-size: 0.75rem; color: var(--fg-muted); font-weight: 400; }
.footer-section ul li { margin-bottom: 0.5rem; }
.footer-section ul a {
  font-size: 0.875rem;
  color: var(--fg-muted);
  transition: color 0.2s;
}
.footer-section ul a:hover { color: var(--primary); }

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--fg-muted);
}
@media (min-width: 768px) {
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}

/* ========== SVG Icon Utility ========== */
.icon { display: inline-block; width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.icon-sm { width: 1rem; height: 1rem; }
.icon-lg { width: 1.5rem; height: 1.5rem; }

/* ========== Utility Classes ========== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.relative { position: relative; }
.w-full { width: 100%; }
.hidden { display: none; }
.inline-flex { display: inline-flex; }
.block { display: block; }

@media (min-width: 768px) {
  .md\:text-left { text-align: left; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ========== Animations ========== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 20px var(--primary-30); }
  50% { box-shadow: 0 0 40px var(--primary-50); }
}
.animate-pulse { animation: pulse 1.5s ease-in-out infinite; }
