/* SINAGPH UI Design System - Signature Grey Mobile App-Shell Architecture
   Reverse-Engineered from jl-bet.ph + Aligned with /casino-design-system & /ace58-ui-guidance */

:root {
  /* Signature Grey Palette */
  --backdrop: #1a1a1a;
  --bg: #2b2b2b;
  --surface: #383838;
  --surface2: #444444;
  --border: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(240, 230, 140, 0.35);

  /* Brand Accents */
  --primary-gold: #F0E68C;       /* Sinag Solar Khaki Gold */
  --accent-cta: #F59E0B;         /* High-CTR Solar Amber CTA */
  --gold-gradient: linear-gradient(135deg, #FFD700 0%, #F59E0B 100%);
  --glow: rgba(240, 230, 140, 0.15);

  /* Studio Provider Colorways */
  --studio-jili: #E11D48;
  --studio-jili-glow: rgba(225, 29, 72, 0.2);
  --studio-fc: #D97706;
  --studio-fc-glow: rgba(217, 119, 6, 0.2);
  --studio-pp: #EA580C;
  --studio-pp-glow: rgba(234, 88, 12, 0.2);
  --studio-pg: #8B5CF6;
  --studio-pg-glow: rgba(139, 92, 246, 0.2);
  --studio-live: #2563EB;
  --studio-live-glow: rgba(37, 99, 235, 0.2);

  /* Typography & Layout Tokens */
  --text: #f0f0f0;
  --text-cream: #FFEBCD;
  --muted: #a0a0aa;
  --success: #10B981;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-pill: 50px;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shell-shadow: 0 0 35px rgba(0, 0, 0, 0.95);
}

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

body {
  background: var(--backdrop);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary-gold);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.9;
}

/* Mobile App-Shell Container (Max 430px) */
.app-shell {
  width: 100%;
  max-width: 430px;
  background: var(--bg);
  min-height: 100vh;
  padding-bottom: 84px;
  position: relative;
  box-shadow: var(--shell-shadow);
  display: flex;
  flex-direction: column;
}

/* Sticky Top Header */
.hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(43, 43, 43, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.hdr .logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.hdr .logo-link img {
  height: 34px;
  width: auto;
  display: block;
}

.hdr .logo-text {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: var(--primary-gold);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
}

.hdr .logo-text span {
  color: #fff;
}

.hdr-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Primary Button Styling */
.btn {
  background: var(--gold-gradient);
  color: #000;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 0.82rem;
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  color: #000;
}

.btn-login {
  background: transparent;
  border: 1px solid var(--primary-gold);
  color: var(--primary-gold);
}

.btn-login:hover {
  background: rgba(240, 230, 140, 0.1);
  color: var(--primary-gold);
  box-shadow: none;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  font-size: 0.72rem;
  padding: 6px 12px;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
  padding: 12px 20px;
  font-size: 0.95rem;
}

/* Hero Section with First Container Visual */
.hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #1f1f1f;
}

.hero-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.hero-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, rgba(43, 43, 43, 0.8) 40%, rgba(0, 0, 0, 0.3) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  text-align: left;
}

/* STRICT RULE: h1 is strictly the first heading in DOM */
.hero-grad h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-cream);
  line-height: 1.25;
  margin-bottom: 6px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--primary-gold);
}

.hero-meta .badge-pagcor {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--success);
  color: #34d399;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.65rem;
}

/* Main Content Wrapper */
.main {
  padding: 16px;
}

/* TLDR & Highlights Container */
.tldr {
  background: var(--glow);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 0.85rem;
  color: var(--text-cream);
  margin-bottom: 20px;
}

/* Category Filter Chips */
.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.chip.active, .chip:hover {
  background: var(--surface2);
  border-color: var(--primary-gold);
  color: var(--primary-gold);
}

/* 3x2 Interactive Grid Boxes (3 columns x 2 rows) */
.game-grid-3x2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s, border-color 0.2s;
}

.game-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-gold);
}

.card-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #222;
}

.card-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Studio Colorway Badges */
.studio-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-jili { background: var(--studio-jili); color: #fff; }
.badge-fc { background: var(--studio-fc); color: #fff; }
.badge-pp { background: var(--studio-pp); color: #fff; }
.badge-pg { background: var(--studio-pg); color: #fff; }
.badge-live { background: var(--studio-live); color: #fff; }

.rtp-pill {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--primary-gold);
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
}

.card-info {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  justify-content: space-between;
}

.card-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* Dual Buttons per Placecard */
.card-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-card-play {
  background: var(--gold-gradient);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 5px 0;
  border-radius: var(--radius-pill);
  text-align: center;
  display: block;
}

.btn-card-guide {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
  padding: 3px 0;
  border-radius: var(--radius-pill);
  text-align: center;
  display: block;
}

.btn-card-guide:hover {
  color: #fff;
  border-color: var(--primary-gold);
}

/* 2-Column Standard Grid (Featured Guides & Functional Pages) */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.nav-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.nav-box:hover {
  transform: translateY(-2px);
  border-color: var(--border-gold);
}

.nav-box img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}

.nav-box span {
  display: block;
  padding: 10px 8px;
  font-weight: 700;
  font-size: 0.75rem;
  text-align: center;
}

/* Article & Content Body Styling */
.article-body {
  font-size: 0.88rem;
  color: var(--text);
  margin-top: 16px;
}

.article-body h2 {
  font-size: 1.15rem;
  color: var(--primary-gold);
  margin: 24px 0 10px;
  line-height: 1.3;
}

.article-body h3 {
  font-size: 0.98rem;
  color: var(--text-cream);
  margin: 18px 0 8px;
}

.article-body p {
  margin-bottom: 12px;
  line-height: 1.6;
}

.article-body ul, .article-body ol {
  margin-left: 20px;
  margin-bottom: 14px;
}

.article-body li {
  margin-bottom: 6px;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.78rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.article-body th, .article-body td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.article-body th {
  background: var(--surface2);
  color: var(--primary-gold);
  font-weight: 700;
}

.inline-banner {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 16px 0;
  border: 1px solid var(--border);
}

/* Conversion CTA Group */
.cta-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px 0;
  background: var(--surface);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-gold);
  text-align: center;
}

/* FAQ Accordion Styling */
.faq-block {
  margin: 20px 0;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  padding: 12px;
}

.faq-q {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-cream);
  margin-bottom: 6px;
}

.faq-a {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Age Verification Modal (Strict: Uses <div class="modal-title">, NOT h1-h6) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  max-width: 360px;
  width: 100%;
  padding: 24px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-gold);
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 0.8rem;
  color: var(--text-cream);
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

/* Compliance Footer */
.compliance-footer {
  margin-top: 30px;
  padding: 16px;
  background: #222222;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
}

.compliance-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.badge-21 {
  background: #dc2626;
  color: #fff;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
}

/* Fixed Bottom Navigation (Exactly 5 Sticky Tabs) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: rgba(43, 43, 43, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 12px;
  z-index: 100;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ni {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.68rem;
  transition: color 0.2s;
  gap: 2px;
}

.ni.on, .ni:hover {
  color: var(--primary-gold);
}

.ni em {
  font-size: 1.25rem;
  font-style: normal;
}


/* Clean Subtle Section Divider */
hr.divider, .divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 20px 0;
}
