/* ==========================================================================
   CardRules+ Website — Felt Table Theme
   ========================================================================== */

/* Google Fonts loaded via <link> in HTML head */

/* --- Custom Scrollbar --- */
::-webkit-scrollbar { width: 8px; background: transparent; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(45, 90, 61, 0.5);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(45, 90, 61, 0.75); }

/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(45, 90, 61, 0.5) transparent;
}

/* --- CSS Variables --- */
:root {
  /* Felt greens */
  --felt-dark: #1E3F2B;
  --felt-medium: #2D5A3D;
  --felt-light: #3A7050;
  --felt-glow: rgba(45, 90, 61, 0.4);

  /* Parchment / surface */
  --parchment: #F5EFE4;
  --parchment-dark: #EDE5D6;
  --card-surface: #FEFCF7;
  --card-separator: #E8DFD0;

  /* Text */
  --text-dark: #2C2416;
  --text-secondary: #8A7E70;
  --text-cream: #F5ECD8;
  --text-light: #FDF6E3;
  --text-label: #5A5248;

  /* Accent */
  --accent: #D4763C;
  --accent-hover: #E8884A;
  --accent-muted: #B5684A;
  --accent-glow: rgba(212, 118, 60, 0.25);

  /* Card suits */
  --suit-dark: #2C2416;
  --suit-red: #C23B3B;

  /* Status */
  --green: #3A8548;
  --red: #C23B3B;

  /* Spacing (mirrors designTokens) */
  --sp-xxs: 2px;
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;
  --sp-xxl: 32px;
  --sp-xxxl: 48px;

  /* Radius */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-xxl: 24px;

  /* Typography */
  --font-display: 'Bitter', Georgia, serif;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;

  /* Shadows */
  --shadow-card: 0 3px 8px rgba(26, 26, 14, 0.12);
  --shadow-elevated: 0 6px 14px rgba(26, 26, 14, 0.2);
  --shadow-subtle: 0 1px 3px rgba(26, 26, 14, 0.06);

  /* Felt texture (inline SVG) */
  --felt-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect x='0' y='2' width='4' height='2' fill='rgba(0,0,0,0.05)'/%3E%3Crect x='2' y='0' width='2' height='4' fill='rgba(0,0,0,0.035)'/%3E%3C/svg%3E");
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 100px; overflow-x: clip; }
body { overflow-x: clip; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-dark);
  background: var(--parchment);
  -webkit-font-smoothing: antialiased;
}

body.is-404 {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--felt-medium); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  color: var(--text-dark);
}

/* ==========================================================================
   Felt Background
   ========================================================================== */
.felt-bg {
  position: relative;
  background-color: var(--felt-dark);
  background-image:
    var(--felt-texture),
    linear-gradient(to bottom, rgba(10,18,12,0.7) 0%, transparent 40%),
    linear-gradient(to top, rgba(10,18,12,0.6) 0%, transparent 40%),
    linear-gradient(to right, rgba(10,18,12,0.5) 0%, transparent 35%),
    linear-gradient(to left, rgba(10,18,12,0.5) 0%, transparent 35%),
    radial-gradient(ellipse at center, var(--felt-glow), transparent 70%);
  color: var(--text-cream);
}

.felt-bg a { color: var(--text-cream); }
.felt-bg a:hover { color: var(--accent-hover); }
.felt-bg h1, .felt-bg h2, .felt-bg h3 { color: var(--text-light); }

/* Decorative suit symbols */
.felt-bg::before {
  content: '\2660  \2665  \2666  \2663';
  position: absolute;
  font-size: 120px;
  opacity: 0.04;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  letter-spacing: 60px;
  pointer-events: none;
  white-space: nowrap;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--sp-xl);
}

.container-wide {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--sp-xl);
}

/* ==========================================================================
   Site Header
   ========================================================================== */
.site-header {
  position: sticky !important;
  top: 0;
  z-index: 500;
  height: 65px;
  background-color: var(--felt-dark);
  background-image: var(--felt-texture);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.site-header::before { display: none; }

.site-header .container {
  height: 100%;
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
}

.site-logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-light);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.site-logo .plus { color: var(--accent); }

.site-nav {
  display: flex;
  gap: var(--sp-lg);
  margin-left: auto;
  align-items: center;
}

.site-nav a {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  color: var(--text-cream);
  opacity: 0.85;
  transition: opacity 0.2s, color 0.2s;
}

.site-nav a:hover { opacity: 1; color: var(--text-light); }

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  background: var(--accent);
  color: var(--text-light) !important;
  opacity: 1 !important;
  padding: var(--sp-sm) var(--sp-lg);
  border-radius: var(--r-xxl);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}

.header-cta:hover {
  background: var(--accent-hover);
  color: var(--text-light) !important;
  transform: translateY(-1px);
}

/* Language picker */
.lang-picker {
  position: relative;
}

.lang-picker-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--r-md);
  padding: var(--sp-xs) var(--sp-sm);
  color: var(--text-cream);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.lang-picker-toggle svg { opacity: 0.7; }
.lang-picker-toggle:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.06);
}

.lang-picker-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  padding-top: var(--sp-xxs);
  background: var(--card-surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-elevated);
  min-width: 160px;
  z-index: 300;
  overflow: hidden;
}

.lang-picker:hover .lang-picker-dropdown,
.lang-picker:focus-within .lang-picker-dropdown {
  display: block;
}

.lang-picker-dropdown a {
  display: block;
  padding: var(--sp-sm) var(--sp-lg);
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 400;
  transition: background 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.lang-picker-dropdown a:hover {
  background: var(--parchment);
  color: var(--text-dark);
}

.lang-picker-dropdown a.active {
  font-weight: 600;
  color: var(--accent);
}

/* Mobile hamburger */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-cream);
  font-size: 24px;
  cursor: pointer;
  padding: var(--sp-xs);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding: var(--sp-xxxl) 0 calc(var(--sp-xxxl) + var(--sp-xl));
  text-align: center;
  overflow: visible;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: var(--sp-lg);
  color: var(--text-light);
}

.hero .tagline {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 400;
  color: var(--text-cream);
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto var(--sp-xxl);
}

/* ==========================================================================
   Game Hero (detail page)
   ========================================================================== */
.game-hero {
  padding: var(--sp-xxl) 0 var(--sp-xxxl);
}

.game-hero .container {
  display: flex;
  gap: var(--sp-xxl);
  align-items: flex-start;
}

.game-hero-image {
  width: 200px;
  min-width: 200px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-elevated);
  background: var(--card-surface);
}

.game-hero-content { flex: 1; }

.game-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: var(--sp-sm);
}

.game-hero .game-description {
  font-size: 1.05rem;
  line-height: 1.6;
  opacity: 0.9;
  margin-bottom: var(--sp-xl);
}

/* Metadata badges */
.meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  background: rgba(255,255,255,0.1);
  padding: var(--sp-xs) var(--sp-md);
  border-radius: var(--r-xxl);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-cream);
  white-space: nowrap;
}

.badge-accent {
  background: var(--accent);
  color: var(--text-light);
  font-weight: 600;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  background: var(--card-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}

.card-body { padding: var(--sp-lg); }

/* Game card (in listings) */
.game-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text-dark);
}

.game-card:hover { color: var(--text-dark); }

.game-card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--parchment-dark);
}

.game-card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: var(--sp-xs);
  color: var(--text-dark);
}

.game-card-meta {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ==========================================================================
   Game Cards Grid
   ========================================================================== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-xl);
}

/* ==========================================================================
   Download CTA
   ========================================================================== */
.download-cta {
  background: linear-gradient(135deg, var(--felt-medium), var(--felt-dark));
  background-image:
    var(--felt-texture),
    linear-gradient(135deg, var(--felt-medium), var(--felt-dark));
  border-radius: var(--r-xl);
  padding: var(--sp-xxl) var(--sp-xl);
  text-align: center;
  margin: var(--sp-xxl) 0;
}

.download-cta-heading {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: var(--sp-sm);
}

.download-cta p {
  color: var(--text-cream);
  opacity: 0.9;
  margin-bottom: var(--sp-xl);
  font-size: 0.95rem;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  background: var(--accent);
  color: var(--text-light);
  padding: var(--sp-md) var(--sp-xxl);
  border-radius: var(--r-xxl);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.cta-button:hover {
  background: var(--accent-hover);
  color: var(--text-light) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.cta-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Inline CTA (within content) */
.inline-cta {
  background: var(--parchment-dark);
  border: 1px solid var(--card-separator);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-md);
  padding: var(--sp-lg) var(--sp-xl);
  margin: var(--sp-xl) 0;
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
}

.inline-cta-text {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text-dark);
}

.inline-cta-text strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: var(--sp-xxs);
}

.inline-cta .cta-button {
  padding: var(--sp-sm) var(--sp-xl);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* ==========================================================================
   Sticky Bottom CTA
   ========================================================================== */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--felt-dark);
  background-image: var(--felt-texture);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: var(--sp-md) var(--sp-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-lg);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.sticky-cta.visible { transform: translateY(0); }

.sticky-cta-text {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-cream);
  font-size: 14px;
}

.sticky-cta .cta-button {
  padding: var(--sp-sm) var(--sp-xl);
  font-size: 13px;
}

.sticky-cta-close {
  background: none;
  border: none;
  color: var(--text-cream);
  opacity: 0.6;
  cursor: pointer;
  font-size: 18px;
  padding: var(--sp-xs);
  transition: opacity 0.2s;
}

.sticky-cta-close:hover { opacity: 1; }

/* ==========================================================================
   Quick Reference Card
   ========================================================================== */
.quick-ref {
  background: var(--card-surface);
  border: 1px solid var(--card-separator);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--sp-xxl);
}

.quick-ref-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--felt-medium);
  margin-bottom: var(--sp-lg);
  padding-bottom: var(--sp-sm);
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.quick-ref-section {
  margin-bottom: var(--sp-lg);
}

.quick-ref-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: var(--sp-xs);
}

.quick-ref-goal {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-dark);
}

.quick-ref ol, .quick-ref ul {
  padding-left: var(--sp-xl);
  margin: 0;
}

.quick-ref li {
  margin-bottom: var(--sp-xs);
  font-size: 0.95rem;
  line-height: 1.5;
}

.quick-ref-tip {
  background: rgba(212, 118, 60, 0.08);
  border-radius: var(--r-md);
  padding: var(--sp-md);
  font-size: 0.9rem;
  color: var(--text-dark);
  border-left: 3px solid var(--accent);
}

/* ==========================================================================
   Rules Accordion
   ========================================================================== */
.rules-section { margin-bottom: var(--sp-xxl); }

.rules-section > h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: var(--sp-lg);
}

.rules-overview {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-dark);
  margin-bottom: var(--sp-xl);
}

.rules-quote {
  font-style: italic;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent-muted);
  padding-left: var(--sp-lg);
  margin-bottom: var(--sp-xl);
}

details.rule-block {
  background: var(--card-surface);
  border: 1px solid var(--card-separator);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-sm);
  overflow: hidden;
}

details.rule-block[open] {
  box-shadow: var(--shadow-subtle);
}

details.rule-block summary {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  padding: var(--sp-lg);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  color: var(--text-dark);
  transition: background 0.15s;
}

details.rule-block summary::-webkit-details-marker { display: none; }

details.rule-block summary::before {
  content: '\25B6';
  font-size: 10px;
  color: var(--accent);
  transition: transform 0.2s;
  flex-shrink: 0;
}

details.rule-block[open] summary::before {
  transform: rotate(90deg);
}

details.rule-block summary:hover {
  background: var(--parchment);
}

.rule-block-content {
  padding: 0 var(--sp-lg) var(--sp-lg);
  font-size: 0.95rem;
  line-height: 1.7;
}

.rule-block-content p { margin-bottom: var(--sp-md); }

.rule-block-content ol, .rule-block-content ul {
  padding-left: var(--sp-xl);
  margin-bottom: var(--sp-md);
}

.rule-block-content li {
  margin-bottom: var(--sp-sm);
  line-height: 1.6;
}

/* ==========================================================================
   Content Sections
   ========================================================================== */
.content-section {
  margin-bottom: var(--sp-xxl);
}

.content-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: var(--sp-lg);
  padding-bottom: var(--sp-sm);
  border-bottom: 2px solid var(--parchment-dark);
}

.content-section p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-dark);
  margin-bottom: var(--sp-md);
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */
.breadcrumbs {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--sp-xs) var(--sp-sm);
  font-size: 13px;
  color: var(--text-cream);
  opacity: 0.7;
  padding: var(--sp-lg) 0 0;
}

.breadcrumbs a { color: var(--text-cream); }
.breadcrumbs a:hover { color: var(--accent-hover); }
.breadcrumbs .sep { opacity: 0.5; }

/* ==========================================================================
   Similar Games
   ========================================================================== */
.similar-games {
  margin-bottom: var(--sp-xxl);
}

.similar-games h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: var(--sp-lg);
}

/* ==========================================================================
   Collections Row (Homepage)
   ========================================================================== */
.collection-row {
  margin-bottom: var(--sp-xxl);
}

.collection-row h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--sp-lg);
  color: var(--text-dark);
}

.collection-scroll {
  display: flex;
  gap: var(--sp-lg);
  overflow-x: auto;
  padding-bottom: var(--sp-md);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.collection-scroll::-webkit-scrollbar { height: 4px; }
.collection-scroll::-webkit-scrollbar-track { background: var(--parchment-dark); border-radius: 2px; }
.collection-scroll::-webkit-scrollbar-thumb { background: var(--card-separator); border-radius: 2px; }

.collection-scroll .card {
  min-width: 200px;
  max-width: 220px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

/* ==========================================================================
   Categories Grid (Homepage)
   ========================================================================== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-lg);
  margin-bottom: var(--sp-xxl);
}

.category-card {
  background: var(--card-surface);
  border: 1px solid var(--card-separator);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  text-align: center;
  text-decoration: none;
  color: var(--text-dark);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: var(--accent);
  color: var(--text-dark);
}

.category-card-icon {
  font-size: 28px;
  margin-bottom: var(--sp-sm);
}

.category-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.category-card-count {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: var(--sp-xxs);
}

/* ==========================================================================
   Search
   ========================================================================== */
.search-wrapper {
  position: relative;
  z-index: 200;
  max-width: 520px;
  margin: 0 auto var(--sp-xxl);
}

.search-input {
  width: 100%;
  padding: 14px var(--sp-xl) 14px 48px;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: var(--r-xxl);
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-cream);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

.search-input::placeholder { color: rgba(245, 236, 216, 0.4); }
.search-input:focus {
  border-color: var(--accent);
  background: rgba(0,0,0,0.35);
  box-shadow: 0 0 0 4px rgba(212, 118, 60, 0.15), 0 8px 24px rgba(0,0,0,0.2);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
  transition: opacity 0.2s;
  filter: grayscale(1) brightness(2);
}

.search-input:focus ~ .search-icon,
.search-wrapper:focus-within .search-icon { opacity: 0.8; }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card-surface);
  border-radius: var(--r-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.05);
  max-height: 420px;
  overflow-y: auto;
  display: none;
  z-index: 200;
}

.search-results.active {
  display: block;
  animation: searchDropIn 0.2s ease-out;
}

@keyframes searchDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  color: var(--text-dark);
  text-decoration: none;
  border-bottom: 1px solid var(--card-separator);
  transition: background 0.15s, padding-left 0.15s;
}

.search-result-item::before {
  content: '\2660';
  font-size: 14px;
  color: var(--felt-medium);
  opacity: 0.4;
  flex-shrink: 0;
  transition: opacity 0.15s, color 0.15s;
}

.search-result-item:hover {
  background: var(--parchment);
  padding-left: var(--sp-xl);
}

.search-result-item:hover::before {
  opacity: 1;
  color: var(--accent);
}

.search-result-item:last-child { border-bottom: none; }

.search-result-info { flex: 1; min-width: 0; }

.search-result-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-dark);
}

.search-result-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ==========================================================================
   A-Z Index
   ========================================================================== */
.az-index { margin-bottom: var(--sp-xxl); }

.az-letters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-xs);
  margin-bottom: var(--sp-xl);
  justify-content: center;
}

.az-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--felt-medium);
  background: var(--card-surface);
  border: 1px solid var(--card-separator);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.az-letter:hover {
  background: var(--felt-medium);
  color: var(--text-light);
}

.az-group {
  margin-bottom: var(--sp-xl);
}


.az-group-header {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--accent);
  border-bottom: 2px solid var(--card-separator);
  padding-bottom: var(--sp-sm);
  margin-bottom: var(--sp-md);
}

.az-game-list {
  list-style: none;
  columns: 2;
  column-gap: var(--sp-xxl);
}

.az-game-item {
  break-inside: avoid;
  margin-bottom: var(--sp-sm);
}

.az-game-link {
  display: inline-flex;
  align-items: baseline;
  gap: var(--sp-sm);
  color: var(--text-dark);
  font-size: 0.95rem;
  transition: color 0.15s;
}

.az-game-link:hover { color: var(--accent); }

.az-game-players {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  padding: var(--sp-xxxl) 0 calc(var(--sp-xxl) + 60px);
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--sp-xxl);
}

.footer-brand { }

.footer-brand .site-logo {
  font-size: 24px;
  margin-bottom: var(--sp-md);
}

.footer-brand p {
  font-size: 0.9rem;
  color: var(--text-cream);
  opacity: 0.7;
  max-width: 300px;
  line-height: 1.6;
}

.footer-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-cream);
  margin-bottom: var(--sp-md);
}

.footer-links ul {
  list-style: none;
}

.footer-links li { margin-bottom: var(--sp-sm); }

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-cream);
  opacity: 0.65;
  transition: opacity 0.2s;
}

.footer-links a:hover { opacity: 1; }

.footer-bottom {
  margin-top: var(--sp-xxl);
  padding-top: var(--sp-xl);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-cream);
  opacity: 0.5;
}

.lang-switcher {
  display: flex;
  gap: var(--sp-sm);
}

.lang-switcher a {
  color: var(--text-cream);
  opacity: 0.5;
  font-size: 13px;
}

.lang-switcher a:hover, .lang-switcher a.active { opacity: 1; }

/* ==========================================================================
   Page Content Area
   ========================================================================== */
.page-content {
  padding: var(--sp-xxl) 0;
}

/* ==========================================================================
   Listing Page Header
   ========================================================================== */
.listing-header {
  padding: var(--sp-xxl) 0;
  text-align: center;
}

.listing-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: var(--sp-sm);
}

.listing-header p {
  font-size: 1.05rem;
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto;
}

/* ==========================================================================
   App Features Section
   ========================================================================== */
.app-features {
  border-radius: var(--r-xl);
  padding: var(--sp-xxxl) var(--sp-xl);
  margin-bottom: var(--sp-xxl);
}

.features-header {
  text-align: center;
  margin-bottom: var(--sp-xxl);
}

.features-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: var(--sp-sm);
}

.features-header p {
  font-size: 1.05rem;
  opacity: 0.85;
  max-width: 550px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-xl);
  max-width: 900px;
  margin: 0 auto;
}

.feature-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  transition: background 0.2s, border-color 0.2s;
}

.feature-card:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.15);
}

.feature-icon {
  font-size: 28px;
  margin-bottom: var(--sp-md);
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: var(--sp-sm);
}

.feature-card p {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-cream);
  opacity: 0.8;
  margin: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
  .game-hero .container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .game-hero-image {
    width: 160px;
    min-width: 160px;
  }

  .meta-badges { justify-content: center; }

  .site-nav { display: none; }
  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--felt-dark);
    padding: var(--sp-lg);
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 500;
  }

  .mobile-menu-toggle { display: block; margin-left: auto; }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand p { max-width: none; }
  .footer-bottom { flex-direction: column; gap: var(--sp-md); }

  .az-game-list { columns: 1; }

  .inline-cta { flex-direction: column; text-align: center; }

  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--sp-lg);
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .features-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sticky-cta { padding: var(--sp-sm) var(--sp-lg); }
  .sticky-cta-text { font-size: 12px; flex: 1; }
  .sticky-cta .cta-button { white-space: nowrap; flex-shrink: 0; }
}

@media (max-width: 480px) {
  .container, .container-wide { padding: 0 var(--sp-lg); }

  .games-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-md);
  }

  .categories-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-md);
  }

  .features-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Section Dividers (suit-themed)
   ========================================================================== */
.suit-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-lg);
  margin: var(--sp-xxl) 0;
  color: var(--accent-muted);
  font-size: 16px;
  letter-spacing: 10px;
}

.suit-divider::before,
.suit-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent-muted), transparent);
}

/* ==========================================================================
   Collection Scroll Fade Edges
   ========================================================================== */
.collection-scroll-wrapper {
  position: relative;
}

.collection-scroll-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 60px;
  background: linear-gradient(to right, transparent, var(--parchment));
  pointer-events: none;
}

/* ==========================================================================
   Enhanced Game Card Hover
   ========================================================================== */
.game-card .game-card-image {
  transition: transform 0.35s ease;
}

.game-card:hover .game-card-image {
  transform: scale(1.04);
}

.game-card .card-body {
  position: relative;
}

.game-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 0 var(--accent-glow);
  transition: box-shadow 0.3s ease;
  pointer-events: none;
}

.game-card:hover::after {
  box-shadow: 0 8px 24px rgba(212, 118, 60, 0.12);
}

/* ==========================================================================
   Enhanced Quick Reference
   ========================================================================== */
.quick-ref {
  position: relative;
  background:
    linear-gradient(135deg, rgba(254,252,247,1) 0%, rgba(245,239,228,0.6) 100%),
    var(--card-surface);
}

.quick-ref::before {
  content: '\2660  \2665  \2666  \2663';
  position: absolute;
  top: var(--sp-lg);
  right: var(--sp-xl);
  font-size: 12px;
  letter-spacing: 6px;
  color: var(--card-separator);
  pointer-events: none;
}

/* ==========================================================================
   404 Page
   ========================================================================== */
.not-found {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-xxxl) var(--sp-xl);
  background: var(--parchment);
}

.not-found-code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 15vw, 10rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: var(--sp-lg);
}

.not-found h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-dark);
  margin-bottom: var(--sp-md);
}

.not-found p {
  color: var(--text-secondary);
  margin-bottom: var(--sp-xl);
}

.not-found-suggestions {
  margin-bottom: var(--sp-xxl);
}

.not-found-suggestions-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dark);
  margin-bottom: var(--sp-md);
}

.not-found-suggestions-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-sm);
}

.not-found-suggestion {
  display: inline-block;
  padding: var(--sp-sm) var(--sp-lg);
  background: var(--card-surface);
  border: 1px solid var(--card-separator);
  border-radius: var(--r-xxl);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--felt-medium);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.not-found-suggestion:hover {
  background: var(--felt-medium);
  border-color: var(--felt-medium);
  color: var(--text-light);
}

/* ==========================================================================
   Print
   ========================================================================== */
@media print {
  .site-header, .site-footer, .sticky-cta, .download-cta, .inline-cta,
  .header-cta, .similar-games { display: none !important; }

  .felt-bg { background: white !important; color: black !important; }
  body { font-size: 12pt; }
}
