/* Server-rendered /games pages (server/seoPages.js). Same tokens as the
   display/about pages (public/display/base.css, default-theme.css), restated
   here so these pages need no app-shell CSS. Dark follows the saved theme or
   the system, same rule as the other pages. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --coral: #FF6B6B; --teal: #4ECDC4; --amber: #FFD93D; --violet: #A855F7;
  --indigo: #D4AF37;
  --bg: #F3F1EA; --surface: #FAF9F5; --text: #221F1B; --muted: #6B665B; --border: #D6D2C4;
  --link: #2E8F88;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(40,36,28,.09);
  --font-display: 'Cinzel', 'Segoe UI', system-ui, serif;
}
:root[data-theme='dark'] {
  --bg: #171512; --surface: #221F1A; --text: #F2F0E8; --muted: #A8A398;
  --border: rgba(200,180,140,.22); --indigo: #F0C169; --link: #4ECDC4;
  --shadow: 0 6px 20px rgba(0,0,0,.5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']):not([data-theme='dark']) {
    --bg: #171512; --surface: #221F1A; --text: #F2F0E8; --muted: #A8A398;
    --border: rgba(200,180,140,.22); --indigo: #F0C169; --link: #4ECDC4;
    --shadow: 0 6px 20px rgba(0,0,0,.5);
  }
}

html { background: var(--bg); }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--link); }

.gp-page { max-width: 760px; margin: 0 auto; padding: 16px 16px 64px; }

.gp-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 24px; }
.gp-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 18px; }
.gp-brand img { border-radius: 6px; }
.gp-nav-links { display: flex; gap: 16px; font-size: 14px; font-weight: 700; }
.gp-nav-links a { color: var(--muted); text-decoration: none; }
.gp-nav-links a:hover { color: var(--text); text-decoration: underline; }

.gp-crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.gp-crumbs a { color: var(--muted); }

h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(28px, 6vw, 40px); line-height: 1.1; letter-spacing: -.02em; }
h2 { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.gp-lead { color: var(--muted); font-size: 17px; margin-top: 10px; }

.gp-hero { text-align: center; margin-bottom: 28px; padding: 8px 0; }
.gp-hero .gp-btn { margin-top: 18px; }

.gp-game-head { display: flex; gap: 22px; align-items: center; margin-bottom: 24px; }
.gp-art {
  flex: none;
  width: 168px; height: 168px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.gp-game-text { min-width: 0; }

.gp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.gp-btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius);
  background: var(--indigo);
  color: #221F1B;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.gp-btn:hover { opacity: .92; }
.gp-btn:focus-visible, a:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }
.gp-btn-alt { background: var(--surface); color: var(--text); border: 2px solid var(--border); padding: 10px 20px; box-shadow: none; }

.gp-section {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.gp-section p { color: var(--muted); font-size: 15px; }
.gp-section p + p { margin-top: 10px; }

.gp-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.gp-facts dt { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.gp-facts dd { font-weight: 700; }

.gp-faq dt { font-weight: 700; margin-top: 12px; }
.gp-faq dt:first-child { margin-top: 0; }
.gp-faq dd { color: var(--muted); font-size: 15px; margin-top: 4px; }

.gp-steps { padding-left: 22px; color: var(--muted); font-size: 15px; }
.gp-steps li { margin-bottom: 8px; }
.gp-steps strong { color: var(--text); }

.gp-list { list-style: none; display: grid; gap: 4px; }
.gp-list a { display: block; padding: 8px 10px; margin: 0 -10px; border-radius: 8px; text-decoration: none; color: var(--text); }
.gp-list a:hover { background: color-mix(in srgb, var(--indigo) 14%, transparent); }
.gp-list strong { display: block; }
.gp-list span { display: block; color: var(--muted); font-size: 14px; }

/* /games index: art card grid, grouped by category. */
.gp-page--wide { max-width: 1120px; }
.gp-hero--compact { margin-bottom: 18px; }
.gp-hero--compact .gp-btn { margin-top: 14px; }

.gp-jump {
  position: sticky; top: 0; z-index: 2;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 0; margin-bottom: 8px;
  background: var(--bg);
}
.gp-jump::-webkit-scrollbar { display: none; }
.gp-jump a {
  flex: none;
  padding: 7px 14px;
  border: 2px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 700; text-decoration: none;
}
.gp-jump a:hover { border-color: var(--indigo); }

.gp-cat { margin: 18px 0 28px; scroll-margin-top: 64px; }
.gp-cat h2 { font-family: var(--font-display); font-size: 22px; margin-bottom: 12px; }

.gp-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.gp-grid li { display: flex; }
.gp-card {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 14px 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  color: var(--text); text-decoration: none; text-align: center;
  transition: transform .15s ease, border-color .15s ease;
}
.gp-card:hover { transform: translateY(-2px); border-color: var(--indigo); }
.gp-card-art { width: 96px; height: 96px; flex: none; margin-bottom: 4px; }
.gp-card-art--none { border: 2px dashed var(--border); border-radius: 12px; }
.gp-card strong { font-size: 18px; line-height: 1.2; }
.gp-card-sum {
  color: var(--muted); font-size: 14px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.gp-card-meta { margin-top: auto; padding-top: 4px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* A category with one game (Party Mode): one wide row, not a lone tile. */
.gp-cat--solo .gp-grid { grid-template-columns: minmax(0, 1fr); }
.gp-cat--solo .gp-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto;
  column-gap: 18px; row-gap: 4px; align-items: center; text-align: left;
}
.gp-cat--solo .gp-card-art { grid-row: 1 / 4; margin: 0; }
.gp-cat--solo .gp-card-sum { -webkit-line-clamp: unset; }
.gp-cat--solo .gp-card-meta { margin-top: 0; padding-top: 0; }

@media (prefers-reduced-motion: reduce) {
  .gp-card { transition: none; }
  .gp-card:hover { transform: none; }
}

.gp-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin-top: 32px; }
.gp-footer a { color: var(--muted); font-size: 13px; text-decoration: none; }
.gp-footer a:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 560px) {
  .gp-game-head { flex-direction: column; align-items: flex-start; }
  .gp-art { width: 132px; height: 132px; }
  .gp-btn { text-align: center; flex: 1 1 100%; }
  .gp-section { padding: 16px 16px; }
  .gp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gp-card { padding: 12px 10px; }
  .gp-card-art { width: 64px; height: 64px; }
  .gp-card strong { font-size: 16px; overflow-wrap: anywhere; }
  .gp-card-sum { font-size: 13px; }
  .gp-hero--compact .gp-btn { flex: none; }
}
