@import url('rubik.css');

:root {
  --bg: #f4efe9;
  --bg-accent: #fff6ee;
  --surface: #ffffff;
  --surface-2: #fff8f1;
  --surface-3: #221d1a;
  --ink: #16110f;
  --muted: #726861;
  --line: #e8ddd2;
  --accent: #ff5a2f;
  --accent-dark: #db421b;
  --accent-soft: rgba(255, 90, 47, 0.12);
  --accent-yellow: #ffb545;
  --accent-green: #27b36a;
  --accent-blue: #4c7dff;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --shadow: 0 18px 40px rgba(44, 28, 18, 0.08);
  --shadow-soft: 0 10px 24px rgba(44, 28, 18, 0.05);
  --container: 1320px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Rubik', system-ui, sans-serif;
  color: var(--ink);
  overflow-x: hidden;
  background:
    radial-gradient(circle at top right, rgba(255, 181, 69, 0.18), transparent 24%),
    radial-gradient(circle at left center, rgba(255, 90, 47, 0.09), transparent 22%),
    linear-gradient(180deg, #fcf8f4 0%, var(--bg) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

main {
  display: block;
  padding-bottom: 56px;
}

.container-shell {
  width: min(var(--container), calc(100% - 28px));
  margin: 0 auto;
}

.topline {
  background: #171210;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
}

.topline-inner {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  overflow-x: auto;
  white-space: nowrap;
}

.topline-links,
.topline-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topline a:hover { color: #fff; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  overflow: visible;
  background: rgba(252, 248, 244, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(232, 221, 210, 0.8);
}

.site-header.scrolled {
  box-shadow: 0 14px 30px rgba(32, 20, 14, 0.06);
}

.header-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
}

.header-row > *,
.hero-grid > *,
.sidebar-layout > *,
.page-grid > *,
.search-grid > *,
.developer-grid > *,
.article-grid > *,
.catalog-grid > *,
.mini-grid > *,
.category-grid > *,
.stack > * {
  min-width: 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.logo img {
  width: 38px;
  height: 38px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: visible;
}

.main-nav::-webkit-scrollbar { display: none; }

.nav-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: 0.2s ease;
}

.nav-pill.active,
.nav-pill:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.nav-dropdown {
  position: relative;
  flex: 0 0 auto;
}

.nav-dropdown-toggle {
  cursor: pointer;
  font: inherit;
}

.nav-dropdown-chevron {
  font-size: 11px;
  transition: transform 0.2s ease;
}

.nav-dropdown.open {
  z-index: 2;
}

.nav-dropdown.open .nav-dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: 0.2s ease;
  z-index: 60;
}

.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.nav-dropdown-menu a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.section-catalog-dropdown {
  position: relative;
}

.section-catalog-toggle {
  cursor: pointer;
  font: inherit;
  border: 0;
}

.section-catalog-chevron {
  font-size: 11px;
  transition: transform 0.2s ease;
}

.section-catalog-dropdown.open .section-catalog-chevron {
  transform: rotate(180deg);
}

.section-catalog-menu {
  display: none;
  width: 100%;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-feature--section:has(.section-catalog-dropdown.open) .section-catalog-menu {
  display: block;
}

.section-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}

.section-catalog-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  line-height: 1.25;
}

.section-catalog-grid a:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

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

.icon-btn,
.menu-btn {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: 0.2s ease;
}

.icon-btn:hover,
.menu-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.search-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(360px, 34vw);
  padding: 0 16px;
  height: 46px;
  border-radius: 16px;
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
}

.search-inline input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
}

.search-inline input::placeholder { color: #9b8f87; }

.mobile-search-panel {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
  padding: 0;
}

.site-header.search-open .mobile-search-panel {
  max-height: 80px;
  opacity: 1;
  padding: 0 0 14px;
}

.mobile-search-form {
  width: 100%;
  min-width: 0;
}

.mobile-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(360px, 86vw);
  background: #fff;
  border-right: 1px solid var(--line);
  box-shadow: 20px 0 50px rgba(30, 18, 14, 0.12);
  transform: translateX(-102%);
  transition: transform 0.28s ease;
  z-index: 70;
  padding: 20px;
  overflow-y: auto;
}

.mobile-drawer.open { transform: translateX(0); }

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(21, 17, 15, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  z-index: 60;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-head,
.drawer-block {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-links {
  display: grid;
  gap: 8px;
}

.drawer-links a {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
}

.drawer-subtoggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.drawer-subtoggle.active,
.drawer-subtoggle:hover {
  background: var(--surface-2);
}

.drawer-toggle-icon {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.drawer-item-has-sub.open .drawer-toggle-icon {
  transform: rotate(180deg);
}

.drawer-submenu {
  display: none;
  padding: 4px 0 8px 12px;
}

.drawer-item-has-sub.open .drawer-submenu {
  display: grid;
  gap: 4px;
}

.drawer-submenu a {
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.drawer-submenu a:hover,
.drawer-submenu a.active {
  background: var(--surface-2);
  color: var(--ink);
}

.drawer-links a.active,
.drawer-links a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.page-hero {
  padding: 28px 0 18px;
  overflow: visible;
}

.hero-grid {
  display: grid;
  gap: 18px;
}

.hero-feature {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.14), transparent 28%),
    linear-gradient(135deg, #211611 0%, #392219 45%, #ff5a2f 100%);
  color: #fff;
  padding: 28px;
  min-height: 360px;
  box-shadow: var(--shadow);
}

.hero-feature.hero-feature--section {
  min-height: auto;
}

.hero-feature::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-title {
  max-width: 680px;
  margin: 18px 0 10px;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 0.92;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}

.hero-text {
  max-width: 560px;
  color: rgba(255,255,255,0.8);
  font-size: 16px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
  overflow: visible;
}

.btn-main,
.btn-ghost,
.btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  transition: 0.2s ease;
}

.btn-main {
  background: #fff;
  color: var(--ink);
  padding: 14px 22px;
}

.btn-main:hover { transform: translateY(-2px); }

.btn-ghost {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  padding: 14px 22px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.hero-stat {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
}

.hero-stat strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.hero-stat span {
  display: block;
  margin-top: 6px;
  color: rgba(255,255,255,0.76);
  font-size: 12px;
}

.hero-side {
  display: grid;
  gap: 18px;
}

.panel {
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(232, 221, 210, 0.9);
  box-shadow: var(--shadow-soft);
  border-radius: 28px;
  padding: 22px;
}

.panel-dark {
  background: #171210;
  color: #fff;
  border-color: #171210;
}

.section {
  padding-top: 24px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head h2,
.section-head h1,
.section-head .section-head-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: 500;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.page-hero .section-head h1 {
  font-size: clamp(28px, 5vw, 42px);
}

.category-page-panel .section-head h2 {
  font-size: 30px;
}

.category-page-panel .catalog-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.category-page-panel .compact-card {
  grid-template-columns: auto 1fr;
}

.category-page-panel .compact-card > .download-chip {
  grid-column: 1 / -1;
  display: block;
  text-align: center;
}

.section-link {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.chips-row-wrap {
  overflow: hidden;
  margin: 0 -2px;
}

.chips-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

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

@media (min-width: 768px) {
  .chips-row,
  .genre-strip,
  .screenshots-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(29, 15, 8, 0.25) transparent;
  }

  .chips-row::-webkit-scrollbar,
  .genre-strip::-webkit-scrollbar,
  .screenshots-scroll::-webkit-scrollbar {
    display: block;
    height: 6px;
  }

  .chips-row::-webkit-scrollbar-thumb,
  .genre-strip::-webkit-scrollbar-thumb,
  .screenshots-scroll::-webkit-scrollbar-thumb {
    background: rgba(29, 15, 8, 0.22);
    border-radius: 999px;
  }
}

.chip {
  flex: 0 0 auto;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.76);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.chip.active,
.chip:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(255, 90, 47, 0.18);
}

.slider-shell {
  position: relative;
}

.slider-viewport {
  overflow: hidden;
}

.slider-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 18px;
  transition: transform 0.35s ease;
  will-change: transform;
}

.slider-nav {
  display: flex;
  gap: 10px;
}

.slider-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.84);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: 0.2s ease;
}

.slider-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.hero-cards,
.catalog-grid,
.mini-grid,
.category-grid,
.article-grid,
.developer-grid,
.search-grid,
.page-grid,
.stat-grid {
  display: grid;
  gap: 18px;
}

.hero-cards {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.catalog-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.mini-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.app-card {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid rgba(232, 221, 210, 0.9);
  box-shadow: var(--shadow-soft);
  transition: 0.24s ease;
}

.app-card:hover,
.compact-card:hover,
.rank-card:hover,
.version-card:hover,
.list-card:hover {
  transform: translateY(-4px);
}

.app-cover {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #2a1a14 0%, #8f3c1b 100%);
  position: relative;
}

.app-cover.blue { background: linear-gradient(135deg, #16253d 0%, #4c7dff 100%); }
.app-cover.green { background: linear-gradient(135deg, #10241c 0%, #27b36a 100%); }
.app-cover.purple { background: linear-gradient(135deg, #241534 0%, #8a4dff 100%); }
.app-cover.gold { background: linear-gradient(135deg, #31210e 0%, #ffb545 100%); }

.app-cover.has-cover { overflow: hidden; }
.app-cover.has-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-cover-badge,
.mini-badge,
.rank-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.app-card-body {
  padding: 18px;
}

.app-head {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-top: -36px;
  position: relative;
  z-index: 1;
}

.app-head > div {
  min-width: 0;
  flex: 1;
}

.app-icon {
  width: 82px;
  height: 82px;
  border-radius: 24px;
  border: 4px solid #fff;
  background: #fff;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}

.app-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-weight: 500;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.compact-card strong,
.rank-card strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.2;
}

.app-meta,
.muted {
  color: var(--muted);
  font-size: 14px;
}

.meta-line,
.card-stats,
.inline-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.card-actions .btn-main {
  background: var(--accent);
  color: #fff;
  padding: 12px 16px;
}

.card-actions .btn-mini {
  padding: 12px 16px;
  background: var(--surface-2);
  color: var(--ink);
}

.compact-card,
.version-card,
.list-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  transition: 0.24s ease;
}

.compact-icon,
.list-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  object-fit: cover;
}

.rank-list {
  display: grid;
  gap: 12px;
}

.rank-card {
  display: grid;
  grid-template-columns: 52px auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  transition: 0.24s ease;
}

.rank-number {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}

.rank-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
}

.score {
  color: var(--accent-yellow);
  font-weight: 600;
}

.download-chip {
  padding: 12px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.category-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.category-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.76);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  min-width: 0;
}

.category-icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
  background: linear-gradient(135deg, var(--accent) 0%, #ff8d53 100%);
}

.category-icon-app {
  background: transparent;
  overflow: hidden;
}

.category-icon-app img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
}

.category-card strong {
  display: block;
  font-size: 16px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.category-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.stack {
  display: grid;
  gap: 18px;
}

.content-card {
  padding: 24px;
  border-radius: 28px;
  background: rgba(255,255,255,0.82);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.content-card h3,
.content-card h2 {
  margin: 0 0 10px;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.content-card p,
.content-card li {
  color: var(--muted);
  line-height: 1.72;
}

.content-card ul {
  margin: 0;
  padding-left: 18px;
}

.subnav {
  display: grid;
  gap: 10px;
}

.subnav a {
  display: block;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--muted);
}

.subnav a.active,
.subnav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.breadcrumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.breadcrumb-row span:last-child {
  color: var(--ink);
}

.sidebar-layout {
  display: grid;
  gap: 18px;
}

.filter-box {
  padding: 20px;
  border-radius: 24px;
  background: rgba(255,255,255,0.82);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.filter-box h4 {
  margin: 0 0 14px;
  font-size: 16px;
}

.filter-group {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}

.filter-option input {
  accent-color: var(--accent);
}

.form-card {
  display: grid;
  gap: 12px;
}

.form-card input,
.form-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: #fff;
  font: inherit;
  color: var(--ink);
  outline: 0;
}

.form-card textarea {
  min-height: 140px;
  resize: vertical;
}

.foot {
  border-top: 1px solid rgba(232, 221, 210, 0.9);
  background: rgba(255,255,255,0.68);
  backdrop-filter: blur(8px);
}

.foot-grid {
  display: grid;
  gap: 18px;
  padding: 30px 0 20px;
}

.foot-brand {
  padding: 18px 20px;
  border-radius: 24px;
  background: #171210;
  color: rgba(255,255,255,0.82);
}

.foot-brand p {
  margin: 10px 0 0;
  color: rgba(255,255,255,0.68);
}

.foot-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.foot-box {
  padding: 18px 20px;
  border-radius: 24px;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--line);
}

.foot-box h4 {
  margin: 0 0 12px;
  font-size: 14px;
}

.foot-box a {
  display: block;
  padding: 6px 0;
  color: var(--muted);
  font-size: 14px;
}

.foot-box a:hover { color: var(--accent); }

.foot-bottom {
  padding: 0 0 26px;
  color: var(--muted);
  font-size: 13px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.06s; }
.reveal-delay-2 { transition-delay: 0.12s; }
.reveal-delay-3 { transition-delay: 0.18s; }
.reveal-delay-4 { transition-delay: 0.24s; }

.desktop-only { display: none; }

@media (min-width: 768px) {
  .container-shell {
    width: min(var(--container), calc(100% - 44px));
  }

  .hero-grid,
  .sidebar-layout,
  .page-grid,
  .search-grid,
  .developer-grid,
  .article-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
  }

  .foot-grid {
    grid-template-columns: 1.1fr 1.4fr;
    align-items: start;
  }
}

@media (min-width: 1024px) {
  .desktop-only { display: inline-flex; }
  .menu-btn { display: none; }
  .mobile-search-panel { display: none; }
  [data-search-toggle] { display: none; }

  .hero-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.72fr);
  }

  .sidebar-layout,
  .page-grid,
  .search-grid,
  .developer-grid,
  .article-grid {
    grid-template-columns: 320px minmax(0, 1fr);
  }
}

@media (max-width: 1023px) {
  .main-nav,
  .search-inline.desktop-only {
    display: none;
  }
}

@media (max-width: 767px) {
  .topline { display: none; }

  .container-shell {
    width: min(var(--container), calc(100% - 24px));
  }

  .header-row {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    padding: 12px 0;
  }

  .logo span { display: none; }

  .logo img {
    width: 34px;
    height: 34px;
  }

  .icon-btn,
  .menu-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .header-actions {
    gap: 6px;
  }

  .page-hero {
    padding: 18px 0 10px;
  }

  .hero-feature {
    min-height: auto;
    padding: 18px;
    border-radius: 24px;
  }

  .eyebrow {
    font-size: 11px;
    padding: 7px 10px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero-title {
    margin: 14px 0 10px;
    font-size: clamp(25px, 8.8vw, 34px);
    line-height: 0.98;
  }

  .hero-text {
    font-size: 13px;
    line-height: 1.55;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .btn-main,
  .btn-ghost {
    width: 100%;
    min-height: 50px;
    padding: 12px 16px;
    font-size: 15px;
  }

  .compact-card,
  .version-card,
  .list-card,
  .rank-card {
    grid-template-columns: auto 1fr;
    padding: 13px;
    gap: 12px;
  }

  .compact-card > :last-child,
  .version-card > :last-child,
  .list-card > :last-child,
  .rank-card > :last-child {
    grid-column: 1 / -1;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
  }

  .section-head h2,
  .section-head h1,
  .section-head .section-head-title {
    font-size: clamp(22px, 7.2vw, 30px);
    line-height: 1;
  }

  .section-head p {
    font-size: 13px;
  }

  .panel,
  .content-card,
  .filter-box {
    padding: 16px;
    border-radius: 22px;
  }

  .app-card-body {
    padding: 14px;
  }

  .app-head {
    align-items: flex-end;
    gap: 10px;
  }

  .app-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    border-width: 3px;
  }

  .app-title {
    font-size: 17px;
  }

  .app-meta,
  .muted,
  .meta-line,
  .card-stats,
  .inline-metrics {
    font-size: 12px;
  }

  .download-chip {
    justify-self: start;
    padding: 10px 12px;
    font-size: 12px;
  }

  .category-grid,
  .catalog-grid,
  .mini-grid,
  .hero-cards,
  .foot-columns {
    grid-template-columns: 1fr;
  }

  .category-card {
    padding: 14px;
  }

  .category-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 14px;
    font-size: 16px;
  }

  .slider-track {
    grid-auto-columns: calc(100% - 8px);
    gap: 14px;
  }

  .slider-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .chip {
    padding: 10px 14px;
    font-size: 13px;
  }

  .breadcrumb-row {
    gap: 6px;
    font-size: 12px;
    margin-bottom: 12px;
  }

  .section {
    padding-top: 18px;
  }

  .foot-grid {
    padding: 22px 0 16px;
  }
}

@media (max-width: 420px) {
  .container-shell {
    width: min(var(--container), calc(100% - 16px));
  }

  .hero-feature,
  .panel,
  .content-card,
  .filter-box {
    padding: 14px;
    border-radius: 20px;
  }

  .category-card {
    gap: 10px;
  }

  .compact-icon,
  .list-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }

  .hero-title {
    font-size: 24px;
  }

  .btn-main,
  .btn-ghost {
    min-height: 46px;
    font-size: 14px;
  }

  .download-chip {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* --- PHP template components --- */
.container-xl { width: min(var(--container), calc(100% - 28px)); margin: 0 auto; }
.section-head-link, .section-link { flex: 0 0 auto; font-size: 14px; font-weight: 600; color: var(--accent); }
.breadcrumb-wrap { margin-bottom: 16px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; list-style: none; padding: 0; margin: 0; font-size: 13px; color: var(--muted); }
.breadcrumb-item + .breadcrumb-item::before { content: '/'; margin-right: 8px; color: var(--line); }
.breadcrumb-item.active { color: var(--ink); }
.banner-card { display: block; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-soft); overflow: hidden; transition: 0.24s ease; }
.banner-card:hover { transform: translateY(-4px); }
.banner-card-thumb { aspect-ratio: 16/10; background: linear-gradient(135deg, #2a1a14 0%, #8f3c1b 100%); overflow: hidden; }
.banner-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.banner-card-body { display: flex; align-items: center; gap: 12px; padding: 14px; }
.banner-card-icon { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.banner-card-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.banner-card-cat { font-size: 12px; color: var(--muted); margin-top: 2px; }
.row-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 14px; border-radius: 22px; background: rgba(255,255,255,0.8); border: 1px solid var(--line); box-shadow: var(--shadow-soft); transition: 0.24s ease; }
.row-card:hover { transform: translateY(-2px); }
.row-card-icon { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; }
.row-card-name { font-weight: 600; font-size: 14px; }
.row-card-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.row-card-rating { color: var(--accent-yellow); }
.row-card-btn, .row-card-num { padding: 10px 14px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; }
.row-card-num { background: var(--surface-2); color: var(--accent); min-width: 36px; text-align: center; }
.genre-strip-wrap { margin: 16px 0; overflow: hidden; }
.genre-strip { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.genre-strip::-webkit-scrollbar { display: none; }
.genre-chip { flex: 0 0 auto; padding: 10px 16px; border-radius: 999px; background: rgba(255,255,255,0.76); border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 500; }
.genre-chip.active, .genre-chip:hover { background: var(--accent-soft); color: var(--accent); border-color: rgba(255,90,47,0.18); }
.chips-row .chip { flex: 0 0 auto; }
.pagination-wrap { margin: 24px 0; display: flex; justify-content: center; }
.pagination { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; }
.page-link { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 14px; }
.page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-item.disabled .page-link { opacity: 0.5; pointer-events: none; }
.app-hero { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 24px; background: rgba(255,255,255,0.82); border: 1px solid var(--line); margin-bottom: 16px; }
.app-hero-icon { width: 88px; height: 88px; border-radius: 22px; object-fit: cover; }
.app-hero-name { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.app-hero-version, .app-hero-dev, .app-hero-cat { font-size: 13px; color: var(--muted); margin-top: 4px; }
.app-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.app-stat-item { padding: 14px 18px; border-radius: 18px; background: rgba(255,255,255,0.82); border: 1px solid var(--line); min-width: 100px; }
.app-stat-value { display: block; font-size: 18px; font-weight: 700; }
.app-stat-label { font-size: 11px; color: var(--muted); }
.app-stat-icon { color: var(--accent-yellow); margin-right: 4px; }
.download-actions > [class*="col-"] { display: flex; }
.download-actions form { display: flex; flex: 1; width: 100%; }
.btn-download-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 72px; height: 100%; padding: 14px 18px; border: 0; border-radius: 18px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; transition: 0.2s ease; }
.btn-download-main:hover { background: var(--accent-dark); }
.btn-download-main-label { display: block; font-size: 15px; }
.btn-download-main-meta { display: block; font-size: 12px; opacity: 0.85; margin-top: 2px; }
.btn-download-alt { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 72px; height: 100%; padding: 14px 18px; border-radius: 18px; background: rgba(255,255,255,0.82); border: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.info-list { margin: 0; }
.info-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.info-row:last-child { border-bottom: 0; }
.info-row dt { color: var(--muted); font-weight: 500; flex: 0 0 auto; }
.info-row dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; word-break: break-word; max-width: 62%; }
.info-row dd.mono { font-family: monospace; font-size: 11px; font-weight: 500; }
.screenshots-wrap { margin: 20px 0; }
.screenshots-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; overscroll-behavior-x: contain; }
.screenshots-scroll::-webkit-scrollbar { display: none; }
.screenshot-slide { flex: 0 0 auto; width: 140px; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; cursor: pointer; }
.screenshot-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.desc-block { padding: 20px; border-radius: 24px; background: rgba(255,255,255,0.82); border: 1px solid var(--line); margin-bottom: 16px; }
.desc-block h2, .desc-block .h5 { margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.desc-collapse { max-height: 200px; overflow: hidden; position: relative; }
.desc-collapse.expanded { max-height: none; }
.desc-text { font-size: 14px; color: var(--muted); line-height: 1.7; }
.btn-read-more, .btn-versions { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 8px 0; }
.version-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.version-num { font-weight: 600; font-size: 14px; }
.version-date, .version-size { font-size: 12px; color: var(--muted); }
.btn-version-dl { padding: 10px 16px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-version-dl.unavailable { background: var(--surface-2); color: var(--muted); }
.similar-list { display: grid; gap: 8px; }
.similar-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: var(--surface-2); transition: 0.2s ease; }
.similar-item:hover { background: var(--accent-soft); }
.similar-icon { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.similar-name { font-size: 13px; font-weight: 600; }
.similar-desc { font-size: 11px; color: var(--muted); }
.search-hero { padding: 24px; border-radius: 28px; background: rgba(255,255,255,0.82); border: 1px solid var(--line); margin-bottom: 20px; }
.search-hero h1 { margin: 0 0 16px; font-size: 28px; }
.search-form-main { display: flex; gap: 8px; max-width: 560px; }
.search-form-main input { flex: 1; height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: 16px; font: inherit; outline: 0; }
.search-form-main button { width: 48px; height: 48px; border: 0; border-radius: 16px; background: var(--accent); color: #fff; cursor: pointer; }
.popular-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.popular-tag { padding: 8px 14px; border-radius: 999px; background: var(--surface-2); font-size: 13px; color: var(--muted); }
.popular-tag:hover { background: var(--accent-soft); color: var(--accent); }
.developer-hero { padding: 24px; border-radius: 28px; background: linear-gradient(135deg, #211611 0%, #392219 45%, #ff5a2f 100%); color: #fff; margin-bottom: 20px; }
.developer-name { margin: 0; font-size: 32px; font-weight: 800; }
.developer-desc { margin-top: 12px; font-size: 14px; opacity: 0.85; line-height: 1.6; }
.developer-meta { margin-top: 12px; font-size: 13px; opacity: 0.75; }
.article-sidebar-box { padding: 20px; border-radius: 24px; background: rgba(255,255,255,0.82); border: 1px solid var(--line); }
.article-sidebar-box h2, .article-sidebar-box h6 { margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.article-nav-link { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.article-nav-link.active, .article-nav-link:hover { background: var(--accent-soft); color: var(--accent); }
.article-content { padding: 24px; border-radius: 28px; background: rgba(255,255,255,0.82); border: 1px solid var(--line); }
.article-content h1 { margin: 0 0 16px; font-size: 32px; letter-spacing: -0.03em; }
.page-404 { text-align: center; padding: 60px 20px; }
.page-404-num { font-size: 120px; font-weight: 800; color: var(--accent); line-height: 1; letter-spacing: -0.05em; }
.page-404-msg { font-size: 24px; font-weight: 700; margin: 12px 0 8px; }
.page-404-sub { color: var(--muted); margin-bottom: 24px; }
.btn-scroll-top { position: fixed; right: 20px; bottom: 20px; width: 48px; height: 48px; border: 0; border-radius: 16px; background: var(--accent); color: #fff; opacity: 0; pointer-events: none; transition: 0.25s ease; z-index: 40; cursor: pointer; }
.btn-scroll-top.visible { opacity: 1; pointer-events: auto; }
.lightbox-overlay { position: fixed; inset: 0; background: rgba(21,17,15,0.92); z-index: 100; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: 0.25s ease; }
.lightbox-overlay.open { opacity: 1; pointer-events: auto; }
.lightbox-img { max-width: 90vw; max-height: 85vh; border-radius: 12px; }
.lightbox-close, .lightbox-prev, .lightbox-next { position: absolute; width: 44px; height: 44px; border: 0; border-radius: 14px; background: rgba(255,255,255,0.15); color: #fff; cursor: pointer; }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
.review-form .form-control { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; font: inherit; margin-bottom: 8px; }
.star-rating-input { display: flex; flex-direction: row-reverse; gap: 4px; }
.star-rating-input input { display: none; }
.star-rating-input label { color: var(--line); cursor: pointer; font-size: 20px; }
.star-rating-input input:checked ~ label, .star-rating-input label:hover, .star-rating-input label:hover ~ label { color: var(--accent-yellow); }
.list-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 16px; border-radius: 22px; background: rgba(255,255,255,0.8); border: 1px solid var(--line); box-shadow: var(--shadow-soft); transition: 0.24s ease; }
.list-card:hover { transform: translateY(-2px); }
.list-icon { width: 64px; height: 64px; border-radius: 18px; object-fit: cover; }
@media (min-width: 768px) { .container-xl { width: min(var(--container), calc(100% - 44px)); } }
@media (max-width: 767px) {
  .row-card { grid-template-columns: auto 1fr; }
  .row-card-btn, .row-card-num { grid-column: 1 / -1; justify-self: start; }
  .app-hero { flex-direction: column; text-align: center; }
  .page-404-num { font-size: 80px; }
}
