/* The public page's own styles. The colours and everything it shares with the back office are in app/css/base.css,
   loaded before this file. */
html { background: var(--bg); overflow-x: clip; }
body { margin: 0; overflow-x: clip; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 max(18px, env(safe-area-inset-left)); }

.hero { position: relative; overflow: hidden; padding: calc(56px + env(safe-area-inset-top)) 0 34px; background:
  linear-gradient(var(--bg), transparent 90px),
  radial-gradient(60% 120% at max(15%, calc(50% - 520px)) 0%, rgba(230, 0, 35, var(--glow)), transparent 70%),
  radial-gradient(60% 120% at min(85%, calc(50% + 520px)) 0%, rgba(31, 155, 255, var(--glow)), transparent 70%), var(--bg); }
.hero h1 { margin: 0; font-size: clamp(32px, 7vw, 60px); font-weight: 800; letter-spacing: -.035em; line-height: 1.02; }
.stats { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 18px; }
.stats div { color: var(--dim); font-size: 14px; font-weight: 600; }
.stats b { display: block; color: var(--text); font-size: 26px; font-weight: 800; letter-spacing: -.02em; }

.bar { border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.tabs { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; white-space: nowrap; padding: 14px 0 12px; font-weight: 700; color: var(--faint); border-bottom: 2px solid transparent; transition: color .15s; }
.tabs button.on { color: var(--text); border-color: var(--accent); }
.tabs button span { color: var(--faint); font-weight: 600; margin-left: 4px; font-size: 13px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 4px 0 12px; }
.search-row { display: none; flex: 1 1 100%; align-items: center; gap: 10px; min-width: 0; height: 36px; } /* the same height as the chips: nothing moves when they swap */
.controls.searching .search-row { display: flex; }
.controls.searching .chiprow { display: none; }
.cancel { flex: none; color: var(--accent); font-weight: 600; font-size: 16px; padding: 8px 2px; }
/* The box opens out of the 🔍 chip (1.82.3), as in the back office (app/css/app.css): the glass is the chip's (20px,
   8px in, same weight), the ✕ mirrors it on the right, and tapping 🔍 (.opening) grows the box from the chip. The glass is 20px, 8px in, since 1.88.6 (it was 19px, 8.5px in): half a pixel is a dot and a half on the iPhone's screen, which it rounded up in the chip and down in the box, so the glass moved a dot when Search opened or closed. */
.search-row .search > svg { width: 20px; height: 20px; stroke-width: 1.8; stroke-linejoin: round; }
/* How it grows (1.88.2): the box is its full size from the start, and its grey is a layer of its own that slides out
   from behind the chip's circle (a transform), while the words in it and Cancel fade in (opacity). Sliding and fading
   are the two things the iPhone goes on drawing smoothly by itself while the page is busy, and it is busy just then:
   the keyboard is opening. Until 1.88.2 the box's width was animated, which the page has to work out frame by frame,
   so most of it was skipped: the box went from the circle to full in one to four frames, sometimes showing a
   half-open box with Cancel beside it on the way (a little jump, now and then). */
@media (prefers-reduced-motion: no-preference) {
  .controls.opening .search-row .search { position: relative; isolation: isolate; overflow: hidden; background: none; animation: search-open .24s cubic-bezier(.2, .8, .2, 1); }
  .controls.opening .search-row .search::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--surface-2); animation: search-open-grey .24s cubic-bezier(.2, .8, .2, 1); }
  .controls.opening .search-row .search > svg { animation: search-open-ico .24s ease-out; }
  .controls.opening .search-row .search > :not(svg) { animation: search-open-fade .24s ease-in; } /* late, so the words don't show past the grey's edge */
  .controls.opening .search-row .cancel { animation: search-open-fade .24s ease-out; }
}
.chip.menu.icon.on { color: var(--bg); } /* 🔍 while a search is on */
.search { flex: 1 1 240px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 11px; background: var(--surface-2); color: var(--dim); }
.search > svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; } /* the magnifying glass only: the ✕ has its own (base.css) */
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; color: var(--text); }

main.wrap { padding-top: 24px; padding-bottom: 40px; }
/* While a search is open, the page is at least a screen tall under the bar, so the bar can always sit at the top of
   the screen however few games match (dock in public.js). */
body:has(#controls.searching) main.wrap { min-height: 100vh; min-height: 100lvh; }
.card { min-width: 0; display: flex; flex-direction: column; justify-content: flex-start; align-self: start; text-align: left; }
.cover img.ld { opacity: 1; }
/* The console as words, on a cover: shown only for the moment before the console logos have loaded. */
.badge { position: absolute; top: 7px; left: 7px; padding: 2px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 800; color: #fff; background: var(--s1); box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.badge.switch2 { background: var(--s2); }
.badge.switch2_edition { background: var(--s1); }
.t { margin-top: 8px; font-size: 13.5px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;  min-height: 2.5em; }
.s { margin-top: 2px; font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
@media (max-width: 520px) { .t { font-size: 12.5px; } .s { font-size: 11.5px; } }
/* Nothing to show: the same white box as the back office's "nothing here" (emptyBox() in app/js/app.js). */
.empty { background: var(--surface); border-radius: 14px; color: var(--dim); padding: 14px 16px; margin: 12px 0; min-height: 50px; display: flex; align-items: center; }
/* A search that also finds games in the other lists: "Also in Wishlist 3 · Coming soon 1", each a tap away. */
.also { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 14px; color: var(--dim); font-size: 14px; }
.also button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; border: 0; cursor: pointer; }
.also button b { color: var(--accent); }
.foot { display: flex; justify-content: space-between; color: var(--faint); font-size: 13px; padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
.foot a { color: var(--faint); text-decoration: none; }
.manage svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.manage.owner { background: var(--text); color: var(--bg); border-color: transparent; }
.manage { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: max(18px, env(safe-area-inset-right), calc((100% - 1280px) / 2 + 18px)); z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--dim); font-size: 14px; font-weight: 700; text-decoration: none; }

.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; align-items: center; }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }
.s span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Game page: slides in over the list, Back slides it away */
.gpage { position: fixed; inset: 0; z-index: 30; background: var(--bg); overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  transform: translateX(100%); visibility: hidden; transition: transform .34s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .34s; } /* no shadow down its left edge (1.88.28), as in the back office */
.gpage.open { transform: none; visibility: visible; transition: transform .34s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
.gbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; padding: calc(8px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-left)) 8px; }
.gbody { max-width: 560px; margin: 0 auto; padding: 8px 20px calc(40px + env(safe-area-inset-bottom)); text-align: center; }
.ghero { position: relative; isolation: isolate; width: min(78vw, 420px); margin: 26px auto 26px; }
.ghero .cover { border-radius: 12px; box-shadow: 0 14px 34px rgba(0, 0, 0, var(--hero-shadow, .3)); }
.ghero .cover img { opacity: 1; cursor: zoom-in; }
.ghero-bg { position: absolute; inset: -12% -14%; background-size: cover; background-position: center; filter: blur(40px) saturate(1.3); opacity: var(--hero-glow, .4); z-index: -1; pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 35%, transparent 100%); mask-image: radial-gradient(closest-side, #000 35%, transparent 100%); }
.gbody h2 { margin: 0 0 4px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.gbody .pills { margin-top: 12px; }

.shelves { margin: 0 -12px; }

.search-clear { position: relative; flex: none; display: none; place-items: center; width: 20px; height: 20px; margin-right: 2.25px; /* same gap to the edge as the magnifying glass (18px icon, its circle starts 2.25px in) */ padding: 0; border: 0; border-radius: 50%; background: var(--faint); color: var(--bg); cursor: pointer; }

/* One scrolling chip row (view · consoles · publisher · sort), like the app */
.chiprow { display: flex; align-items: center; gap: 8px; flex: 1 1 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px; }
.chiprow::-webkit-scrollbar { display: none; }
.chip.menu { position: relative; }
.chip.menu .srt { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip.menu .fil { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.chip.menu .chev { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* Every chip in the row is 36px tall; icon-only chips are 36px circles with 20px icons, as in the back office (19px until 1.88.6, see .search-row). */
.chiprow .chip { height: 36px; padding-top: 0; padding-bottom: 0; }
.chip.menu.icon { width: 36px; padding: 0; justify-content: center; color: var(--text); }
.chip.menu.icon .lbl { display: flex; }
.chip.menu.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chip.menu .lbl { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }

/* Menus (view, publisher, sort): the shared bottom sheet, app/sheet.css */
/* Collection / bundle tag: at the top of Games included, or its own line under the badges */
.gbody .pills.kind-row { margin-top: 8px; }
/* Share buttons */
.share-top { position: absolute; top: calc(14px + env(safe-area-inset-top)); left: max(18px, env(safe-area-inset-left), calc((100% - 1280px) / 2 + 18px)); z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--dim); font-size: 14px; font-weight: 700; } /* same look as Sign in / Manage; on wide screens both line up with the content edges */
.share-top svg, .gshare svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gshare { margin-left: auto; display: grid; place-items: center; width: 40px; height: 40px; color: var(--accent); }
.gshare svg { width: 22px; height: 22px; stroke-width: 2.2; }

/* Game page on wide screens (tablet landscape and desktop): cover on the left, details on the right.
   Phones keep the single column above; .ginfo and .gextra are plain wrappers there. */
@media (min-width: 900px) {
  .gbar { padding-inline: max(14px, calc((100% - 1040px) / 2 + 26px)); /* Back where the back office's is */ }
  .gbody { max-width: 1040px; display: grid; grid-template-columns: 400px minmax(0, 1fr); column-gap: 56px; align-items: start; text-align: left; padding: 8px 40px 60px; }
  .ghero { width: auto; margin: 18px 0 0; position: sticky; top: calc(76px + env(safe-area-inset-top)); }
  .ghero-bg { inset: -3% -45% -30%; filter: blur(60px) saturate(1.3); } /* kept below the top bar so the bar never cuts across it */
  .ginfo { padding-top: 22px; min-width: 0; }
  .gbody h2 { font-size: 34px; }
  .gbody .pills { justify-content: flex-start; }
}
/* The description, rating card, Games included and series: shared with the back office, in app/css/shelf.css. */

/* Signed in: the page shows what's hidden from visitors, marked, with "View as visitor". */
.owner-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--dim); }
.owner-bar span { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.owner-bar button { flex: none; padding: 7px 12px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 700; }
.hid-ico { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs button.hid .hid-ico { width: 14px; height: 14px; margin-right: 5px; vertical-align: -2px; }
.hid-note { grid-column: 1 / -1; text-align: left; display: flex; align-items: flex-start; gap: 7px; margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--surface); color: var(--dim); font-size: 13.5px; line-height: 1.4; }
.hid-note .hid-ico { margin-top: 1px; }

/* The back office's preview of one game: the game straight away, no list first, no Back or Share (the
   preview sheet has its own close button), and nothing that leads to the list. */
.preview-game .gpage { transform: none; visibility: visible; transition: none; }
.preview-game .gbar, .preview-game .series-all { display: none; }
.preview-game .gbody { padding-top: 4px; }

