:root {
  /* Nylon Cards theme — matches nyloncards.com (Art of Play light storefront) */
  --accent: #2563eb;
  --accent-light: rgba(37, 99, 235, 0.1);
  --accent-dark: #1d4ed8;
  --bg: #f2f2f2;
  --card: #ffffff;
  --card-elevated: #ffffff;
  --text: #000000;
  --muted: rgba(0, 0, 0, 0.6);
  --border: rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --shadow: none;
  --header-pad: 76px;
  --footer-pad: 88px;
  --logo-top: 0;
  --logo-height: 48px;
  --logo-band: 76px;
  --font: "Roboto", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Crimson Text", Georgia, "Times New Roman", serif;
}

/* Per-category colours (icons + card/detail accents) */
.app-shell[data-icon="kids"],
.game-card[data-icon="kids"] {
  --theme: #e85d04;
  --theme-light: rgba(232, 93, 4, 0.2);
  --theme-dark: #fdba74;
  --theme-shadow: rgba(232, 93, 4, 0.22);
}
.app-shell[data-icon="speed"],
.game-card[data-icon="speed"] {
  --theme: #2563eb;
  --theme-light: rgba(37, 99, 235, 0.2);
  --theme-dark: #93b4fd;
  --theme-shadow: rgba(37, 99, 235, 0.22);
}
.app-shell[data-icon="party"],
.game-card[data-icon="party"] {
  --theme: #a855f7;
  --theme-light: rgba(168, 85, 247, 0.2);
  --theme-dark: #d8b4fe;
  --theme-shadow: rgba(168, 85, 247, 0.22);
}
.app-shell[data-icon="fishing"],
.game-card[data-icon="fishing"] {
  --theme: #0d9488;
  --theme-light: rgba(13, 148, 136, 0.2);
  --theme-dark: #5eead4;
  --theme-shadow: rgba(13, 148, 136, 0.22);
}
.app-shell[data-icon="memory"],
.game-card[data-icon="memory"] {
  --theme: #4f46e5;
  --theme-light: rgba(79, 70, 229, 0.2);
  --theme-dark: #a5b4fc;
  --theme-shadow: rgba(79, 70, 229, 0.22);
}
.app-shell[data-icon="matching"],
.game-card[data-icon="matching"] {
  --theme: #e11d48;
  --theme-light: rgba(225, 29, 72, 0.2);
  --theme-dark: #fda4af;
  --theme-shadow: rgba(225, 29, 72, 0.22);
}
.app-shell[data-icon="shedding"],
.game-card[data-icon="shedding"] {
  --theme: #d97706;
  --theme-light: rgba(217, 119, 6, 0.2);
  --theme-dark: #fcd34d;
  --theme-shadow: rgba(217, 119, 6, 0.22);
}
.app-shell[data-icon="trick"],
.game-card[data-icon="trick"] {
  --theme: #7c3aed;
  --theme-light: rgba(124, 58, 237, 0.2);
  --theme-dark: #c4b5fd;
  --theme-shadow: rgba(124, 58, 237, 0.22);
}
.app-shell[data-icon="solitaire"],
.game-card[data-icon="solitaire"] {
  --theme: #16a34a;
  --theme-light: rgba(22, 163, 74, 0.2);
  --theme-dark: #86efac;
  --theme-shadow: rgba(22, 163, 74, 0.22);
}
.app-shell[data-icon="indian"],
.game-card[data-icon="indian"] {
  --theme: #ca8a04;
  --theme-light: rgba(202, 138, 4, 0.2);
  --theme-dark: #fde047;
  --theme-shadow: rgba(202, 138, 4, 0.22);
}
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  color-scheme: light;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  padding-top: var(--header-pad);
  padding-bottom: var(--footer-pad);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.skip-link {
  position: absolute; left: -9999px; top: 0;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
  z-index: 10001;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
}
.brand-pg,
.brand-logo {
  width: auto;
  height: var(--logo-height);
  max-width: 120px;
  object-fit: contain;
  object-position: left center;
}
a.brand-link {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  height: var(--logo-band);
  padding: 0 1rem;
  background: hsla(0, 0%, 95%, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  line-height: 0;
}
a.brand-link .brand-logo {
  position: static;
}
.app-shell {
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 1rem 24px;
}
.hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 0 20px;
}
.hero-copy { flex: 1; min-width: 0; }
.hero h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}
.hero p { margin: 0; color: var(--muted); font-size: 1rem; }
.hero-photo {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-photo-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.filter-banner {
  margin-bottom: 12px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.filter-banner-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: cover;
}
.moment-card {
  grid-column: 1 / -1;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--card);
}
.moment-card-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
}
.moment-card figcaption {
  margin: 0;
  padding: 12px 14px;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text);
  text-align: center;
  background: var(--card);
  border-top: 1px solid var(--border);
}
.loading-state,
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px 16px 40px;
  color: var(--muted);
}
.loading-photo,
.empty-photo {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto 16px;
  border-radius: var(--radius);
  object-fit: cover;
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow);
}
.empty-state p,
.loading-state p { margin: 0; }
.filters {
  position: sticky;
  top: var(--logo-band);
  z-index: 100;
  background: linear-gradient(var(--bg) 85%, transparent);
  padding: 6px 0 10px;
  margin-bottom: 6px;
}
@media (max-width: 959px) {
  .filters {
    top: var(--logo-band);
    z-index: 900;
    background: var(--bg);
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-bottom: 8px;
    padding: 8px 16px 10px 16px;
    box-shadow: 0 1px 0 var(--border);
    border-bottom: 1px solid var(--border);
  }
}
.filter-group { margin-bottom: 6px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-group label {
  display: block;
  font-size: .6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 4px;
}
.chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
  gap: 5px;
}
.filters .chip {
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 999px;
  background: transparent;
  font-size: 0.75rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
@media (max-width: 639px) {
  .filters .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .filters .chip {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 3px 8px;
    font-size: .6875rem;
  }
}
.chip {
  min-height: 44px;
  padding: 0.625rem 1.25rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover {
  border-color: rgba(0, 0, 0, 0.3);
  background: var(--card);
}
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
.game-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  text-decoration: none;
  color: inherit;
  min-height: 140px;
  transition: border-color 0.15s, background-color 0.15s;
}
.game-card:hover, .game-card:focus {
  border-color: rgba(0, 0, 0, 0.2);
  background: #ffffff;
  outline: none;
}
.game-card[data-icon] h2 {
  color: var(--theme);
}
.game-card .icon-wrap {
  width: 48px; height: 48px; margin-bottom: 10px;
}
.game-card .icon-wrap img { width: 48px; height: 48px; }
.game-card h2 {
  margin: 0 0 4px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
}
.game-card p {
  margin: 0;
  font-size: .8125rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.detail-header { margin-bottom: 20px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 16px;
  min-height: 44px;
}
.back-link:hover { text-decoration: underline; }
.detail-hero { text-align: center; margin-bottom: 24px; }
.detail-hero .icon-wrap img { width: 64px; height: 64px; }
.detail-hero h1 {
  margin: 12px 0 8px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.meta-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.pill {
  font-size: 0.75rem;
  padding: 4px 10px;
  background: var(--theme-light, var(--accent-light));
  color: var(--theme, var(--accent));
  border-radius: 999px;
}
.app-shell[data-icon] > .detail-header .back-link {
  color: var(--theme);
}
.app-shell[data-icon] > .section h2 {
  color: var(--theme);
}
.section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.section h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
}
.section p, .section ol { margin: 0; font-size: .9375rem; }
.section ol { padding-left: 1.25rem; }
.section li { margin-bottom: 6px; }
.faq details {
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.faq details:last-child { border-bottom: none; }
.faq summary {
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 8px 0 0; color: var(--muted); font-size: .875rem; }
.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}
.video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}
.subscribe {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 32px;
  padding: 0;
  background: transparent;
  border-radius: var(--radius);
  box-shadow: none;
  overflow: hidden;
}
.subscribe-visual {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.subscribe-photo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}
.subscribe-content {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.subscribe h2 { margin: 0 0 12px; font-size: 1.125rem; }
.channel-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.channel-toggle button {
  flex: 1;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  font-size: .875rem;
}
.channel-toggle button.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-dark);
  font-weight: 600;
}
.subscribe input {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 12px;
}
.btn-primary {
  width: 100%;
  min-height: 48px;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.025em;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
a.btn-primary,
a.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}
.btn-secondary {
  width: 100%;
  min-height: 48px;
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.025em;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-secondary:hover {
  border-color: rgba(0, 0, 0, 0.35);
  background: var(--card);
}
.shop-cta {
  margin: 0 0 20px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}
.shop-cta-lead {
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-weight: 400;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  color: var(--text);
}
.shop-cta-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (min-width: 480px) {
  .shop-cta-actions {
    flex-direction: row;
  }
  .shop-cta-actions .btn-primary,
  .shop-cta-actions .btn-secondary {
    flex: 1;
    width: auto;
  }
}
.form-msg {
  margin-top: 12px;
  font-size: .875rem;
  min-height: 1.25em;
}
.form-msg.success { color: #237d64; }
.form-msg.error { color: #cc3333; }
.wa-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-size: .875rem;
}
.loading-state {
  text-align: center;
  padding: 48px 16px;
}
.error-banner {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}
.error-banner { color: var(--accent); }
/* ——— Tablet ——— */
@media (min-width: 640px) {
  .app-shell { padding: 0 1.5rem 32px; }
  a.brand-link { padding: 0 1.5rem; }
  .grid { gap: 16px; }
  .game-card { min-height: 150px; }
}

/* ——— Desktop: use full width ——— */
@media (min-width: 960px) {
  :root {
    --header-pad: 84px;
    --footer-pad: 96px;
    --logo-band: 84px;
  }

  .app-shell {
    max-width: 78rem;
    padding: 0 2rem 48px;
  }

  a.brand-link {
    padding: 0 2rem;
  }

  .hero {
    display: grid;
    grid-template-columns: 1fr minmax(260px, 400px);
    gap: 28px;
    align-items: center;
    padding: 16px 0 8px;
  }
  .hero h1 { font-size: 2.25rem; }
  .hero p { font-size: 1.125rem; max-width: 52rem; }
  .hero-photo-img { max-height: 280px; }
  .filter-banner-img { max-height: 260px; }
  .moment-card-img { max-height: 280px; }

  /* Browse: sidebar filters + wide game grid */
  .app-shell:has(> .grid#game-grid) {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
    column-gap: 28px;
    row-gap: 20px;
    align-items: start;
  }

  .app-shell:has(> .grid#game-grid) > .hero {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .app-shell:has(> .grid#game-grid) > .filters {
    grid-column: 1;
    grid-row: 2 / 4;
    position: sticky;
    top: calc(var(--logo-band) + 12px);
    align-self: start;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 10px;
    margin-bottom: 0;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
  }

  .app-shell:has(> .grid#game-grid) > .filters::before {
    content: "Find a game";
    display: block;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 8px;
  }

  .app-shell:has(> .grid#game-grid) > .filter-banner {
    grid-column: 2;
    grid-row: 2;
    margin-bottom: 0;
  }

  .app-shell:has(> .grid#game-grid) > .grid {
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .app-shell:has(> .grid#game-grid):has(> .filter-banner) > .grid {
    grid-row: 3;
  }

  .app-shell:has(> .grid#game-grid) > .subscribe {
    grid-column: 1 / -1;
    grid-row: 4;
    margin-top: 8px;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
  }

  .app-shell:has(> .grid#game-grid) > .subscribe .subscribe-visual {
    flex: 0 0 38%;
    max-width: 440px;
    border-radius: var(--radius) 0 0 var(--radius);
  }

  .app-shell:has(> .grid#game-grid) > .subscribe .subscribe-photo {
    max-height: none;
    height: 100%;
    min-height: 220px;
    aspect-ratio: auto;
  }

  .app-shell:has(> .grid#game-grid) > .subscribe .subscribe-content {
    flex: 1;
    padding: 28px 36px;
    border-radius: 0 var(--radius) var(--radius) 0;
  }

  .app-shell:has(> .grid#game-grid) > .subscribe h2 {
    font-size: 1.35rem;
    margin: 0 0 12px;
    max-width: none;
  }

  .app-shell:has(> .grid#game-grid) > .subscribe form {
    max-width: 440px;
    margin: 0;
  }

  .app-shell:has(> .grid#game-grid) .filter-group {
    margin-bottom: 8px;
  }
  .app-shell:has(> .grid#game-grid) .filter-group label {
    font-size: .6875rem;
    margin-bottom: 3px;
  }
  .app-shell:has(> .grid#game-grid) .chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }
  .app-shell:has(> .grid#game-grid) .filters .chip {
    min-height: 30px;
    padding: 4px 8px;
    font-size: 0.6875rem;
    border-radius: 999px;
    text-align: center;
  }

  /* Game cards: larger vertical tiles on desktop */
  .app-shell:has(> .grid#game-grid) .game-card {
    flex-direction: column;
    align-items: stretch;
    min-height: 200px;
    padding: 22px 20px;
    gap: 0;
  }
  .app-shell:has(> .grid#game-grid) .game-card .icon-wrap {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
  }
  .app-shell:has(> .grid#game-grid) .game-card .icon-wrap img {
    width: 64px;
    height: 64px;
  }
  .app-shell:has(> .grid#game-grid) .game-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .app-shell:has(> .grid#game-grid) .game-card p {
    font-size: 0.9375rem;
    line-height: 1.45;
    color: var(--muted);
    -webkit-line-clamp: 3;
  }

  /* Detail: two columns — rules left, video + subscribe right */
  .app-shell:has(> .detail-hero) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
    column-gap: 36px;
    row-gap: 16px;
    align-items: start;
  }

  .app-shell:has(> .detail-hero) > .detail-header,
  .app-shell:has(> .detail-hero) > .detail-hero {
    grid-column: 1 / -1;
  }

  .app-shell:has(> .detail-hero) > .section:has(.video-wrap),
  .app-shell:has(> .detail-hero) > .section.section-media {
    grid-column: 2;
    grid-row: 3 / span 6;
    position: sticky;
    top: calc(var(--logo-band) + 12px);
    align-self: start;
  }

  .app-shell:has(> .detail-hero) > .detail-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 8px 20px;
    text-align: left;
    align-items: center;
    padding: 20px 24px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 8px;
  }

  .app-shell:has(> .detail-hero) > .detail-hero .icon-wrap {
    grid-row: 1 / 3;
    grid-column: 1;
  }
  .app-shell:has(> .detail-hero) > .detail-hero .icon-wrap img {
    width: 80px;
    height: 80px;
  }
  .app-shell:has(> .detail-hero) > .detail-hero h1 {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    text-align: left;
  }
  .app-shell:has(> .detail-hero) > .detail-hero .meta-pills {
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-start;
  }

  .app-shell:has(> .detail-hero) > .section {
    grid-column: 1;
  }

  .app-shell:has(> .detail-hero) > .subscribe {
    grid-column: 2;
    margin-top: 0;
  }

  .section { padding: 20px 24px; }
  .section h2 { font-size: 1.125rem; }
  .section p, .section ol { font-size: 1rem; }
}

@media (min-width: 1200px) {
  .app-shell:has(> .grid#game-grid) > .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
  }
  .app-shell:has(> .grid#game-grid) .game-card {
    min-height: 210px;
    padding: 24px 22px;
  }
}

@media (min-width: 1440px) {
  .app-shell { max-width: 1440px; }
  .app-shell:has(> .grid#game-grid) > .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
  .app-shell:has(> .grid#game-grid) .game-card {
    min-height: 220px;
  }
  .app-shell:has(> .grid#game-grid) .game-card h2 {
    font-size: 1.3125rem;
  }
}

.game-card-body { flex: 1; min-width: 0; }
.game-card-meta {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted);
}
@media (min-width: 960px) {
  .app-shell:has(> .grid#game-grid) .game-card-meta {
    font-size: 0.875rem;
    line-height: 1.5;
  }
  .app-shell:has(> .grid#game-grid) .game-card p.game-card-meta {
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* Fixed subscribe — bottom right */
.subscribe-dock {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  right: max(20px, env(safe-area-inset-right, 0px));
  z-index: 1001;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.subscribe-dock > * {
  pointer-events: auto;
}
.subscribe-dock-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.25);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.subscribe-dock-fab:hover {
  background: var(--accent-dark);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}
.subscribe-dock-panel {
  display: none;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  padding: 18px;
  max-height: min(70vh, 420px);
  overflow-y: auto;
}
.subscribe-dock-panel.subscribe-content {
  padding: 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.subscribe-dock-panel input {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 12px;
}
.subscribe-dock.is-open .subscribe-dock-panel {
  display: block;
}
.subscribe-dock-panel h2 {
  margin: 0 0 12px;
  font-size: 1.125rem;
  color: var(--text);
}
.subscribe-dock.is-open .subscribe-dock-fab {
  background: var(--accent-dark);
}
body {
  padding-bottom: calc(var(--footer-pad) + 8px);
}
@media (min-width: 960px) {
  .subscribe-dock {
    bottom: max(28px, env(safe-area-inset-bottom, 0px));
    right: max(28px, env(safe-area-inset-right, 0px));
  }
}

/* Nylon Cards — form fields & headings */
.subscribe input,
.subscribe-dock-panel input {
  background: #ffffff;
  color: var(--text);
  border-color: rgba(0, 0, 0, 0.15);
}
.subscribe input::placeholder,
.subscribe-dock-panel input::placeholder {
  color: var(--muted);
}
.detail-hero h1,
.section h2,
.subscribe h2,
.subscribe-dock-panel h2 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
.chip:hover {
  border-color: rgba(0, 0, 0, 0.3);
  background: var(--card);
}
.channel-toggle button {
  color: var(--text);
  background: var(--bg);
}
.channel-toggle button.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.moment-card {
  border: 1px solid var(--border);
}

/* ——— Dark theme (?theme=dark) ——— */
html[data-theme="dark"] {
  color-scheme: dark;
  --accent: #3b82f6;
  --accent-light: rgba(59, 130, 246, 0.18);
  --accent-dark: #60a5fa;
  --bg: #121212;
  --card: #1e1e1e;
  --card-elevated: #252525;
  --text: #f0f0f0;
  --muted: rgba(255, 255, 255, 0.62);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] a.brand-link {
  background: hsla(0, 0%, 10%, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .filters .chip,
html[data-theme="dark"] .chip {
  border-color: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .chip:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: var(--card-elevated);
}

html[data-theme="dark"] .game-card:hover,
html[data-theme="dark"] .game-card:focus {
  border-color: rgba(255, 255, 255, 0.22);
  background: var(--card-elevated);
}

html[data-theme="dark"] .btn-secondary {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
}

html[data-theme="dark"] .btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.38);
  background: var(--card-elevated);
}

html[data-theme="dark"] .subscribe input,
html[data-theme="dark"] .subscribe-dock-panel input {
  background: var(--card-elevated);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .subscribe-dock-fab {
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.35);
}

html[data-theme="dark"] .subscribe-dock-fab:hover {
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.45);
}

html[data-theme="dark"] .subscribe-dock-panel {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .form-msg.success {
  color: #6ee7b7;
}

html[data-theme="dark"] .form-msg.error {
  color: #fca5a5;
}

html[data-theme="dark"] .channel-toggle button.active {
  color: var(--accent-dark);
}
