/* Storefront layout for the hub page (index.html), modelled on gog.com:
   dark top nav → icon subnav → hero banner → featured carousel → genre
   tiles → product grid. Colors derive from themes.css tokens where they can,
   so an admin theme still tints the page. The top nav and shared tokens
   live in store.css. */

body.hub {
  padding: 0 0 env(safe-area-inset-bottom);
  background-color: var(--page-2);
  background-image: linear-gradient(var(--page) 0, var(--page) 560px, var(--page-2) 900px);
}
/* ── Sub nav ─────────────────────────────────────────────────────────── */
.gh-subnav { background: var(--nav-bg); border-top: 1px solid #2a2a2e; }
.gh-subnav .container {
  display: flex; justify-content: center; gap: 34px; min-height: 52px;
  overflow-x: auto; scrollbar-width: none;
}
.gh-subnav .container::-webkit-scrollbar { display: none; }
.gh-subnav a, .gh-subnav button {
  font: inherit; background: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 9px; flex: none;
  color: var(--nav-fg); text-decoration: none; font-size: .95rem; font-weight: 500;
}
.gh-subnav a:hover, .gh-subnav button:hover { color: var(--lavender); }
.gh-subnav svg { width: 20px; height: 20px; }

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; }
.hero .container { position: relative; z-index: 1; }
.hero .container {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  align-items: center; gap: 24px; min-height: 290px; padding-top: 18px; padding-bottom: 18px;
}
.hero-title {
  margin: 0; line-height: .92; font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 900; letter-spacing: -.01em; transform: rotate(-4deg);
  font-family: "Arial Black", "Helvetica Neue", system-ui, sans-serif;
}
.hero-title span { display: block; paint-order: stroke fill; -webkit-text-stroke: 8px #6b1d0a; }
.hero-title .l1 { color: #ffc93c; text-shadow: 0 6px 0 #6b1d0a; }
.hero-title .l2 { color: #ff4d3a; margin-left: .7em; text-shadow: 0 6px 0 #4a1106; }
.hero-art {
  aspect-ratio: 9 / 4; width: 100%;
  border: 10px solid #caa98a; border-radius: 4px;
  background: #e8590c url("art/hero.svg") center / cover no-repeat;
  box-shadow: inset 0 0 0 3px #7d5f45, 0 18px 40px rgba(0,0,0,.35);
}
.hero-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  grid-column: 1 / -1;
}
.hero-deal { margin: 0; font-size: clamp(1.1rem, 2.2vw, 1.5rem); font-weight: 650; color: #fff; }
.btn-browse {
  font: inherit; cursor: pointer; border: 0; border-radius: 4px;
  background: var(--lavender); color: var(--lavender-ink);
  padding: 14px 34px; font-size: 1rem; font-weight: 700;
  text-decoration: none; display: inline-block;
  transition: filter var(--t-base) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.btn-browse:hover, .btn-browse:focus-visible { filter: brightness(1.08); outline: none; }
.btn-browse:active { transform: scale(.97); }
.pixel {
  position: absolute; top: 0; width: 14px; height: 14px; pointer-events: none;
  animation: drift 9s linear infinite; opacity: .85;
}
@keyframes drift {
  from { transform: translateY(-40px) rotate(0); }
  to   { transform: translateY(420px) rotate(260deg); }
}
@media (prefers-reduced-motion: reduce) { .pixel { animation: none; } }

/* ── Featured carousel ───────────────────────────────────────────────── */
.featured { position: relative; margin-top: 8px; }
.feat-frame {
  display: grid; grid-template-columns: minmax(0, 1fr) 150px;
  background: #0e0d12; border-radius: 6px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.4);
}
.feat-stage { position: relative; aspect-ratio: 16 / 7; overflow: hidden; }
.feat-slide {
  position: absolute; inset: 0; display: block; color: #fff; text-decoration: none;
  opacity: 0; visibility: hidden;
  transition: opacity .5s var(--ease-out), visibility 0s linear .5s;
}
.feat-slide.on { opacity: 1; visibility: visible; transition: opacity .5s var(--ease-out); }
.feat-slide img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.04); transition: transform 6s linear; }
.feat-slide.on img { transform: scale(1); }
.feat-slide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.85) 100%);
  pointer-events: none;
}
.feat-slide > a { position: absolute; inset: 0; }
.feat-info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 24px 28px;
}
.feat-name { margin: 0 0 8px; font-size: clamp(1.25rem, 2.6vw, 1.8rem); font-weight: 650; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.feat-meta { display: flex; align-items: center; gap: 20px; font-size: .95rem; color: #e6e6ea; }
.feat-meta svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; }
.buy { display: flex; align-items: center; gap: 10px; flex: none; }
.badge-deal {
  background: var(--lavender); color: var(--lavender-ink);
  font-weight: 700; font-size: 1.05rem; padding: 10px 10px; border-radius: 3px;
}
.price { display: flex; flex-direction: column; line-height: 1.05; }
.price s { color: #9d9da6; font-size: .85rem; }
.price b { font-size: 1.5rem; font-weight: 650; }
.btn-heart {
  width: 50px; height: 50px; display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid rgba(255,255,255,.7); border-radius: 3px; color: #fff;
  transition: background var(--t-base) var(--ease-out), color var(--t-base) var(--ease-out);
}
.btn-heart svg { width: 22px; height: 22px; }
.btn-heart:hover { background: rgba(255,255,255,.1); }
.btn-heart[aria-pressed="true"] { color: #ff6b8b; border-color: #ff6b8b; }
.btn-heart[aria-pressed="true"] svg path { fill: currentColor; }
.btn-go {
  display: inline-flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 24px; border-radius: 3px;
  background: var(--go); color: #fff; text-decoration: none;
  font-size: 1.1rem; font-weight: 650; white-space: nowrap;
  transition: background var(--t-base) var(--ease-out);
}
.btn-go svg { width: 22px; height: 22px; }
.btn-go:hover, .btn-go:focus-visible { background: var(--go-hover); outline: none; }

.feat-thumbs {
  display: flex; flex-direction: column; gap: 10px; justify-content: center;
  padding: 12px 18px; background: #1a1920;
}
.feat-thumb {
  padding: 0; border: 2px solid transparent; border-radius: 2px; cursor: pointer;
  background: #000; aspect-ratio: 4 / 3; overflow: hidden; opacity: .6;
  transition: opacity var(--t-base) var(--ease-out), border-color var(--t-base) var(--ease-out);
}
.feat-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feat-thumb:hover, .feat-thumb.on { opacity: 1; }
.feat-thumb.on { border-color: var(--lavender); }

.feat-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 40px; height: 60px; display: grid; place-items: center; cursor: pointer;
  background: #232129; color: #fff; border: 0; border-radius: 3px;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.feat-arrow svg { width: 16px; height: 16px; }
.feat-arrow:hover { background: #34313d; }
.feat-arrow.prev { left: -40px; }
.feat-arrow.next { right: -40px; }
.feat-dots { display: flex; gap: 6px; margin: 4px 0 0 16px; padding: 4px 6px; width: max-content; background: #0e0d12; border-radius: 0 0 4px 4px; }
.feat-dots button {
  width: 14px; height: 4px; padding: 0; border: 0; border-radius: 2px; cursor: pointer;
  background: #55535e;
}
.feat-dots button.on { background: #fff; width: 22px; }

/* ── Genre tiles ─────────────────────────────────────────────────────── */
.genres {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px;
  margin: 40px 0 0;
}
.genre-tile {
  position: relative; aspect-ratio: 2 / 1; overflow: hidden; cursor: pointer;
  border: 0; border-radius: 3px; padding: 0; background: #000;
  font: inherit; color: #fff;
}
.genre-tile img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--t-slow) var(--ease-out), filter var(--t-base) var(--ease-out);
}
.genre-tile span {
  position: relative; display: grid; place-items: center; height: 100%;
  font-size: 1.15rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0,0,0,.6), 0 0 18px rgba(0,0,0,.8);
  background: radial-gradient(ellipse at center, rgba(0,0,0,.6), rgba(0,0,0,.25) 75%);
}
.genre-tile:hover img, .genre-tile:focus-visible img { transform: scale(1.07); }
.genre-tile:focus-visible { outline: 2px solid var(--lavender); outline-offset: 2px; }
.genre-tile.active { box-shadow: 0 0 0 3px var(--lavender); }

/* ── Product grid ────────────────────────────────────────────────────── */
.shelf { margin: 44px 0 56px; scroll-margin-top: 80px; }
.shelf-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
}
.shelf-head h2 { margin: 0; font-size: 1.45rem; font-weight: 650; color: #fff; }
.shelf-head .count { color: var(--nav-muted); font-size: .9rem; }
.shelf-head .clear {
  font: inherit; font-size: .85rem; color: var(--lavender); background: none;
  border: 0; cursor: pointer; padding: 0; text-decoration: underline;
}
.products {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px;
}
a.product {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); color: #fff; text-decoration: none;
  border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.25);
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
  animation: tile-in .38s var(--ease-out) backwards;
}
a.product:hover, a.product:focus-visible {
  transform: translateY(-4px); outline: none;
  box-shadow: 0 0 0 2px var(--lavender), 0 14px 30px rgba(0,0,0,.4);
}
.product .cover { position: relative; aspect-ratio: 16 / 9; background: #000; }
.product .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product .tag-new {
  position: absolute; top: 8px; left: 8px;
  background: var(--lavender); color: var(--lavender-ink);
  font-size: .72rem; font-weight: 800; letter-spacing: .06em; padding: 3px 8px; border-radius: 2px;
}
.product .fav {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #ff6b8b;
}
.product .fav svg { width: 16px; height: 16px; }
.product .fav svg path { fill: currentColor; }
.product .body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; flex: 1; }
.product .title { font-weight: 650; font-size: 1rem; }
.product .sub { margin: 0; color: var(--nav-muted); font-size: .82rem; }
.product .foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: auto; padding-top: 10px;
}
.product .best-line { font-size: .78rem; color: var(--nav-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product .free {
  flex: none; font-size: .78rem; font-weight: 800; letter-spacing: .04em;
  background: var(--go); color: #fff; padding: 4px 10px; border-radius: 2px;
}
.empty { color: var(--nav-muted); padding: 30px 0; text-align: center; }
.products a.product:nth-child(2) { animation-delay: .04s; }
.products a.product:nth-child(3) { animation-delay: .08s; }
.products a.product:nth-child(4) { animation-delay: .12s; }
.products a.product:nth-child(n+5) { animation-delay: .16s; }

.gh-foot {
  background: var(--nav-bg); color: var(--nav-muted);
  font-size: .82rem; padding: 22px 0 calc(22px + env(safe-area-inset-bottom));
}
.gh-foot .container { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.gh-foot a { color: var(--nav-muted); }
.gh-foot a:hover { color: var(--lavender); }

/* install.js banner, restyled for the storefront */
.hub .install-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--nav-bg); border-top: 1px solid #333;
  padding: 12px 20px; display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; font-size: .88rem; color: var(--nav-fg);
}
.hub .install-bar span { flex: 1 1 200px; }
.hub .install-bar .btn { padding: 6px 14px; font-size: .82rem; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .feat-arrow.prev { left: 6px; }
  .feat-arrow.next { right: 156px; }
}
@media (max-width: 900px) {
  .feat-frame { grid-template-columns: 1fr; }
  .feat-thumbs { display: none; }
  .feat-arrow.next { right: 6px; }
  .feat-stage { aspect-ratio: 16 / 10; }
  .feat-info { flex-direction: column; align-items: stretch; padding: 18px; }
  .buy { justify-content: flex-end; }
}
@media (max-width: 640px) {
  .gh-subnav .container { justify-content: flex-start; gap: 24px; }
  .hero .container { grid-template-columns: 1fr; min-height: 0; }
  .hero-title { font-size: 2.6rem; text-align: center; }
  .hero-foot { flex-direction: column; align-items: stretch; text-align: center; }
  .feat-arrow { display: none; }
  .feat-stage { aspect-ratio: 4 / 5; }
  .feat-meta { gap: 14px; font-size: .88rem; }
  .buy { justify-content: space-between; }
  .btn-go { flex: 1; justify-content: center; }
  .genres { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .genre-tile:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 1; }
  .products { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
}
