/*
 Theme Name:   APKStore
 Description:  APKPure-style APK download theme
 Version:      4.0.0
 Text Domain:  apkstore
*/

/* ══════════════════════════════════════════════
   1. DESIGN TOKENS
══════════════════════════════════════════════ */
:root {
  --green:        #00c566;
  --green-dark:   #00a855;
  --green-light:  #e6fff3;
  --blue:         #1a73e8;
  --blue-dark:    #1558b0;
  --yellow:       #fbbc04;
  --red:          #ea4335;
  --orange:       #ff6d00;
  --purple:       #7b2ff7;
  --white:        #ffffff;
  --bg:           #f5f7fa;
  --bg2:          #eef1f5;
  --border:       #e2e8f0;
  --txt:          #1a202c;
  --txt2:         #4a5568;
  --txt3:         #718096;
  --txt4:         #a0aec0;
  --header-bg:    #00c566;
  --header-h:     56px;
  --font:         'Noto Sans', system-ui, -apple-system, sans-serif;
  --r:            8px;
  --r-lg:         12px;
  --r-xl:         16px;
  --sh:           0 1px 4px rgba(0,0,0,.08);
  --sh-md:        0 4px 14px rgba(0,0,0,.1);
  --sh-lg:        0 8px 24px rgba(0,0,0,.12);
  --t:            .18s ease;
  --content-max:  1200px;
  --sidebar-w:    230px;
}

/* ══════════════════════════════════════════════
   2. RESET & BASE
══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--txt); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; }
svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ══════════════════════════════════════════════
   3. LAYOUT
══════════════════════════════════════════════ */
.site-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }
.container { width: 100%; max-width: var(--content-max); margin-inline: auto; padding-inline: 16px; }

/* Content + Sidebar grid */
.content-sidebar-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
  gap: 20px;
  align-items: start;
  padding-block: 16px;
}
/* CRITICAL: content-area must have min-width:0 to prevent overflow */
.content-area { min-width: 0; overflow: hidden; }
.sidebar-area  { position: sticky; top: calc(var(--header-h) + 12px); min-width: 0; overflow: hidden; }

/* ══════════════════════════════════════════════
   4. HEADER
══════════════════════════════════════════════ */
.site-header {
  background: var(--header-bg);
  height: var(--header-h);
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

.site-header .container { height: 100%; display: flex; align-items: center; gap: 14px; }
.site-logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; text-decoration: none !important; }
.logo-icon  { width: 34px; height: 34px; background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--green-dark); flex-shrink: 0; }
.logo-text  { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -.3px; white-space: nowrap; }

.header-search { flex: 1; max-width: 500px; position: relative; }
.header-search input { width: 100%; height: 36px; border-radius: 18px; border: none; padding: 0 42px 0 16px; font-size: 13.5px; background: rgba(255,255,255,.22); color: #fff; outline: none; transition: background var(--t); }
.header-search input::placeholder { color: rgba(255,255,255,.65); }
.header-search input:focus { background: rgba(255,255,255,.32); }
.search-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: none; color: rgba(255,255,255,.85); padding: 6px 10px; cursor: pointer; }

.header-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.header-nav a { color: rgba(255,255,255,.9); font-size: 13px; font-weight: 500; padding: 6px 10px; border-radius: 4px; white-space: nowrap; transition: background var(--t); text-decoration: none !important; }
.header-nav a:hover { background: rgba(255,255,255,.18); }
.menu-toggle { display: none; background: none; border: none; color: #fff; padding: 4px; cursor: pointer; }

/* Mobile nav */
.mobile-nav { background: var(--white); border-bottom: 1px solid var(--border); display: none; }
.mobile-nav.is-open { display: block; }
.mobile-nav nav { display: flex; flex-direction: column; padding: 8px 16px; gap: 2px; }
.mobile-nav a { padding: 9px 12px; font-size: 14px; color: var(--txt2); border-radius: var(--r); text-decoration: none !important; display: flex; align-items: center; gap: 8px; transition: all var(--t); }
.mobile-nav a:hover { background: var(--green-light); color: var(--green-dark); }

/* Primary nav */
.primary-nav { background: var(--white); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.primary-nav::-webkit-scrollbar { display: none; }
.primary-nav .container { display: flex; height: 40px; }
.primary-nav a,
.primary-nav li > a { font-size: 13px; font-weight: 500; color: var(--txt2); padding: 0 14px; height: 40px; display: flex; align-items: center; white-space: nowrap; border-bottom: 2px solid transparent; text-decoration: none !important; transition: all var(--t); }
.primary-nav a:hover,
.primary-nav a.current,
.primary-nav .current-menu-item > a { color: var(--green-dark); border-bottom-color: var(--green); }
.primary-nav ul { display: flex; height: 100%; }
.primary-nav li { list-style: none; }

/* Breadcrumbs */
.breadcrumb-bar { background: var(--white); border-bottom: 1px solid var(--border); font-size: 12px; color: var(--txt3); }
.breadcrumb-bar .container { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding-block: 8px; min-height: 36px; }
.breadcrumb-bar a, .bc-home { color: var(--txt3); text-decoration: none !important; display: inline-flex; align-items: center; }
.breadcrumb-bar a:hover { color: var(--green-dark); }
.bc-sep { opacity: .4; }
.bc-current { color: var(--txt2); font-weight: 500; }

/* Section box */
.section-box { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; margin-bottom: 16px; overflow: hidden; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; min-width: 0; }
.section-head h2 { font-size: 14px; font-weight: 700; color: var(--txt); display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.section-head h2::before { content: ''; display: block; width: 3px; height: 15px; background: var(--green); border-radius: 2px; flex-shrink: 0; }
.see-all { font-size: 12.5px; color: var(--green-dark); display: flex; align-items: center; gap: 2px; flex-shrink: 0; white-space: nowrap; text-decoration: none !important; margin-left: 8px; }
.see-all:hover { text-decoration: underline !important; }

/* ══════════════════════════════════════════════
   5. APPBOX SYSTEM — ALL 8 STYLES
   Each style is fully self-contained with
   strict overflow control.
══════════════════════════════════════════════ */

/* ─── Grid containers ─────────────────────── */
.apps-list   { display: flex; flex-direction: column; gap: 6px; }
.apps-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.apps-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.apps-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }

/* ─── Shared app icon ─────────────────────── */
.app-icon {
  flex-shrink: 0;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
}
.app-icon-ph {
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   STYLE 1 — HORIZONTAL APP ROW
   Used on: homepage, archive, category, search, related apps
   Layout: [Icon] [Info flex] [Download btn]
   Fix: min-width:0 on info, flex-shrink:0 on btn
═══════════════════════════════════════════ */
.appbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  text-decoration: none !important;
  color: inherit;
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
  /* OVERFLOW FIX: total width must be constrained */
  width: 100%;
  min-width: 0;
  overflow: hidden;
}
.appbox-row:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-1px);
  border-color: #bfdbfe;
}

/* STYLE 1 Icon */
.appbox-row .app-icon,
.appbox-row .app-icon-ph {
  width: 52px; height: 52px;
  border-radius: 12px;
  flex-shrink: 0;
}

/* STYLE 1 Info — MUST have min-width:0 and overflow:hidden */
.app-info {
  flex: 1;
  min-width: 0;      /* critical: allows truncation */
  overflow: hidden;
}
.app-name {
  font-size: 13.5px; font-weight: 600; color: var(--txt);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 2px;
  display: block; /* ensures ellipsis works */
}
.app-dev {
  font-size: 11.5px; color: var(--txt3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 2px;
  display: block;
}
.app-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; overflow: hidden; }
.app-rating { font-size: 11px; color: var(--txt3); display: flex; align-items: center; gap: 2px; white-space: nowrap; flex-shrink: 0; }
.app-rating svg { color: var(--yellow); }
.app-size { font-size: 11px; color: var(--txt4); white-space: nowrap; flex-shrink: 0; }
.app-cat-tag { font-size: 10px; background: var(--bg2); color: var(--txt3); padding: 1px 6px; border-radius: 100px; white-space: nowrap; flex-shrink: 0; }

/* STYLE 1 Button — CRITICAL: flex-shrink:0 so it never gets crushed */
.app-dl-btn {
  background: var(--green);
  color: #fff !important;
  border: none;
  padding: 7px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;          /* never shrink */
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none !important;
  transition: background var(--t);
  line-height: 1;
}
.app-dl-btn:hover { background: var(--green-dark); text-decoration: none !important; color: #fff !important; }
.app-dl-btn.btn-blue  { background: var(--blue); }
.app-dl-btn.btn-blue:hover  { background: var(--blue-dark); }
.app-dl-btn.btn-read  { background: var(--blue); }

/* ═══════════════════════════════════════════
   STYLE 2 — GRID CARD
   Used on: homepage games, category games, trending
   Layout: [Thumbnail 16:9] [Body: icon+name+footer]
═══════════════════════════════════════════ */
.appbox-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none !important;
  color: inherit;
  transition: box-shadow var(--t), transform var(--t);
  min-width: 0;
}
.appbox-card:hover { box-shadow: var(--sh-lg); transform: translateY(-2px); }

.card-thumb-wrap { width: 100%; aspect-ratio: 16/9; overflow: hidden; flex-shrink: 0; background: var(--bg2); }
.card-thumb { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.appbox-card:hover .card-thumb { transform: scale(1.04); }
.card-thumb-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.8); }

.card-body { padding: 10px 12px 12px; flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.card-icon,
.card-icon-ph {
  width: 40px; height: 40px; border-radius: 10px;
  object-fit: cover; flex-shrink: 0; border: 1px solid var(--border);
}
.card-icon-ph { display: flex; align-items: center; justify-content: center; color: #fff; }
.card-titles { flex: 1; min-width: 0; }
.card-name { font-size: 13px; font-weight: 700; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.card-dev  { font-size: 11px; color: var(--txt3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; flex-wrap: wrap; gap: 4px; }
.card-rating { font-size: 11px; color: var(--txt3); display: flex; align-items: center; gap: 2px; }
.card-rating svg { color: var(--yellow); }
.card-badge { background: var(--green-light); color: var(--green-dark); font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 100px; white-space: nowrap; }

/* ═══════════════════════════════════════════
   STYLE 3 — MINI SIDEBAR ROW
   Used on: sidebar top-ranked, all rankings
   Layout: [Rank#] [Icon] [Name+Sub] [Get btn]
   Fix: "Get" button must be flex-shrink:0
        sidebar width is only 230px — keep compact
═══════════════════════════════════════════ */
.appbox-mini {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  text-decoration: none !important;
  color: inherit;
  border-top: 1px solid var(--border);
  transition: background var(--t);
  min-width: 0;
  overflow: hidden;
  width: 100%;
}
.appbox-mini:first-child { border-top: none; }
.appbox-mini:hover { background: var(--bg); text-decoration: none !important; }

.rank-num { font-size: 12px; font-weight: 700; color: var(--txt3); width: 18px; text-align: center; flex-shrink: 0; line-height: 1; }
.rank-num.top3 { color: var(--orange); }

/* Mini icon — smaller for sidebar */
.appbox-mini .app-icon,
.appbox-mini .app-icon-ph,
.mini-icon,
.mini-icon-ph {
  width: 40px; height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
  border: 1px solid var(--border);
}
.mini-icon-ph { display: flex; align-items: center; justify-content: center; color: #fff; }

.mini-info { flex: 1; min-width: 0; overflow: hidden; }
.mini-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.mini-sub  { font-size: 10.5px; color: var(--txt3); display: flex; align-items: center; gap: 2px; }
.mini-sub svg { color: var(--yellow); }

/* "Get" button — CRITICAL fix: flex-shrink:0, small padding for sidebar */
.mini-dl {
  background: var(--green);
  color: #fff !important;
  border: none;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;       /* never shrink — was overflowing */
  cursor: pointer;
  text-decoration: none !important;
  display: inline-block;
  white-space: nowrap;
  line-height: 1.6;
  transition: background var(--t);
}
.mini-dl:hover { background: var(--green-dark); color: #fff !important; }

/* ═══════════════════════════════════════════
   STYLE 4 — BANNER CARD (featured)
   Used on: homepage featured, category top-3
   Layout: full-bleed image + gradient overlay + content row
═══════════════════════════════════════════ */
.appbox-banner {
  border-radius: var(--r-xl);
  overflow: hidden;
  position: relative;
  aspect-ratio: 2 / 1;
  text-decoration: none !important;
  color: #fff;
  display: block;
  background: var(--bg2);
  transition: transform var(--t), box-shadow var(--t);
  min-width: 0;
}
.appbox-banner:hover { transform: scale(1.015); box-shadow: var(--sh-lg); }

.banner-bg     { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; z-index: 0; display: block; }
.banner-bg-ph  { width: 100%; height: 100%; position: absolute; inset: 0; z-index: 0; }
.appbox-banner::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(0deg, rgba(0,0,0,.75) 0%, rgba(0,0,0,.1) 55%, transparent 100%);
}
.banner-content {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  padding: 12px 14px;
  display: flex; align-items: flex-end; gap: 10px;
  min-width: 0;
}
.banner-icon,
.banner-icon-ph {
  width: 46px; height: 46px; border-radius: 11px;
  flex-shrink: 0; object-fit: cover;
  border: 2px solid rgba(255,255,255,.3);
}
.banner-icon-ph { background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; }
.banner-info { flex: 1; min-width: 0; }
.banner-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; margin-bottom: 2px; }
.banner-sub  { font-size: 11px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.banner-btn {
  background: var(--green); color: #fff;
  border: none; padding: 6px 14px; border-radius: 100px;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0; white-space: nowrap; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
}

/* ═══════════════════════════════════════════
   STYLE 5 — CATEGORY CHIP
   Used on: category filters, chips row, search filters
═══════════════════════════════════════════ */
.app-cat-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px;
  background: var(--white); border: 1px solid var(--border); border-radius: 100px;
  font-size: 12px; font-weight: 500; color: var(--txt2);
  text-decoration: none !important;
  white-space: nowrap; flex-shrink: 0;
  transition: all var(--t);
}
.app-cat-chip:hover { background: var(--green-light); border-color: var(--green); color: var(--green-dark); }
.app-cat-chip.active { background: var(--green); border-color: var(--green); color: #fff; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

/* ═══════════════════════════════════════════
   STYLE 6 — SCREENSHOT HORIZONTAL ROW
   Used on: single post screenshots, download page
═══════════════════════════════════════════ */
.screenshot-row {
  display: flex; gap: 8px;
  overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.screenshot-row::-webkit-scrollbar { height: 4px; }
.screenshot-row::-webkit-scrollbar-track { background: transparent; }
.screenshot-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.screenshot-row img {
  height: 200px; width: auto;
  border-radius: var(--r); border: 1px solid var(--border);
  flex-shrink: 0; cursor: zoom-in;
  transition: opacity var(--t);
  display: block;
}
.screenshot-row img:hover { opacity: .88; }

/* ═══════════════════════════════════════════
   STYLE 7 — HORIZONTAL SCROLL ICON ROW
   Used on: homepage category browse, trending quick-scroll
═══════════════════════════════════════════ */
.app-scroll-row {
  display: flex; gap: 10px;
  overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.app-scroll-row::-webkit-scrollbar { display: none; }
.app-scroll-item {
  flex-shrink: 0; width: 76px;
  text-align: center; text-decoration: none !important; color: inherit;
  transition: transform var(--t);
}
.app-scroll-item:hover { transform: translateY(-2px); }
.app-scroll-item:hover .scroll-icon-ph { box-shadow: var(--sh-md); }
.scroll-icon-ph {
  width: 58px; height: 58px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 6px; color: #fff;
  transition: box-shadow var(--t);
}
.scroll-name { font-size: 11px; font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: block; white-space: nowrap; }

/* ═══════════════════════════════════════════
   STYLE 8 — VERSION TABLE ROW
   Used on: single post versions tab, download page versions
═══════════════════════════════════════════ */
.version-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r);
  margin-bottom: 6px;
  min-width: 0; overflow: hidden;
}
.ver-num {
  font-size: 13px; font-weight: 700; color: var(--txt);
  flex: 1; min-width: 0;
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
}
.ver-date,
.ver-size { font-size: 11.5px; color: var(--txt3); flex: 1; min-width: 60px; display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.ver-latest-badge { background: #dcfce7; color: #166534; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 100px; white-space: nowrap; }
.ver-dl {
  background: var(--green); color: #fff !important;
  padding: 5px 12px; border-radius: 100px;
  font-size: 11.5px; font-weight: 600;
  text-decoration: none !important;
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap; transition: background var(--t);
}
.ver-dl:hover { background: var(--green-dark); color: #fff !important; }

/* ═══════════════════════════════════════════
   RELATED APPS — uses Style 1 rows in a grid
   Fix: was causing overflow in 2-column grid
═══════════════════════════════════════════ */
.related-apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 8px;
}
/* Inside related grid, limit download btn to just icon */
.related-apps-grid .app-dl-btn { padding: 6px 10px; font-size: 11px; }

/* ══════════════════════════════════════════════
   6. SIDEBAR
══════════════════════════════════════════════ */
.sidebar-box { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: 12px; overflow: hidden; }
.sidebar-box-title { font-size: 13px; font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--txt); display: flex; align-items: center; gap: 5px; }
.sidebar-box-title::before { content: ''; display: block; width: 3px; height: 13px; background: var(--green); border-radius: 2px; flex-shrink: 0; }
.sidebar-box-content { padding: 2px 0; }

/* Sidebar category list */
.sidebar-cat-list a { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 7px 12px; font-size: 12.5px; color: var(--txt2); text-decoration: none !important; transition: all var(--t); border-top: 1px solid transparent; min-width: 0; }
.sidebar-cat-list a:first-child { border-top: none; }
.sidebar-cat-list a:hover { background: var(--green-light); color: var(--green-dark); }
.sidebar-cat-list a span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { background: var(--bg2); color: var(--txt3); font-size: 10px; padding: 1px 7px; border-radius: 100px; white-space: nowrap; flex-shrink: 0; }
.sidebar-empty { padding: 10px 12px; font-size: 12px; color: var(--txt3); }

.ad-box {
  background: var(--bg2); border: 1px dashed var(--border); border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  color: var(--txt4); font-size: 11px; text-align: center; margin-bottom: 12px;
}

/* ══════════════════════════════════════════════
   7. SINGLE APP PAGE
══════════════════════════════════════════════ */
.single-app-header { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; margin-bottom: 16px; }
.single-app-top { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; flex-wrap: wrap; }

.single-app-icon { width: 86px; height: 86px; border-radius: 20px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); box-shadow: var(--sh); display: block; }
.single-app-icon-ph { width: 86px; height: 86px; border-radius: 20px; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; box-shadow: var(--sh); }

.single-app-info { flex: 1; min-width: 180px; }
.single-app-name { font-size: 20px; font-weight: 800; line-height: 1.2; margin-bottom: 4px; }
.single-app-dev  { font-size: 13px; color: var(--green-dark); margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.single-app-dev a { color: var(--green-dark); }
.cats-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.single-meta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; }
.single-meta-item { text-align: center; }
.single-meta-val { font-size: 14px; font-weight: 700; color: var(--txt); line-height: 1.2; }
.single-meta-label { font-size: 10px; color: var(--txt3); margin-top: 2px; display: flex; align-items: center; justify-content: center; gap: 3px; }

.single-dl-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--green); color: #fff !important;
  padding: 11px 28px; border-radius: 100px;
  font-size: 15px; font-weight: 700;
  text-decoration: none !important; border: none; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,197,102,.35);
  transition: all var(--t); white-space: nowrap;
}
.single-dl-btn:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,197,102,.45); }

.trust-badges { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.trust-badge  { font-size: 11.5px; color: var(--txt3); display: flex; align-items: center; gap: 4px; }
.trust-badge svg { color: var(--green); }

/* Rating block */
.rating-block { display: flex; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); margin-top: 14px; flex-wrap: wrap; }
.rating-big { text-align: center; min-width: 65px; }
.rating-big .big-num { font-size: 36px; font-weight: 800; line-height: 1; color: var(--txt); }
.star-rating { display: inline-flex; align-items: center; gap: 1px; }
.stars-filled svg { color: var(--yellow); }
.stars-empty  svg { color: var(--bg2); }
.star-num { font-size: 13px; color: var(--txt3); margin-left: 4px; }
.rating-count-label { font-size: 11px; color: var(--txt3); margin-top: 3px; }
.rating-bars { flex: 1; min-width: 130px; }
.rating-bar-row { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.rbar-label { font-size: 10.5px; color: var(--txt3); width: 10px; text-align: right; }
.rbar-track { flex: 1; height: 6px; background: var(--bg2); border-radius: 3px; overflow: hidden; }
.rbar-fill  { height: 100%; background: var(--yellow); border-radius: 3px; transition: width .4s ease; }
.rbar-pct   { font-size: 10px; color: var(--txt4); width: 28px; }

/* App info grid */
.app-info-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; padding: 14px 0; border-top: 1px solid var(--border); margin-top: 14px; }
.app-info-item { text-align: center; }
.info-val { font-size: 12.5px; font-weight: 600; color: var(--txt); }
.info-lbl { font-size: 10px; color: var(--txt3); margin-top: 2px; display: flex; align-items: center; justify-content: center; gap: 3px; }

/* ══ TABS ══ */
.tab-bar { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn { background: none; border: none; padding: 9px 14px; font-size: 12.5px; font-weight: 500; color: var(--txt3); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 5px; transition: all var(--t); flex-shrink: 0; }
.tab-btn:hover { color: var(--green-dark); }
.tab-btn.active { color: var(--green-dark); border-bottom-color: var(--green); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* App description */
.app-desc { font-size: 13.5px; line-height: 1.75; color: var(--txt2); position: relative; overflow: hidden; }
.app-desc.collapsed { max-height: 110px; }
.app-desc.collapsed::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 50px; background: linear-gradient(transparent, var(--white)); pointer-events: none; }
.read-more-btn { background: none; border: none; color: var(--green-dark); font-size: 13px; font-weight: 600; padding: 7px 0; display: flex; align-items: center; gap: 5px; cursor: pointer; margin-top: 4px; }

/* ══ USER RATING WIDGET ══ */
.user-rating-widget { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; margin: 14px 0; }
.user-rating-title  { font-size: 14px; font-weight: 700; color: var(--txt); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.user-rating-title svg { color: var(--yellow); }
.rating-stars-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; margin-bottom: 10px; }
.rating-stars-input input[type=radio] { display: none; }
.rating-stars-input label { cursor: pointer; color: var(--bg2); font-size: 0; }
.rating-stars-input label svg { width: 26px; height: 26px; transition: color var(--t), transform var(--t); }
.rating-stars-input label:hover svg,
.rating-stars-input label:hover ~ label svg,
.rating-stars-input input:checked ~ label svg { color: var(--yellow); transform: scale(1.1); }
.rating-stars-input.voted label { cursor: default; }
.rating-stars-input.voted label:hover svg,
.rating-stars-input.voted label:hover ~ label svg { transform: none; }
.rating-summary { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rating-avg { font-size: 22px; font-weight: 800; color: var(--txt); }
.rating-count { font-size: 12px; color: var(--txt3); }
.rating-voted-msg { font-size: 12.5px; color: var(--green-dark); display: flex; align-items: center; gap: 5px; margin-top: 8px; font-weight: 600; }

/* ══ COMMENTS ══ */
.comments-section { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; margin-bottom: 16px; }
.comments-title { font-size: 15px; font-weight: 700; color: var(--txt); margin-bottom: 16px; display: flex; align-items: center; gap: 6px; }
.comments-title::before { content: ''; display: block; width: 3px; height: 16px; background: var(--green); border-radius: 2px; }
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment-list .children { list-style: none; margin-left: 40px; padding-left: 12px; border-left: 2px solid var(--border); }
.comment-body { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment-body:last-child { border-bottom: none; }
.comment-avatar img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: block; }
.comment-avatar { flex-shrink: 0; }
.comment-content { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.comment-author-name { font-size: 13px; font-weight: 700; color: var(--txt); }
.comment-date { font-size: 11.5px; color: var(--txt3); display: flex; align-items: center; gap: 3px; }
.comment-text { font-size: 13.5px; color: var(--txt2); line-height: 1.65; }
.comment-text p { margin-bottom: .5em; }
.comment-text p:last-child { margin-bottom: 0; }
.comment-reply-link { font-size: 11.5px; color: var(--green-dark); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; margin-top: 6px; cursor: pointer; background: none; border: none; padding: 0; }
.bypostauthor > .comment-body { background: var(--green-light); border-radius: var(--r); padding: 14px 12px; margin-inline: -12px; }
.comment-author-badge { background: var(--green); color: #fff; font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 100px; text-transform: uppercase; }
.no-comments { text-align: center; padding: 24px; color: var(--txt3); font-size: 13.5px; }
.no-comments svg { opacity: .3; display: block; margin: 0 auto 10px; }
.comment-form-wrap { background: var(--bg2); border-radius: var(--r-lg); padding: 18px 20px; }
.comment-form { display: flex; flex-direction: column; gap: 12px; }
.comment-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.comment-form label { display: block; font-size: 11.5px; font-weight: 700; color: var(--txt2); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r); font-size: 13.5px; color: var(--txt); background: var(--white); font-family: var(--font); transition: border-color var(--t), box-shadow var(--t); }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(0,197,102,.12); }
.comment-form textarea { resize: vertical; min-height: 100px; }
.comment-form .required { color: var(--red); }
.comment-must-login { font-size: 13px; color: var(--txt3); padding: 12px; text-align: center; }
.comment-submit-btn { background: var(--green); color: #fff; border: none; padding: 10px 26px; border-radius: 100px; font-size: 14px; font-weight: 700; cursor: pointer; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; transition: background var(--t); box-shadow: 0 4px 12px rgba(0,197,102,.3); }
.comment-submit-btn:hover { background: var(--green-dark); }
#cancel-comment-reply-link { color: var(--red); font-size: 12px; text-decoration: none; }
#respond { margin-top: 16px; }

/* ══ CATEGORY HERO ══ */
.cat-hero { background: linear-gradient(135deg,var(--green-dark),#00a3d9); border-radius: var(--r-xl); padding: 20px; color: #fff; margin-bottom: 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cat-hero-games { background: linear-gradient(135deg,var(--purple),#f107a3); }
.cat-icon { font-size: 0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cat-icon svg { color: rgba(255,255,255,.9); width: 50px; height: 50px; }
.cat-hero h1 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.cat-hero p  { font-size: 13px; opacity: .85; }

/* ══ FILTER BAR ══ */
.filter-bar { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 10px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar label { font-size: 12px; font-weight: 600; color: var(--txt2); flex-shrink: 0; }
.filter-bar select { height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; background: var(--bg); color: var(--txt); outline: none; }
.filter-bar select:focus { border-color: var(--green); }
.filter-divider { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
.view-btn { padding: 4px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 4px; transition: all var(--t); color: var(--txt2); white-space: nowrap; }
.view-btn:hover, .view-btn.active { border-color: var(--green); color: var(--green-dark); background: var(--green-light); }

/* ══ SEARCH ══ */
.search-results-header { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 14px; }
.search-results-header h1 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.result-count { font-size: 13px; color: var(--txt3); margin-top: 3px; }
.search-filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* ══ ARCHIVE ══ */
.archive-header { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 14px; }
.archive-header h1 { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.archive-header .cat-desc { font-size: 13px; color: var(--txt3); margin-top: 5px; }

/* ══ PAGINATION ══ */
.pagination { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 20px; padding-top: 4px; }
.pagination a,
.pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: var(--r); font-size: 13px; font-weight: 500; text-decoration: none !important; border: 1px solid var(--border); color: var(--txt2); gap: 4px; transition: all var(--t); }
.pagination a:hover { border-color: var(--green); color: var(--green-dark); background: var(--green-light); }
.pagination .current { background: var(--green); border-color: var(--green); color: #fff; }
.pagination .dots { border: none; background: none; pointer-events: none; }

/* ══ DOWNLOAD PAGE ══ */
.dl-page-wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px 40px; }
.dl-hero-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; margin-bottom: 16px; display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.dl-hero-icon { width: 78px; height: 78px; border-radius: 18px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); box-shadow: var(--sh); display: block; }
.dl-hero-icon-ph { width: 78px; height: 78px; border-radius: 18px; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; box-shadow: var(--sh); }
.dl-meta-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.dl-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: var(--bg2); border: 1px solid var(--border); border-radius: 100px; font-size: 11.5px; color: var(--txt2); white-space: nowrap; }
.dl-main-box { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px 20px; text-align: center; margin-bottom: 16px; }
.dl-countdown { font-size: 52px; font-weight: 900; color: var(--green); line-height: 1; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.dl-countdown-label { font-size: 13px; color: var(--txt3); margin-bottom: 20px; }
.dl-main-btn { display: inline-flex; align-items: center; gap: 10px; background: var(--green); color: #fff !important; padding: 14px 36px; border-radius: 100px; font-size: 17px; font-weight: 800; text-decoration: none !important; border: none; cursor: pointer; box-shadow: 0 6px 20px rgba(0,197,102,.4); transition: all var(--t); }
.dl-main-btn:hover { background: var(--green-dark); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,197,102,.5); }
.dl-main-btn:disabled, .dl-main-btn.is-disabled { background: #9ca3af; box-shadow: none; pointer-events: none; }
.dl-progress-wrap { height: 4px; background: var(--border); border-radius: 2px; margin-bottom: 14px; overflow: hidden; }
.dl-progress-bar { height: 100%; background: var(--green); border-radius: 2px; transition: width 1s linear; }
.dl-trust-row { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.dl-trust-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--txt2); font-weight: 500; }
.dl-trust-item svg { color: var(--green); }
.dl-safe-notice { background: #f0fdf4; border: 1px solid #86efac; border-radius: var(--r); padding: 10px 14px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #166534; margin-bottom: 12px; }
.dl-safe-notice svg { color: var(--green); flex-shrink: 0; }
.dl-warn { background: #fff8e1; border: 1px solid #fdd835; border-radius: var(--r); padding: 10px 14px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #92400e; margin-bottom: 12px; }
.dl-secondary-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 20px; margin-bottom: 14px; }
.dl-secondary-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.dl-mirror-btn { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r); font-size: 13px; color: var(--txt); text-decoration: none !important; transition: all var(--t); margin-bottom: 6px; }
.dl-mirror-btn:hover { background: var(--green-light); border-color: var(--green); color: var(--green-dark); }
.dl-mirror-info { flex: 1; min-width: 0; }
.dl-mirror-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-mirror-sub  { font-size: 11px; color: var(--txt3); }
.dl-step { display: flex; gap: 12px; margin-bottom: 10px; align-items: flex-start; font-size: 13px; color: var(--txt2); }
.dl-step-num { width: 24px; height: 24px; background: var(--green); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; margin-top: 1px; }

/* ══ EMPTY STATE ══ */
.empty-state { text-align: center; padding: 40px 20px; color: var(--txt3); }
.empty-state svg { opacity: .2; display: block; margin: 0 auto 14px; }
.empty-state p { font-size: 14px; }
.admin-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* ══ TRENDING SWITCHER ══ */
.trending-switcher { display: flex; gap: 6px; background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 8px; margin-bottom: 16px; width: fit-content; }
.trending-tab-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 22px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg2); color: var(--txt2); font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s; }
.trending-tab-btn:hover { background: var(--green-light); border-color: var(--green); color: var(--green-dark); }
.trending-tab-btn.active { background: var(--green); border-color: var(--green); color: #fff; }
.trending-panel { display: none; }
.trending-panel.active { display: block; }

/* ══ FOOTER ══ */
.site-footer { background: var(--white); border-top: 1px solid var(--border); padding: 24px 0 16px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; margin-bottom: 20px; }
.footer-brand .brand-name { font-size: 18px; font-weight: 700; color: var(--green-dark); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.footer-brand p { font-size: 12.5px; color: var(--txt3); line-height: 1.65; }
.footer-socials { display: flex; gap: 8px; margin-top: 12px; }
.footer-social-btn { width: 32px; height: 32px; background: var(--bg2); border: 1px solid var(--border); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--txt2); text-decoration: none !important; transition: all var(--t); }
.footer-social-btn:hover { border-color: var(--green); color: var(--green-dark); background: var(--green-light); }
.footer-col h4 { font-size: 12.5px; font-weight: 700; color: var(--txt); margin-bottom: 10px; }
.footer-col ul { display: flex; flex-direction: column; gap: 6px; }
.footer-col a { font-size: 12px; color: var(--txt3); transition: color var(--t); }
.footer-col a:hover { color: var(--green-dark); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 14px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 11.5px; color: var(--txt3); }

/* ══════════════════════════════════════════════
   8. RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 1100px) {
  :root { --sidebar-w: 200px; }
  .apps-grid-4 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
@media (max-width: 860px) {
  .content-sidebar-wrap { grid-template-columns: 1fr; }
  .sidebar-area { position: static; }
  .apps-grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .apps-grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .header-nav { display: none; }
  .menu-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .related-apps-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .apps-grid-4,
  .apps-grid-3,
  .apps-grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cat-hero { flex-wrap: wrap; }
  .single-app-top { gap: 12px; }
  .app-info-grid { grid-template-columns: repeat(2,1fr); }
  .comment-form .form-row { grid-template-columns: 1fr; }
  .comment-list .children { margin-left: 16px; }
  /* On mobile, download btn text shrinks */
  .app-dl-btn { padding: 6px 10px; font-size: 11.5px; }
  .mini-dl { padding: 4px 8px; font-size: 10.5px; }
}

@media print {
  .site-header, .site-footer, .sidebar-area, .primary-nav { display: none; }
  body { background: #fff; color: #000; }
}
