* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root { --bg: #0f172a; --bg2: #1e293b; }
body { background: var(--bg); color: #e2e8f0; font-family: -apple-system, system-ui, "Segoe UI", sans-serif; }
.loading { padding: 40vh 20px; text-align: center; color: #64748b; }
a { color: inherit; }

/* ---------- Categories home ---------- */
.home-head { padding: 26px 20px 12px; }
.home-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.home-head p { color: #94a3b8; font-size: 13px; margin-top: 3px; }
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 12px 16px 40px; max-width: 560px; margin: 0 auto; }
.cat-tile {
  position: relative; border: none; cursor: pointer; text-align: left;
  border-radius: 20px; padding: 18px; min-height: 128px; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(150deg, var(--c), color-mix(in srgb, var(--c) 55%, #0f172a));
  box-shadow: 0 8px 24px rgba(0,0,0,.35); transition: transform .12s ease;
}
.cat-tile { min-height: 150px; }
.cat-tile:active { transform: scale(.97); }
.cat-emoji { font-size: 30px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.cat-name { font-size: 18px; font-weight: 800; margin-top: 8px; text-shadow: 0 2px 8px rgba(0,0,0,.6); }

/* ---------- Category card stack ---------- */
.cat-bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  background: rgba(15,23,42,.9); backdrop-filter: blur(8px); padding: 14px 16px;
  border-bottom: 1px solid #1e293b;
}
.cat-bar #back { background: none; border: none; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 6px 0 0; }
.cat-bar .title { font-size: 16px; font-weight: 700; flex: 1; }
.cat-bar .count { font-size: 12px; color: #94a3b8; }

.stack { scroll-snap-type: y mandatory; }
.card { scroll-snap-align: start; min-height: calc(100vh - 52px); display: flex; flex-direction: column;
        background: #fff; color: #0f172a; }
.card-img { position: relative; height: 40vh; overflow: hidden; background: #0f172a; flex-shrink: 0; }
.card-img .blur { position: absolute; inset: 0; background-size: cover; background-position: center;
                  filter: blur(22px) brightness(.6); transform: scale(1.15); }
.card-img .fg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.card-img.ph { display: flex; align-items: center; justify-content: center;
               background: linear-gradient(150deg, var(--c), color-mix(in srgb, var(--c) 50%, #0f172a)); }
.card-img.ph span { font-size: 64px; opacity: .9; }
.card-body { padding: 20px 22px; display: flex; flex-direction: column; flex: 1; position: relative; }
.chips { display: flex; align-items: center; gap: 10px; }
.chip { color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; letter-spacing: .03em; }
.src { font-size: 12px; color: #64748b; font-weight: 600; }
.card-body h2 { font-size: 22px; line-height: 1.25; margin: 14px 0 12px; font-weight: 800; letter-spacing: -.01em; }
.card-body p { font-size: 16px; line-height: 1.6; color: #334155; }
.card-body a { margin-top: 16px; font-size: 13px; font-weight: 700; color: #2563eb; text-decoration: none; }
.pageno { position: absolute; top: 20px; right: 22px; font-size: 12px; color: #94a3b8; font-weight: 600; }

.end-card { align-items: center; justify-content: center; text-align: center; gap: 18px; padding: 24px; }
.end-card p { font-size: 18px; font-weight: 600; color: #334155; }
.next-btn { border: none; background: #0f172a; color: #fff; font-size: 15px; font-weight: 700;
            padding: 14px 22px; border-radius: 999px; cursor: pointer; }
