/* ==========================================================================
   39JL GREY MOBILE APP-SHELL DESIGN SYSTEM & COMPLIANCE UI
   Container: #1a1a1a outer, #2b2b2b app-shell (430px max-width)
   ========================================================================== */

:root {
  --bg-outer: #1a1a1a;
  --bg-shell: #2b2b2b;
  --bg-surface: #343434;
  --bg-surface-elevated: #3f3f3f;
  --bg-header-nav: #222222;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-subtle: #6b7280;
  --brand-gold: #FEB805;
  --brand-gold-hover: #e0a304;
  --brand-blue: #38A8FA;
  --brand-green: #10b981;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(254, 184, 5, 0.3);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shell-width: 430px;
}

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

html {
  background-color: var(--bg-outer);
  color-scheme: dark;
}

body {
  background-color: var(--bg-outer);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--brand-gold);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* App Shell Container */
.app-shell {
  max-width: var(--shell-width);
  margin: 0 auto;
  min-height: 100vh;
  background-color: var(--bg-shell);
  color: var(--text-main);
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

/* Fixed Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: var(--shell-width);
  height: 60px;
  background-color: rgba(34, 34, 34, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 50;
}

.brand-logo-link,
.header-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}

.brand-logo-img,
.header-logo img {
  height: 38px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Header Login Action */
.btn-header-login,
.btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 15px;
  background-color: rgba(255, 255, 255, 0.08);
  color: #f3f4f6;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  line-height: 1;
  box-sizing: border-box;
}

.btn-header-login:hover,
.btn-login:hover {
  background-color: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

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

/* Header Register Action (Primary CTA) */
.btn-header-register,
.btn-register,
.btn-header-deposit,
.btn-header-cashier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 16px;
  background: linear-gradient(135deg, var(--brand-gold) 0%, #f59e0b 100%);
  color: #111827 !important;
  border: 1px solid var(--brand-gold);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none !important;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(254, 184, 5, 0.35);
  transition: all 0.2s ease;
  line-height: 1;
  box-sizing: border-box;
}

.btn-header-register:hover,
.btn-register:hover,
.btn-header-deposit:hover,
.btn-header-cashier:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(254, 184, 5, 0.55);
  color: #111827 !important;
  text-decoration: none !important;
}

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

/* Category Quick Strip */
.category-strip {
  display: flex;
  overflow-x: auto;
  padding: 12px 14px 4px;
  gap: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.category-strip::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  flex-shrink: 0;
  padding: 6px 14px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cat-pill.is-active,
.cat-pill:hover {
  background-color: var(--bg-surface-elevated);
  border-color: var(--brand-gold);
  color: var(--brand-gold);
}

/* Main Content Area */
.app-content {
  flex: 1;
  padding: 72px 16px 84px; /* Space for fixed header & bottom nav */
}

/* Strict Heading Hierarchy */
h1 {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
  color: #ffffff;
  margin-top: 28px;
  margin-bottom: 12px;
  border-left: 3px solid var(--brand-gold);
  padding-left: 10px;
}

h3 {
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--brand-gold);
  margin-top: 20px;
  margin-bottom: 8px;
}

p {
  color: #d1d5db;
  margin-bottom: 14px;
  font-size: 14.5px;
}

/* Audit / Testing Desk Hero Card */
.hero-desk-card {
  background: linear-gradient(180deg, #383838 0%, #2e2e2e 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.badge-desk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(254, 184, 5, 0.15);
  border: 1px solid rgba(254, 184, 5, 0.4);
  color: var(--brand-gold);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.badge-desk::before {
  content: "";
  width: 6px;
  height: 6px;
  background-color: var(--brand-green);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px var(--brand-green);
}

.desk-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.desk-stat-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
}

.desk-stat-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-gold);
  display: block;
}

.desk-stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
  display: block;
}

/* Primary CTA Button (Stealth /play/ link) */
.btn-cta-primary,
.btn-cta-gold {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: linear-gradient(135deg, var(--brand-gold) 0%, #f59e0b 100%);
  color: #111827 !important;
  font-weight: 800;
  font-size: 15px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  text-decoration: none !important;
  text-align: center;
  box-shadow: 0 4px 14px rgba(254, 184, 5, 0.35);
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  margin: 16px 0;
  box-sizing: border-box;
}

.btn-cta-primary:hover,
.btn-cta-gold:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(254, 184, 5, 0.5);
  color: #111827 !important;
  text-decoration: none !important;
}

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

.btn-cta-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background-color: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  text-decoration: none;
  text-align: center;
  margin: 8px 0;
  transition: background-color 0.15s ease;
}

.btn-cta-secondary:hover {
  background-color: var(--bg-surface-elevated);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0 24px;
}

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

.game-card:hover {
  transform: translateY(-2px);
  border-color: rgba(254, 184, 5, 0.4);
}

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

.game-card-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.game-title, .game-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.game-rtp, .game-card-meta {
  font-size: 11px;
  color: #10b981;
  font-weight: 600;
  margin-bottom: 4px;
}

.game-card-btn {
  margin-top: auto;
  background-color: rgba(254, 184, 5, 0.15);
  border: 1px solid rgba(254, 184, 5, 0.5);
  color: var(--brand-gold);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 6px 0;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.game-card-btn:hover {
  background-color: var(--brand-gold);
  color: #111827;
}

/* Testing Desk Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

th {
  background-color: var(--bg-surface-elevated);
  color: var(--brand-gold);
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  color: #e5e7eb;
}

tr:last-child td {
  border-bottom: none;
}

/* PAA Accordion Section */
.paa-section {
  margin: 28px 0;
}

.paa-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}

.paa-question {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 14px 16px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.paa-question::after {
  content: "+";
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-gold);
  transition: transform 0.2s ease;
}

.paa-item.is-open .paa-question::after {
  content: "−";
  color: var(--text-muted);
}

.paa-answer {
  display: none;
  padding: 0 16px 14px;
  color: #d1d5db;
  font-size: 13.5px;
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.paa-item.is-open .paa-answer {
  display: block;
}

/* Compliance & Page Footer */
.app-footer,
.compliance-footer {
  background-color: #1a1a1a;
  border-top: 1px solid var(--border-subtle);
  padding: 24px 16px 20px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 32px;
}

.compliance-badge,
.compliance-badge-21 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-weight: 800;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  margin: 14px 0;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-nav a,
.compliance-footer a {
  color: #9ca3af !important;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 600;
  transition: color 0.15s ease;
  padding: 2px 4px;
}

.footer-nav a:hover,
.compliance-footer a:hover {
  color: var(--brand-gold) !important;
  text-decoration: none !important;
}

/* Guide Cards Section */
.guide-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #252525;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 10px 12px;
  color: #f3f4f6 !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.guide-card:hover {
  background: #2e2e2e;
  border-color: var(--brand-gold);
  color: var(--brand-gold) !important;
  transform: translateY(-1px);
}

/* Sticky Bottom Navigation (5 icons) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: var(--shell-width);
  height: 64px;
  background-color: rgba(34, 34, 34, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  padding: 8px 0;
  transition: color 0.15s ease;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  margin-bottom: 3px;
  transition: transform 0.15s ease;
}

.nav-item span {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav-item.is-active,
.nav-item:hover {
  color: var(--brand-gold);
}

.nav-item.is-active svg {
  transform: translateY(-2px);
}

.nav-item-account {
  color: var(--brand-blue);
}
