/* The storefront chrome every page shares, modelled on gog.com: the tokens,
   the top nav (rendered by store.js), and the product-page frame the game
   pages sit in — breadcrumb and title, the game where GOG puts its screenshots,
   and a side panel with the price box, details and "more like this".

   Game pages size their boards from the space the page leaves them, so nothing
   here changes height after load: the nav is a fixed height, and the side
   panel is a fixed-width column that store.js fills in afterwards.

   Rules that a game page may want to override are wrapped in :where() so they
   carry no more weight than the page's own. */

:root {
  --nav-bg: #1c1c1e;
  --nav-fg: #f1f1f3;
  --nav-muted: #a9a9b3;
  --nav-h: 64px;
  --page: color-mix(in srgb, var(--accent) 22%, #17122b);
  --page-2: color-mix(in srgb, var(--accent) 14%, #120e21);
  --panel: #232129;
  --panel-2: #2c2a35;
  --lavender: #cdb4ff;
  --lavender-ink: #1d1233;
  --join: #a42fd0;
  --join-hover: #b940e4;
  --go: #72b01d;
  --go-hover: #82c52a;
  --maxw: 1100px;
}
@media (max-width: 640px) { :root { --nav-h: 56px; } }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── Top nav ─────────────────────────────────────────────────────────── */
.gh-nav {
  background: var(--nav-bg); color: var(--nav-fg);
  position: sticky; top: 0; z-index: 50; flex: none;
  height: var(--nav-h);
  box-shadow: 0 1px 0 rgba(255,255,255,.05);
}
.gh-nav .container {
  display: flex; align-items: center; gap: 22px; height: 100%;
}
.logo {
  display: grid; place-items: center; flex: none;
  width: 38px; height: 38px; border: 2.5px solid currentColor; border-radius: 4px;
  color: var(--nav-fg); text-decoration: none;
  font: 900 .62rem/0.95 system-ui, sans-serif; letter-spacing: .02em; text-align: center;
}
.logo span { display: block; }
.nav-links { display: flex; gap: 22px; }
.nav-links a {
  color: var(--nav-fg); text-decoration: none;
  font-size: .86rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--lavender); outline: none; }
.nav-links svg { width: 10px; height: 10px; opacity: .7; }

.search { flex: 1 1 260px; min-width: 0; position: relative; margin: 0; }
.search input {
  width: 100%; font: inherit; font-size: .9rem;
  padding: 10px 16px 10px 40px; border-radius: 999px;
  border: 1px solid #3a3a40; background: #2a2a2e; color: var(--nav-fg);
  transition: border-color var(--t-base) var(--ease-out), background var(--t-base) var(--ease-out);
}
.search input::placeholder { color: var(--nav-muted); }
.search input:focus { outline: none; border-color: var(--lavender); background: #313136; }
.search svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--nav-muted); pointer-events: none;
}
.nav-right { display: flex; align-items: center; gap: 18px; flex: none; }
.nav-right a.plain {
  color: var(--nav-fg); text-decoration: none; font-size: .86rem;
  font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 7px;
}
.nav-right a.plain:hover { color: var(--lavender); }
.nav-right a.plain svg { width: 20px; height: 20px; }
.btn-join {
  font: inherit; cursor: pointer; border: 0; border-radius: 3px;
  background: var(--join); color: #fff;
  padding: 10px 16px; font-size: .84rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  transition: background var(--t-base) var(--ease-out);
}
.btn-join:hover, .btn-join:focus-visible { background: var(--join-hover); outline: none; }

@media (max-width: 900px) { .nav-links { display: none; } }
@media (max-width: 640px) {
  .gh-nav .container { gap: 12px; }
  .nav-right .label, .btn-join { display: none; }
}

/* Full screen belongs to the game alone. */
html.immersive .gh-nav, html.immersive .backdrop { display: none; }

/* ── Product page ────────────────────────────────────────────────────── */
body.store {
  padding: 0 0 env(safe-area-inset-bottom);
  background-color: var(--page-2);
  color-scheme: dark;         /* dark scrollbars on the panels that scroll */
}
/* The game's own art, blurred behind the top of the page, the way GOG hangs a
   screenshot behind a product's title. Fixed and behind everything, so it
   takes no room in the layout. */
.backdrop {
  position: fixed; left: 0; right: 0; top: 0; height: 560px; z-index: -1;
  background: center / cover no-repeat;
  filter: blur(28px) saturate(1.2) brightness(.55);
  transform: scale(1.1);
  -webkit-mask-image: linear-gradient(#000 30%, transparent);
          mask-image: linear-gradient(#000 30%, transparent);
  pointer-events: none;
}
body.store .wrap {
  max-width: var(--maxw); margin: 0 auto;
  padding: 16px 16px 40px;
}
body.store .topbar {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  justify-content: flex-start; margin-bottom: 4px;
}
.crumbs {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .82rem; color: var(--nav-muted);
}
.crumbs a { color: var(--nav-fg); text-decoration: none; opacity: .85; }
.crumbs a:hover { color: var(--lavender); opacity: 1; }
.crumbs .sep { opacity: .5; }
body.store:not(.fit) h1 {
  margin: 6px 0 8px; color: #fff;
  font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 700; letter-spacing: -.01em;
}
body.store:not(.fit) .wrap > .sub { color: #d8d6e0; margin-bottom: 14px; }
.product-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.product-tags span {
  font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 3px;
  background: rgba(255,255,255,.1); color: #eeeaf6;
}
.product-tags .new { background: var(--lavender); color: var(--lavender-ink); font-weight: 800; letter-spacing: .05em; }
.product-tags .free { background: var(--go); color: #fff; font-weight: 800; letter-spacing: .05em; }

/* The game sits where GOG shows its media: a dark panel. */
:where(body.store) .stage {
  background: #16151b; border: 1px solid #2c2a35; border-radius: 6px;
  box-shadow: 0 18px 44px rgba(0,0,0,.35);
}
:where(body.store) .btn {
  border-radius: 3px; background: var(--panel-2); border-color: #3b3846; color: #fff;
}
:where(body.store) .btn:hover, :where(body.store) .btn:focus-visible {
  border-color: var(--lavender); color: var(--lavender);
}
:where(body.store) .btn.primary { background: var(--go); border-color: var(--go); color: #fff; }
:where(body.store) .btn.primary:hover { background: var(--go-hover); border-color: var(--go-hover); color: #fff; }
:where(body.store) .modal { border-radius: 6px; background: var(--panel); border-color: #34313d; }

/* Two columns once there is room: the game, then a 300px side panel. Pages
   that fit their board to the viewport (body.fit) lay this out themselves,
   because the board's row has to take all the height that is left. */
@media (min-width: 1000px) {
  html:not(.immersive) body.store:not(.fit) .wrap {
    display: grid; grid-template-columns: minmax(0, 1fr) 300px;
    column-gap: 24px; align-items: start;
  }
}
/* Everything spans both columns except the game and the panel beside it.
   The panel follows the stage in the markup, so auto-placement puts it in
   the stage's row. */
body.store .wrap > * { grid-column: 1 / -1; }
body.store .wrap > .stage { grid-column: 1; min-width: 0; }
body.store .wrap > .store-aside { grid-column: 2; }

@media (max-width: 999px) {
  body.store.fit .store-aside { display: none; }
  body.store:not(.fit) .store-aside { margin-top: 20px; }
}

/* ── Side panel ──────────────────────────────────────────────────────── */
.store-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; min-height: 0; color: var(--nav-fg); }
.buybox {
  background: var(--panel); border-radius: 6px; padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.buybox .pricing { display: flex; align-items: center; gap: 10px; }
.buybox .off {
  background: var(--lavender); color: var(--lavender-ink);
  font-weight: 800; padding: 6px 8px; border-radius: 3px;
}
.buybox .was { color: #8f8d99; font-size: .9rem; }
.buybox .now { font-size: 1.7rem; font-weight: 700; margin-left: auto; }
.buybox .go {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; cursor: pointer; border: 0; border-radius: 3px;
  height: 48px; background: var(--go); color: #fff; text-decoration: none;
  font-size: 1.05rem; font-weight: 700;
  transition: background var(--t-base) var(--ease-out);
}
.buybox .go:hover, .buybox .go:focus-visible { background: var(--go-hover); outline: none; }
.buybox .go svg { width: 18px; height: 18px; }
.buybox .wish {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; cursor: pointer; height: 42px; border-radius: 3px;
  background: transparent; color: #fff; border: 1px solid #55525f;
  font-size: .92rem; font-weight: 600;
  transition: border-color var(--t-base) var(--ease-out), color var(--t-base) var(--ease-out);
}
.buybox .wish svg { width: 18px; height: 18px; }
.buybox .wish:hover { border-color: #fff; }
.buybox .wish[aria-pressed="true"] { color: #ff6b8b; border-color: #ff6b8b; }
.buybox .wish[aria-pressed="true"] svg path { fill: currentColor; }
.buybox .perks { margin: 0; padding: 0; list-style: none; font-size: .82rem; color: var(--nav-muted); display: grid; gap: 6px; }
.buybox .perks li::before { content: "✓"; color: var(--go-hover); font-weight: 800; margin-right: 8px; }

.details { background: var(--panel); border-radius: 6px; padding: 6px 18px; }
.details h2, .more h2 {
  margin: 12px 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--nav-muted);
}
.details dl { margin: 0; display: grid; grid-template-columns: auto 1fr; }
.details dt, .details dd {
  margin: 0; padding: 9px 0; border-top: 1px solid #34313d; font-size: .85rem;
}
.details dt { color: var(--nav-muted); padding-right: 14px; }
.details dd { color: #fff; text-align: right; overflow-wrap: anywhere; }
.details dl > :nth-child(-n+2) { border-top: 0; }

.more { display: grid; gap: 8px; }
.more h2 { margin: 4px 0 2px; }
.more a {
  display: grid; grid-template-columns: 88px 1fr auto; align-items: center; gap: 12px;
  padding: 6px; border-radius: 4px; background: var(--panel);
  color: #fff; text-decoration: none; font-size: .9rem; font-weight: 600;
  transition: background var(--t-base) var(--ease-out);
}
.more a:hover, .more a:focus-visible { background: var(--panel-2); outline: none; }
.more img { width: 88px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 2px; display: block; }
.more small { display: block; color: var(--nav-muted); font-weight: 400; font-size: .76rem; }
.more .free {
  font-size: .72rem; font-weight: 800; letter-spacing: .04em;
  background: var(--go); color: #fff; padding: 3px 8px; border-radius: 2px;
}
