/* =========================================================
   Patco Games — stylesheet
   Look: a shelf of game cartridges. Each game owns a label color
   (set per game in games.js). One pixel font for names, plain
   system text for everything else. No glow, no gradients.
   ========================================================= */
:root {
  --shelf: #262230;
  --shelf-dark: #1c1924;
  --surface: #322d3f;
  --line: #463f57;
  --paper: #f4ead8;
  --muted: #b3aac4;
  --plastic: #9d98aa;
  --plastic-dark: #7d788b;
  --action: #f2c14e;
  --pixel: "Silkscreen", ui-monospace, Menlo, Consolas, monospace;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--shelf); color: var(--paper);
  font: 16px/1.55 var(--text);
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--paper); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--action); }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.15; font-weight: 700; }
h1 { font: 700 clamp(1.7rem, 4vw, 2.6rem)/1.1 var(--pixel); letter-spacing: -.01em; }
h2 { font: 700 1.25rem/1.2 var(--pixel); }
h3 { font-size: 1.05rem; }
.container { width: min(1240px, 100% - 32px); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--action); color: #1c1924; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 3px; }

/* ---------- Header ---------- */
.site-header { background: var(--shelf-dark); border-bottom: 4px solid #15131b; }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--paper); }
.logo svg { width: 30px; height: 34px; flex: none; }
.logo-word { font: 700 1.5rem/1 var(--pixel); letter-spacing: .02em; }
.main-nav { margin-left: auto; display: flex; gap: 4px; }
.main-nav a { text-decoration: none; color: var(--muted); font-weight: 600; padding: 8px 12px; border-radius: 6px; }
.main-nav a:hover { color: var(--paper); background: var(--surface); }
.main-nav a[aria-current="page"] { color: var(--paper); box-shadow: inset 0 -3px 0 var(--action); border-radius: 0; }
.nav-toggle { display: none; margin-left: auto; background: var(--surface); color: var(--paper); border: 2px solid var(--line); border-radius: 6px; padding: 7px 12px; font: 600 .95rem var(--text); cursor: pointer; }
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; flex-direction: column; position: absolute; left: 0; right: 0; top: 64px; background: var(--shelf-dark); padding: 10px 16px 16px; z-index: 40; border-bottom: 4px solid #15131b; }
  .main-nav.open { display: flex; }
  .site-header { position: relative; }
}

/* ---------- Intro + search ---------- */
.intro { padding: 32px 0 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 32px; align-items: end; }
.intro p { color: var(--muted); margin: 0; max-width: 46ch; }
.search { display: flex; align-items: center; gap: 8px; background: var(--paper); color: #1c1924; border-radius: 6px; padding: 0 12px; width: min(360px, 100%); border: 3px solid #15131b; }
.search svg { width: 18px; height: 18px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: 500 1rem var(--text); color: #1c1924; height: 44px; outline: none; }
.search:focus-within { box-shadow: 0 0 0 3px var(--action); }
@media (max-width: 720px) { .intro { grid-template-columns: 1fr; } .search { width: 100%; } }

.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 0; padding-bottom: 14px; border-bottom: 2px solid var(--line); }
.filter { background: none; border: 0; color: var(--muted); font: 600 .95rem var(--text); padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.filter:hover { color: var(--paper); background: var(--surface); }
.filter[aria-pressed="true"] { background: var(--paper); color: #1c1924; }

/* ---------- Layout ---------- */
.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; padding: 8px 0 48px; }
.sidebar { display: flex; flex-direction: column; gap: 24px; padding-top: 28px; }
@media (max-width: 1000px) { .with-sidebar { grid-template-columns: minmax(0, 1fr); } .sidebar { align-items: center; } }

.section { margin: 28px 0 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.count { color: var(--muted); font-size: .9rem; }
.empty { color: var(--muted); padding: 32px 0; }

/* ---------- The shelf ---------- */
.shelf {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 34px 22px;
  padding: 6px 0 0;
}
.shelf .shelf-ad { grid-column: 1 / -1; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 210px); gap: 22px; overflow-x: auto; padding: 6px 2px 16px; }

/* ---------- Cartridge card ---------- */
.cart { --label: #9fd36b; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--paper); }
.cart-body {
  position: relative; background: var(--plastic); padding: 22px 12px 14px; border-radius: 6px 6px 10px 10px;
  clip-path: polygon(0 10px, 10px 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  box-shadow: inset 0 -6px 0 var(--plastic-dark), inset 0 2px 0 rgba(255,255,255,.35);
  transition: transform .15s ease;
}
/* grip ridges along the top edge */
.cart-body::before {
  content: ""; position: absolute; left: 22%; right: 22%; top: 7px; height: 8px;
  background: repeating-linear-gradient(90deg, var(--plastic-dark) 0 3px, transparent 3px 7px);
  border-radius: 2px;
}
.cart-label { background: var(--label); border-radius: 4px; padding: 6px; box-shadow: 0 0 0 2px rgba(0,0,0,.18); }
.cart-shot { aspect-ratio: 16 / 10; background: #15131b; border-radius: 2px; overflow: hidden; }
.cart-shot img { width: 100%; height: 100%; object-fit: cover; }
.cart-name { font: 700 1rem/1 var(--pixel); color: #1c1924; padding: 8px 2px 2px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.cart-new { font: 700 .62rem/1 var(--text); background: #1c1924; color: var(--paper); padding: 3px 5px; border-radius: 3px; letter-spacing: .02em; }
.cart-tagline { margin: 0; font-size: .9rem; color: var(--muted); line-height: 1.4; }
.cart-kind { font-size: .8rem; color: var(--muted); opacity: .8; }
.cart:hover .cart-body, .cart:focus-visible .cart-body { transform: translateY(-6px); }
.cart:hover .cart-tagline { color: var(--paper); }

/* ---------- Ad slots ----------
   Paste ad code INSIDE .ad-slot. The dashed box shows only while empty.
   Nothing here is fixed or floating, so an ad can never cover a game. */
.ad-wrap { width: fit-content; max-width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 4px; }
.ad-tag { font-size: .72rem; color: var(--muted); }
.ad-slot { max-width: 100%; overflow: hidden; display: grid; place-items: center; }
.ad-slot:empty { border: 2px dashed var(--line); border-radius: 4px; }
.ad-slot:empty::before { content: "Ad space " attr(data-size); color: var(--muted); font-size: .8rem; opacity: .7; }
.ad-300x250 { width: 300px; height: 250px; }
.ad-728x90 { width: 728px; height: 90px; }
.ad-160x600 { width: 160px; height: 600px; }
.only-desktop { display: flex; }
.only-mobile { display: none; }
@media (max-width: 760px) { .only-desktop { display: none; } .only-mobile { display: flex; } }

/* ---------- Affiliate widgets ---------- */
.sponsored { font-size: .72rem; font-weight: 700; color: #1c1924; background: var(--action); padding: 2px 6px; border-radius: 3px; }
.aff-widget { width: 300px; max-width: 100%; background: var(--surface); border-radius: 6px; padding: 16px; border-top: 4px solid var(--action); }
.aff-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.aff-head h3 { margin: 0; font: 700 .95rem var(--pixel); }
.aff-item { display: block; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--paper); }
.aff-item:first-of-type { border-top: 0; }
.aff-item:hover .aff-name { text-decoration: underline; }
.aff-name { display: block; font-weight: 700; font-size: .92rem; }
.aff-note { display: block; color: var(--muted); font-size: .82rem; }
.aff-more { display: inline-block; margin-top: 6px; font-weight: 700; font-size: .88rem; color: var(--action); }
a.aff-unset { cursor: not-allowed; }

.gear-cat { margin: 36px 0; }
.gear-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.gear-card { background: var(--surface); border-radius: 6px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.gear-card .sponsored { align-self: flex-start; }
.gear-card h3 { margin: 4px 0 0; }
.gear-card p { margin: 0; color: var(--muted); font-size: .92rem; flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--action); color: #1c1924; border: 0; border-radius: 6px;
  padding: 10px 16px; font: 700 .95rem var(--text); cursor: pointer; text-decoration: none;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.22);
}
.btn:hover { color: #1c1924; filter: brightness(1.06); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgba(0,0,0,.22); }
.btn.ghost { background: var(--surface); color: var(--paper); box-shadow: inset 0 -4px 0 rgba(0,0,0,.3); }
.btn.small { padding: 7px 12px; font-size: .88rem; }

/* ---------- Game page ---------- */
.game-layout { display: grid; grid-template-columns: 160px minmax(0, 1fr) 300px; gap: 28px; align-items: start; padding: 22px 0 48px; }
.game-side { display: flex; flex-direction: column; gap: 24px; align-items: center; }
.game-center { min-width: 0; }
@media (max-width: 1280px) { .game-layout { grid-template-columns: minmax(0, 1fr) 300px; } .game-side.left { display: none; } }
@media (max-width: 1000px) { .game-layout { grid-template-columns: minmax(0, 1fr); } }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.title-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.title-row h1 { margin: 0; }
.title-row h1::before { content: ""; display: inline-block; width: .55em; height: .55em; background: var(--label); margin-right: .35em; vertical-align: .08em; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.best { color: var(--muted); font-size: .92rem; margin-right: 4px; }
.best b { color: var(--paper); font-family: var(--pixel); }

/* the console bezel around a game */
.game-frame {
  position: relative; background: var(--shelf-dark); border-radius: 10px; padding: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  box-shadow: inset 0 0 0 3px #15131b, inset 0 -8px 0 #15131b;
}
.game-stage {
  position: relative; width: min(100%, var(--maxw, 900px), calc(76vh * var(--ar, 1.7778)));
  aspect-ratio: var(--ar, 1.7778); border-radius: 4px; overflow: hidden; background: #000;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.game-stage canvas { display: block; width: 100%; height: 100%; }
.game-extras { display: flex; gap: 8px; }
.game-frame:fullscreen { width: 100vw; height: 100vh; border-radius: 0; padding: 0; justify-content: center; background: #000; box-shadow: none; }
.game-frame:fullscreen .game-stage { width: min(100vw, calc(100vh * var(--ar, 1.7778))); border-radius: 0; }
.game-frame.pseudo-fs { position: fixed; inset: 0; z-index: 1000; border-radius: 0; padding: 0; justify-content: center; background: #000; box-shadow: none; }
.game-frame.pseudo-fs .game-stage { width: min(100vw, calc(100vh * var(--ar, 1.7778))); }
.fs-exit { display: none; position: absolute; top: 10px; right: 10px; z-index: 5; }
.game-frame.pseudo-fs .fs-exit, .game-frame:fullscreen .fs-exit { display: inline-flex; }

/* start / game-over screens inside a game (part of the game, never an ad) */
.overlay {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 18px; text-align: center; background: rgba(28,25,36,.78);
}
.overlay.hidden { display: none; }
.overlay h2 { font: 700 clamp(1.4rem, 4.5vw, 2.4rem)/1.1 var(--pixel); margin: 0; color: var(--paper); }
.overlay p { margin: 0; color: var(--muted); font-size: clamp(.85rem, 2.2vw, 1rem); max-width: 44ch; }
.overlay .big { color: var(--paper); font: 700 clamp(1.1rem, 3vw, 1.5rem) var(--pixel); }
.overlay .row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 4px; }
.overlay .more { display: none; }
/* small game boxes (wide games on a phone): drop the long help, then shrink everything */
.overlay.tight { gap: 6px; padding: 10px; }
.overlay.tight .help, .overlay.tight .more2, .overlay.tight .longp { display: none; }
.overlay.tight .more { display: block; font-size: .78rem; }
.overlay.tight h2 { font-size: 1.25rem; }
.overlay.tight .big { font-size: 1rem; }
.overlay.tight .row { gap: 6px; margin-top: 0; }
.overlay.tight .btn { padding: 7px 12px; font-size: .85rem; }
.overlay.tighter { gap: 3px; padding: 6px; }
.overlay.tighter .more { display: none; }
.overlay.tighter h2 { font-size: 1.05rem; }
.overlay.tighter p { font-size: .75rem; }
.overlay.tighter .btn { padding: 5px 9px; font-size: .78rem; box-shadow: inset 0 -2px 0 rgba(0,0,0,.22); }
.stars { color: var(--action); letter-spacing: .15em; font-size: 1.6em; }

.info { background: var(--surface); border-radius: 6px; padding: 18px 20px; margin: 22px 0; }
.info h2 { font-size: 1rem; }
.info ul { margin: 0; padding-left: 20px; color: var(--muted); }
.info li { margin: 4px 0; }
.info p { margin: 0; color: var(--muted); max-width: 70ch; }
kbd { font: 600 .82em var(--text); background: var(--paper); color: #1c1924; border-radius: 4px; padding: 1px 6px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.25); }
.below-game { margin: 4px 0 8px; }

/* ---------- Text pages ---------- */
.prose { max-width: 720px; padding: 36px 0 56px; }
.prose h1 { margin-bottom: .6em; }
.prose h2 { font-size: 1.05rem; margin-top: 2em; }
.prose p, .prose li { color: #ddd5e6; }
.callout { background: var(--surface); border-left: 4px solid var(--action); padding: 14px 18px; border-radius: 0 6px 6px 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--shelf-dark); border-top: 4px solid #15131b; color: var(--muted); font-size: .9rem; padding: 28px 0 32px; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--paper); text-decoration: underline; }
.disclosure { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: .84rem; max-width: 90ch; }
.disclosure a { color: var(--muted); }

@media (max-width: 560px) {
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .cart-body { padding: 18px 8px 10px; }
  .cart-name { font-size: .82rem; }
  .cart-tagline { font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* level select (used by games with levels) */
.lvl-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; width: min(100%, 520px); margin-top: 6px; }
.lvl { font: 700 clamp(.7rem, 2vw, .9rem) var(--pixel); aspect-ratio: 1; border: 0; border-radius: 4px; background: var(--paper); color: #1c1924; cursor: pointer; box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); padding: 0; }
.lvl.done { background: var(--label, var(--action)); }
.lvl:disabled { background: rgba(255,255,255,.12); color: rgba(255,255,255,.35); cursor: not-allowed; box-shadow: none; }
.lvl:not(:disabled):hover { filter: brightness(1.08); }
@media (max-width: 480px) { .lvl-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.overlay.tight .lvl-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; margin-top: 0; }
.overlay.tight .lvl-grid button, .overlay.tight .lvl-grid .lvl { padding: 2px 0; min-height: 0; font-size: .72rem; }


/* =========================================================
   Look v4: ink and bus yellow
   Flat deep-ink surfaces, school-bus yellow for anything you can press,
   one typeface (Archivo, narrowed for headings). The game covers do the
   talking: no glows, no gradients, no tilted cards.
   ========================================================= */
:root {
  --shelf: #131b30; --shelf-dark: #0f1628; --surface: #1c2643; --line: #2a3659;
  --paper: #eef1f8; --muted: #98a2c3; --action: #ffc83d; --ink: #131b30;
  --pixel: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
body { background: var(--shelf); font-family: var(--text); }
h1, h2, h3 { font-family: var(--pixel); font-stretch: 82%; letter-spacing: -.005em; }
h1 { font-weight: 800; font-size: clamp(1.9rem, 3.6vw, 2.7rem); line-height: 1.02; }
h2 { font-weight: 800; font-size: 1.35rem; }
a:hover { color: var(--action); }
.logo svg { width: 30px; height: 30px; }
.logo-word { font: 800 1.45rem/1 var(--pixel); font-stretch: 82%; letter-spacing: 0; }
.site-header { background: var(--shelf-dark); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.main-nav a { font-weight: 600; }
.main-nav a[aria-current="page"] { color: var(--paper); box-shadow: inset 0 -2px 0 var(--action); }
.nav-toggle { background: var(--surface); color: var(--paper); border: 1px solid var(--line); }

/* home: title line + search, then the featured mosaic */
.intro { padding: 34px 0 18px; align-items: end; }
.intro h1 { margin: 0 0 6px; }
.intro p { color: var(--muted); font-size: 1.02rem; }
.search { background: var(--surface); color: var(--muted); border: 1px solid var(--line); border-radius: 8px; box-shadow: none; }
.search input { color: var(--paper); font-family: var(--text); }
.search input::placeholder { color: var(--muted); }
.search:focus-within { border-color: var(--action); box-shadow: none; }
.mosaic { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; margin: 6px 0 8px; align-items: start; }
.tile { position: relative; display: block; border-radius: 10px; overflow: hidden; background: var(--surface); color: var(--paper); text-decoration: none; }
.tile img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .3s ease; }
.tile-big { grid-row: span 2; align-self: stretch; }
.tile-big img { height: 100%; aspect-ratio: auto; }
.tile-meta { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; background: var(--surface); }
.tile-meta p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.35; }
.tile-meta .btn { flex: none; }
.tile:hover img, .tile:focus-visible img { transform: scale(1.035); }
@media (max-width: 720px) { .mosaic { grid-template-columns: 1fr 1fr; } .tile-big { grid-column: 1 / -1; grid-row: auto; } .tile-meta { padding: 10px 12px; } .tile-meta p { font-size: .88rem; } }

.filters { gap: 6px; border-bottom: 1px solid var(--line); }
.filter { font-family: var(--text); border-radius: 6px; }
.filter:hover { background: var(--surface); color: var(--paper); }
.filter[aria-pressed="true"] { background: var(--action); color: var(--ink); }
.section-head h2 { font-size: 1.35rem; }
.count { color: var(--muted); font-size: .9rem; }

/* game cards: just the cover, its name and its kind */
.strip { grid-auto-columns: minmax(220px, 240px); gap: 18px; }
.shelf { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 26px 18px; }
.cart { gap: 4px; }
.cart-body { background: none; padding: 0; border-radius: 0; clip-path: none; box-shadow: none; transform: none !important; transition: none; }
.cart-body::before { display: none; }
.cart-label { background: none; padding: 0; border-radius: 0; box-shadow: none; }
.cart-shot { border-radius: 8px; background: var(--surface); }
.cart-shot img { transition: transform .3s ease; }
.cart-name { font: 700 1rem/1.25 var(--text); color: var(--paper); padding: 9px 0 0; justify-content: flex-start; gap: 8px; }
.cart-new { background: var(--action); color: var(--ink); font: 800 .64rem/1 var(--text); padding: 3px 6px; border-radius: 4px; letter-spacing: .02em; }
.cart-tagline { font-size: .88rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-kind { font-size: .78rem; color: var(--muted); opacity: .75; }
.cart:hover .cart-shot img, .cart:focus-visible .cart-shot img { transform: scale(1.04); }
.cart:hover .cart-name { color: var(--action); }
.cart:hover .cart-tagline { color: var(--muted); }
@media (max-width: 560px) { .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; } .cart-name { font-size: .92rem; } .cart-tagline { display: none; } }

/* buttons */
.btn { background: var(--action); color: var(--ink); box-shadow: none; border-radius: 8px; font-family: var(--text); font-weight: 700; }
.btn:hover { color: var(--ink); filter: brightness(1.05); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--paper); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--muted); }

/* game pages */
.best b { font-family: var(--text); }
.title-row h1::before { border-radius: 3px; }
.game-frame { background: var(--shelf-dark); box-shadow: none; border: 1px solid var(--line); }
.overlay h2 { font-family: var(--pixel); font-stretch: 82%; }
.site-footer { background: var(--shelf-dark); border-top: 1px solid var(--line); }

/* Empty ad slots stay hidden until real ad code is pasted in (add ?adslots to any URL to see where they go) */
body:not(.show-ad-slots) .ad-wrap:has(> .ad-slot:empty) { display: none; }
body:not(.show-ad-slots) .with-sidebar:not(:has(.sidebar .ad-slot:not(:empty))) { grid-template-columns: minmax(0, 1fr); }
body:not(.show-ad-slots) .with-sidebar:not(:has(.sidebar .ad-slot:not(:empty))) .sidebar { display: none; }
body:not(.show-ad-slots) .game-layout:not(:has(.game-side .ad-slot:not(:empty))) { grid-template-columns: minmax(0, 1fr); max-width: 1080px; }
body:not(.show-ad-slots) .game-layout:not(:has(.game-side .ad-slot:not(:empty))) .game-side { display: none; }
body:not(.show-ad-slots) .grid-ad:not(:has(.ad-slot:not(:empty))) { display: none; }

.nav-toggle { white-space: nowrap; flex: none; }
@media (max-width: 360px) { .logo-word { font-size: 1.15rem; } .logo { gap: 8px; } }

/* =========================================================
   Look v5: playground
   Bright royal-blue ground with a dot pattern, a sunshine-yellow header,
   white sticker cards with thick ink outlines, hot-pink for likes and picks.
   Lilita One (chunky display) for names and headings, Nunito for text.
   ========================================================= */
:root {
  --sky: #1d6ae5; --sky-deep: #1655c0; --sun: #ffd23f; --pink: #ff4fa3; --lime: #6fdc3a; --ink: #1b1340;
  --card: #ffffff; --card-muted: #5d5783; --on-sky: #e6efff;
  --shelf: var(--sky); --shelf-dark: var(--ink); --surface: #ffffff; --line: rgba(27,19,64,.25);
  --paper: #ffffff; --muted: var(--on-sky); --action: var(--sun);
  --pixel: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --text: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
body { background: var(--sky) radial-gradient(rgba(255,255,255,.13) 2px, transparent 2.6px) 0 0 / 26px 26px; color: #fff; font-family: var(--text); font-weight: 600; }
h1, h2, h3 { font-family: var(--pixel); font-weight: 400; font-stretch: normal; letter-spacing: .01em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; text-shadow: 0 4px 0 rgba(27,19,64,.35); }
h2 { font-size: 1.5rem; text-shadow: 0 3px 0 rgba(27,19,64,.3); }
a { color: #fff; }
a:hover { color: var(--sun); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

/* header */
.site-header { background: var(--sun); border-bottom: 4px solid var(--ink); }
.logo, .logo:hover { color: var(--ink); }
.logo-word { font: 400 1.75rem/1 var(--pixel); letter-spacing: .02em; }
.main-nav a { color: var(--ink); font-weight: 800; border-radius: 999px; }
.main-nav a:hover { color: var(--ink); background: #fff; }
.main-nav a[aria-current="page"] { color: #fff; background: var(--pink); box-shadow: none; border-radius: 999px; }
.nav-toggle { background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; font-weight: 800; }
@media (max-width: 720px) { .main-nav { background: var(--sun); border-bottom: 4px solid var(--ink); } }

/* home intro, search, filters */
.intro { padding: 30px 0 18px; }
.search { background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; box-shadow: 0 4px 0 var(--ink); }
.search input { color: var(--ink); font: 700 1rem var(--text); }
.search input::placeholder { color: var(--card-muted); }
.search:focus-within { border-color: var(--ink); box-shadow: 0 4px 0 var(--ink), 0 0 0 4px var(--sun); }
.filters { border-bottom: 0; gap: 8px; }
.filter { background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; font: 800 .95rem var(--text); padding: 6px 16px; box-shadow: 0 3px 0 var(--ink); }
.filter:hover { background: #fff6cc; color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--pink); color: #fff; }
.count { color: var(--on-sky); font-weight: 700; }

/* featured tiles */
.tile { border: 4px solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 var(--ink); background: var(--ink); }

/* game cards: white stickers */
.cart { background: var(--card); color: var(--ink); border: 3px solid var(--ink); border-radius: 18px; padding: 8px 8px 10px; box-shadow: 0 6px 0 var(--ink); transition: transform .15s ease, box-shadow .15s ease; gap: 2px; }
.cart:hover, .cart:focus-visible { transform: translateY(-4px); box-shadow: 0 10px 0 var(--ink); color: var(--ink); }
.cart-shot { border-radius: 12px; background: var(--ink); }
.cart-name { font: 400 1.12rem/1.15 var(--pixel); color: var(--ink); padding: 9px 2px 0; letter-spacing: .01em; }
.cart:hover .cart-name { color: var(--sky); }
.cart-new { background: var(--pink); color: #fff; font: 900 .66rem/1 var(--text); border-radius: 999px; padding: 4px 8px; }
.cart-tagline { color: var(--card-muted); padding: 0 2px; font-weight: 600; }
.cart:hover .cart-tagline { color: var(--card-muted); }
.cart-kind { display: none; }
.cart-stats { display: flex; gap: 12px; padding: 6px 2px 0; font: 900 .82rem/1 var(--text); color: var(--card-muted); opacity: .35; transition: opacity .3s ease; }
.cart-stats.ready { opacity: 1; }
.cart-stats > span { display: inline-flex; align-items: center; gap: 4px; }
.cart-stats svg { width: 15px; height: 15px; }
.st-like svg { fill: none; stroke: var(--pink); stroke-width: 2.6; }
.cart-stats.is-liked .st-like svg { fill: var(--pink); }
.st-play svg { fill: var(--sky); }
@media (max-width: 560px) { .cart { padding: 6px 6px 8px; border-radius: 14px; } .cart-name { font-size: .98rem; } }

/* buttons */
.btn { background: var(--sun); color: var(--ink); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 0 4px 0 var(--ink); font: 900 .95rem var(--text); }
.btn:hover { color: var(--ink); filter: brightness(1.04); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.ghost { background: #fff; color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.btn.ghost:hover { border-color: var(--ink); background: #fff6cc; }
.btn.small { padding: 6px 12px; }
.overlay .btn.ghost { background: #fff; }

/* game pages */
.crumbs, .crumbs a { color: var(--on-sky); font-weight: 700; }
.title-row h1::before { background: var(--label); border: 3px solid var(--ink); border-radius: 8px; width: .6em; height: .6em; }
.game-frame { background: var(--ink); border: 4px solid var(--ink); border-radius: 20px; box-shadow: 0 8px 0 rgba(27,19,64,.45); }
.info { background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 5px 0 var(--ink); }
.info h2 { color: var(--ink); text-shadow: none; font-size: 1.25rem; }
.info ul, .info p { color: #3f3a66; }
.overlay h2 { font-family: var(--pixel); font-weight: 400; letter-spacing: .02em; }
.overlay .big { font-family: var(--pixel); font-weight: 400; }

/* like button + play count */
.like-btn { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; padding: 4px 13px 4px 9px; font: 900 .95rem/1 var(--text); cursor: pointer; box-shadow: 0 3px 0 var(--ink); min-height: 38px; }
.like-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--pink); stroke-width: 2.6; transition: transform .15s ease; }
.like-btn:hover svg { transform: scale(1.12); }
.like-btn[aria-pressed="true"] { background: #ffe1f0; }
.like-btn[aria-pressed="true"] svg { fill: var(--pink); }
.like-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.like-btn.pop svg { animation: heartpop .45s ease; }
@keyframes heartpop { 0% { transform: scale(1); } 35% { transform: scale(1.45); } 70% { transform: scale(.9); } 100% { transform: scale(1); } }
.plays { display: inline-flex; align-items: center; gap: 5px; color: #fff; font: 800 .95rem/1 var(--text); margin-right: 4px; white-space: nowrap; min-width: 7.4em; }
/* fixed widths so the toolbar never shifts the game when a count changes */
.like-btn b { min-width: 2.6ch; text-align: left; }
.plays svg { width: 14px; height: 14px; fill: var(--sun); }
.plays b { font-weight: 900; }

/* text pages + footer */
.prose p, .prose li { color: #f2f6ff; }
.prose a { color: var(--sun); }
.callout { background: #fff; color: var(--ink); border: 3px solid var(--ink); border-left-width: 8px; border-radius: 14px; }
.callout a { color: var(--sky-deep); }
.site-footer { background: var(--ink); border-top: 4px solid var(--ink); color: #cfc9f2; }
.footer-links a { color: #cfc9f2; }
.footer-links a:hover { color: var(--sun); }
.disclosure { border-top: 1px solid rgba(255,255,255,.15); }
.ad-tag { color: var(--on-sky); }
.ad-slot:empty { border-color: rgba(255,255,255,.4); }
.ad-slot:empty::before { color: var(--on-sky); }

/* legal pages + health note */
.legal .updated { color: var(--on-sky); font-weight: 700; margin-top: -.4em; }
.legal h2 { scroll-margin-top: 90px; }
.legal ul { padding-left: 1.2em; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
.toc a { background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: .88rem; text-decoration: none; box-shadow: 0 3px 0 var(--ink); }
.toc a:hover { background: #fff6cc; color: var(--ink); }
.info .note { margin-top: 12px; font-size: .88rem; color: var(--card-muted); }
.info .note a { color: var(--sky-deep); font-weight: 800; }
.prose p.callout, .prose .callout { color: var(--ink); }
.prose .callout a { color: var(--sky-deep); }
