/* AppVay static directory — original design */
:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #1c2333;
  --muted: #64708a;
  --line: #e4e8f2;
  --brand: #3b5bfd;
  --brand-ink: #fff;
  --green: #0f9d58;
  --blue: #2469f4;
  --amber: #f5a623;
  --red: #e0523e;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(28, 35, 51, .08), 0 8px 24px rgba(28, 35, 51, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141c;
    --card: #1b1f2b;
    --ink: #e8ebf4;
    --muted: #97a1b8;
    --line: #2a3040;
    --shadow: 0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; }

/* header */
.site-head {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px clamp(14px, 4vw, 40px);
  background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.05rem; color: var(--ink); white-space: nowrap; }
.site-head nav { display: flex; gap: clamp(8px, 2vw, 22px); }
.site-head nav a { color: var(--muted); font-weight: 600; font-size: .95rem; }
.site-head nav a:hover { color: var(--brand); }

main { max-width: 1080px; margin: 0 auto; padding: clamp(16px, 3vw, 32px) clamp(14px, 4vw, 40px) 48px; }
h1 { font-size: clamp(1.35rem, 3.5vw, 1.9rem); margin: 6px 0 4px; }
h2 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); margin: 26px 0 12px; }
.sub { color: var(--muted); margin: 0 0 18px; }

/* hero (index) */
.hero { text-align: center; padding: clamp(20px, 5vw, 48px) 0 8px; }
.hero p { color: var(--muted); max-width: 640px; margin: 8px auto 0; }
.stats { display: flex; justify-content: center; gap: 14px; margin: 22px 0; flex-wrap: wrap; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 26px; min-width: 110px;
}
.stat b { display: block; font-size: 1.6rem; color: var(--brand); }
.stat span { color: var(--muted); font-size: .9rem; }
.cats { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.cat {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 28px; color: var(--ink); transition: transform .12s ease;
}
.cat:hover { transform: translateY(-2px); }
.cat b { font-size: 1.05rem; }
.cat span { color: var(--muted); }
.cat-android b { color: var(--green); }
.cat-ios b { color: var(--blue); }

/* toolbar (listing) */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
#q {
  flex: 1; min-width: 200px; padding: 10px 14px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink);
}
#q:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
#sort { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: .95rem; }
.count { color: var(--muted); font-size: .9rem; white-space: nowrap; }

/* card grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; color: var(--ink);
  transition: transform .12s ease, border-color .12s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--brand); }
.card-title { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-badges { margin: 4px 0; }
.card-excerpt { margin: 0; color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.icon {
  width: 52px; height: 52px; border-radius: 12px; flex: none; object-fit: cover;
  background: var(--bg); border: 1px solid var(--line);
}
.icon.big { width: 84px; height: 84px; border-radius: 18px; }
.icon.ph { display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.4rem; color: var(--brand); }

/* badges & rating */
.badge {
  display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--bg);
}
.badge.android { color: var(--green); border-color: var(--green); }
.badge.ios { color: var(--blue); border-color: var(--blue); }
.badge.web { color: var(--muted); }
.badge.dl { color: var(--brand); border-color: var(--brand); }
.rating { font-weight: 800; font-size: .9rem; white-space: nowrap; }
.rating.good { color: var(--green); }
.rating.mid { color: var(--amber); }
.rating.bad { color: var(--red); }
.rating.none { color: var(--muted); font-weight: 600; font-size: .8rem; }

/* detail page */
.crumbs { color: var(--muted); font-size: .88rem; margin: 4px 0 16px; }
.crumbs b { color: var(--ink); }
.d-head { display: flex; gap: 18px; align-items: center; margin: 10px 0 18px; flex-wrap: wrap; }
.d-head h1 { margin: 0; }
.d-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.rate-count { color: var(--muted); font-size: .88rem; }

.dl-box {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin: 14px 0 20px;
}
.dl-title { font-weight: 800; margin-bottom: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; margin: 4px 8px 4px 0;
  padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: .98rem;
  color: #fff !important; transition: opacity .12s ease;
}
.btn:hover { opacity: .88; }
.btn-android { background: var(--green); }
.btn-ios { background: #111; }
.btn-web { background: var(--brand); }
.nodl { color: var(--muted); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 6px 0 18px; }
.fact {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px;
}
.fact-k { color: var(--muted); font-size: .82rem; margin-bottom: 4px; }
.fact-v { font-weight: 700; }
.excerpt { color: var(--muted); max-width: 760px; }
.related { margin-top: 8px; }

/* footer */
.site-foot {
  border-top: 1px solid var(--line); background: var(--card);
  padding: 22px clamp(14px, 4vw, 40px); color: var(--muted); font-size: .88rem;
}
.site-foot p { max-width: 860px; margin: 6px auto; }
.src { opacity: .8; }

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .btn { width: 100%; justify-content: center; margin-right: 0; }
}
