/* ============================================================
   playogames.com — site styles
   Part 1 applies to every page (fonts, consent banner, legal links), including
   the game pages. Part 2 is the hub layout, scoped to body.pg-page so it never
   touches a game.
   (The studio's apps are in the games since 2026-10-04, shared/app-card; the old top bar is gone.)
   ============================================================ */

/* Lilita One (SIL OFL 1.1, fonts/OFL-lilita-one.txt), latin subset, served from
   playogames.com itself: no request to Google Fonts. */
@font-face {
  font-family: 'Lilita One';
  src: url('/assets/fonts/lilita-one.woff2') format('woff2');
  font-display: swap;
}

:root {
  --pg-ink: #16203b;
  --pg-ink-soft: #4a5273;
  --pg-ink-faint: #656c88;     /* 4.7:1 on --pg-bg (was #767d99, 3.7:1: failed WCAG 1.4.3) */
  --pg-bg: #f6f4ef;
  --pg-card: #ffffff;
  --pg-line: rgba(22, 32, 59, 0.12);
  --pg-accent: #ff7a1a;
  --pg-accent-2: #ffb13d;
  --pg-accent-ink: #b24e05;     /* accent as text on light backgrounds (AA) */
  --pg-accent-text: #e0620a;    /* accent as LARGE text (24px+) on light backgrounds: 3.2:1 (#ff7a1a is 2.4:1) */
  --pg-focus: #16203b;          /* focus ring on light backgrounds (14:1); orange rings were 2.4:1, under WCAG 1.4.11's 3:1 */
  --pg-navy: #121a33;
  --pg-display: 'Lilita One', system-ui, sans-serif;
  --pg-ui: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --pg-radius: 16px;
  --pg-max: 1120px;
}

/* One weight of Lilita exists; never let the browser smear a fake bold. */
html { font-synthesis-weight: none; }
[hidden] { display: none !important; }

.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 2147483001;
  padding: 10px 14px; border-radius: 10px; background: #fff; color: var(--pg-ink);
  font: 600 15px/1.2 var(--pg-ui); text-decoration: none; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.skip-link:focus { top: 12px; }

/* ---------- consent banner (consent.js) ----------
   A bottom card on every screen size. z-index 65: above the site header (50).
   It never takes focus by itself. */
.consent-banner {
  position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 65;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  max-width: 620px; margin: 0 auto; padding: 14px 16px; box-sizing: border-box;
  background: #fff; color: var(--pg-ink); border: 1px solid var(--pg-line); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(10, 14, 30, 0.28);
  font: 14px/1.45 var(--pg-ui); text-align: left;
}
.consent-banner[hidden] { display: none; }
.consent-text { flex: 1 1 300px; margin: 0; }
.consent-text a { color: var(--pg-accent-ink); font-weight: 600; }
.consent-actions { display: flex; gap: 10px; flex: 0 0 auto; }
.consent-btn {
  min-width: 96px; padding: 10px 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--pg-ink); background: var(--pg-ink); color: #fff;
  font: 600 14px/1.2 var(--pg-ui);
}
.consent-btn:hover { background: #26335e; }
.consent-btn:focus-visible, .consent-text a:focus-visible { outline: 3px solid var(--pg-focus); outline-offset: 2px; }
@media (max-width: 460px) {
  .consent-actions { width: 100%; }
  .consent-btn { flex: 1; }
}

/* ---------- legal links inside a game's start screen ---------- */
.pg-legal { display: contents; }
.pg-legal a, .pg-legal button {
  background: none; border: 0; padding: 4px 2px; font: inherit; color: inherit; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;   /* no opacity: over a game it cost contrast */
}
.pg-legal a:hover, .pg-legal button:hover { text-decoration-thickness: 2px; }

/* ============================================================
   Part 2 — hub pages (home, privacy, 404)
   ============================================================ */
body.pg-page {
  margin: 0;
  background: var(--pg-bg);
  color: var(--pg-ink);
  font: 16px/1.6 var(--pg-ui);
  -webkit-text-size-adjust: 100%;
  /* room to scroll the last footer line above the open consent banner */
  padding-bottom: var(--consent-h, 0px);
}
.pg-page *, .pg-page *::before, .pg-page *::after { box-sizing: border-box; }
.pg-page a { color: var(--pg-accent-ink); }
.pg-page a:focus-visible, .pg-page button:focus-visible { outline: 3px solid var(--pg-focus); outline-offset: 3px; border-radius: 4px; }
/* Keyboard focus stays clear of the sticky header (Shift+Tab used to leave links under
   them: WCAG 2.2 2.4.11), and of the consent banner while it is open (consent.js sets --consent-h).
   Anchor offsets come from here too: a scroll-margin-top on a target would ADD to this. */
html:has(> body.pg-page) {
  scroll-padding-top: 80px;
  scroll-padding-bottom: calc(var(--consent-h, 0px) + 12px);
}
.pg-wrap { max-width: var(--pg-max); margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }

/* header — sticky at the top */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 244, 239, 0.92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--pg-line);
}
.site-header .pg-wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.pg-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--pg-ink) !important; }
.pg-logo svg { width: 36px; height: 36px; flex: 0 0 auto; }
.pg-logo span { font-family: var(--pg-display); font-size: 26px; line-height: 1; letter-spacing: 0.01em; }
.pg-logo b { color: var(--pg-accent-text); font-weight: normal; }
.pg-nav { display: flex; gap: 6px; }
.pg-nav a {
  padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--pg-ink); font-weight: 600; font-size: 15px;
}
.pg-nav a:hover { background: rgba(22, 32, 59, 0.06); }

/* hero */
.pg-hero { padding: clamp(36px, 7vw, 72px) 0 clamp(20px, 4vw, 36px); }
/* the intro runs the full width of the games grid below it (owner, 2026-09-30) */
.pg-hero h1 {
  margin: 0; font-family: var(--pg-display); font-weight: normal;
  font-size: clamp(38px, 6.4vw, 68px); line-height: 1.02; letter-spacing: 0.005em;
}
.pg-hero h1 em { font-style: normal; color: var(--pg-accent-text); }
.pg-hero p { margin: 18px 0 0; font-size: clamp(17px, 2.1vw, 19px); color: var(--pg-ink-soft); }

/* game grid */
.pg-section { padding: clamp(20px, 4vw, 40px) 0; }
.pg-section > .pg-wrap > h2 {
  margin: 0 0 18px; font-family: var(--pg-display); font-weight: normal; font-size: clamp(28px, 3.6vw, 36px); line-height: 1.1;
}
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.pg-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--pg-card); border: 1px solid var(--pg-line); border-radius: var(--pg-radius);
  box-shadow: 0 1px 2px rgba(10, 14, 30, 0.04), 0 10px 30px rgba(10, 14, 30, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pg-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(10, 14, 30, 0.05), 0 18px 40px rgba(10, 14, 30, 0.12); }
.pg-card-featured { grid-column: 1 / -1; }
@media (min-width: 820px) {
  .pg-card-featured { flex-direction: row; }
  .pg-card-featured .pg-cover { flex: 1 1 58%; aspect-ratio: auto; min-height: 340px; }
  .pg-card-featured .pg-card-body { flex: 1 1 42%; padding: 30px 30px 28px; justify-content: center; }
  .pg-card-featured h3 { font-size: 40px; }
  .pg-card-featured .pg-play { margin-top: 6px; } /* the featured body is centred: Play stays with its text */
}
.pg-cover { display: block; aspect-ratio: 16 / 9; background: var(--pg-navy); overflow: hidden; }
.pg-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pg-card-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; }
.pg-card h3 { margin: 0; font-family: var(--pg-display); font-weight: normal; font-size: 28px; line-height: 1.1; }
.pg-card h3 a { color: var(--pg-ink); text-decoration: none; }
/* the whole card is the link target */
.pg-card h3 a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.pg-card p { margin: 0; color: var(--pg-ink-soft); }
/* play totals and rank (the Worker fills them in: worker/plays.ts); empty in the page as built.
   A stats row: a rank medal (gold, silver, bronze, then navy) and a dark pill with the count, so it
   reads at a glance as "how many times this has been played", not as description text. */
.pg-card p.pg-plays { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 2px 0 2px; }
.pg-card p.pg-plays:empty { display: none; }
.pg-rank {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 8px; border-radius: 999px;
  font: 400 21px/1 var(--pg-display); letter-spacing: 0.02em;
  background: linear-gradient(180deg, #4a5578, var(--pg-navy)); color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35), 0 2px 0 rgba(10, 14, 30, 0.25);
}
.pg-rank-1 { background: linear-gradient(180deg, #ffe58a, #e0a526 60%, #c98a12); color: #3b2700; box-shadow: inset 0 0 0 2px #fff3c2, 0 2px 0 #9a6a08; }
.pg-rank-2 { background: linear-gradient(180deg, #f4f6fa, #c3cad6 60%, #a3acbb); color: #1d2433; box-shadow: inset 0 0 0 2px #fff, 0 2px 0 #7d8697; }
.pg-rank-3 { background: linear-gradient(180deg, #f6c79a, #d0823f 60%, #b86a2a); color: #341604; box-shadow: inset 0 0 0 2px #fde2c6, 0 2px 0 #8a4a17; }
.pg-count {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 8px; border-radius: 999px;
  background: var(--pg-navy); color: #c9d0e6; font: 700 15px/1 var(--pg-ui); white-space: nowrap;
}
.pg-count svg { width: 28px; height: 28px; flex: 0 0 auto; }
.pg-count b { color: #fff; font: 400 22px/1 var(--pg-display); letter-spacing: 0.02em; margin-right: 1px; }
.pg-card-featured .pg-rank { min-width: 52px; height: 52px; font-size: 25px; }
.pg-card-featured .pg-count { height: 52px; padding-right: 20px; font-size: 17px; }
.pg-card-featured .pg-count svg { width: 34px; height: 34px; }
.pg-card-featured .pg-count b { font-size: 27px; }
.pg-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.pg-desc-long { display: none; }
.pg-card-featured .pg-desc-long { display: block; }
.pg-card-featured .pg-desc-short { display: none; }
.pg-rank-note { margin: -10px 0 16px; font-size: 14px; color: var(--pg-ink-soft); }
.pg-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }
.pg-tags li {
  padding: 3px 10px; border-radius: 999px; background: rgba(22, 32, 59, 0.06);
  font-size: 13px; font-weight: 600; color: var(--pg-ink-soft);
}
/* margin-top auto: Play sits at the bottom of every card, so a row's buttons line up however many lines
   of tags each card has (owner, 2026-10-01: Dogfight's Play sat higher than its neighbours') */
.pg-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: auto; }
.pg-card-actions .pg-play { margin-top: 0; align-self: center; }
@media (min-width: 820px) { .pg-card-featured .pg-card-actions { margin-top: 6px; } } /* the featured body is centred: its buttons stay with its text */
/* the card's second link sits above the whole-card link (h3 a::after, z-index 1) */
.pg-howto { position: relative; z-index: 2; padding: 10px 2px; font-weight: 700; color: var(--pg-ink); text-underline-offset: 3px; }
.pg-howto:hover { text-decoration-thickness: 2px; }
.pg-play {
  align-self: flex-start; margin-top: auto; padding: 12px 26px; border-radius: 12px;
  background: linear-gradient(180deg, var(--pg-accent-2), var(--pg-accent)); color: #1b1300;
  font-family: var(--pg-display); font-size: 21px; letter-spacing: 0.02em; line-height: 1;
  box-shadow: 0 4px 0 #b44d00;
}
.pg-badge-new {
  position: absolute; top: 14px; left: 14px; z-index: 2; padding: 4px 10px; border-radius: 999px;
  background: var(--pg-navy); color: #fff; font: 700 12px/1.3 var(--pg-ui); letter-spacing: 0.06em; text-transform: uppercase;
}
.pg-card-soon {
  justify-content: center; align-items: flex-start; min-height: 180px; padding: 22px;
  background: repeating-linear-gradient(135deg, rgba(22, 32, 59, 0.035) 0 14px, transparent 14px 28px), var(--pg-card);
  border-style: dashed; box-shadow: none;
}
.pg-card-soon:hover { transform: none; box-shadow: none; }
.pg-card-soon h3 { font-size: 24px; }

/* about */
.pg-about { padding-bottom: clamp(36px, 6vw, 64px); }
.pg-about-box {
  display: grid; gap: 18px 36px; grid-template-columns: 1fr; padding: clamp(22px, 4vw, 36px);
  background: var(--pg-navy); color: #e8ecf8; border-radius: var(--pg-radius);
}
@media (min-width: 820px) { .pg-about-box { grid-template-columns: 1.1fr 1fr; } }
.pg-about-box h2 { margin: 0 0 8px; font-family: var(--pg-display); font-weight: normal; font-size: 32px; line-height: 1.1; color: #fff; }
.pg-about-box p { margin: 0 0 12px; color: #c9d0e6; }
.pg-about-box a { color: var(--pg-accent-2); }
.pg-about-box a:focus-visible { outline-color: var(--pg-accent-2); }   /* a light ring on the navy box */
.pg-promises { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; align-content: start; }
.pg-promises li { display: flex; gap: 10px; align-items: flex-start; color: #e8ecf8; }
.pg-promises li::before {
  content: ''; flex: 0 0 auto; width: 20px; height: 20px; margin-top: 3px; border-radius: 50%;
  background: var(--pg-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1300' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* long-form pages (privacy) */
.pg-doc { padding: clamp(28px, 5vw, 56px) 0 clamp(40px, 6vw, 72px); }
.pg-doc .pg-wrap { max-width: 760px; }
.pg-kicker { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pg-accent-ink); }
.pg-doc h1 { margin: 0; font-family: var(--pg-display); font-weight: normal; font-size: clamp(34px, 5vw, 48px); line-height: 1.05; }
.pg-lead { margin: 14px 0 6px; font-size: 19px; color: var(--pg-ink-soft); }
.pg-updated { margin: 0 0 8px; font-size: 14px; color: var(--pg-ink-faint); }
.pg-doc h2 {
  margin: 38px 0 10px; padding-top: 6px; font-family: var(--pg-display); font-weight: normal; font-size: 26px; line-height: 1.15;
}
.pg-doc h3 { margin: 22px 0 6px; font-size: 17px; }
.pg-doc p, .pg-doc li { color: #2b3353; }
.pg-doc ul { padding-left: 1.2em; }
.pg-doc li { margin: 6px 0; }
.pg-summary { margin: 22px 0 8px; padding: 18px 22px; background: #fff; border: 1px solid var(--pg-line); border-radius: 14px; }
.pg-summary h2 { margin-top: 0; }
.pg-summary ul { margin: 0; }
.pg-table-wrap { overflow-x: auto; margin: 14px 0; border: 1px solid var(--pg-line); border-radius: 12px; background: #fff; }
/* focusable (tabindex=0 in the page) so a keyboard can scroll it sideways on a phone: WCAG 2.1.1 */
.pg-table-wrap:focus-visible { outline: 3px solid var(--pg-focus); outline-offset: 2px; }
.pg-doc table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 520px; }
.pg-doc th, .pg-doc td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--pg-line); }
.pg-doc tr:last-child td { border-bottom: 0; }
.pg-doc th { background: rgba(22, 32, 59, 0.04); font-size: 13px; letter-spacing: 0.02em; }
.pg-doc code { font-size: 0.92em; padding: 1px 5px; border-radius: 5px; background: rgba(22, 32, 59, 0.07); }
.pg-choices-btn {
  display: inline-block; margin: 4px 0; padding: 10px 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--pg-ink); background: var(--pg-ink); color: #fff; font: 600 15px/1.2 var(--pg-ui);
}

/* game guides: /games/<slug>/how-to-play/ (build-site.mjs 3c), and the About page's game list */
.pg-guide-play { position: relative; display: block; margin: 22px 0 18px; border-radius: var(--pg-radius); overflow: hidden; background: var(--pg-navy); }
.pg-guide-play img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.pg-guide-play .pg-play { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); white-space: nowrap; }
.pg-guide-play:hover .pg-play { filter: brightness(1.06); }
.pg-guide-play:focus-visible { outline: 3px solid var(--pg-focus); outline-offset: 3px; }
.pg-guide a.pg-play, .pg-guide-end a.pg-play { display: inline-block; text-decoration: none; }
.pg-facts {
  display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; padding: 16px 20px;
  background: #fff; border: 1px solid var(--pg-line); border-radius: 14px; font-size: 15px;
}
.pg-facts div { display: contents; }
.pg-facts dt { font-weight: 700; color: var(--pg-ink); }
.pg-facts dd { margin: 0; color: #2b3353; }
@media (max-width: 480px) {
  .pg-facts { grid-template-columns: 1fr; gap: 0; }
  .pg-facts dd { margin-bottom: 10px; }
  .pg-facts div:last-child dd { margin-bottom: 0; }
}
.pg-steps li, .pg-tips li { margin: 8px 0; }
.pg-steps { padding-left: 1.4em; }
.pg-doc table.pg-controls { min-width: 0; margin: 6px 0 4px; background: #fff; border: 1px solid var(--pg-line); border-radius: 12px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.pg-doc .pg-controls th[scope="row"] { width: 42%; background: none; font-size: 14.5px; letter-spacing: 0; }
.pg-doc .pg-controls tr:last-child th { border-bottom: 0; }
.pg-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pg-shots figure { margin: 0; }
.pg-shots figure:first-child { grid-column: 1 / -1; }
.pg-shots img { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--pg-navy); }
.pg-shots figcaption { margin-top: 6px; font-size: 14px; color: var(--pg-ink-soft); }
@media (max-width: 560px) { .pg-shots { grid-template-columns: 1fr; } }
.pg-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; padding: 0 !important; list-style: none; }
.pg-doc .pg-more li { margin: 0; padding: 0 0 12px; background: #fff; border: 1px solid var(--pg-line); border-radius: 14px; overflow: hidden; }
.pg-more-link { display: block; color: var(--pg-ink); text-decoration: none; }
.pg-more-link img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--pg-navy); }
.pg-more-link span { display: block; margin: 10px 14px 0; font-family: var(--pg-display); font-size: 22px; line-height: 1.1; }
.pg-more-link:hover span { text-decoration: underline; text-underline-offset: 3px; }
.pg-more p { margin: 4px 14px 0; font-size: 14.5px; }
.pg-more .pg-howto { display: inline-block; margin: 2px 14px 0; font-size: 14.5px; }
.pg-guide-end { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 30px; }
.pg-gamelist li { margin: 10px 0; }

/* 404 */
.pg-404 { padding: clamp(60px, 12vw, 120px) 0; text-align: center; }
.pg-404 h1 { margin: 0 0 10px; font-family: var(--pg-display); font-weight: normal; font-size: clamp(40px, 7vw, 64px); }
.pg-404 p { color: var(--pg-ink-soft); }
.pg-404 .pg-play { display: inline-block; text-decoration: none; }

/* footer */
.site-footer { border-top: 1px solid var(--pg-line); padding: 26px 0 34px; font-size: 14px; color: var(--pg-ink-faint); }
.site-footer .pg-wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--pg-ink-soft); }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; }
.footer-link-button {
  padding: 0; border: 0; background: none; color: var(--pg-ink-soft); font: inherit; text-decoration: underline; cursor: pointer;
}

@media (max-width: 560px) {
  .pg-logo span { font-size: 24px; }   /* 24px+ counts as large text, so the orange "Games" passes at 3:1 */
  .pg-nav a { padding: 8px 8px; }
}
/* 320px wide (WCAG 1.4.10 reflow): logo + nav were 13px too wide and the page scrolled sideways */
@media (max-width: 360px) {
  .site-header .pg-wrap { gap: 8px; }
  .pg-logo { gap: 6px; }
  .pg-logo svg { width: 28px; height: 28px; }
  .pg-nav { gap: 0; }
  .pg-nav a { padding: 8px 6px; font-size: 14px; }
}
/* phones: three header links don't fit beside the logo (the page scrolled sideways up to 417 px wide,
   WCAG 1.4.10); Contact stays in the footer there */
@media (max-width: 440px) {
  .pg-nav-contact { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pg-card, .pg-card:hover { transition: none; transform: none; }
}
@media print {
  body.pg-page { padding-top: 0; }
  .site-header { position: static; top: 0; }
  .consent-banner { display: none !important; }
}

