/* ==========================================================================
   PH365 Authority Portal - Seeded Design Tokens & UI Architecture
   Target: Philippines (en-PH) - Mobile-First 436px App Shell
   Zero AST / CSS Fingerprinting via Brand-Seeded Token Bounds
   ========================================================================== */

:root {
  /* Bounded Design Tokens seeded by [ph365] */
  --shell-max-w: 436px;
  --btn-min-h: 49px;
  --btn-radius: 16px;
  --btn-pad-x: 19px;
  --card-pad: 14px;
  --card-radius: 16px;
  --font-stack-base: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Color Palette: Deep Charcoal Shell with Electric Cyan & Gold Metallic Accents */
  --color-outer-bg: #1a1a1a;
  --color-app-bg: #2b2b2b;
  --color-surface-1: #333333;
  --color-surface-2: #3a3a3a;
  --color-surface-card: #303030;
  --color-border: #444444;
  --color-border-subtle: #383838;

  --color-text-main: #f3f4f6;
  --color-text-muted: #9ca3af;
  --color-text-dim: #6b7280;

  --color-gold: #f59e0b;
  --color-gold-hover: #d97706;
  --color-gold-light: #fbbf24;
  --color-brand-cyan: #38bdf8;
  --color-brand-cyan-hover: #0284c7;
  --color-amber-badge: #b45309;
  --color-crimson: #ef4444;
  --color-emerald: #10b981;
  --color-blue: #3b82f6;

  --header-h: 58px;
  --bottom-nav-h: 64px;
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  background-color: var(--color-outer-bg);
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-outer-bg);
  color: var(--color-text-main);
  font-family: var(--font-stack-base);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  margin: 0;
}

/* Centered Mobile App Shell */
.app-shell {
  width: 100%;
  max-width: var(--shell-max-w);
  min-height: 100vh;
  background-color: var(--color-app-bg);
  color: var(--color-text-main);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 45px rgba(0, 0, 0, 0.9);
  padding-bottom: var(--bottom-nav-h);
  overflow-x: hidden;
}

/* Fixed Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(43, 43, 43, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}

.header-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
}

.header-cashier-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-hover));
  color: #0f172a;
  font-size: 0.825rem;
  font-weight: 800;
  border-radius: var(--btn-radius);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.header-cashier-btn:active {
  transform: scale(0.96);
}

/* Hero Carousel (Critical CSS inlined in HTML, styles repeated for external sheet) */
.hero-carousel {
  position: relative;
  width: 100%;
  background: #1e1e1e;
  overflow: hidden;
}

.hero-slider-track {
  position: relative;
  width: 100%;
  min-height: 250px;
}

.hero-slide {
  display: none !important;
  position: relative;
  width: 100%;
}

.hero-slide.active {
  display: block !important;
}

.hero-slide-media {
  position: relative;
  width: 100%;
  height: 230px;
  overflow: hidden;
}

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

.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(43,43,43,0.95) 90%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px 14px;
}

.hero-slide-overlay h2 {
  font-size: 1.125rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
  margin-bottom: 6px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.hero-slide-overlay p {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.35;
  margin-bottom: 10px;
}

.hero-slide-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 var(--btn-pad-x);
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-hover));
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: var(--btn-radius);
  text-decoration: none;
  align-self: flex-start;
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
}

.hero-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0 6px;
  background: var(--color-app-bg);
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #555555;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.25s ease;
}

.hero-dot.active {
  background: var(--color-gold);
  width: 22px;
  border-radius: 4px;
}

/* Dynamic Operational Status Ticker */
.win-ticker {
  background: #202020;
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
  height: 36px;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.ticker-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #111111;
  color: var(--color-gold);
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  height: 100%;
  padding: 0 10px;
  z-index: 2;
  flex-shrink: 0;
  border-right: 1px solid #333333;
}

.ticker-pulse {
  width: 6px;
  height: 6px;
  background: var(--color-emerald);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--color-emerald);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.ticker-track {
  display: flex;
  white-space: nowrap;
  animation: tickerMarquee 38s linear infinite;
  gap: 28px;
  padding-left: 14px;
}

.win-ticker:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #d1d5db;
}

.ticker-item strong {
  color: var(--color-gold);
  font-weight: 700;
}

.ticker-item span.metric-val {
  color: var(--color-emerald);
  font-weight: 700;
}

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

/* Main Content Area */
.main-content {
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Page Titles */
.page-header-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.page-h1 {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
  color: #ffffff;
}

.page-intro {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

/* Operational Trust Badges */
.trust-badges-bar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: #232323;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--card-radius);
  padding: 10px;
}

.trust-badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.trust-badge-icon {
  font-size: 1.1rem;
  margin-bottom: 3px;
}

.trust-badge-title {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #e5e7eb;
}

.trust-badge-sub {
  font-size: 0.625rem;
  color: var(--color-emerald);
  font-weight: 600;
}

/* Featured Catalog & Grids */
.section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--color-gold);
  border-radius: 2px;
}

.game-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.game-card {
  background: var(--color-surface-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--card-radius);
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

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

.game-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 400 / 260;
  background: #1e1e1e;
  overflow: hidden;
}

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

.game-card-info {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.game-card-title {
  font-size: 0.8125rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card-title-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.game-card-title-link:hover .game-card-title {
  color: var(--color-gold);
}

.game-card-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  margin-top: 6px;
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-hover));
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--btn-radius);
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.game-card-play-btn:hover {
  opacity: 0.92;
  transform: scale(1.02);
}

/* Primary CTA Button (Tap-Target Compliant) */
.btn-primary-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--btn-min-h);
  padding: 0 var(--btn-pad-x);
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-hover));
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: var(--btn-radius);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transition: transform 0.15s ease, opacity 0.15s ease;
  width: 100%;
  margin: 10px 0;
}

.btn-primary-cta:active {
  transform: scale(0.98);
}

/* Asymmetric Data Presentations (Tables, Definition Lists, Badges) */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin: 8px 0;
  background: #232323;
  border-radius: 8px;
  overflow: hidden;
}

.specs-table th,
.specs-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #333333;
}

.specs-table th {
  background: #1b1b1b;
  color: var(--color-gold-light);
  font-weight: 700;
}

.specs-table td:last-child {
  color: #f3f4f6;
  font-weight: 600;
}

/* Definition Lists */
.specs-dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 0.8125rem;
  background: #232323;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #333333;
}

.specs-dl dt {
  color: var(--color-text-muted);
  font-weight: 600;
}

.specs-dl dd {
  color: #ffffff;
  font-weight: 700;
  text-align: right;
  margin: 0;
}

/* Badge Matrix */
.badge-matrix {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.badge-tag {
  background: #1e1e1e;
  border: 1px solid #3d3d3d;
  color: #d1d5db;
  font-size: 0.725rem;
  padding: 4px 8px;
  border-radius: 4px;
}

/* Topic Breakdown Content Sections */
.topic-breakdown-card {
  background: #252525;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--card-radius);
  padding: var(--card-pad);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.topic-breakdown-card h2,
.topic-breakdown-card h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

.topic-breakdown-card p {
  font-size: 0.8125rem;
  color: #d1d5db;
  line-height: 1.45;
}

.topic-breakdown-card ul {
  padding-left: 18px;
  font-size: 0.8125rem;
  color: #9ca3af;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Interactive FAQ Accordion */
.faq-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  background: #232323;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 12px 14px;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: inherit;
}

.faq-icon {
  font-size: 1.1rem;
  color: var(--color-gold);
  transition: transform 0.2s ease;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  display: none;
  padding: 0 14px 14px;
  font-size: 0.825rem;
  color: #d1d5db;
  line-height: 1.5;
  border-top: 1px solid #383838;
  padding-top: 10px;
}

.faq-item.active .faq-answer {
  display: block;
}

/* Responsible Gaming 21+ Notice */
.compliance-footer-box {
  background: #1b1b1b;
  border: 1px solid #333333;
  border-radius: var(--card-radius);
  padding: 12px;
  text-align: center;
  font-size: 0.75rem;
  color: #9ca3af;
  line-height: 1.4;
  margin-top: 10px;
}

.compliance-badge-21 {
  display: inline-block;
  background: #b91c1c;
  color: #ffffff;
  font-weight: 900;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

/* 21+ Age Gate Modal (Uses styled <p class="age-gate-title">) */
.age-gate-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.age-gate-modal.active {
  display: flex;
}

.age-gate-card {
  background: #222222;
  border: 1px solid #444444;
  border-radius: 16px;
  padding: 24px 20px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0,0,0,0.8);
}

.age-gate-badge {
  display: inline-block;
  background: #dc2626;
  color: #ffffff;
  font-weight: 900;
  font-size: 1.1rem;
  padding: 4px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.age-gate-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}

.age-gate-desc {
  font-size: 0.8125rem;
  color: #9ca3af;
  line-height: 1.45;
  margin-bottom: 18px;
}

.age-gate-btn {
  display: block;
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-hover));
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 800;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 8px;
}

.age-gate-exit {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
}

/* Sticky Bottom Navigation (5 English Icons, Tap-Target >= 44px) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--shell-max-w);
  height: var(--bottom-nav-h);
  background: #1c1c1c;
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.6);
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 48px;
  text-decoration: none;
  color: #9ca3af;
  font-size: 0.6875rem;
  font-weight: 600;
  gap: 3px;
  transition: color 0.15s ease;
}

.nav-tab.active,
.nav-tab:hover {
  color: var(--color-gold);
}

.nav-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
