/* Pixel Gun 2 Hub — single stylesheet, mobile-first, no frameworks */

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2128;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --accent: #ff7a1a;
  --accent-hover: #ff9c4d;
  --accent-2: #3aa6ff;
  --border: #30363d;
  --success: #3fb950;
  --warning: #d29922;
  --danger: #f85149;
  --radius: 8px;
  --radius-lg: 14px;
  --max-width: 880px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 10px 32px rgba(0, 0, 0, 0.46);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, p, ul, ol, figure, table { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.18s ease; }
a:hover, a:focus { color: var(--accent-hover); text-decoration: underline; }
button { font: inherit; cursor: pointer; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font);
  line-height: 1.6;
  font-size: 16px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #0d1117;
  padding: 8px 12px;
  z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-image:
    linear-gradient(165deg, rgba(11, 14, 19, 0.86) 0%, rgba(11, 14, 19, 0.93) 55%, rgba(11, 14, 19, 0.97) 100%),
    url("../images/pixel-gun-2-official-gameplay-megacity-arena.jpg");
  background-size: cover;
  background-position: center 32%;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
/* Header nav is Bootstrap 5.3 (navbar/collapse/dropdown) — .site-header
   is kept only for the background-art image/overlay above. Bootstrap's
   own CSS variables are overridden below to pick up this site's accent
   color instead of Bootstrap's default blue. */
.site-header.navbar {
  --bs-navbar-color: var(--text-secondary);
  --bs-navbar-hover-color: var(--accent);
  --bs-navbar-active-color: var(--accent);
  --bs-navbar-brand-color: var(--text-primary);
  --bs-navbar-brand-hover-color: var(--text-primary);
  padding-top: 16px;
  padding-bottom: 16px;
}
.site-header .navbar-brand {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
}
.site-header .text-accent-brand { color: var(--accent); }
.site-header .nav-link { display: flex; align-items: center; }
.site-header .dropdown-menu {
  --bs-dropdown-bg: var(--bg-card);
  --bs-dropdown-border-color: var(--border);
  --bs-dropdown-link-color: var(--text-primary);
  --bs-dropdown-link-hover-bg: var(--bg-secondary);
  --bs-dropdown-link-hover-color: var(--accent);
  --bs-dropdown-link-active-bg: var(--bg-secondary);
  --bs-dropdown-link-active-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.site-header .dropdown-item { display: flex; align-items: center; }

.nav-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.85;
  margin-right: 8px;
}

.site-search {
  display: flex;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(13, 17, 23, 0.4);
}
.site-search input {
  flex: 1;
  background: var(--bg-secondary);
  border: none;
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: 0.9rem;
}
.site-search input:focus { outline: none; }
.site-search button {
  background: var(--bg-card);
  border: none;
  color: var(--text-primary);
  padding: 0 12px;
  transition: color 0.18s ease;
}
.site-search button:hover { color: var(--accent); }

/* ---------- breadcrumb ---------- */
.breadcrumb {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.breadcrumb-inner { max-width: var(--max-width); margin: 0 auto; padding: 8px 16px; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 4px; color: var(--border); }
.breadcrumb [aria-current="page"] { color: var(--text-primary); }

/* ---------- main content ---------- */
main { display: block; }
.content-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px 48px;
}

article { display: block; }

article h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  color: var(--text-primary);
}
article h2 {
  font-size: 1.25rem;
  margin: 38px 0 14px;
  color: var(--text-primary);
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}
article h3 {
  font-size: 1.05rem;
  margin: 22px 0 8px;
  color: var(--accent-2);
}
article p { margin: 0 0 15px; color: var(--text-primary); }
article p.last-updated {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-bottom: 18px;
}
article ul, article ol {
  margin: 0 0 16px;
  padding-left: 1.2em;
}
article ul { list-style: disc; }
article ol { list-style: decimal; }
article li { margin-bottom: 6px; }
article strong { color: var(--text-primary); }

/* tables */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 18px;
}
.table-wrap article table, article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}
.table-wrap table { margin: 0; }
article th, article td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}
article th {
  background: var(--bg-card);
  color: var(--accent);
}
article tr:nth-child(even) td { background: var(--bg-secondary); }

/* codes table copy button */
.codes-table td.code-cell { position: relative; padding-right: 74px; }
.copy-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius);
  padding: 3px 8px;
  font-size: 0.72rem;
  white-space: nowrap;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.copied { color: var(--success); border-color: var(--success); }

/* images */
.content-image {
  margin: 0 0 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
}
.content-image img { width: 100%; opacity: 0; transition: opacity 0.3s ease; }
.content-image img.loaded, .content-image img[loading="lazy"] { opacity: 1; }

/* link cards (hub page) */
.link-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0 0 22px;
}
.link-cards .card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.link-cards .card:hover {
  border-color: var(--accent);
  background: var(--bg-secondary);
}
.link-cards .card a {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}
.link-cards .card a:hover { color: var(--accent); }
.link-cards .card p {
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* cpa gate */
.cpa-gate {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  margin: 0 0 22px;
  text-align: center;
}
.cpa-gate__lock { display: block; margin: 0 auto 8px; color: var(--accent); }
.cpa-gate__message { color: var(--text-primary); margin-bottom: 16px; font-weight: 600; }
.cpa-gate__button {
  background: var(--accent);
  color: #171314;
  border: none;
  border-radius: var(--radius);
  padding: 10px 24px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.2s ease;
}
.cpa-gate__button:hover { background: var(--accent-hover); }
.cpa-gate__content { margin-top: 14px; text-align: left; color: var(--text-secondary); }

/* Skeleton loader shown in .cpa-gate__content while locked-content.json fetches */
.cpa-skeleton { display: flex; flex-direction: column; gap: 10px; }
.cpa-skeleton__line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--border) 37%, var(--bg-card) 63%);
  background-size: 400% 100%;
  animation: cpa-skeleton-shimmer 1.4s ease infinite;
}
@keyframes cpa-skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.cpa-note { margin-top: 24px; }

/* related pages */
.related-pages {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.related-pages h2 {
  font-size: 1.05rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}
.related-pages ul { display: flex; flex-direction: column; gap: 9px; }
.related-pages a {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 13px;
  color: var(--text-primary);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.related-pages a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
  transform: translateX(3px);
}

/* freshness badge */
.freshness-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(63, 185, 80, 0.15);
  color: var(--success);
  border: 1px solid var(--success);
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  margin-top: 48px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 16px 36px;
  color: var(--text-secondary);
  font-size: 0.82rem;
}
.disclaimer { margin-bottom: 14px; }
.footer-nav { display: flex; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.footer-nav a { color: var(--text-secondary); transition: color 0.18s ease; }
.footer-nav a:hover { color: var(--accent); }
.footer-updated { color: var(--text-secondary); }

/* sponsored-content footnote — muted, visually separated from the main
   footer disclaimer/nav block it sits below */
.footer-inner .cpa-disclosure {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  opacity: 0.7;
  color: var(--text-secondary);
}

/* ---------- search page ---------- */
.search-page input#pgSearchInput {
  width: 100%;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 18px;
}
#searchResults li { margin-bottom: 10px; }
#searchResults a {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
#searchResults a:hover { border-color: var(--accent); text-decoration: none; }
#searchResults p { color: var(--text-secondary); font-size: 0.85rem; margin-top: 4px; }

/* ---------- 404 ---------- */
.error-page { text-align: center; padding: 60px 16px; }
.error-page h1 { font-size: 3rem; color: var(--accent); }

/* ---------- tablet ---------- */
@media (min-width: 768px) {
  .site-search { margin-top: 0; width: 180px; }
  .link-cards { grid-template-columns: 1fr 1fr; }
  article h1 { font-size: 2rem; }
}

/* ---------- desktop ---------- */
@media (min-width: 1024px) {
  .content-wrap { padding-top: 32px; }
  article h1 { font-size: 2.2rem; }
  .site-search { width: 220px; }
}

/* ---------------- SEO/Mobile audit: touch target minimum sizing (44px) ---------------- */
.cpa-gate__button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.site-header .nav-link, .site-header .dropdown-item { min-height: 44px; }
