/*
 * Marketing stylesheet for the server-rendered public site.
 *
 * This is a standalone, self-contained extraction of the shared design
 * tokens and chrome from the Vue app (frontend/src/assets/base.css,
 * App.vue, HomeView.vue). It is deliberately duplicated for W1 so the
 * SSR site has no coupling to the SPA build. A drift-guard / dedup is a
 * later task.
 */

/* ------------------------------------------------------------------ */
/* Reset                                                              */
/* ------------------------------------------------------------------ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ------------------------------------------------------------------ */
/* Design tokens (shared subset of base.css :root)                    */
/* ------------------------------------------------------------------ */
:root {
  /* Logo colours */
  --color-logo-teal: #0c4651;
  --color-logo-teal-dark: #082e35;
  --color-logo-teal-light: #1a6b7a;
  --color-logo-gold: #d79f32;
  --color-logo-gold-dark: #b8852a;
  --color-logo-gold-light: #e8b85a;
  --color-logo-black: #000000;
  --color-logo-beige: #dbc396;
  --color-logo-beige-dark: #c4b085;
  --color-logo-beige-light: #f0e5d0;

  /* Role identity colours */
  --color-logo-green: #3a6b4a;
  --color-logo-green-dark: #2a5237;
  --color-logo-green-light: #4e8560;
  --color-logo-slate: #524868;
  --color-logo-slate-dark: #3d3550;
  --color-logo-slate-light: #6a5f80;

  /* Pen colours (mapped to logo colours) */
  --color-pen-blue: var(--color-logo-teal);
  --color-pen-black: var(--color-logo-black);
  --color-pen-red: var(--color-logo-gold);
  --color-pen-green: var(--color-logo-green);
  --color-pen-slate: var(--color-logo-slate);

  /* Primary */
  --color-primary: var(--color-logo-teal);
  --color-primary-dark: var(--color-logo-teal-dark);
  --color-primary-light: var(--color-logo-teal-light);

  /* Backgrounds / text */
  --color-bg: #f5f1e8;
  --color-bg-alt: #e8e0d3;
  --color-bg-light: #faf8f3;
  --color-border: #dbc396;
  --color-border-light: #e8e0d3;
  --color-text: var(--color-logo-black);
  --color-text-light: #ffffff;
  --color-text-muted: #4b5563;
  --color-accent: var(--color-logo-gold);
  --color-accent-dark: var(--color-logo-gold-dark);
  --color-button: var(--color-logo-teal);
  --color-button-dark: var(--color-logo-teal-dark);

  /* Typography */
  --font-family-heading: "Caveat", cursive;
  --font-family-base: "Inter", "Arial", sans-serif;
  --font-size-base: 16px;
  --font-size-xs: 0.8rem;
  --font-size-sm: 0.95rem;
  --font-size-md: 1.1rem;
  --font-size-lg: 1.5rem;
  --font-size-xl: 1.9rem;
  --font-weight-bold: 700;
  --font-weight-semibold: 600;
  --font-weight-normal: 400;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 3rem;

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* ------------------------------------------------------------------ */
/* Fonts                                                              */
/* ------------------------------------------------------------------ */
@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/caveat-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/caveat-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/caveat-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/caveat-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/inter-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/inter-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/inter-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/inter-latin-700-normal.woff2") format("woff2");
}

/* ------------------------------------------------------------------ */
/* Base elements                                                      */
/* ------------------------------------------------------------------ */
html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  background: var(--color-bg);
  color: var(--color-text);
  background-image: repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.01) 2px,
      rgba(0, 0, 0, 0.01) 4px);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1 {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  display: inline-block;
  text-shadow:
    0.5px 0.5px 0px rgba(0, 0, 0, 0.1),
    1px 1px 0px rgba(0, 0, 0, 0.05);
  transform: rotate(-0.3deg);
}

h1::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right,
      var(--color-pen-blue) 0%,
      transparent 100%);
  opacity: 0.3;
  transform: rotate(-0.2deg);
}

h2 {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  position: relative;
  display: inline-block;
  text-shadow: 0.3px 0.3px 0px rgba(0, 0, 0, 0.1);
  transform: rotate(0.2deg);
}

h2::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right,
      var(--color-pen-blue) 0%,
      transparent 100%);
  opacity: 0.3;
  transform: rotate(-0.2deg);
}

h3 {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-md);
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--color-pen-black);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

p {
  margin-bottom: var(--space-sm);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover,
a:focus {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

button,
.btn {
  font-family: inherit;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  color: var(--color-button);
  border: 2px solid var(--color-button);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
}

button:hover,
.btn:hover,
button:focus,
.btn:focus {
  background: var(--color-button);
  color: var(--color-text-light);
}

/* ------------------------------------------------------------------ */
/* Layout shell                                                       */
/* ------------------------------------------------------------------ */
.site-main {
  flex: 1 0 auto;
  width: 100%;
}

/* Entry-card shared surface (from base.css) */
.entry-card {
  max-width: 900px;
  margin: var(--space-lg) auto;
  padding: var(--space-xl);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

/* ------------------------------------------------------------------ */
/* Header / navbar (mirrors App.vue navbar chrome)                    */
/* ------------------------------------------------------------------ */
.navbar-container {
  position: relative;
  overflow: visible;
  margin-top: var(--space-md);
  min-height: 140px;
  display: flex;
  align-items: center;
}

.navbar {
  display: flex;
  align-items: center;
  background: transparent;
  color: var(--color-text-light);
  padding: 0 var(--space-lg);
  position: relative;
  width: 100%;
  min-height: 67.5px;
  gap: var(--space-md);
}

.navbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 67.5px;
  background: var(--color-logo-teal);
  transform: translateY(-50%);
  z-index: 0;
}

.navbar>* {
  position: relative;
  z-index: 1;
}

/* Logo + Play Now (+ mobile hamburger). On desktop the drawer toggle is hidden
   and the sibling .nav-drawer-panel carries the rest of the links. */
.nav-bar-primary {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
}

.nav-bar-primary .logo {
  position: relative;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none !important;
  padding: 0;
  margin: 0;
}

.logo-image {
  height: 140px;
  width: auto;
  display: block;
  flex-shrink: 0;
  margin: -10px 0;
  padding: 0;
  border-radius: var(--radius-md);
}

.navbar-link {
  color: var(--color-text-light);
  text-decoration: none;
  font-weight: 500;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
  white-space: nowrap;
  font-size: 1rem;
  display: inline-block;
}

/* Logout is a button (it runs a small script) but must look like a nav link. */
.navbar-logout {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  line-height: inherit;
}

.navbar .navbar-link,
.navbar .navbar-link:focus,
.navbar .navbar-link:hover {
  text-decoration: none !important;
  color: var(--color-text-light);
}

.navbar-link:hover,
.navbar-link:focus {
  background-color: var(--color-primary-dark);
  color: var(--color-text-light);
}

/* "Play Now" nav link — gold pill */
.navbar-link--play {
  background: var(--color-logo-gold) !important;
  color: var(--color-logo-teal-dark) !important;
  font-weight: var(--font-weight-bold) !important;
  font-family: var(--font-family-heading);
  font-size: 1.25rem;
  letter-spacing: 0.03em;
  padding: 5px var(--space-md) !important;
  border-radius: 20px !important;
  transform: rotate(-0.3deg);
  transition: background-color 0.2s ease !important;
}

.navbar .navbar-link--play,
.navbar .navbar-link--play:hover,
.navbar .navbar-link--play:focus {
  color: var(--color-logo-teal-dark) !important;
}

.navbar-link--play:hover,
.navbar-link--play:focus {
  background: var(--color-logo-gold-dark) !important;
  text-decoration: none !important;
}

/* Desktop: Games / Studio / Management / FAQ + auth sit in this panel, always
   visible. On mobile the hamburger <details> toggles it via :has(). */
.nav-drawer-panel {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-width: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-left: auto;
}

.nav-actions .navbar-link {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  padding: 6px 12px;
}

/* Hamburger toggle — hidden on desktop; CSS bars mirror App.vue burger. */
.nav-drawer {
  display: none;
  margin-left: auto;
}

.nav-drawer-toggle {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  user-select: none;
}

.nav-drawer-toggle::-webkit-details-marker {
  display: none;
}

.nav-drawer-toggle:hover,
.nav-drawer-toggle:focus {
  background: rgba(0, 0, 0, 0.18);
}

.nav-drawer-bar {
  display: block;
  width: 26px;
  height: 3px;
  margin: 3px 0;
  background: var(--color-text-light);
  border-radius: 2px;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.nav-drawer[open]>.nav-drawer-toggle .nav-drawer-bar:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.nav-drawer[open]>.nav-drawer-toggle .nav-drawer-bar:nth-child(2) {
  opacity: 0;
}

.nav-drawer[open]>.nav-drawer-toggle .nav-drawer-bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* "Games" nav dropdown (no-JS <details>): type-page links reachable from every
   page. Desktop shows an absolutely-positioned paper panel under the summary;
   mobile expands the type list inline inside the drawer. */
.nav-games {
  position: relative;
}

.nav-games-summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nav-games-summary::-webkit-details-marker {
  display: none;
}

.nav-games-summary::after {
  content: "▾";
  font-size: 0.7em;
  transition: transform 0.15s ease;
}

.nav-games[open]>.nav-games-summary::after {
  transform: rotate(180deg);
}

.nav-games[open]>.nav-games-summary {
  background: rgba(0, 0, 0, 0.18);
}

.nav-games-menu {
  list-style: none;
  margin: var(--space-xs) 0 0;
  padding: var(--space-xs);
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  min-width: 200px;
  /* Light paper panel dropping from the dark teal bar — the site's own
     background, so it reads as a card and stands apart from the header. */
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

/* Caret pointing up to the "Games" summary. */
.nav-games-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  left: var(--space-md);
  width: 10px;
  height: 10px;
  background: var(--color-bg-light);
  border-left: 1px solid var(--color-border);
  border-top: 1px solid var(--color-border);
  transform: rotate(45deg);
}

.nav-games-menu li {
  margin: 0;
}

/* Set "All games" apart from the game-type list. */
.nav-games-menu li:first-child {
  margin-bottom: 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--color-border);
}

.nav-games-menu a {
  display: block;
  padding: 7px var(--space-sm);
  color: var(--color-logo-teal-dark);
  text-decoration: none;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  font-weight: var(--font-weight-semibold);
  transition:
    background-color 0.12s ease,
    color 0.12s ease;
}

.nav-games-menu a:hover,
.nav-games-menu a:focus {
  background: var(--color-logo-gold);
  color: var(--color-logo-teal-dark);
}

/* ------------------------------------------------------------------ */
/* Footer (mirrors App.vue footer chrome)                             */
/* ------------------------------------------------------------------ */
.site-footer {
  margin-top: var(--space-xl);
  padding: 0;
  background: transparent;
  position: relative;
  overflow: visible;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-shrink: 0;
  --side-bleed: max(0px, (100vw - 100%) / 2);
}

.site-footer::before {
  content: "";
  position: absolute;
  left: calc(0px - var(--side-bleed));
  right: calc(0px - var(--side-bleed));
  top: 0;
  bottom: 0;
  background: var(--color-logo-teal);
  z-index: 0;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  min-height: 78px;
  box-sizing: border-box;
  gap: var(--space-sm);
  position: relative;
  z-index: 1;
  padding: var(--space-md) var(--space-lg);
}

.footer-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  text-align: center;
  min-width: 0;
}

.site-footer p {
  margin: 0;
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
}

.footer-link,
.footer-link:hover,
.footer-link:focus,
.footer-link:visited {
  color: var(--color-text-light);
  text-decoration: underline;
}

.footer-link:hover {
  color: var(--color-logo-beige-light);
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs);
  font-size: 0.75rem;
  margin-top: 0;
}

.footer-legal-links .footer-link {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.footer-legal-sep {
  color: rgba(255, 255, 255, 0.45);
  font-size: inherit;
}

/* ------------------------------------------------------------------ */
/* Hand-drawn icons                                                   */
/* ------------------------------------------------------------------ */
.hand-drawn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.icon-svg {
  width: 1em;
  height: 1em;
  filter: drop-shadow(0.5px 0.5px 0px currentColor);
  transform: rotate(-0.5deg);
}

.icon-blue {
  color: var(--color-pen-blue);
}

.icon-black {
  color: var(--color-pen-black);
}

.icon-red {
  color: var(--color-pen-red);
}

.icon-green {
  color: var(--color-pen-green);
}

.icon-slate {
  color: var(--color-pen-slate);
}

/* ------------------------------------------------------------------ */
/* Home view (from HomeView.vue)                                      */
/* ------------------------------------------------------------------ */
.home-view p {
  margin-bottom: var(--space-md);
  font-size: var(--font-size-md);
  text-align: left;
}

.divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-md) 0;
}

/* Demo callout */
.demo-callout {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  background: #fde4bb;
  border: 2px solid var(--color-logo-gold-dark);
  border-radius: var(--radius-lg);
  margin: var(--space-lg) 0;
  overflow: hidden;
  box-shadow:
    0 2px 12px rgba(184, 133, 42, 0.18),
    0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Illustration + text sit side by side; the CTA is centered below the row. */
.demo-callout-row {
  display: flex;
  align-items: stretch;
}

.demo-callout-illustration {
  flex-shrink: 0;
  width: 170px;
  min-height: 140px;
  background-color: #fde4bb;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: var(--space-lg);
}

.demo-callout-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.demo-callout-content {
  flex: 1;
  min-width: 0;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.demo-callout-content h2 {
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--font-size-lg);
  color: var(--color-text);
  text-align: left;
}

.demo-callout-content p {
  margin: 0;
  font-size: var(--font-size-md);
  color: #4a5568;
  line-height: 1.5;
  text-align: left;
}

.demo-callout-link {
  align-self: center;
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  margin: 0 0 var(--space-lg);
  background: var(--color-logo-gold-dark);
  color: #fff;
  border: 2px solid var(--color-logo-gold-dark);
  border-radius: 9999px;
  text-decoration: none;
  font-weight: var(--font-weight-bold);
  font-family: var(--font-family-heading);
  font-size: var(--font-size-lg);
  letter-spacing: 0.05em;
  white-space: nowrap;
  transform: rotate(-0.4deg);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.demo-callout-link:hover {
  background: var(--color-logo-gold-dark);
  border-color: var(--color-logo-gold-dark);
  color: #fff;
  text-decoration: none;
  transform: rotate(-0.4deg);
}

/* Genres */
.genres-section {
  margin: var(--space-lg) 0;
}

.genres-section h2 {
  margin-bottom: var(--space-md);
  font-size: var(--font-size-lg);
  color: var(--color-text);
  text-align: left;
}

.genres-section p {
  margin-bottom: var(--space-md);
  font-size: var(--font-size-md);
  text-align: left;
}

.genres-subheading {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-family-heading);
  color: #7f5f18;
  margin: var(--space-md) 0 var(--space-xs);
}

.genres-list {
  margin-left: var(--space-lg);
  padding-left: var(--space-sm);
  line-height: 1.8;
}

.genres-list li {
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-md);
}

.genres-list--coming li {
  font-weight: var(--font-weight-normal);
}

/* Who section */
.who-section {
  margin: var(--space-lg) 0;
}

.who-section h2 {
  margin-bottom: var(--space-md);
  font-size: var(--font-size-lg);
  color: var(--color-text);
  text-align: left;
}

.user-types {
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
}

.user-type {
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--color-bg-alt);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.user-type:last-child {
  margin-bottom: 0;
}

.user-type--players {
  border-left-color: var(--color-logo-gold);
  background: linear-gradient(to right,
      rgba(215, 159, 50, 0.08) 0%,
      var(--color-bg-alt) 100%);
}

.user-type--designers {
  border-left-color: var(--color-logo-green);
  background: linear-gradient(to right,
      rgba(58, 107, 74, 0.08) 0%,
      var(--color-bg-alt) 100%);
}

.user-type--managers {
  border-left-color: var(--color-logo-slate);
  background: linear-gradient(to right,
      rgba(82, 72, 104, 0.08) 0%,
      var(--color-bg-alt) 100%);
}

.user-content {
  flex: 1;
}

.user-type h3 {
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--font-size-md);
  color: var(--color-text);
  font-weight: var(--font-weight-bold);
}

.user-type p {
  margin: 0;
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

.user-icon {
  width: 30px;
  height: 30px;
  color: var(--color-primary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-icon .hand-drawn-icon {
  font-size: 1.5em;
}

.user-icon .icon-svg {
  width: 30px;
  height: 30px;
}

/* Sections grid */
.sections {
  margin: var(--space-lg) 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-xl);
}

.section {
  padding: var(--space-lg);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 200px;
  position: relative;
}

.sections .section h2 {
  margin-bottom: var(--space-md);
  font-size: var(--font-size-lg);
  color: var(--color-text);
}

.section p {
  margin-bottom: var(--space-lg);
  font-size: var(--font-size-md);
  line-height: 1.5;
}

.section-link {
  display: inline-block;
  padding: var(--space-md) var(--space-lg);
  background: transparent;
  color: var(--color-button);
  border: 2px solid var(--color-button);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: var(--font-weight-bold);
  transition: all 0.2s;
  margin-top: auto;
}

.section-link:hover {
  background: var(--color-button);
  color: var(--color-text-light);
  text-decoration: none;
}

.section-icon {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  background: var(--color-bg);
  border: 3px solid var(--color-pen-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-icon .hand-drawn-icon {
  font-size: 1.8em;
}

.section-icon .icon-svg {
  width: 28px;
  height: 28px;
}

/* Play card — gold accent */
.section--play {
  border: 2px solid var(--color-logo-gold-dark);
  background: #fde4bb;
  box-shadow:
    0 2px 8px rgba(184, 133, 42, 0.2),
    0 1px 3px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.section-icon--play {
  border-color: var(--color-logo-gold-dark);
  background: var(--color-logo-gold);
}

.section-icon--play .icon-black {
  color: #fff;
}

.section-link--play {
  background: var(--color-logo-gold-dark);
  color: #fff;
  border-color: var(--color-logo-gold-dark);
  font-family: var(--font-family-heading);
  font-size: var(--font-size-lg);
  letter-spacing: 0.05em;
  border-radius: 9999px;
  transform: rotate(-0.4deg);
}

.section-link--play:hover {
  background: var(--color-logo-gold-dark);
  border-color: var(--color-logo-gold-dark);
  color: #fff;
  transform: rotate(-0.4deg);
}

/* Studio card — green accent */
.section--studio {
  border: 2px solid var(--color-logo-green);
  background: linear-gradient(160deg,
      var(--color-bg) 55%,
      rgba(58, 107, 74, 0.08) 100%);
  box-shadow:
    0 2px 8px rgba(42, 82, 55, 0.15),
    0 1px 3px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.section-icon--studio {
  border-color: var(--color-logo-green);
  background: var(--color-bg);
}

.section-link--studio {
  color: var(--color-logo-green-dark);
  border-color: var(--color-logo-green);
}

.section-link--studio:hover {
  background: var(--color-logo-green);
  border-color: var(--color-logo-green);
  color: #fff;
}

/* Management card — slate accent */
.section--management {
  border: 2px solid var(--color-logo-slate);
  background: linear-gradient(160deg,
      var(--color-bg) 55%,
      rgba(82, 72, 104, 0.08) 100%);
  box-shadow:
    0 2px 8px rgba(61, 53, 80, 0.15),
    0 1px 3px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.section-icon--management {
  border-color: var(--color-logo-slate);
  background: var(--color-bg);
}

.section-link--management {
  color: var(--color-logo-slate-dark);
  border-color: var(--color-logo-slate);
}

.section-link--management:hover {
  background: var(--color-logo-slate);
  border-color: var(--color-logo-slate);
  color: #fff;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                         */
/* ------------------------------------------------------------------ */
@media (max-width: 900px) {
  .sections {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

@media (max-width: 768px) {

  /* Compact mobile chrome: Logo | Play Now | hamburger. Secondary links live in
     the drawer panel toggled by .nav-drawer (no-JS <details> + :has). */
  .navbar-container {
    min-height: 0;
    margin-top: var(--space-sm);
  }

  .navbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    /* Inset matches the gap after the logo so left/right breathing room is equal. */
    --nav-mobile-inset: 1.25rem;
    padding: var(--space-sm) var(--nav-mobile-inset);
    min-height: 0;
    /* Keep the closed chrome to the primary row; the open drawer overlays. */
    overflow: visible;
  }

  .navbar::before {
    top: 0;
    bottom: 0;
    height: auto;
    transform: none;
    border-radius: var(--radius-md);
  }

  .nav-bar-primary {
    width: 100%;
    gap: var(--nav-mobile-inset);
  }

  .logo-image {
    height: 72px;
    margin: 0;
  }

  .nav-drawer {
    display: block;
  }

  /* Overlay drawer: absolute under the primary row so opening it does not
     push page content down. */
  .nav-drawer-panel {
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 40;
    width: auto;
    margin: 0;
    padding: var(--space-sm) var(--nav-mobile-inset) var(--space-md);
    background: var(--color-logo-teal);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    box-sizing: border-box;
  }

  .navbar:has(.nav-drawer[open]) .nav-drawer-panel {
    display: flex;
  }

  /* Teal band stays on the primary row only; the overlay panel paints itself. */
  .navbar:has(.nav-drawer[open])::before {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }

  .nav-links,
  .nav-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    margin-left: 0;
  }

  .nav-links .navbar-link,
  .nav-actions .navbar-link,
  .nav-games-summary {
    display: block;
    width: 100%;
    padding: var(--space-sm) var(--space-sm);
    text-align: left;
    box-sizing: border-box;
  }

  .nav-actions .navbar-link {
    font-size: 1rem;
    font-weight: 500;
  }

  /* Games types expand inline in the drawer — no floating paper card. */
  .nav-games {
    position: static;
    width: 100%;
  }

  /* Full-width row with a larger, spaced caret for touch. */
  .nav-games-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    min-height: 44px;
    padding: var(--space-sm) var(--space-sm);
  }

  .nav-games-summary::after {
    content: "▾";
    font-size: 1.15rem;
    line-height: 1;
    flex-shrink: 0;
    padding: var(--space-xs);
    margin-right: calc(-1 * var(--space-xs));
  }

  .nav-games-menu {
    position: static;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 0 0 var(--space-xs) var(--space-md);
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box;
  }

  .nav-games-menu::before {
    display: none;
  }

  .nav-games-menu li:first-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
  }

  .nav-games-menu a {
    color: var(--color-text-light);
    font-weight: 500;
    padding: var(--space-xs) var(--space-sm);
  }

  .nav-games-menu a:hover,
  .nav-games-menu a:focus {
    background: rgba(0, 0, 0, 0.18);
    color: var(--color-text-light);
  }

  h1 {
    font-size: 1.4rem;
  }
}

@media (max-width: 700px) {
  .demo-callout {
    flex-direction: column;
    align-items: stretch;
  }

  .demo-callout-row {
    flex-direction: column;
  }

  .demo-callout-illustration {
    width: 100%;
    height: 180px;
    min-height: unset;
    margin-left: 0;
    overflow: hidden;
  }

  .demo-callout-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .demo-callout-content {
    padding: var(--space-md) var(--space-md) 0;
  }

  .demo-callout-link {
    margin: var(--space-md);
    align-self: stretch;
    text-align: center;
    transform: none;
  }
}

/* ── FAQ page ──────────────────────────────────────────────────────────── */
.faq-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Each Q&A is one block: the question hugs its answer, and blocks are evenly
   separated by a subtle divider so the vertical rhythm reads as intentional. */
.faq-list>li {
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

.faq-list>li:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.faq-list strong {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-md);
  color: var(--color-text);
}

.faq-list p {
  margin: 0;
  font-size: var(--font-size-md);
  color: var(--color-text-muted);
  text-align: left;
}

/* ── Footer language switcher ──────────────────────────────────────────── */
.footer-lang {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-md);
  justify-content: center;
  padding: 0 var(--space-lg) var(--space-md);
}

.footer-lang-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.footer-lang-link:hover,
.footer-lang-link:focus {
  color: var(--color-text-light);
  text-decoration: underline;
}

.footer-lang-link--active {
  color: var(--color-logo-beige-light);
  text-decoration: underline;
}

/* Games catalog (server-rendered). A responsive card grid (auto-fill, so no
   media query needed) that sits in the same paper/gold site family. */
.games-empty {
  padding: var(--space-lg) 0;
  color: var(--color-text-muted);
}

/* Server-side filter bar: each option is a link that re-renders the page with
   the updated query (players/demo). Shared by /games and /games/<type>. */
.catalog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.catalog-filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.catalog-filter-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.catalog-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.catalog-filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.catalog-filter-btn:hover,
.catalog-filter-btn:focus {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.catalog-filter-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-light);
}

.games-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.game-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-light);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Card banner: the game's artwork (via the catalog banner endpoint, with a
   game-type default fallback) under a dark gradient, with a diagonal
   player-mode sash and the game name overlaid. */
.game-card-banner {
  position: relative;
  height: 168px;
  display: flex;
  align-items: flex-end;
  padding: var(--space-md);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.game-card-sash {
  position: absolute;
  top: 40px;
  right: -52px;
  width: 220px;
  text-align: center;
  transform: rotate(45deg);
  padding: 4px 0;
  font-family: var(--font-family-heading);
  font-size: var(--font-size-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.game-card-sash.sash-single {
  background: var(--color-accent);
  color: var(--color-text);
}

.game-card-sash.sash-multi {
  background: var(--color-primary);
  color: var(--color-text-light);
}

.game-card-sash.sash-open {
  background: var(--color-logo-teal);
  color: var(--color-text-light);
}

.game-card-demo {
  align-self: flex-start;
  font-size: var(--font-size-xs);
  background: var(--color-accent);
  color: var(--color-text);
  padding: 2px 10px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.game-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
}

.game-card-name {
  margin: 0;
  font-size: var(--font-size-lg);
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  line-height: 1.2;
}

.game-card-desc {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-md);
}

.game-card-host {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.game-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--font-size-sm);
}

.game-card-meta>li {
  padding: 2px 8px;
  border: 1px solid var(--color-border);
  border-radius: 9999px;
}

.game-card-delivery {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.game-card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: auto;
  padding-top: var(--space-sm);
}

.game-card-join {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  background: var(--color-logo-gold-dark);
  border-radius: 9999px;
  /* Dark text on the gold pill: white at this size fails 4.5:1 (3.26). */
  color: var(--color-text);
  font-family: var(--font-family-heading);
  text-decoration: none;
}

.game-card-rules {
  font-size: var(--font-size-sm);
}

.game-card-type a {
  color: inherit;
  text-decoration: none;
}

.game-card-type a:hover,
.game-card-type a:focus {
  text-decoration: underline;
}

/* Game-type landing pages (/games/:type). Dedicated pages composed of stacked
   sections (intro → open games → future type-specific blocks). Each type sets
   a --type-accent so the page can carry its own theme; new features added
   later inherit it without extra wiring. */
.game-type-page {
  --type-accent: var(--color-primary);
}

.game-type--adventure {
  --type-accent: #b45309;
}

.game-type--mecha {
  --type-accent: #0d9488;
}

.game-type--arena {
  --type-accent: #b91c1c;
}

.game-type--connect6 {
  --type-accent: #4338ca;
}

.game-type--mahjong {
  --type-accent: #15803d;
}

.game-type-intro-lead {
  font-size: var(--font-size-md);
  color: var(--color-text);
  margin: 0 0 var(--space-lg);
  max-width: 60ch;
}

.game-type-features {
  list-style: none;
  margin: 0 0 var(--space-lg);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.game-type-feature {
  padding: var(--space-sm) var(--space-md);
  border-left: 3px solid var(--type-accent);
  background: var(--color-bg-alt);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.game-type-feature-title {
  margin: 0 0 var(--space-xs);
  font-size: var(--font-size-md);
  color: var(--type-accent);
}

.game-type-feature-body {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.game-type-how-turn {
  font-style: italic;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-lg);
  max-width: 60ch;
}

.game-type-cta {
  margin-bottom: var(--space-sm);
}

.game-type-rules-link {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  border: 2px solid var(--type-accent);
  border-radius: var(--radius-sm);
  color: var(--type-accent);
  font-weight: var(--font-weight-bold);
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.game-type-rules-link:hover,
.game-type-rules-link:focus {
  background: var(--type-accent);
  color: var(--color-text-light);
}

.game-type-section-heading {
  font-size: var(--font-size-lg);
  margin: 0 0 var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--type-accent);
  display: inline-block;
}

/* Footer parity: coming-soon banner (left) + build info (right), so the SSR
   footer matches the SPA footer instead of feeling like a downgrade. */
.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.footer-right {
  justify-content: flex-end;
}

.coming-soon-banner {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  pointer-events: none;
}

.envelope-icon {
  display: block;
  height: 140px;
  width: auto;
  flex-shrink: 0;
  border-radius: var(--radius-md);
}

.coming-soon-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.coming-soon-title {
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-normal);
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  opacity: 0.8;
}

.coming-soon-date {
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0.95;
}

.build-info-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 0.75rem;
  color: var(--color-text-light);
  text-align: right;
  opacity: 0.9;
}

.build-commit {
  color: var(--color-logo-beige-light);
  font-weight: 500;
}

.build-date {
  white-space: nowrap;
}

.release-notes-link {
  color: var(--color-text-light);
  text-decoration: underline;
  opacity: 0.9;
}

.release-notes-link:hover {
  color: var(--color-logo-beige-light);
  opacity: 1;
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .footer-left,
  .footer-right {
    justify-content: center;
  }

  .coming-soon-banner {
    flex-direction: column;
    gap: var(--space-xs);
    text-align: center;
  }

  .envelope-icon {
    height: 100px;
  }

  .build-info-panel {
    align-items: center;
    text-align: center;
  }
}

/* Legal documents (server-rendered). The body is pre-rendered prose; style
   the surrounding chrome (locale-fallback notice, version/effective meta). */
.legal-body {
  line-height: 1.7;
}

.legal-locale-fallback {
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-left: 3px solid var(--color-logo-gold-dark);
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.legal-unavailable {
  padding: var(--space-xl) 0;
  text-align: center;
  color: var(--color-text-muted);
}

/* Shared page header — icon + title + optional subtitle, rendered at the top
   of every server-rendered page via the "page-header" template partial. One
   heading layout for all pages: left-aligned, icon vertically centred. */
.page-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  text-align: left;
}

/* Circular icon badge, matching the front-page .section-icon treatment: a
   colour-ringed disc (colour driven by the icon-* class via currentColor) with
   the hand-drawn glyph centred inside. */
.page-header-icon {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border: 3px solid currentColor;
  border-radius: 50%;
  background: var(--color-bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-header-icon .hand-drawn-icon {
  font-size: 1.8em;
}

.page-header-icon .icon-svg {
  width: 28px;
  height: 28px;
}

/* min-width:0 lets a long title/subtitle wrap instead of overflowing. */
.page-header-text {
  min-width: 0;
}

.page-header-title {
  margin: 0;
}

/* Give the gradient underline clear breathing room: a gap above it (between
   the title text and the dash) and below it (before the subtitle), consistent
   on every page that uses the shared header. */
.page-header-title::after {
  bottom: -8px;
}

.page-header-subtitle {
  margin: 16px 0 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-md);
}

/* Studio / Game Masters landing pages (server-rendered) */
.landing-features {
  margin: var(--space-md) 0;
  padding-left: var(--space-lg);
}

.landing-features li {
  margin-bottom: var(--space-sm);
}

.landing-cta {
  margin-top: var(--space-lg);
}

.landing-cta-note {
  margin-top: var(--space-sm);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

/* Rules pages: the markdown body needs restrained document typography, not the
   site display headings. Everything is scoped under .rules-body so the
   base Caveat h1-h3 (still used for the page-header title) is overridden only
   inside the rules content. */
.rules-locale-fallback {
  margin: 0 0 var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.rules-unavailable {
  padding: var(--space-xl) 0;
  text-align: center;
  color: var(--color-text-muted);
}

.rules-body {
  line-height: 1.7;
}

.rules-body h1,
.rules-body h2,
.rules-body h3,
.rules-body h4,
.rules-body h5,
.rules-body h6 {
  font-family: var(--font-family-base);
  text-transform: none;
  letter-spacing: normal;
  text-shadow: none;
  transform: none;
  display: block;
  color: var(--color-text);
}

.rules-body h1::after,
.rules-body h2::after,
.rules-body h3::after {
  display: none;
}

.rules-body h1 {
  font-size: 1.8rem;
  margin: 0 0 var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-border);
}

.rules-body h2 {
  font-size: 1.4rem;
  margin: var(--space-xl) 0 var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--color-border);
}

.rules-body h3 {
  font-size: 1.15rem;
  margin: var(--space-lg) 0 var(--space-xs);
}

.rules-body h4 {
  font-size: 1rem;
  margin: var(--space-md) 0 var(--space-xs);
  color: var(--color-text-muted);
}

.rules-body p {
  margin: var(--space-sm) 0;
}

.rules-body ul,
.rules-body ol {
  padding-left: var(--space-lg);
  margin: var(--space-xs) 0 var(--space-md);
}

.rules-body li {
  margin: 2px 0;
}

.rules-body hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-lg) 0;
}

.rules-body code {
  background: var(--color-bg-alt);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-family: "Menlo", "Monaco", "Ubuntu Mono", monospace;
  font-size: 0.9em;
}

.rules-body pre {
  background: var(--color-bg-alt);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: var(--space-md) 0;
  font-size: 0.875em;
  line-height: 1.5;
}

.rules-body pre code {
  background: none;
  padding: 0;
}

/* Wide rules tables scroll within themselves so the page never scrolls
   sideways (display:block makes overflow-x apply to the table). */
.rules-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: var(--space-md) 0;
  font-size: 0.9em;
}

.rules-body th,
.rules-body td {
  border: 1px solid var(--color-border);
  padding: var(--space-xs) var(--space-sm);
  text-align: left;
}

.rules-body thead th {
  background: var(--color-bg-alt);
  font-weight: var(--font-weight-semibold);
}

.rules-body tbody tr:nth-child(even) {
  background: var(--color-bg-alt);
}

/* Server-rendered auth pages (/login, /verify) */
.auth-view {
  max-width: 460px;
}

.auth-intro {
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

.auth-error {
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
  background: #fdecea;
  border: 1px solid #f5c2c0;
  border-radius: var(--radius-sm);
  color: #8a1f1a;
  font-size: var(--font-size-sm);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.auth-form label {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
}

.auth-form input {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--font-size-base);
  background: var(--color-bg-light);
}

.auth-form input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.auth-submit {
  margin-top: var(--space-sm);
  align-self: center;
  padding: var(--space-sm) var(--space-lg);
  background: transparent;
  color: var(--color-button);
  border: 2px solid var(--color-button);
  border-radius: var(--radius-sm);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.auth-submit:hover {
  background: var(--color-button);
  color: var(--color-text-light);
}

.auth-or {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.auth-google {
  display: block;
  width: fit-content;
  margin: 0 auto;
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-light);
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.auth-google:hover {
  background: var(--color-bg-alt);
  text-decoration: none;
}

.auth-resend {
  margin-top: var(--space-md);
}

.auth-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-primary);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}