/* HeroForge — app & game directory
   Layout borrows the card-grid hub pattern (dense responsive grid, hover
   title reveal, big lead cards) with its own palette and type scale. */

:root {
  --bg: #f3f5ff;
  --card: #ffffff;
  --ink: #10131c;
  --ink-2: #2b3040;
  --muted: #6b7280;
  --line: #e6e8f5;
  --accent: #4b57e7;
  --accent-soft: #eef0ff;
  --mint: #17b892;
  --amber: #ffb020;
  --radius: 16px;
  --shadow: 0 6px 16px rgba(16, 19, 28, 0.14);
  --shadow-lg: 0 18px 40px rgba(16, 19, 28, 0.22);
  --wrap: 1240px;
  --font: "Helvetica Neue", Helvetica, "Segoe UI", Arial, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: -9999px; top: 0; background: #fff;
  padding: 10px 16px; z-index: 99; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); font-size: 0.9rem; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem;
  font-weight: 700; color: var(--mint); margin-bottom: 0.6rem;
}

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.25);
}
.topbar__inner {
  display: flex; align-items: center; gap: 20px;
  min-height: 64px; padding-block: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand__mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #7c8cff);
  font: 800 0.82rem/1 var(--font); letter-spacing: 0.04em; color: #fff;
}
.brand__name { font-weight: 800; font-size: 1.12rem; letter-spacing: -0.02em; }
.brand__name em { font-style: normal; color: var(--mint); }

.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.search input, .hero__search input {
  width: 100%; padding: 11px 46px 11px 16px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1); color: #fff;
  font: inherit; font-size: 0.95rem;
}
.search input::placeholder { color: rgba(255, 255, 255, 0.6); }
.search button {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 1rem;
}
.topnav { display: flex; gap: 18px; }
.topnav a { color: rgba(255, 255, 255, 0.82); font-weight: 600; font-size: 0.92rem; }
.topnav a:hover { color: #fff; text-decoration: none; }

/* ------------------------------------------------------------------ hero */

.hero {
  background:
    radial-gradient(1000px 500px at 12% -10%, rgba(49, 208, 170, 0.28), transparent 60%),
    radial-gradient(900px 600px at 95% 10%, rgba(124, 140, 255, 0.45), transparent 65%),
    linear-gradient(160deg, #141a35 0%, #1d2450 55%, #2a2367 100%);
  color: #fff;
  padding: clamp(36px, 6vw, 68px) 0 clamp(30px, 5vw, 54px);
}
.hero .wrap {
  display: grid; gap: clamp(24px, 4vw, 48px);
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}
@media (min-width: 900px) {
  .hero .wrap { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.3rem); margin-bottom: 0.4em; }
.lede { font-size: clamp(1rem, 1.4vw, 1.12rem); color: rgba(255, 255, 255, 0.8); }
.hero .eyebrow { color: #6fe6c8; }
.hero__search { display: flex; gap: 10px; margin-top: 22px; max-width: 520px; }
.hero__search input {
  background: rgba(255, 255, 255, 0.94); color: var(--ink);
  border-color: transparent; padding-right: 16px;
}
.hero__search input::placeholder { color: #8b90a5; }
.hero__search button {
  padding: 0 22px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--mint); color: #04241d; font-weight: 700; font-size: 0.95rem;
}
.hero__stats { display: flex; gap: 26px; margin-top: 26px; flex-wrap: wrap; }
.hero__stats strong { display: block; font-size: 1.55rem; letter-spacing: -0.03em; }
.hero__stats span { color: rgba(255, 255, 255, 0.66); font-size: 0.82rem; }

/* ------------------------------------------------------------------ grid */

.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
}
.grid--hero { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2vw, 20px); }

.card { position: relative; }
.card__link {
  display: block; color: inherit;
  transition: transform 0.22s ease;
}
.card__link:hover { text-decoration: none; }
.card__thumb {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius); background: #dfe3f5;
  box-shadow: var(--shadow);
  transition: box-shadow 0.22s ease;
}
.card__img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.card__shade {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 0%, transparent 58%);
  opacity: 0; transition: opacity 0.22s ease;
}
.card__title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 9px; color: var(--ink); font-weight: 700;
  font-size: 0.8rem; line-height: 1.3; letter-spacing: -0.01em;
  min-height: 2.6em;
}
.card__meta {
  display: block; margin-top: 3px;
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--muted);
}
.card__link:hover, .card__link:focus-visible { transform: translateY(-4px); }
.card__link:hover .card__thumb,
.card__link:focus-visible .card__thumb { box-shadow: var(--shadow-lg); }
.card__link:hover .card__shade,
.card__link:focus-visible .card__shade { opacity: 1; }
.card__link:hover .card__meta,
.card__link:focus-visible .card__meta { color: var(--accent); }

.grid--hero .card__title { font-size: clamp(0.95rem, 1.5vw, 1.15rem); color: #fff; min-height: 0; }
.grid--hero .card__meta { color: rgba(255, 255, 255, 0.62); }
.card[hidden] { display: none; }

/* -------------------------------------------------------------- sections */

.section { padding: clamp(28px, 4vw, 46px) 0; }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 18px; }
.section__head h2 { position: relative; padding-left: 14px; }
.section__head h2::before {
  content: ""; position: absolute; left: 0; top: 0.15em; bottom: 0.15em;
  width: 4px; border-radius: 4px; background: var(--accent);
}
.section__head p { color: var(--muted); margin: 0; }
.section[hidden] { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 22px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  font: 600 0.88rem/1 var(--font); display: inline-flex; align-items: center; gap: 7px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip__n {
  font-size: 0.72rem; background: rgba(75, 87, 231, 0.12); color: var(--accent);
  padding: 2px 7px; border-radius: 999px;
}
.chip.is-active .chip__n { background: rgba(255, 255, 255, 0.22); color: #fff; }
.empty { color: var(--muted); font-style: italic; }

/* show-more control for long grids */
.more { margin: 22px 0 0; text-align: center; }
.more[hidden] { display: none; }
.more__btn {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 12px 24px; border-radius: 999px;
  font: 600 0.94rem/1 var(--font);
  transition: border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.more__btn:hover {
  border-color: var(--accent); color: var(--accent);
  box-shadow: var(--shadow);
}

/* --------------------------------------------------------------- ad slots */

.ad {
  position: relative; display: grid; place-items: center;
  min-height: 96px; margin: 26px auto;
  max-width: 1200px; border-radius: 12px;
  background: repeating-linear-gradient(
    -45deg, rgba(75, 87, 231, 0.05) 0 12px, transparent 12px 24px
  );
  border: 1px dashed rgba(75, 87, 231, 0.28);
}
.ad--inline { margin: 4px 0 24px; min-height: 84px; }
/* A placement that has a real AdSense slot ID: the <ins> unit fills it. */
.ad--unit {
  background: transparent; border-style: solid; border-color: rgba(75, 87, 231, 0.16);
  min-height: 108px; padding: 6px;
}
.ad--unit .ad__label { display: none; }
.ad__label {
  font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}

/* ---------------------------------------------------------------- footer */

.footer { background: var(--ink); color: rgba(255, 255, 255, 0.72); padding: 40px 0 30px; margin-top: 34px; }
.footer__inner { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .footer__inner { grid-template-columns: 2fr 1fr; } }
.footer__brand { display: flex; gap: 14px; align-items: flex-start; }
.footer__brand p { max-width: 62ch; font-size: 0.9rem; margin: 0; }
.footer__brand strong { color: #fff; }
.footer__links { display: flex; flex-direction: column; gap: 9px; }
.footer__links a { color: rgba(255, 255, 255, 0.8); font-size: 0.92rem; }
.footer__links a:hover { color: #fff; }
.footer__legal { border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: 26px; padding-top: 18px; }
.footer__legal p { font-size: 0.78rem; color: rgba(255, 255, 255, 0.5); margin-bottom: 0.5em; }

/* --------------------------------------------------------------- detail */

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 22px; font-size: 0.87rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs span[aria-current] { color: var(--ink-2); font-weight: 600; }

.detail { padding: 20px 0 34px; }
.detail__head { display: flex; gap: clamp(16px, 3vw, 28px); align-items: flex-start; flex-wrap: wrap; }
.detail__icon {
  width: clamp(92px, 14vw, 132px); aspect-ratio: 1; border-radius: 24px;
  box-shadow: var(--shadow); background: #fff;
}
.detail__id { flex: 1 1 240px; min-width: 0; }
.detail__id h1 { margin-bottom: 0.2em; }
.detail__by { color: var(--muted); font-weight: 600; margin-bottom: 0.5em; }
.detail__tagline { font-size: 1.05rem; color: var(--ink-2); max-width: 62ch; }
.detail__rating { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.92rem; color: var(--ink-2); font-weight: 600; }
.detail__rating .dot { color: var(--muted); }

.stars { position: relative; display: inline-block; font-size: 1rem; letter-spacing: 2px; line-height: 1; }
.stars__ghost { color: #d7dAea; }
.stars__fill { position: absolute; left: 0; top: 0; overflow: hidden; color: var(--amber); white-space: nowrap; }

.stores { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 6px; }
.store {
  display: inline-flex; align-items: center; gap: 11px;
  padding: 11px 20px; border-radius: 12px; color: #fff; font-weight: 700;
  min-width: 190px; transition: transform 0.16s ease, filter 0.16s ease;
}
.store:hover { transform: translateY(-2px); filter: brightness(1.06); text-decoration: none; }
.store--google { background: var(--mint); color: #04241d; }
.store--apple { background: var(--ink); }
.store__glyph { flex: 0 0 auto; }
.store__text { display: flex; flex-direction: column; line-height: 1.15; font-size: 1.02rem; }
.store__text small { font-size: 0.68rem; font-weight: 600; opacity: 0.82; text-transform: uppercase; letter-spacing: 0.06em; }

.detail__cols {
  display: grid; gap: clamp(22px, 3vw, 34px); margin-top: 26px;
  grid-template-columns: minmax(0, 1fr);
}
/* min-width: 0 stops the screenshot rail's intrinsic width from stretching
   the grid track (min-width:auto would inherit the rail's content width). */
.detail__main, .detail__side, .block, .shots { min-width: 0; }
@media (min-width: 940px) { .detail__cols { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); } }

.block { margin-bottom: 30px; }
.block h2 { font-size: 1.22rem; padding-bottom: 9px; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.block--card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.review { font-size: 1.03rem; line-height: 1.75; color: var(--ink-2); }
.bullets { display: grid; gap: 10px; }
.bullets li { position: relative; padding-left: 28px; color: var(--ink-2); }
.bullets li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  width: 19px; height: 19px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); font-size: 0.72rem; font-weight: 800;
  display: grid; place-items: center; margin-top: 0.28em;
}

.shots {
  display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px;
  align-items: flex-start; scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.shots:focus-visible { outline-offset: 6px; }
.shot { margin: 0; flex: 0 0 auto; height: 300px; scroll-snap-align: start; }
.shot img {
  height: 100%; width: auto; max-width: none;
  border-radius: 14px; border: 1px solid var(--line); background: #eceffd;
}
.shots__note { margin-top: 8px; }

.spec { display: grid; gap: 0; margin: 0; }
.spec__row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
}
.spec__row:last-child { border-bottom: 0; }
.spec dt { color: var(--muted); font-size: 0.88rem; }
.spec dd { margin: 0; font-weight: 700; text-align: right; font-size: 0.92rem; }

.stats { display: grid; gap: 12px; }
.stat {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 6px 12px; background: var(--accent-soft); border-radius: 12px; padding: 12px 14px;
}
.stat__store { grid-column: 1 / -1; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--accent); }
.stat strong { font-size: 1.1rem; }
.stat__big { font-size: 1.5rem !important; grid-column: 1 / -1; }
.stat__sub { color: var(--muted); font-size: 0.82rem; text-align: right; }

/* ---------------------------------------------------------------- legal */

.legal { padding: clamp(34px, 6vw, 66px) 0 46px; max-width: 800px; }
.legal h1 { margin-bottom: 0.3em; }
.legal .lede { color: var(--ink-2); font-size: 1.1rem; }
.legal h2 { font-size: 1.15rem; margin-top: 1.8em; }
.legal p { color: var(--ink-2); }
.legal__date { margin-top: 2.4em; font-size: 0.85rem; }
.btn {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 12px 22px; border-radius: 999px; font-weight: 700;
}
.btn:hover { text-decoration: none; filter: brightness(1.07); }

/* -------------------------------------------------------------- responsive */

@media (max-width: 640px) {
  .topnav { display: none; }
  .search { max-width: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px 12px; }
  .card__title { font-size: 0.76rem; }
  .shot { height: 236px; }
  .detail__rating .dot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
