/* ==========================================================================
   MindPuzz — Ultra-Premium Tactile Design System
   Pure CSS3 | Editorial Light & Obsidian Dark Modes | Zero Dependencies
   ========================================================================== */

:root {
  /* Light Mode Palette — Crisp Ceramic & Slate */
  --bg: #F6F7FB;
  --bg-glow-1: rgba(99, 102, 241, 0.09);
  --bg-glow-2: rgba(16, 185, 129, 0.07);
  --surface: #FFFFFF;
  --surface-elevated: #FFFFFF;
  --surface-alt: #F1F4F9;
  --surface-hover: #E6ECF5;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.16);
  --inner-highlight: rgba(255, 255, 255, 0.9);
  --text: #0B1120;
  --text-muted: #526075;

  /* Layered Elevation Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 32px -6px rgba(15, 23, 42, 0.09), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 28px 60px -12px rgba(15, 23, 42, 0.22), 0 8px 20px -4px rgba(15, 23, 42, 0.08);
  --key-bevel: #CBD5E1;

  /* Brand & Semantic Accents */
  --emerald: #10B981;
  --emerald-dark: #059669;
  --emerald-glow: rgba(16, 185, 129, 0.28);
  --amber: #F59E0B;
  --amber-dark: #D97706;
  --amber-glow: rgba(245, 158, 11, 0.28);
  --slate: #64748B;
  --indigo: #6366F1;
  --indigo-hover: #4F46E5;
  --indigo-soft: rgba(99, 102, 241, 0.11);
  --indigo-glow: rgba(99, 102, 241, 0.3);
  --rose: #EC4899;
  --rose-glow: rgba(236, 72, 153, 0.28);
  --danger: #EF4444;

  /* LinkGrid Jewel Tiers */
  --tier-0-bg: linear-gradient(135deg, #FEF08A, #FDE047);
  --tier-0-text: #713F12;
  --tier-1-bg: linear-gradient(135deg, #BBF7D0, #86EFAC);
  --tier-1-text: #14532D;
  --tier-2-bg: linear-gradient(135deg, #BFDBFE, #93C5FD);
  --tier-2-text: #1E3A8A;
  --tier-3-bg: linear-gradient(135deg, #E9D5FF, #D8B4FE);
  --tier-3-text: #581C87;

  /* Typography */
  --font-ui: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-tile: 'Space Grotesk', ui-monospace, SFMono-Regular, monospace;

  /* Radii & Motion */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  /* Dark Mode Palette — Obsidian Glass & Hairline Specular Edges */
  --bg: #0A0B0F;
  --bg-glow-1: rgba(99, 102, 241, 0.14);
  --bg-glow-2: rgba(16, 185, 129, 0.08);
  --surface: #13151C;
  --surface-elevated: #1A1D27;
  --surface-alt: #1D212D;
  --surface-hover: #262B3A;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --inner-highlight: rgba(255, 255, 255, 0.06);
  --text: #F8FAFC;
  --text-muted: #94A3B8;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 18px 40px -10px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 30px 70px -12px rgba(0, 0, 0, 0.85);
  --key-bevel: #0B0D12;
  --indigo-soft: rgba(99, 102, 241, 0.2);

  --tier-0-bg: linear-gradient(135deg, #FACC15, #EAB308);
  --tier-0-text: #18181B;
  --tier-1-bg: linear-gradient(135deg, #34D399, #10B981);
  --tier-1-text: #022C22;
  --tier-2-bg: linear-gradient(135deg, #60A5FA, #3B82F6);
  --tier-2-text: #0F172A;
  --tier-3-bg: linear-gradient(135deg, #C084FC, #A855F7);
  --tier-3-text: #1E1B4B;
}

/* ==========================================================================
   Reset & Ambient Canvas
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 45% at 50% -10%, var(--bg-glow-1), transparent 70%),
    radial-gradient(ellipse 50% 35% at 85% 15%, var(--bg-glow-2), transparent 65%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, a {
  font-family: inherit;
  color: inherit;
  touch-action: manipulation;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

/* ==========================================================================
   Frosted Glass Top Navigation Bar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.72rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-family: var(--font-tile);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.035em;
  color: var(--text);
  transition: opacity 0.15s ease;
}

.brand-logo:hover {
  opacity: 0.9;
}

.brand-logo svg {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px var(--indigo-glow));
  transition: transform 0.25s var(--ease-spring);
}

.brand-logo:hover svg {
  transform: rotate(-4deg) scale(1.06);
}

.brand-logo span em {
  font-style: normal;
  background: linear-gradient(135deg, var(--indigo), #818CF8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 38px;
  padding: 0 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--inner-highlight);
  font-family: var(--font-tile);
  font-weight: 700;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.streak-pill .flame {
  font-size: 1rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px var(--amber-glow));
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--inner-highlight);
  color: var(--text);
  transition: background-color 0.15s ease, transform 0.12s var(--ease-spring), border-color 0.15s ease;
}

.icon-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==========================================================================
   Homepage Hub — Editorial Hero & Glowing Game Cards
   ========================================================================== */
.hub-main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.75rem 1.25rem 4rem;
}

.hero-banner {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2.75rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--indigo-soft);
  border: 1px solid color-mix(in srgb, var(--indigo) 26%, transparent);
  color: var(--indigo);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}

[data-theme="dark"] .hero-eyebrow {
  color: #A5B4FC;
}

.hero-banner h1 {
  font-family: var(--font-tile);
  font-size: clamp(2.15rem, 5.4vw, 3.45rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin-bottom: 0.95rem;
  background: linear-gradient(180deg, var(--text) 35%, var(--text-muted) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-banner p {
  color: var(--text-muted);
  font-size: 1.06rem;
  max-width: 560px;
  margin: 0 auto;
}

.hub-summary-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  max-width: 660px;
  margin: 2rem auto 0;
}

.summary-chip {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 0.9rem;
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--inner-highlight);
}

.summary-chip .val {
  display: block;
  font-family: var(--font-tile);
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text);
}

.summary-chip .lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.15rem;
  display: block;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem;
  margin-bottom: 3.25rem;
}

.game-card {
  --card-accent: var(--indigo);
  --card-glow: var(--indigo-glow);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.65rem;
  text-decoration: none;
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--inner-highlight);
  transition: transform 0.25s var(--ease-smooth), box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
  isolation: isolate;
}

.game-card[data-game-card="wordpulse"] { --card-accent: var(--emerald); --card-glow: var(--emerald-glow); }
.game-card[data-game-card="linkgrid"]  { --card-accent: var(--indigo);  --card-glow: var(--indigo-glow); }
.game-card[data-game-card="targetnum"] { --card-accent: var(--amber);   --card-glow: var(--amber-glow); }
.game-card[data-game-card="cluefive"]  { --card-accent: var(--rose);    --card-glow: var(--rose-glow); }

.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 12% 0%, var(--card-glow), transparent 55%);
  opacity: 0.28;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: -1;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--card-accent) 55%, var(--border));
}

.game-card:hover::before {
  opacity: 0.55;
}

.game-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.game-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: var(--font-tile);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: #FFFFFF;
  flex-shrink: 0;
  box-shadow: 0 10px 22px -6px var(--card-glow), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  transition: transform 0.25s var(--ease-spring);
}

.game-card:hover .game-icon-box {
  transform: scale(1.07) rotate(-2deg);
}

.icon-wordpulse { background: linear-gradient(135deg, #10B981, #047857); }
.icon-linkgrid  { background: linear-gradient(135deg, #6366F1, #4338CA); }
.icon-targetnum { background: linear-gradient(135deg, #F59E0B, #B45309); }
.icon-cluefive  { background: linear-gradient(135deg, #EC4899, #9D174D); }

.status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.32rem 0.78rem;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
  letter-spacing: 0.01em;
}

.status-badge.solved {
  background: rgba(16, 185, 129, 0.14);
  color: var(--emerald-dark);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .status-badge.solved {
  color: #34D399;
}

.game-card h2 {
  font-family: var(--font-tile);
  font-size: 1.48rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.4rem;
}

.game-card p {
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.55;
  margin-bottom: 1.45rem;
}

.game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
  font-weight: 700;
}

.card-streak {
  color: var(--text-muted);
  font-weight: 600;
}

.play-cta {
  color: var(--card-accent);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: transform 0.2s var(--ease-smooth);
}

.game-card:hover .play-cta {
  transform: translateX(4px);
}

/* SEO FAQ Section */
.faq-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--inner-highlight);
}

.faq-section h2 {
  font-family: var(--font-tile);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.faq-item {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}

.faq-item:first-of-type {
  border-top: none;
  padding-top: 0.25rem;
}

.faq-item summary {
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-alt);
  display: grid;
  place-items: center;
  font-family: var(--font-tile);
  font-size: 1.1rem;
  color: var(--indigo);
  flex-shrink: 0;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
  background: var(--indigo-soft);
}

.faq-item p {
  margin-top: 0.7rem;
  color: var(--text-muted);
  font-size: 0.94rem;
  max-width: 72ch;
}

/* ==========================================================================
   Shared Game Page Chrome
   ========================================================================== */
.game-main {
  flex: 1;
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  padding: 1.4rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.game-top-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  text-align: center;
}

.game-heading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.game-heading-row h1 {
  font-family: var(--font-tile);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.puzzle-meta {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.28rem 0.75rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
}

/* Segmented Mode Switcher */
.mode-switcher {
  display: inline-flex;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 4px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.mode-btn {
  padding: 0.46rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s var(--ease-smooth);
}

.mode-btn:hover:not(.active) {
  color: var(--text);
}

.mode-btn.active {
  background: linear-gradient(135deg, var(--indigo), var(--indigo-hover));
  color: #FFFFFF;
  box-shadow: 0 4px 12px var(--indigo-glow);
}

.practice-bar {
  display: none;
  justify-content: center;
}

.practice-bar.visible {
  display: flex;
}

/* Reusable Tactile Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.92rem;
  transition: transform 0.12s var(--ease-spring), background-color 0.15s ease, box-shadow 0.2s ease, opacity 0.15s ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.96);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--indigo), var(--indigo-hover));
  color: #FFFFFF;
  box-shadow: 0 6px 18px -4px var(--indigo-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -4px var(--indigo-glow);
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 var(--inner-highlight);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.btn-emerald {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
  color: #FFFFFF;
  box-shadow: 0 8px 20px -4px var(--emerald-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-emerald:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -4px var(--emerald-glow);
}

.btn-sm {
  padding: 0.48rem 0.95rem;
  font-size: 0.83rem;
  border-radius: var(--radius-sm);
}

/* Game Stage Panel */
.game-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.35rem;
  box-shadow: var(--shadow-md), inset 0 1px 0 var(--inner-highlight);
}

/* Collapsible Rules for SEO */
.rules-details {
  margin-top: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-xs);
}

.rules-details summary {
  font-family: var(--font-tile);
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rules-details summary::-webkit-details-marker { display: none; }

.rules-details summary::after {
  content: '▾';
  color: var(--indigo);
  transition: transform 0.2s ease;
}

.rules-details[open] summary::after {
  transform: rotate(180deg);
}

.rules-body {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text-muted);
}

.rules-body ul {
  padding-left: 1.2rem;
  display: grid;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

/* ==========================================================================
   GAME 1: WordPulse (Rock-Solid Sizing + 3D Flip + Tactile Keycaps)
   ========================================================================== */
.wp-hint-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.15rem;
}

.wp-hint-pill {
  display: none;
  padding: 0.48rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--indigo-soft);
  border: 1px solid color-mix(in srgb, var(--indigo) 30%, transparent);
  color: var(--indigo);
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
  animation: fadeSlideUp 0.25s var(--ease-smooth);
}

[data-theme="dark"] .wp-hint-pill {
  color: #C7D2FE;
}

.wp-hint-pill.revealed {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.wp-result-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.1rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  animation: fadeSlideUp 0.25s ease;
}

.wp-result-bar.visible {
  display: flex;
}

.wp-result-bar.won {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
}

.wp-result-text {
  font-weight: 700;
  font-size: 0.92rem;
}

.wp-result-actions {
  display: flex;
  gap: 0.5rem;
}

.wp-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(332px, 100%);
  margin: 0 auto 1.4rem;
  perspective: 900px;
}

.wp-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.wp-tile {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-tile);
  font-size: clamp(1.45rem, 5vw, 1.9rem);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  border-radius: 12px;
  border: 2px solid var(--border-strong);
  background: var(--surface-alt);
  color: var(--text);
  box-shadow: inset 0 1px 0 var(--inner-highlight);
  user-select: none;
  transform-style: preserve-3d;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.wp-tile.is-active {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-soft);
}

.wp-tile.filled {
  border-color: var(--text-muted);
  background: var(--surface);
  animation: tilePop 0.14s var(--ease-spring);
}

.wp-tile.flip {
  animation: tileFlip 0.52s var(--ease-smooth) forwards;
}

.wp-tile.win-bounce {
  animation: tileBounce 0.55s var(--ease-spring);
}

.wp-tile.correct {
  background: linear-gradient(145deg, #10B981, #059669);
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 6px 16px -4px var(--emerald-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.wp-tile.present {
  background: linear-gradient(145deg, #F59E0B, #D97706);
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 6px 16px -4px var(--amber-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.wp-tile.absent {
  background: var(--slate);
  border-color: transparent;
  color: #FFFFFF;
  opacity: 0.85;
}

/* Mechanical Keycap Keyboard */
.wp-keyboard {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-width: 520px;
  margin: 0 auto;
}

.wp-key-row {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.wp-key {
  flex: 1;
  height: 52px;
  min-width: 26px;
  max-width: 46px;
  border-radius: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  box-shadow: 0 3px 0 var(--key-bevel), inset 0 1px 0 var(--inner-highlight);
  font-family: var(--font-tile);
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease, color 0.15s ease;
}

.wp-key:hover {
  background: var(--surface-hover);
}

.wp-key.wide {
  flex: 1.65;
  max-width: 76px;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.wp-key:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--key-bevel);
}

.wp-key.correct {
  background: var(--emerald);
  border-color: transparent;
  box-shadow: 0 3px 0 var(--emerald-dark);
  color: #FFFFFF;
}

.wp-key.present {
  background: var(--amber);
  border-color: transparent;
  box-shadow: 0 3px 0 var(--amber-dark);
  color: #FFFFFF;
}

.wp-key.absent {
  background: var(--slate);
  border-color: transparent;
  box-shadow: 0 3px 0 rgba(15, 23, 42, 0.35);
  color: #FFFFFF;
  opacity: 0.55;
}

/* ==========================================================================
   GAME 2: LinkGrid
   ========================================================================== */
.lg-subtitle {
  text-align: center;
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.lg-solved-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 9px;
}

.lg-solved-banner {
  border-radius: var(--radius-md);
  padding: 0.95rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  animation: fadeSlideUp 0.35s var(--ease-spring);
}

.lg-solved-banner.tier-0 { background: var(--tier-0-bg); color: var(--tier-0-text); }
.lg-solved-banner.tier-1 { background: var(--tier-1-bg); color: var(--tier-1-text); }
.lg-solved-banner.tier-2 { background: var(--tier-2-bg); color: var(--tier-2-text); }
.lg-solved-banner.tier-3 { background: var(--tier-3-bg); color: var(--tier-3-text); }

.lg-solved-banner h3 {
  font-family: var(--font-tile);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lg-solved-banner p {
  font-size: 0.88rem;
  font-weight: 700;
  margin-top: 0.2rem;
  opacity: 0.92;
}

.lg-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 1.2rem;
}

.lg-tile {
  min-height: 76px;
  padding: 0.45rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1.5px solid var(--border-strong);
  box-shadow: 0 3px 0 var(--key-bevel), inset 0 1px 0 var(--inner-highlight);
  font-family: var(--font-tile);
  font-weight: 700;
  font-size: clamp(0.72rem, 2.3vw, 0.92rem);
  text-transform: uppercase;
  line-height: 1.2;
  word-break: break-word;
  display: grid;
  place-items: center;
  text-align: center;
  user-select: none;
  transition: transform 0.12s var(--ease-spring), background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.lg-tile:hover:not(:disabled) {
  border-color: var(--indigo);
  transform: translateY(-2px);
}

.lg-tile.selected {
  background: linear-gradient(135deg, var(--indigo), var(--indigo-hover));
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 6px 18px -4px var(--indigo-glow);
  transform: translateY(1px) scale(0.97);
}

.lg-mistakes-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.lg-dots {
  display: inline-flex;
  gap: 7px;
}

.lg-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--indigo);
  box-shadow: 0 0 10px var(--indigo-glow);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.lg-dot.used {
  transform: scale(0.35);
  opacity: 0.18;
  box-shadow: none;
}

.lg-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* ==========================================================================
   GAME 3: TargetNum
   ========================================================================== */
.tn-target-box {
  text-align: center;
  padding: 1.35rem 1.15rem;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at 50% 0%, var(--indigo-soft), var(--surface-alt) 75%);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 var(--inner-highlight);
  margin-bottom: 1.25rem;
}

.tn-target-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.tn-target-number {
  font-family: var(--font-tile);
  font-size: clamp(2.8rem, 9vw, 3.85rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--text);
}

.tn-target-box.solved {
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.25), rgba(16, 185, 129, 0.08) 75%);
  border-color: var(--emerald);
}

.tn-target-box.solved .tn-target-number {
  color: var(--emerald);
}

.tn-tiles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  max-width: 390px;
  margin: 0 auto 1.2rem;
}

.tn-num-tile {
  height: 78px;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1.5px solid var(--border-strong);
  box-shadow: 0 4px 0 var(--key-bevel), inset 0 1px 0 var(--inner-highlight);
  font-family: var(--font-tile);
  font-size: 1.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  display: grid;
  place-items: center;
  transition: transform 0.14s var(--ease-spring), background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tn-num-tile:hover:not(:disabled) {
  border-color: var(--indigo);
  transform: translateY(-2px);
}

.tn-num-tile.selected {
  background: linear-gradient(135deg, var(--indigo), var(--indigo-hover));
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 8px 20px -4px var(--indigo-glow);
  transform: scale(1.04);
}

.tn-num-tile.computed {
  border-style: dashed;
  border-color: var(--amber);
}

.tn-num-tile.hit {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 8px 20px -4px var(--emerald-glow);
  animation: tileBounce 0.5s var(--ease-spring);
}

.tn-num-tile.consumed {
  visibility: hidden;
  pointer-events: none;
}

.tn-ops-row {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-bottom: 1.1rem;
}

.tn-op-btn {
  width: 58px;
  height: 54px;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1.5px solid var(--border-strong);
  box-shadow: 0 3px 0 var(--key-bevel), inset 0 1px 0 var(--inner-highlight);
  font-family: var(--font-tile);
  font-size: 1.5rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}

.tn-op-btn:hover:not(:disabled) {
  border-color: var(--indigo);
  transform: translateY(-1px);
}

.tn-op-btn.active {
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 6px 16px -4px var(--amber-glow);
}

.tn-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.1rem;
}

.tn-history {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  min-height: 60px;
}

.tn-history-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.tn-history-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tn-history-item {
  font-family: var(--font-tile);
  font-size: 0.88rem;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  animation: fadeSlideUp 0.2s ease;
}

/* ==========================================================================
   GAME 4: ClueFive
   ========================================================================== */
.cf-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.cf-cat-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.34rem 0.82rem;
  border-radius: var(--radius-pill);
  background: var(--indigo-soft);
  border: 1px solid color-mix(in srgb, var(--indigo) 30%, transparent);
  color: var(--indigo);
}

[data-theme="dark"] .cf-cat-badge {
  color: #C7D2FE;
}

.cf-progress {
  display: flex;
  gap: 6px;
}

.cf-pip {
  width: 28px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.cf-pip.active  { background: var(--indigo); border-color: var(--indigo); box-shadow: 0 0 8px var(--indigo-glow); }
.cf-pip.wrong   { background: var(--danger); border-color: var(--danger); }
.cf-pip.correct { background: var(--emerald); border-color: var(--emerald); box-shadow: 0 0 8px var(--emerald-glow); }

.cf-clues-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}

.cf-clue-card {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  animation: fadeSlideUp 0.28s var(--ease-smooth);
}

.cf-clue-card.latest {
  border-color: color-mix(in srgb, var(--indigo) 60%, transparent);
  background: var(--indigo-soft);
  box-shadow: 0 4px 16px -4px var(--indigo-glow);
}

.cf-clue-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--indigo-hover));
  color: #FFFFFF;
  font-family: var(--font-tile);
  font-weight: 700;
  font-size: 0.82rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.cf-clue-text {
  font-size: 0.96rem;
  font-weight: 500;
}

.cf-form {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.cf-input {
  flex: 1;
  padding: 0.78rem 1.05rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: var(--surface-alt);
  font-size: 0.98rem;
  font-weight: 600;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.cf-input:focus {
  border-color: var(--indigo);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--indigo-soft);
  outline: none;
}

.cf-guesses {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.cf-guess-pill {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-pill);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--danger);
  text-decoration: line-through;
}

.cf-answer-reveal {
  display: none;
  padding: 1.1rem;
  border-radius: var(--radius-md);
  text-align: center;
  margin-top: 0.85rem;
  animation: fadeSlideUp 0.25s ease;
}

.cf-answer-reveal.show { display: block; }
.cf-answer-reveal.win {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.45);
}
.cf-answer-reveal.lose {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.cf-answer-reveal strong {
  display: block;
  font-family: var(--font-tile);
  font-size: 1.4rem;
  margin-top: 0.2rem;
}

/* ==========================================================================
   Modal & Toast Notifications
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 10, 18, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(440px, 100%);
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.65rem;
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--inner-highlight);
  transform: translateY(16px) scale(0.96);
  transition: transform 0.28s var(--ease-spring);
}

.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.05rem;
}

.modal-head h2 {
  font-family: var(--font-tile);
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.stat-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.4rem;
  text-align: center;
}

.stat-box .num {
  display: block;
  font-family: var(--font-tile);
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-box .txt {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.share-preview {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  font-family: var(--font-tile);
  font-size: 0.9rem;
  white-space: pre-wrap;
  text-align: center;
  margin-bottom: 1.15rem;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.countdown-box {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 1rem;
  font-weight: 600;
}

.countdown-box strong {
  font-family: var(--font-tile);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.overview-list {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.overview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.78rem 0.95rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.overview-row strong {
  font-family: var(--font-tile);
}

.toast-container {
  position: fixed;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--text);
  color: var(--bg);
  padding: 0.62rem 1.25rem;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  animation: fadeSlideUp 0.2s var(--ease-spring);
}

.toast.success { background: var(--emerald); color: #FFFFFF; }
.toast.error   { background: var(--danger); color: #FFFFFF; }

/* ==========================================================================
   Tactile Keyframe Animations
   ========================================================================== */
.shake {
  animation: rowShake 0.42s ease;
}

@keyframes tileFlip {
  0%   { transform: rotateX(0deg); }
  50%  { transform: rotateX(-90deg); }
  100% { transform: rotateX(0deg); }
}

@keyframes tilePop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes tileBounce {
  0%, 100% { transform: translateY(0); }
  40%      { transform: translateY(-10px); }
  68%      { transform: translateY(2px); }
}

@keyframes rowShake {
  0%, 100% { transform: translateX(0); }
  18%      { transform: translateX(-7px); }
  36%      { transform: translateX(7px); }
  54%      { transform: translateX(-5px); }
  72%      { transform: translateX(5px); }
  90%      { transform: translateX(-2px); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 720px) {
  .games-grid {
    grid-template-columns: 1fr;
  }
  .hub-summary-bar {
    gap: 0.55rem;
  }
  .summary-chip {
    padding: 0.75rem 0.5rem;
  }
  .summary-chip .val {
    font-size: 1.22rem;
  }
}

@media (max-width: 480px) {
  .header-inner {
    padding: 0.65rem 0.9rem;
  }
  .brand-logo {
    font-size: 1.18rem;
  }
  .game-panel {
    padding: 1.05rem 0.8rem;
    border-radius: 18px;
  }
  .wp-grid {
    gap: 6px;
  }
  .wp-row {
    gap: 6px;
  }
  .wp-key-row {
    gap: 4px;
  }
  .wp-key {
    height: 48px;
    font-size: 0.86rem;
    border-radius: 8px;
  }
  .lg-tile {
    min-height: 64px;
    padding: 0.32rem;
  }
  .cf-form {
    flex-direction: column;
  }
}

/* Back-to-Home Navigation Pill */
.game-nav-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  margin-bottom: -0.35rem;
}

.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem 0.45rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs), inset 0 1px 0 var(--inner-highlight);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: transform 0.15s var(--ease-spring), color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.back-home-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s var(--ease-smooth);
}

.back-home-btn:hover {
  color: var(--text);
  border-color: var(--indigo);
  background: var(--surface-alt);
}

.back-home-btn:hover svg {
  transform: translateX(-3px);
}

.back-home-btn:active {
  transform: scale(0.96);
}

/* ==========================================================================
   NEW GAMES: Homepage Card Accents (CrownGrid & ZipLine)
   ========================================================================== */
.game-card[data-game-card="crowngrid"] { --card-accent: #8B5CF6; --card-glow: rgba(139, 92, 246, 0.30); }
.game-card[data-game-card="zipline"]   { --card-accent: #06B6D4; --card-glow: rgba(6, 182, 212, 0.30); }

.icon-crowngrid { background: linear-gradient(135deg, #8B5CF6, #6D28D9); font-size: 1.55rem; }
.icon-zipline   { background: linear-gradient(135deg, #06B6D4, #0284C7); font-size: 1.05rem; }

/* Shared Live Status Bar (Timer + Progress) */
.arcade-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
  padding: 0.6rem 0.95rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-family: var(--font-tile);
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
}

.hud-pill span.muted {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
}

/* ==========================================================================
   GAME 5: CrownGrid (6x6 Colored Region Logic)
   ========================================================================== */
:root {
  --cg-r0: #FECACA;
  --cg-r1: #BFDBFE;
  --cg-r2: #BBF7D0;
  --cg-r3: #FEF08A;
  --cg-r4: #E9D5FF;
  --cg-r5: #A5F3FC;
  --cg-wall: #0F172A;
}

[data-theme="dark"] {
  --cg-r0: #7F1D1D;
  --cg-r1: #1E3A8A;
  --cg-r2: #14532D;
  --cg-r3: #713F12;
  --cg-r4: #581C87;
  --cg-r5: #164E63;
  --cg-wall: #F8FAFC;
}

.cg-board-wrap {
  width: min(378px, 100%);
  margin: 0 auto 1.2rem;
  padding: 5px;
  border-radius: 16px;
  background: var(--cg-wall);
  box-shadow: var(--shadow-md);
}

.cg-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-radius: 12px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.cg-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid rgba(15, 23, 42, 0.14);
  font-size: clamp(1.2rem, 5vw, 1.7rem);
  font-weight: 700;
  transition: filter 0.12s ease, transform 0.1s ease;
}

[data-theme="dark"] .cg-cell {
  border-color: rgba(255, 255, 255, 0.14);
}

.cg-cell:hover:not(:disabled) {
  filter: brightness(1.06);
}

.cg-cell:active:not(:disabled) {
  transform: scale(0.95);
}

.cg-cell.r-0 { background: var(--cg-r0); }
.cg-cell.r-1 { background: var(--cg-r1); }
.cg-cell.r-2 { background: var(--cg-r2); }
.cg-cell.r-3 { background: var(--cg-r3); }
.cg-cell.r-4 { background: var(--cg-r4); }
.cg-cell.r-5 { background: var(--cg-r5); }

/* Thick region boundaries */
.cg-cell.b-top    { border-top: 3px solid var(--cg-wall); }
.cg-cell.b-right  { border-right: 3px solid var(--cg-wall); }
.cg-cell.b-bottom { border-bottom: 3px solid var(--cg-wall); }
.cg-cell.b-left   { border-left: 3px solid var(--cg-wall); }

.cg-cell .mark-x {
  font-family: var(--font-tile);
  font-size: 1.05rem;
  color: rgba(15, 23, 42, 0.55);
  pointer-events: none;
}

[data-theme="dark"] .cg-cell .mark-x {
  color: rgba(248, 250, 252, 0.65);
}

.cg-cell .mark-crown {
  display: inline-block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.28));
  animation: tilePop 0.22s var(--ease-spring);
  pointer-events: none;
}

.cg-cell.conflict {
  box-shadow: inset 0 0 0 3px var(--danger);
  animation: rowShake 0.35s ease;
}

.cg-cell.conflict::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(239, 68, 68, 0.28);
  pointer-events: none;
}

.cg-cell.win-cell .mark-crown {
  animation: tileBounce 0.55s var(--ease-spring);
}

.cg-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.cg-tip {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.85rem;
}

/* ==========================================================================
   GAME 6: ZipLine (5x5 Tactile Single-Path Puzzle)
   ========================================================================== */
.zl-board-wrap {
  width: min(368px, 100%);
  margin: 0 auto 1.2rem;
  padding: 10px;
  border-radius: 18px;
  background: var(--surface-alt);
  border: 1.5px solid var(--border-strong);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
}

.zl-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.zl-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}

.zl-cell.visited {
  background: color-mix(in srgb, #06B6D4 16%, var(--surface));
  border-color: color-mix(in srgb, #06B6D4 55%, var(--border));
}

.zl-cell.head {
  background: color-mix(in srgb, #06B6D4 28%, var(--surface));
  border-color: #06B6D4;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.25);
}

.zl-cell.won-cell {
  background: color-mix(in srgb, var(--emerald) 22%, var(--surface));
  border-color: var(--emerald);
}

/* Glowing Path Connectors */
.zl-pipe {
  position: absolute;
  background: linear-gradient(135deg, #06B6D4, #3B82F6);
  border-radius: 999px;
  pointer-events: none;
  z-index: 1;
}

.zl-cell.won-cell .zl-pipe {
  background: linear-gradient(135deg, var(--emerald), #059669);
}

.zl-pipe.center {
  width: 24%;
  height: 24%;
  top: 38%;
  left: 38%;
}

.zl-pipe.up    { width: 22%; height: 62%; top: -12%; left: 39%; }
.zl-pipe.down  { width: 22%; height: 62%; bottom: -12%; left: 39%; }
.zl-pipe.left  { height: 22%; width: 62%; left: -12%; top: 39%; }
.zl-pipe.right { height: 22%; width: 62%; right: -12%; top: 39%; }

/* Numbered Checkpoint Node */
.zl-node {
  position: relative;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-tile);
  font-weight: 700;
  font-size: 0.95rem;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s var(--ease-spring), background-color 0.15s ease;
  pointer-events: none;
}

.zl-cell.visited .zl-node {
  background: linear-gradient(135deg, #06B6D4, #0284C7);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
  transform: scale(1.06);
}

.zl-cell.won-cell .zl-node {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
  box-shadow: 0 4px 12px var(--emerald-glow);
}

.zl-cell.next-target .zl-node {
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.35);
}

.zl-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.zl-tip {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.85rem;
}

/* ==========================================================================
   NEW GAMES: Homepage Card Accents (SunMoon & WaffleSwap)
   ========================================================================== */
.game-card[data-game-card="sunmoon"]    { --card-accent: #F97316; --card-glow: rgba(249, 115, 22, 0.30); }
.game-card[data-game-card="waffleswap"] { --card-accent: #EAB308; --card-glow: rgba(234, 179, 8, 0.32); }

.icon-sunmoon    { background: linear-gradient(135deg, #F97316, #EA580C); font-size: 1.45rem; }
.icon-waffleswap { background: linear-gradient(135deg, #FACC15, #CA8A04); font-size: 1.45rem; }

/* ==========================================================================
   GAME 7: SunMoon (6x6 Tango-Style Binary Logic Grid)
   ========================================================================== */
.sm-board-wrap {
  width: min(378px, 100%);
  margin: 0 auto 1.2rem;
  padding: 10px;
  border-radius: 18px;
  background: var(--surface-alt);
  border: 1.5px solid var(--border-strong);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
}

.sm-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  user-select: none;
  -webkit-user-select: none;
}

.sm-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 11px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  box-shadow: 0 2px 0 var(--key-bevel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.25rem, 5vw, 1.65rem);
  transition: transform 0.1s var(--ease-spring), border-color 0.15s ease, background-color 0.15s ease;
}

.sm-cell:hover:not(:disabled) {
  border-color: var(--indigo);
  transform: translateY(-1px);
}

.sm-cell:active:not(:disabled) {
  transform: scale(0.93);
}

.sm-cell.locked {
  background: color-mix(in srgb, var(--indigo) 10%, var(--surface-alt));
  border-style: solid;
  box-shadow: none;
  cursor: default;
}

.sm-cell.locked::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.45;
}

.sm-cell.conflict {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.15);
  animation: rowShake 0.35s ease;
}

.sm-cell.won-cell {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.12);
}

.sm-symbol {
  line-height: 1;
  pointer-events: none;
  animation: tilePop 0.18s var(--ease-spring);
}

/* Edge Constraint Badges (= and ×) */
.sm-clue {
  position: absolute;
  z-index: 5;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-elevated);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-xs);
  font-family: var(--font-tile);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.sm-clue.right {
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
}

.sm-clue.bottom {
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
}

.sm-clue.bad {
  background: var(--danger);
  border-color: var(--danger);
  color: #FFFFFF;
}

.sm-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.sm-tip {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.85rem;
}

/* ==========================================================================
   GAME 8: WaffleSwap (5x5 Intersecting Word-Swap Grid)
   ========================================================================== */
.ws-stars {
  letter-spacing: 2px;
  font-size: 0.95rem;
}

.ws-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  width: min(340px, 100%);
  margin: 0 auto 1.25rem;
  user-select: none;
  -webkit-user-select: none;
}

.ws-hole {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: transparent;
  pointer-events: none;
}

.ws-tile {
  aspect-ratio: 1 / 1;
  border-radius: 13px;
  font-family: var(--font-tile);
  font-size: clamp(1.4rem, 5.2vw, 1.85rem);
  font-weight: 700;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  transition: transform 0.14s var(--ease-spring), box-shadow 0.15s ease, filter 0.15s ease;
}

.ws-tile.correct {
  background: linear-gradient(145deg, #10B981, #059669);
  color: #FFFFFF;
  box-shadow: 0 4px 0 #047857, 0 8px 16px -4px var(--emerald-glow);
  cursor: default;
}

.ws-tile.present {
  background: linear-gradient(145deg, #F59E0B, #D97706);
  color: #FFFFFF;
  box-shadow: 0 4px 0 #B45309, 0 8px 16px -4px var(--amber-glow);
}

.ws-tile.absent {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: 0 4px 0 var(--key-bevel);
}

.ws-tile:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.ws-tile.selected {
  transform: translateY(-4px) scale(1.07);
  border-color: var(--indigo);
  box-shadow: 0 0 0 4px var(--indigo-soft), 0 12px 22px -4px var(--indigo-glow);
  z-index: 3;
}

.ws-tile.swapped {
  animation: tilePop 0.24s var(--ease-spring);
}

.ws-tile.win-bounce {
  animation: tileBounce 0.55s var(--ease-spring);
}

.ws-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.ws-tip {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.85rem;
}

/* ==========================================================================
   NEW GAMES: Homepage Card Accents (SumMerge & PipLogic)
   ========================================================================== */
.game-card[data-game-card="summerge"] { --card-accent: #14B8A6; --card-glow: rgba(20, 184, 166, 0.30); }
.game-card[data-game-card="piplogic"] { --card-accent: #E11D48; --card-glow: rgba(225, 29, 72, 0.30); }

.icon-summerge { background: linear-gradient(135deg, #14B8A6, #0F766E); font-size: 1.05rem; }
.icon-piplogic { background: linear-gradient(135deg, #F43F5E, #BE123C); font-size: 1.65rem; }

/* ==========================================================================
   GAME 9: SumMerge (4x4 Number & Wildcard Merging)
   ========================================================================== */
.sg-board-wrap {
  width: min(356px, 100%);
  margin: 0 auto 1.2rem;
  padding: 10px;
  border-radius: 18px;
  background: var(--surface-alt);
  border: 1.5px solid var(--border-strong);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
}

.sg-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.sg-cell {
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 45%, transparent);
  border: 1.5px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-tile);
  font-size: clamp(1.25rem, 5vw, 1.65rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  position: relative;
  transition: transform 0.14s var(--ease-spring), box-shadow 0.15s ease, border-color 0.15s ease;
}

.sg-cell.occupied {
  background: var(--surface);
  border: 2px solid var(--border-strong);
  box-shadow: 0 4px 0 var(--key-bevel), inset 0 1px 0 var(--inner-highlight);
  color: var(--text);
  cursor: pointer;
}

.sg-cell.occupied:hover:not(:disabled) {
  border-color: #14B8A6;
  transform: translateY(-2px);
}

.sg-cell.wild-add {
  background: linear-gradient(145deg, #F59E0B, #D97706);
  border-color: transparent;
  box-shadow: 0 4px 0 #B45309, 0 8px 16px -4px var(--amber-glow);
  color: #FFFFFF;
}

.sg-cell.wild-mul {
  background: linear-gradient(145deg, #8B5CF6, #6D28D9);
  border-color: transparent;
  box-shadow: 0 4px 0 #5B21B6, 0 8px 16px -4px rgba(139, 92, 246, 0.35);
  color: #FFFFFF;
}

.sg-cell.selected {
  transform: translateY(-3px) scale(1.06);
  border-color: #14B8A6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.28), 0 10px 20px -4px rgba(20, 184, 166, 0.35);
  z-index: 3;
}

.sg-cell.can-merge {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px var(--emerald-glow);
}

.sg-cell.merged-pop {
  animation: tilePop 0.26s var(--ease-spring);
}

.sg-cell.hint-src {
  box-shadow: 0 0 0 4px var(--indigo);
}

.sg-cell.hint-dst {
  box-shadow: 0 0 0 4px var(--emerald);
}

.sg-cell.won-tile {
  background: linear-gradient(145deg, var(--emerald), var(--emerald-dark));
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 10px 26px -4px var(--emerald-glow);
  animation: tileBounce 0.55s var(--ease-spring);
}

.sg-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.sg-tip {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.85rem;
}

/* ==========================================================================
   GAME 10: PipLogic (4x4 Domino Constraint Puzzle)
   ========================================================================== */
:root {
  --pl-r0: rgba(244, 63, 94, 0.16);
  --pl-r1: rgba(59, 130, 246, 0.16);
  --pl-r2: rgba(16, 185, 129, 0.16);
  --pl-r3: rgba(245, 158, 11, 0.18);
  --pl-r4: rgba(139, 92, 246, 0.16);
  --pl-r5: rgba(6, 182, 212, 0.16);
}

[data-theme="dark"] {
  --pl-r0: rgba(244, 63, 94, 0.24);
  --pl-r1: rgba(59, 130, 246, 0.24);
  --pl-r2: rgba(16, 185, 129, 0.24);
  --pl-r3: rgba(245, 158, 11, 0.24);
  --pl-r4: rgba(139, 92, 246, 0.24);
  --pl-r5: rgba(6, 182, 212, 0.24);
}

.pl-board-wrap {
  width: min(352px, 100%);
  margin: 0 auto 1.15rem;
  padding: 5px;
  border-radius: 16px;
  background: var(--cg-wall, #0F172A);
  box-shadow: var(--shadow-md);
}

.pl-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-radius: 12px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.pl-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  transition: filter 0.12s ease;
}

[data-theme="dark"] .pl-cell {
  border-color: rgba(255, 255, 255, 0.12);
}

.pl-cell.r-0 { background: color-mix(in srgb, #F43F5E 18%, var(--surface)); }
.pl-cell.r-1 { background: color-mix(in srgb, #3B82F6 18%, var(--surface)); }
.pl-cell.r-2 { background: color-mix(in srgb, #10B981 18%, var(--surface)); }
.pl-cell.r-3 { background: color-mix(in srgb, #F59E0B 20%, var(--surface)); }
.pl-cell.r-4 { background: color-mix(in srgb, #8B5CF6 18%, var(--surface)); }
.pl-cell.r-5 { background: color-mix(in srgb, #06B6D4 18%, var(--surface)); }

.pl-cell.b-top    { border-top: 3px solid var(--cg-wall, #0F172A); }
.pl-cell.b-right  { border-right: 3px solid var(--cg-wall, #0F172A); }
.pl-cell.b-bottom { border-bottom: 3px solid var(--cg-wall, #0F172A); }
.pl-cell.b-left   { border-left: 3px solid var(--cg-wall, #0F172A); }

.pl-cell:hover:not(:disabled) {
  filter: brightness(1.06);
}

/* Region Condition Badge */
.pl-rule-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 6;
  min-width: 24px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-tile);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
  pointer-events: none;
}

.pl-rule-badge.ok  { background: var(--emerald); color: #FFFFFF; }
.pl-rule-badge.bad { background: var(--danger);  color: #FFFFFF; }

/* Placed Domino Half inside Grid Cell */
.pl-placed-half {
  width: 84%;
  height: 84%;
  border-radius: 10px;
  background: var(--surface-elevated);
  border: 2px solid var(--text);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  animation: tilePop 0.18s var(--ease-spring);
  pointer-events: none;
}

.pl-placed-half.link-right  { border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-right-style: dashed; }
.pl-placed-half.link-left   { border-top-left-radius: 3px;  border-bottom-left-radius: 3px;  border-left-style: dashed; }
.pl-placed-half.link-bottom { border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-bottom-style: dashed; }
.pl-placed-half.link-top    { border-top-left-radius: 3px;    border-top-right-radius: 3px;    border-top-style: dashed; }

/* 3x3 Real Domino Pip Grid */
.pip-face {
  width: 34px;
  height: 34px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  place-items: center;
  padding: 2px;
}

.pip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text);
}

.pip-dot.off {
  opacity: 0;
}

/* Domino Tray & Controls */
.pl-tray-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.pl-orient-pill {
  font-family: var(--font-tile);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.pl-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  min-height: 76px;
}

.pl-domino-btn {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: 10px;
  padding: 3px;
  box-shadow: 0 3px 0 var(--key-bevel);
  transition: transform 0.14s var(--ease-spring), border-color 0.15s ease, box-shadow 0.15s ease;
}

.pl-domino-btn.vertical {
  flex-direction: column;
}

.pl-domino-btn:hover {
  border-color: #E11D48;
  transform: translateY(-2px);
}

.pl-domino-btn.selected {
  border-color: var(--indigo);
  box-shadow: 0 0 0 4px var(--indigo-soft), 0 6px 16px -4px var(--indigo-glow);
  transform: translateY(-2px) scale(1.05);
}

.pl-domino-btn .pip-face {
  width: 28px;
  height: 28px;
}

.pl-domino-btn .pip-dot {
  width: 5.5px;
  height: 5.5px;
}

.pl-domino-divider {
  width: 1.5px;
  height: 22px;
  background: var(--border-strong);
  margin: 0 2px;
}

.pl-domino-btn.vertical .pl-domino-divider {
  width: 22px;
  height: 1.5px;
  margin: 2px 0;
}

.pl-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.pl-tip {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.85rem;
}

/* ==========================================================================
   NEW GAMES: Homepage Card Accents (DeepDive & StrandWeaver)
   ========================================================================== */
.game-card[data-game-card="deepdive"]     { --card-accent: #0EA5E9; --card-glow: rgba(14, 165, 233, 0.32); }
.game-card[data-game-card="strandweaver"] { --card-accent: #3B82F6; --card-glow: rgba(59, 130, 246, 0.30); }

.icon-deepdive     { background: linear-gradient(135deg, #0EA5E9, #0369A1); font-size: 1.5rem; }
.icon-strandweaver { background: linear-gradient(135deg, #3B82F6, #1D4ED8); font-size: 1.55rem; }

/* ==========================================================================
   GAME 11: DeepDive (Krillion-Style Rare-Answer Ocean Trivia)
   ========================================================================== */
.dd-depth-banner {
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 1.1rem;
  background: linear-gradient(135deg, #0C4A6E, #0F172A);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #F8FAFC;
  box-shadow: 0 10px 26px -8px rgba(14, 165, 233, 0.35);
}

.dd-depth-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.dd-depth-val {
  font-family: var(--font-tile);
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #38BDF8;
}

.dd-zone-tag {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  background: rgba(56, 189, 248, 0.16);
  color: #BAE6FD;
}

.dd-depth-track {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.dd-depth-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #38BDF8, #34D399, #FACC15);
  transition: width 0.5s var(--ease-smooth);
}

.dd-splash {
  text-align: center;
  padding: 1.5rem 0.75rem;
}

.dd-splash h2 {
  font-family: var(--font-tile);
  font-size: 1.45rem;
  margin-bottom: 0.5rem;
}

.dd-splash p {
  color: var(--text-muted);
  font-size: 0.94rem;
  max-width: 44ch;
  margin: 0 auto 1.25rem;
}

.dd-tier-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 1.4rem;
}

.dd-tier-chip {
  font-family: var(--font-tile);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.dd-stage {
  display: none;
}

.dd-stage.active {
  display: block;
  animation: fadeSlideUp 0.25s ease;
}

.dd-round-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
  font-family: var(--font-tile);
  font-size: 0.88rem;
  font-weight: 700;
}

.dd-timer-val {
  color: #0EA5E9;
  font-variant-numeric: tabular-nums;
}

.dd-timer-val.urgent {
  color: var(--danger);
}

.dd-timer-bar {
  width: 100%;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  overflow: hidden;
  margin-bottom: 1.1rem;
}

.dd-timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #0EA5E9, #6366F1);
  transition: width 0.2s linear, background-color 0.2s ease;
}

.dd-timer-fill.urgent {
  background: var(--danger);
}

.dd-prompt-card {
  padding: 1.25rem 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1.5px solid var(--border-strong);
  text-align: center;
  margin-bottom: 1rem;
}

.dd-prompt-kicker {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.dd-prompt-text {
  font-family: var(--font-tile);
  font-size: clamp(1.25rem, 4.2vw, 1.55rem);
  font-weight: 700;
  line-height: 1.25;
}

.dd-reveal-box {
  display: none;
  padding: 1.1rem;
  border-radius: var(--radius-md);
  text-align: center;
  background: var(--surface-alt);
  border: 1.5px solid var(--border-strong);
  margin-bottom: 1rem;
  animation: fadeSlideUp 0.28s var(--ease-spring);
}

.dd-reveal-box.show {
  display: block;
}

.dd-rarity-badge {
  display: inline-block;
  font-family: var(--font-tile);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.32rem 0.85rem;
  border-radius: var(--radius-pill);
  color: #FFFFFF;
  margin-bottom: 0.5rem;
}

.dd-rarity-badge.t-0   { background: var(--danger); }
.dd-rarity-badge.t-10  { background: var(--slate); }
.dd-rarity-badge.t-25  { background: #3B82F6; }
.dd-rarity-badge.t-40  { background: #10B981; }
.dd-rarity-badge.t-60  { background: #8B5CF6; }
.dd-rarity-badge.t-80  { background: #EC4899; }
.dd-rarity-badge.t-100 { background: linear-gradient(135deg, #F59E0B, #EA580C); box-shadow: 0 4px 16px var(--amber-glow); }

.dd-reveal-pts {
  font-family: var(--font-tile);
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.dd-reveal-gems {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.dd-log-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 1rem;
}

.dd-log-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.84rem;
}

.dd-log-ans {
  font-weight: 700;
}

.dd-log-score {
  font-family: var(--font-tile);
  font-weight: 700;
  color: #0EA5E9;
  white-space: nowrap;
}

/* ==========================================================================
   GAME 12: StrandWeaver (NYT Strands-Style 6x6 Word Path Grid)
   ========================================================================== */
.sw-theme-card {
  text-align: center;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--indigo-soft), transparent);
  border: 1px solid var(--border-strong);
  margin-bottom: 0.9rem;
}

.sw-theme-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sw-theme-title {
  font-family: var(--font-tile);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.sw-live-word {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-tile);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--indigo);
  margin-bottom: 0.65rem;
}

.sw-board-wrap {
  position: relative;
  width: min(372px, 100%);
  margin: 0 auto 1.15rem;
  padding: 10px;
  border-radius: 18px;
  background: var(--surface-alt);
  border: 1.5px solid var(--border-strong);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
}

.sw-svg-layer {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  pointer-events: none;
  z-index: 1;
}

.sw-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.sw-cell {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  box-shadow: 0 2px 0 var(--key-bevel);
  font-family: var(--font-tile);
  font-size: clamp(1.1rem, 4.5vw, 1.4rem);
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s var(--ease-spring), background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sw-cell.selecting {
  background: var(--indigo);
  border-color: var(--indigo);
  color: #FFFFFF;
  transform: scale(1.08);
  box-shadow: 0 4px 14px var(--indigo-glow);
}

.sw-cell.found-theme {
  background: linear-gradient(135deg, #38BDF8, #2563EB);
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.sw-cell.found-spangram {
  background: linear-gradient(135deg, #FACC15, #D97706);
  border-color: transparent;
  color: #18181B;
  box-shadow: 0 4px 14px var(--amber-glow);
}

.sw-cell.hint-pulse {
  border: 2.5px dashed var(--amber);
  box-shadow: 0 0 0 3px var(--amber-glow);
}

.sw-found-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  min-height: 30px;
}

.sw-pill {
  font-family: var(--font-tile);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.68rem;
  border-radius: var(--radius-pill);
  background: rgba(59, 130, 246, 0.14);
  color: #2563EB;
  border: 1px solid rgba(59, 130, 246, 0.32);
  animation: fadeSlideUp 0.2s ease;
}

[data-theme="dark"] .sw-pill {
  color: #93C5FD;
}

.sw-pill.spangram {
  background: rgba(245, 158, 11, 0.18);
  color: #B45309;
  border-color: rgba(245, 158, 11, 0.45);
}

[data-theme="dark"] .sw-pill.spangram {
  color: #FDE047;
}

.sw-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.sw-tip {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.85rem;
}

/* ==========================================================================
   Homepage Category Filter Bar & 14-Game Scaling Enhancements
   ========================================================================== */
.hub-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.65rem;
}

.filter-pill {
  padding: 0.48rem 1.05rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs), inset 0 1px 0 var(--inner-highlight);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.18s var(--ease-smooth);
}

.filter-pill:hover:not(.active) {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.filter-pill.active {
  background: linear-gradient(135deg, var(--indigo), var(--indigo-hover));
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 6px 16px -4px var(--indigo-glow);
}

.game-card.is-hidden {
  display: none;
}

@media (min-width: 960px) {
  .overview-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .modal-card:has(.overview-list) {
    width: min(560px, 100%);
  }
}

/* ==========================================================================
   NEW GAMES: Homepage Card Accents (SpellHive & MiniDoku)
   ========================================================================== */
.game-card[data-game-card="spellhive"] { --card-accent: #D97706; --card-glow: rgba(245, 158, 11, 0.34); }
.game-card[data-game-card="minidoku"]  { --card-accent: #2563EB; --card-glow: rgba(37, 99, 235, 0.32); }

.icon-spellhive { background: linear-gradient(135deg, #F59E0B, #B45309); font-size: 1.55rem; }
.icon-minidoku  { background: linear-gradient(135deg, #3B82F6, #1D4ED8); font-size: 1.05rem; }

/* ==========================================================================
   GAME 13: SpellHive (7-Letter Honeycomb Word Builder)
   ========================================================================== */
.sh-rank-card {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

.sh-rank-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.sh-rank-name {
  font-family: var(--font-tile);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.sh-rank-score {
  font-family: var(--font-tile);
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #D97706;
}

[data-theme="dark"] .sh-rank-score {
  color: #FBBF24;
}

.sh-progress-track {
  position: relative;
  width: 100%;
  height: 9px;
  border-radius: var(--radius-pill);
  background: var(--border);
  overflow: hidden;
}

.sh-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #F59E0B, #FACC15, #10B981);
  transition: width 0.35s var(--ease-smooth);
}

.sh-goal-note {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.42rem;
}

.sh-input-stage {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: var(--font-tile);
  font-size: clamp(1.6rem, 6vw, 2.05rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  user-select: none;
}

.sh-input-placeholder {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-muted);
  font-weight: 600;
  opacity: 0.7;
}

.sh-char-center {
  color: #D97706;
}

[data-theme="dark"] .sh-char-center {
  color: #FBBF24;
}

.sh-char-bad {
  color: var(--danger);
  opacity: 0.75;
}

.sh-cursor {
  display: inline-block;
  width: 2.5px;
  height: 1.1em;
  background: #F59E0B;
  border-radius: 2px;
  margin-left: 2px;
  animation: shBlink 1s steps(1) infinite;
}

@keyframes shBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Geometric 7-Cell Honeycomb */
.sh-hive {
  position: relative;
  width: 244px;
  height: 248px;
  margin: 0.25rem auto 1.25rem;
  user-select: none;
  -webkit-user-select: none;
}

.sh-hex {
  --tx: 0px;
  --ty: 0px;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 82px;
  height: 72px;
  transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty)));
  clip-path: polygon(25% 4%, 75% 4%, 98% 50%, 75% 96%, 25% 96%, 2% 50%);
  background: var(--surface-alt);
  color: var(--text);
  font-family: var(--font-tile);
  font-size: 1.55rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  transition: transform 0.1s var(--ease-spring), filter 0.14s ease, background-color 0.15s ease;
  filter: drop-shadow(0 3px 0 var(--key-bevel));
}

.sh-hex:hover {
  background: var(--surface-hover);
  filter: brightness(1.04);
}

.sh-hex:active,
.sh-hex.pressed {
  transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.9);
}

.sh-hex.center {
  background: linear-gradient(145deg, #FACC15, #EAB308);
  color: #18181B;
  z-index: 2;
}

.sh-hex.pos-0 { --tx: 0px;   --ty: -80px; }
.sh-hex.pos-1 { --tx: 69px;  --ty: -40px; }
.sh-hex.pos-2 { --tx: 69px;  --ty: 40px;  }
.sh-hex.pos-3 { --tx: 0px;   --ty: 80px;  }
.sh-hex.pos-4 { --tx: -69px; --ty: 40px;  }
.sh-hex.pos-5 { --tx: -69px; --ty: -40px; }

.sh-hex.shuffling {
  animation: shSpinPop 0.24s var(--ease-spring);
}

@keyframes shSpinPop {
  0%   { opacity: 0.45; }
  50%  { opacity: 0.2; }
  100% { opacity: 1; }
}

.sh-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
}

.sh-found-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.95rem;
}

.sh-found-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
}

.sh-found-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  max-height: 150px;
  overflow-y: auto;
}

.sh-word-pill {
  font-family: var(--font-tile);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.24rem 0.62rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  animation: fadeSlideUp 0.2s ease;
}

.sh-word-pill.pangram {
  background: linear-gradient(135deg, #FACC15, #F59E0B);
  border-color: transparent;
  color: #18181B;
  box-shadow: 0 3px 10px var(--amber-glow);
}

.sh-tip {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.85rem;
}

/* ==========================================================================
   GAME 14: MiniDoku (6x6 Mini Sudoku with 2x3 Boxes & Pencil Notes)
   ========================================================================== */
.md-board-wrap {
  width: min(378px, 100%);
  margin: 0 auto 1.15rem;
  padding: 4px;
  border-radius: 16px;
  background: var(--cg-wall, #0F172A);
  box-shadow: var(--shadow-md);
}

.md-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  user-select: none;
  -webkit-user-select: none;
}

.md-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-tile);
  font-size: clamp(1.3rem, 5.4vw, 1.75rem);
  font-weight: 700;
  color: #2563EB;
  transition: background-color 0.12s ease, color 0.12s ease;
}

[data-theme="dark"] .md-cell {
  color: #60A5FA;
}

/* Thick 2x3 Sudoku Box Dividers */
.md-cell.b-right  { border-right: 3px solid var(--cg-wall, #0F172A); }
.md-cell.b-bottom { border-bottom: 3px solid var(--cg-wall, #0F172A); }

.md-cell.given {
  background: var(--surface-alt);
  color: var(--text);
}

.md-cell.peer {
  background: color-mix(in srgb, #3B82F6 10%, var(--surface));
}

.md-cell.given.peer {
  background: color-mix(in srgb, #3B82F6 14%, var(--surface-alt));
}

.md-cell.same-num {
  background: color-mix(in srgb, #3B82F6 24%, var(--surface));
}

.md-cell.selected {
  background: color-mix(in srgb, #3B82F6 30%, var(--surface)) !important;
  box-shadow: inset 0 0 0 2.5px #2563EB;
  z-index: 2;
}

.md-cell.conflict {
  background: rgba(239, 68, 68, 0.22) !important;
  color: var(--danger) !important;
  animation: rowShake 0.32s ease;
}

.md-cell.won-cell {
  background: rgba(16, 185, 129, 0.16) !important;
  color: var(--emerald-dark);
}

[data-theme="dark"] .md-cell.won-cell {
  color: #34D399;
}

.md-cell.pop-val {
  animation: tilePop 0.18s var(--ease-spring);
}

/* 3x2 Pencil Notes Grid inside Empty Cells */
.md-notes {
  position: absolute;
  inset: 3px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  place-items: center;
  pointer-events: none;
}

.md-note {
  font-family: var(--font-tile);
  font-size: clamp(0.56rem, 2vw, 0.72rem);
  font-weight: 700;
  line-height: 1;
  color: var(--text-muted);
  opacity: 0;
}

.md-note.on {
  opacity: 0.92;
}

/* Number Pad (1-6) */
.md-numpad {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  max-width: 396px;
  margin: 0 auto 1rem;
}

.md-num-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 58px;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1.5px solid var(--border-strong);
  box-shadow: 0 3px 0 var(--key-bevel), inset 0 1px 0 var(--inner-highlight);
  font-family: var(--font-tile);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  gap: 3px;
  transition: transform 0.1s var(--ease-spring), border-color 0.15s ease, opacity 0.15s ease;
}

.md-num-btn:hover:not(:disabled) {
  border-color: #2563EB;
  transform: translateY(-2px);
}

.md-num-btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.95);
}

.md-num-btn .rem {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--text-muted);
}

.md-num-btn.done {
  opacity: 0.36;
}

.md-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.btn-notes-on {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 6px 16px -4px rgba(37, 99, 235, 0.35);
}

.md-tip {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.85rem;
}

/* ==========================================================================
   NEW GAMES: Homepage Card Accents (PatchGrid & BlockRush)
   ========================================================================== */
.game-card[data-game-card="patchgrid"] { --card-accent: #65A30D; --card-glow: rgba(132, 204, 22, 0.32); }
.game-card[data-game-card="blockrush"] { --card-accent: #C026D3; --card-glow: rgba(192, 38, 211, 0.34); }

.icon-patchgrid { background: linear-gradient(135deg, #84CC16, #4D7C0F); font-size: 1.55rem; }
.icon-blockrush { background: linear-gradient(135deg, #D946EF, #9333EA); font-size: 1.5rem; }

/* ==========================================================================
   GAME 15: PatchGrid (6x6 Spatial Rectangle-Tiling Puzzle)
   ========================================================================== */
.pg-status-line {
  text-align: center;
  min-height: 24px;
  font-family: var(--font-tile);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.pg-status-line.valid { color: var(--emerald-dark); }
[data-theme="dark"] .pg-status-line.valid { color: #34D399; }
.pg-status-line.invalid { color: var(--danger); }

.pg-board-wrap {
  width: min(378px, 100%);
  margin: 0 auto 1.15rem;
  padding: 5px;
  border-radius: 16px;
  background: var(--cg-wall, #0F172A);
  box-shadow: var(--shadow-md);
}

.pg-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.pg-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: crosshair;
  transition: background-color 0.1s ease, filter 0.1s ease;
}

[data-theme="dark"] .pg-cell {
  border-color: rgba(255, 255, 255, 0.12);
}

.pg-cell.c-0 { background: #FEE2E2; color: #7F1D1D; }
.pg-cell.c-1 { background: #DBEAFE; color: #1E3A8A; }
.pg-cell.c-2 { background: #DCFCE7; color: #14532D; }
.pg-cell.c-3 { background: #FEF3C7; color: #78350F; }
.pg-cell.c-4 { background: #F3E8FF; color: #581C87; }
.pg-cell.c-5 { background: #CFFAFE; color: #164E63; }
.pg-cell.c-6 { background: #FCE7F3; color: #831843; }
.pg-cell.c-7 { background: #ECFCCB; color: #365314; }
.pg-cell.c-8 { background: #E0E7FF; color: #312E81; }

[data-theme="dark"] .pg-cell.c-0 { background: #7F1D1D; color: #FEE2E2; }
[data-theme="dark"] .pg-cell.c-1 { background: #1E3A8A; color: #DBEAFE; }
[data-theme="dark"] .pg-cell.c-2 { background: #14532D; color: #DCFCE7; }
[data-theme="dark"] .pg-cell.c-3 { background: #78350F; color: #FEF3C7; }
[data-theme="dark"] .pg-cell.c-4 { background: #581C87; color: #F3E8FF; }
[data-theme="dark"] .pg-cell.c-5 { background: #164E63; color: #CFFAFE; }
[data-theme="dark"] .pg-cell.c-6 { background: #831843; color: #FCE7F3; }
[data-theme="dark"] .pg-cell.c-7 { background: #365314; color: #ECFCCB; }
[data-theme="dark"] .pg-cell.c-8 { background: #312E81; color: #E0E7FF; }

/* Crisp Patch Perimeter Borders */
.pg-cell.p-top    { border-top: 3px solid var(--cg-wall, #0F172A); }
.pg-cell.p-right  { border-right: 3px solid var(--cg-wall, #0F172A); }
.pg-cell.p-bottom { border-bottom: 3px solid var(--cg-wall, #0F172A); }
.pg-cell.p-left   { border-left: 3px solid var(--cg-wall, #0F172A); }

.pg-cell.preview-valid {
  box-shadow: inset 0 0 0 2.5px var(--emerald);
  background: color-mix(in srgb, var(--emerald) 26%, var(--surface)) !important;
}

.pg-cell.preview-invalid {
  box-shadow: inset 0 0 0 2.5px var(--danger);
  background: color-mix(in srgb, var(--danger) 24%, var(--surface)) !important;
}

.pg-clue-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 2px 5px;
  border-radius: 9px;
  background: var(--surface-elevated);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-xs);
  color: var(--text);
  line-height: 1;
  pointer-events: none;
  gap: 2px;
}

.pg-cell.covered .pg-clue-badge {
  background: rgba(255, 255, 255, 0.88);
  color: #0F172A;
  border-color: rgba(15, 23, 42, 0.25);
}

.pg-clue-num {
  font-family: var(--font-tile);
  font-size: 0.95rem;
  font-weight: 700;
}

.pg-clue-shape {
  display: inline-block;
  border: 1.8px solid currentColor;
  border-radius: 2px;
}

.pg-clue-shape.square { width: 10px; height: 10px; }
.pg-clue-shape.wide   { width: 14px; height: 7px;  }
.pg-clue-shape.tall   { width: 7px;  height: 13px; }

.pg-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.pg-tip {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.85rem;
}

/* ==========================================================================
   GAME 16: BlockRush (8x8 Polyomino Line-Blast Arcade Puzzle)
   ========================================================================== */
.br-target-bar {
  margin-bottom: 0.95rem;
}

.br-target-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-tile);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.br-target-track {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  overflow: hidden;
}

.br-target-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #D946EF, #8B5CF6, #10B981);
  transition: width 0.3s var(--ease-smooth);
}

.br-board-wrap {
  width: min(376px, 100%);
  margin: 0 auto 1.15rem;
  padding: 8px;
  border-radius: 18px;
  background: var(--surface-alt);
  border: 1.5px solid var(--border-strong);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
}

.br-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.br-cell {
  aspect-ratio: 1 / 1;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.14s var(--ease-spring), background-color 0.12s ease, box-shadow 0.12s ease;
}

.br-cell.filled {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 2px 1px rgba(255, 255, 255, 0.35), inset 0 -2px 2px rgba(0, 0, 0, 0.22);
}

.br-b0 { background: linear-gradient(145deg, #F43F5E, #BE123C) !important; }
.br-b1 { background: linear-gradient(145deg, #3B82F6, #1D4ED8) !important; }
.br-b2 { background: linear-gradient(145deg, #10B981, #047857) !important; }
.br-b3 { background: linear-gradient(145deg, #F59E0B, #B45309) !important; }
.br-b4 { background: linear-gradient(145deg, #A855F7, #6D28D9) !important; }
.br-b5 { background: linear-gradient(145deg, #06B6D4, #0E7490) !important; }
.br-b6 { background: linear-gradient(145deg, #EC4899, #9D174D) !important; }

.br-cell.ghost-ok {
  background: color-mix(in srgb, var(--indigo) 45%, var(--surface)) !important;
  border: 2px dashed var(--indigo);
}

.br-cell.ghost-bad {
  background: rgba(239, 68, 68, 0.28) !important;
  border: 2px dashed var(--danger);
}

.br-cell.will-clear {
  box-shadow: 0 0 0 2px #FACC15, inset 0 0 12px rgba(250, 204, 21, 0.55) !important;
  filter: brightness(1.18);
}

.br-cell.clearing {
  animation: brBlast 0.32s var(--ease-smooth) forwards;
}

@keyframes brBlast {
  0%   { transform: scale(1.12); filter: brightness(1.6); }
  100% { transform: scale(0.2); opacity: 0; }
}

/* 3-Slot Piece Tray */
.br-tray {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 396px;
  margin: 0 auto 1.1rem;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.br-slot {
  min-height: 98px;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  cursor: grab;
  transition: transform 0.14s var(--ease-spring), border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.br-slot:hover:not(.empty):not(.unplayable) {
  border-color: #C026D3;
  transform: translateY(-2px);
}

.br-slot.selected {
  border-color: #C026D3;
  box-shadow: 0 0 0 4px rgba(192, 38, 211, 0.22);
  transform: translateY(-3px) scale(1.03);
}

.br-slot.dragging {
  opacity: 0.3;
  cursor: grabbing;
}

.br-slot.empty {
  opacity: 0.35;
  cursor: default;
  border-style: dashed;
}

.br-slot.unplayable {
  opacity: 0.35;
  filter: grayscale(0.75);
}

.br-mini-grid {
  display: grid;
  gap: 3px;
  pointer-events: none;
}

.br-mini-block {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, 0.35), inset 0 -1.5px 1px rgba(0, 0, 0, 0.2);
}

.br-mini-empty {
  width: 17px;
  height: 17px;
}

/* Floating Drag Ghost */
.br-drag-float {
  position: fixed;
  z-index: 250;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.12);
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.35));
}

.br-drag-float .br-mini-block,
.br-drag-float .br-mini-empty {
  width: 30px;
  height: 30px;
  border-radius: 6px;
}

.br-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.br-tip {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.85rem;
}

/* ==========================================================================
   NEW GAMES: Homepage Card Accents (ClimbRung & EqPulse)
   ========================================================================== */
.game-card[data-game-card="climbrung"] { --card-accent: #0EA5E9; --card-glow: rgba(14, 165, 233, 0.32); }
.game-card[data-game-card="eqpulse"]   { --card-accent: #7C3AED; --card-glow: rgba(124, 58, 237, 0.34); }

.icon-climbrung { background: linear-gradient(135deg, #0EA5E9, #2563EB); font-size: 1.5rem; }
.icon-eqpulse   { background: linear-gradient(135deg, #8B5CF6, #6D28D9); font-size: 1.25rem; }

/* ==========================================================================
   GAME 17: ClimbRung (Crossclimb-Style Trivia Word Ladder)
   ========================================================================== */
.cr-phase-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 1rem;
}

.cr-step {
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  text-align: center;
  font-family: var(--font-tile);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.cr-step.active {
  background: var(--indigo-soft);
  border-color: var(--indigo);
  color: var(--indigo);
}

[data-theme="dark"] .cr-step.active {
  color: #C7D2FE;
}

.cr-step.done {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.38);
  color: var(--emerald-dark);
}

[data-theme="dark"] .cr-step.done {
  color: #34D399;
}

.cr-clue-banner {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(99, 102, 241, 0.08));
  border: 1.5px solid color-mix(in srgb, #0EA5E9 45%, var(--border));
  text-align: center;
  margin-bottom: 1rem;
}

.cr-clue-kicker {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0284C7;
  margin-bottom: 0.2rem;
}

[data-theme="dark"] .cr-clue-kicker {
  color: #38BDF8;
}

.cr-clue-text {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text);
}

.cr-ladder {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 440px;
  margin: 0 auto 1.1rem;
}

.cr-rung {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.52rem 0.65rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  transition: transform 0.14s var(--ease-spring), border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.cr-rung:hover:not(.locked) {
  border-color: var(--border-strong);
}

.cr-rung.active {
  border-color: #0EA5E9;
  background: color-mix(in srgb, #0EA5E9 10%, var(--surface));
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.cr-rung.solved {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
}

.cr-rung.swap-selected {
  border-color: var(--amber);
  background: rgba(245, 158, 11, 0.14);
  box-shadow: 0 0 0 3px var(--amber-glow);
  transform: scale(1.02);
}

.cr-rung.locked {
  opacity: 0.58;
  cursor: default;
  border-style: dashed;
}

.cr-rung.capstone:not(.locked) {
  border-color: color-mix(in srgb, var(--amber) 55%, var(--border));
  background: color-mix(in srgb, var(--amber) 9%, var(--surface));
}

.cr-rung.capstone.solved {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.14);
}

.cr-rung-tag {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-family: var(--font-tile);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.cr-rung.solved .cr-rung-tag {
  background: var(--emerald);
  border-color: transparent;
  color: #FFFFFF;
}

.cr-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  flex: 1;
  max-width: 196px;
}

.cr-tile {
  height: 40px;
  border-radius: 9px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  font-family: var(--font-tile);
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.cr-tile.cursor {
  border-color: #0EA5E9;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.25);
}

.cr-tile.hinted {
  color: #0284C7;
  border-color: rgba(14, 165, 233, 0.45);
}

[data-theme="dark"] .cr-tile.hinted {
  color: #38BDF8;
}

.cr-rung.solved .cr-tile {
  background: linear-gradient(145deg, #10B981, #059669);
  border-color: transparent;
  color: #FFFFFF;
}

.cr-rung-meta {
  flex: 1;
  min-width: 0;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cr-move-btns {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.cr-move-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-family: var(--font-tile);
  font-weight: 700;
  font-size: 0.95rem;
  display: grid;
  place-items: center;
  transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.cr-move-btn:hover:not(:disabled) {
  border-color: #0EA5E9;
  background: var(--surface-hover);
}

.cr-move-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.cr-link-row {
  display: flex;
  justify-content: center;
  margin: -2px 0;
  z-index: 2;
}

.cr-link-pill {
  font-family: var(--font-tile);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}

.cr-link-pill.ok {
  background: rgba(16, 185, 129, 0.16);
  border-color: var(--emerald);
  color: var(--emerald-dark);
}

[data-theme="dark"] .cr-link-pill.ok {
  color: #34D399;
}

.cr-link-pill.bad {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
}

.cr-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.cr-keyboard.hidden {
  display: none;
}

.cr-tip {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.8rem;
}

/* ==========================================================================
   GAME 18: EqPulse (Nerdle-Style 8-Tile Daily Equation Guesser)
   ========================================================================== */
.ep-hint-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.ep-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(444px, 100%);
  margin: 0 auto 1.25rem;
  perspective: 900px;
}

.ep-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.ep-tile {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-tile);
  font-size: clamp(1.1rem, 4.4vw, 1.55rem);
  font-weight: 700;
  line-height: 1;
  border-radius: 10px;
  border: 2px solid var(--border-strong);
  background: var(--surface-alt);
  color: var(--text);
  box-shadow: inset 0 1px 0 var(--inner-highlight);
  user-select: none;
  transform-style: preserve-3d;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}

.ep-tile.is-active {
  border-color: #7C3AED;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.22);
}

.ep-tile.filled {
  border-color: var(--text-muted);
  background: var(--surface);
  animation: tilePop 0.14s var(--ease-spring);
}

.ep-tile.flip {
  animation: tileFlip 0.52s var(--ease-smooth) forwards;
}

.ep-tile.win-bounce {
  animation: tileBounce 0.55s var(--ease-spring);
}

.ep-tile.correct {
  background: linear-gradient(145deg, #10B981, #059669);
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 6px 14px -4px var(--emerald-glow);
}

.ep-tile.present {
  background: linear-gradient(145deg, #F59E0B, #D97706);
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 6px 14px -4px var(--amber-glow);
}

.ep-tile.absent {
  background: var(--slate);
  border-color: transparent;
  color: #FFFFFF;
  opacity: 0.85;
}

.ep-keypad {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 470px;
  margin: 0 auto;
}

.ep-key-row {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.ep-key {
  flex: 1;
  height: 50px;
  min-width: 28px;
  border-radius: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  box-shadow: 0 3px 0 var(--key-bevel), inset 0 1px 0 var(--inner-highlight);
  font-family: var(--font-tile);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease, color 0.15s ease;
}

.ep-key:hover {
  background: var(--surface-hover);
}

.ep-key:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--key-bevel);
}

.ep-key.op {
  background: color-mix(in srgb, #7C3AED 12%, var(--surface-alt));
  color: #6D28D9;
  font-size: 1.2rem;
}

[data-theme="dark"] .ep-key.op {
  color: #C4B5FD;
}

.ep-key.wide {
  flex: 1.65;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

.ep-key.correct {
  background: var(--emerald);
  border-color: transparent;
  box-shadow: 0 3px 0 var(--emerald-dark);
  color: #FFFFFF;
}

.ep-key.present {
  background: var(--amber);
  border-color: transparent;
  box-shadow: 0 3px 0 var(--amber-dark);
  color: #FFFFFF;
}

.ep-key.absent {
  background: var(--slate);
  border-color: transparent;
  box-shadow: 0 3px 0 rgba(15, 23, 42, 0.35);
  color: #FFFFFF;
  opacity: 0.52;
}

@media (max-width: 480px) {
  .ep-row { gap: 4px; }
  .ep-tile { border-radius: 8px; }
  .ep-key-row { gap: 4px; }
  .ep-key { height: 46px; font-size: 0.94rem; border-radius: 8px; }
  .cr-tile { height: 36px; font-size: 1.05rem; }
  .cr-rung-meta { display: none; }
}

/* ==========================================================================
   NEW VIRAL TOOLS: Homepage Card Accents (ReflexLab & ChimpLab)
   ========================================================================== */
.game-card[data-game-card="reflexlab"] { --card-accent: #10B981; --card-glow: rgba(16, 185, 129, 0.34); }
.game-card[data-game-card="chimplab"]  { --card-accent: #F43F5E; --card-glow: rgba(244, 63, 94, 0.34); }

.icon-reflexlab { background: linear-gradient(135deg, #10B981, #047857); font-size: 1.55rem; }
.icon-chimplab  { background: linear-gradient(135deg, #F43F5E, #BE123C); font-size: 1.55rem; }

/* ==========================================================================
   TOOL 1: ReflexLab (Millisecond Reaction Time + Go/No-Go Benchmark)
   ========================================================================== */
.rl-submode-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.rl-tab-btn {
  padding: 0.42rem 0.95rem;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-family: var(--font-tile);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.16s ease;
}

.rl-tab-btn.active {
  background: var(--text);
  color: var(--bg);
  border-color: transparent;
}

.rl-stage {
  width: 100%;
  min-height: 280px;
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.6rem;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  cursor: pointer;
  border: 2px solid var(--border-strong);
  background: linear-gradient(145deg, var(--indigo), var(--indigo-hover));
  color: #FFFFFF;
  box-shadow: var(--shadow-md);
  transition: transform 0.08s ease, background 0.08s ease, border-color 0.08s ease;
}

.rl-stage:active {
  transform: scale(0.99);
}

.rl-stage.state-wait {
  background: linear-gradient(145deg, #DC2626, #991B1B);
  border-color: rgba(255, 255, 255, 0.2);
}

.rl-stage.state-go {
  background: linear-gradient(145deg, #10B981, #059669);
  border-color: #6EE7B7;
  box-shadow: 0 0 0 6px var(--emerald-glow), var(--shadow-md);
}

.rl-stage.state-nogo {
  background: linear-gradient(145deg, #EA580C, #C2410C);
  border-color: #FDBA74;
}

.rl-stage.state-early {
  background: linear-gradient(145deg, #F59E0B, #B45309);
  border-color: #FDE68A;
}

.rl-stage.state-result {
  background: linear-gradient(145deg, #1E293B, #0F172A);
  border-color: var(--indigo);
}

.rl-stage-icon {
  font-size: 2.8rem;
  line-height: 1;
}

.rl-stage-big {
  font-family: var(--font-tile);
  font-size: clamp(2rem, 8vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.rl-stage-sub {
  font-size: 0.96rem;
  font-weight: 600;
  opacity: 0.92;
  max-width: 34ch;
}

.rl-trials-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 1.1rem;
}

.rl-trials-strip.cols-10 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.rl-trial-chip {
  padding: 0.55rem 0.35rem;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  text-align: center;
  font-family: var(--font-tile);
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.rl-trial-chip.done {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--emerald-dark);
}

[data-theme="dark"] .rl-trial-chip.done {
  color: #34D399;
}

.rl-trial-chip.miss {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
}

.rl-rank-card {
  display: none;
  margin-top: 1rem;
  padding: 1.05rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1.5px solid var(--border-strong);
  text-align: center;
  animation: fadeSlideUp 0.25s ease;
}

.rl-rank-card.show {
  display: block;
}

.rl-rank-badge {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
  color: #FFFFFF;
  font-family: var(--font-tile);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.rl-rank-metrics {
  font-family: var(--font-tile);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.7rem;
}

.rl-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.rl-tip {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.8rem;
}

/* ==========================================================================
   TOOL 2: ChimpLab (Ayumu Photographic Working-Memory Grid)
   ========================================================================== */
.cl-strikes {
  letter-spacing: 2px;
}

.cl-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  font-size: 0.86rem;
  font-weight: 700;
}

.cl-rank-pill {
  font-family: var(--font-tile);
  font-size: 0.76rem;
  padding: 0.24rem 0.7rem;
  border-radius: var(--radius-pill);
  background: rgba(244, 63, 94, 0.14);
  color: #E11D48;
  border: 1px solid rgba(244, 63, 94, 0.32);
  white-space: nowrap;
}

[data-theme="dark"] .cl-rank-pill {
  color: #FDA4AF;
}

.cl-board-wrap {
  width: min(392px, 100%);
  margin: 0 auto 1.15rem;
  padding: 10px;
  border-radius: 18px;
  background: var(--surface-alt);
  border: 1.5px solid var(--border-strong);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
}

.cl-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  user-select: none;
  -webkit-user-select: none;
}

.cl-cell {
  aspect-ratio: 1 / 1;
  border-radius: 13px;
  border: 2px solid transparent;
  background: transparent;
  font-family: var(--font-tile);
  font-size: clamp(1.3rem, 5.2vw, 1.75rem);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s var(--ease-spring), background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.cl-cell.empty {
  background: color-mix(in srgb, var(--surface) 38%, transparent);
  border: 1.5px dashed var(--border);
  pointer-events: none;
}

.cl-cell.visible-num {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: 0 4px 0 var(--key-bevel), inset 0 1px 0 var(--inner-highlight);
  cursor: pointer;
}

.cl-cell.visible-num:hover {
  border-color: #F43F5E;
  transform: translateY(-2px);
}

.cl-cell.visible-num.first-num {
  border-color: #F43F5E;
  box-shadow: 0 4px 0 #BE123C, 0 0 0 3px rgba(244, 63, 94, 0.22);
}

.cl-cell.hidden-num {
  background: linear-gradient(145deg, var(--indigo), var(--indigo-hover));
  border-color: rgba(255, 255, 255, 0.22);
  color: transparent;
  box-shadow: 0 4px 0 #3730A3, 0 6px 14px -4px var(--indigo-glow);
  cursor: pointer;
}

.cl-cell.hidden-num:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.cl-cell.cleared {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
  color: var(--emerald-dark);
  pointer-events: none;
  animation: tilePop 0.2s var(--ease-spring);
}

[data-theme="dark"] .cl-cell.cleared {
  color: #34D399;
}

.cl-cell.wrong {
  background: linear-gradient(145deg, #EF4444, #B91C1C);
  border-color: transparent;
  color: #FFFFFF;
  animation: rowShake 0.38s ease;
}

.cl-cell.missed-reveal {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--amber);
  color: var(--text);
}

.cl-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.cl-tip {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.85rem;
}

/* ==========================================================================
   Homepage Toolbar (Search, Random Unsolved & Pill Counters)
   ========================================================================== */
.hub-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  max-width: 660px;
  margin: 1.35rem auto 0;
}

.hub-search-wrap {
  position: relative;
  flex: 1 1 250px;
  max-width: 340px;
}

.hub-search-wrap svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.hub-search-input {
  width: 100%;
  height: 40px;
  padding: 0 0.95rem 0 2.45rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-xs), inset 0 1px 0 var(--inner-highlight);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hub-search-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.hub-search-input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-soft);
  outline: none;
}

.pill-count {
  display: inline-block;
  margin-left: 0.28rem;
  padding: 0.05rem 0.42rem;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  font-family: var(--font-tile);
  font-size: 0.72rem;
  opacity: 0.85;
}

.filter-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  opacity: 1;
}

.hub-empty-state {
  text-align: center;
  padding: 2.2rem 1rem;
  margin-bottom: 2.5rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
}

.hub-empty-state p {
  font-weight: 600;
  margin-bottom: 0.85rem;
}

/* ==========================================================================
   Detailed SEO About Section (Editorial Card Architecture)
   ========================================================================== */
.about-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--inner-highlight);
}

.about-header {
  max-width: 760px;
  margin-bottom: 1.85rem;
}

.about-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--indigo-soft);
  border: 1px solid color-mix(in srgb, var(--indigo) 26%, transparent);
  color: var(--indigo);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

[data-theme="dark"] .about-eyebrow {
  color: #A5B4FC;
}

.about-header h2 {
  font-family: var(--font-tile);
  font-size: clamp(1.5rem, 3.6vw, 2.05rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.8rem;
  color: var(--text);
}

.about-lead {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.68;
}

.about-lead strong {
  color: var(--text);
  font-weight: 700;
}

.about-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.about-pillar {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.15rem;
  box-shadow: inset 0 1px 0 var(--inner-highlight);
}

.about-pillar-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow-xs);
}

.about-pillar h3 {
  font-family: var(--font-tile);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.about-pillar p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.58;
}

.about-pillar code {
  font-family: var(--font-tile);
  font-size: 0.82rem;
  padding: 0.08rem 0.35rem;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.about-catalog {
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  margin-bottom: 1.75rem;
}

.about-catalog h3 {
  font-family: var(--font-tile);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
}

.about-catalog-intro {
  color: var(--text-muted);
  font-size: 0.94rem;
  max-width: 72ch;
  margin-bottom: 1.2rem;
}

.about-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.about-cat-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.2rem;
}

.about-cat-card h4 {
  font-family: var(--font-tile);
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.about-cat-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.62;
}

.about-cat-card a {
  color: var(--indigo);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--indigo) 35%, transparent);
  transition: color 0.15s ease, border-color 0.15s ease;
}

[data-theme="dark"] .about-cat-card a {
  color: #A5B4FC;
}

.about-cat-card a:hover {
  border-bottom-color: currentColor;
}

.about-meta-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.about-meta-item {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 0.75rem;
  text-align: center;
}

.about-meta-item strong {
  display: block;
  font-family: var(--font-tile);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
}

.about-meta-item span {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

@media (max-width: 820px) {
  .about-highlights {
    grid-template-columns: 1fr;
  }
  .about-cat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .about-section {
    padding: 1.5rem 1.15rem;
  }
  .about-meta-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ==========================================================================
   Why MindPuzz Comparison Section
   ========================================================================== */
.compare-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--inner-highlight);
}

.compare-header {
  max-width: 760px;
  margin-bottom: 1.75rem;
}

.compare-header h2 {
  font-family: var(--font-tile);
  font-size: clamp(1.5rem, 3.6vw, 2.05rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.8rem;
  color: var(--text);
}

/* Responsive Comparison Table */
.compare-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface-alt);
  margin-bottom: 2rem;
  -webkit-overflow-scrolling: touch;
}

.compare-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.compare-table thead th {
  font-family: var(--font-tile);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.95rem 1rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface-alt);
}

.compare-table tbody th,
.compare-table tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td {
  border-bottom: none;
}

.compare-table tbody th {
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
}

.compare-table tbody td {
  color: var(--text-muted);
  background: var(--surface);
}

/* Highlighted MindPuzz Column */
.compare-table thead th.col-mp {
  background: linear-gradient(135deg, var(--indigo), var(--indigo-hover));
  color: #FFFFFF;
}

.compare-table tbody td.col-mp {
  background: color-mix(in srgb, var(--indigo) 8%, var(--surface));
  color: var(--text);
  font-weight: 700;
  border-left: 1px solid color-mix(in srgb, var(--indigo) 24%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--indigo) 24%, transparent);
}

.cmp-yes,
.cmp-no,
.cmp-mid {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-family: var(--font-tile);
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.cmp-yes {
  background: rgba(16, 185, 129, 0.16);
  color: var(--emerald-dark);
}

[data-theme="dark"] .cmp-yes {
  color: #34D399;
}

.cmp-no {
  background: rgba(239, 68, 68, 0.14);
  color: var(--danger);
}

.cmp-mid {
  background: rgba(245, 158, 11, 0.16);
  color: var(--amber-dark);
}

[data-theme="dark"] .cmp-mid {
  color: #FBBF24;
}

/* 6 Advantage Cards Grid */
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.why-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.2rem;
  box-shadow: inset 0 1px 0 var(--inner-highlight);
  transition: border-color 0.2s ease, transform 0.2s var(--ease-smooth);
}

.why-card:hover {
  border-color: color-mix(in srgb, var(--indigo) 45%, var(--border));
  transform: translateY(-2px);
}

.why-num {
  display: inline-block;
  font-family: var(--font-tile);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 7px;
  background: var(--indigo-soft);
  color: var(--indigo);
  margin-bottom: 0.65rem;
}

[data-theme="dark"] .why-num {
  color: #A5B4FC;
}

.why-card h3 {
  font-family: var(--font-tile);
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.why-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.why-card a {
  color: var(--indigo);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--indigo) 35%, transparent);
}

[data-theme="dark"] .why-card a {
  color: #A5B4FC;
}

.why-card code {
  font-family: var(--font-tile);
  font-size: 0.8rem;
  padding: 0.08rem 0.34rem;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

/* Bottom CTA Strip */
.compare-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--indigo-soft), rgba(16, 185, 129, 0.09));
  border: 1px solid color-mix(in srgb, var(--indigo) 28%, var(--border));
}

.compare-cta h3 {
  font-family: var(--font-tile);
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.compare-cta p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.compare-cta .btn {
  text-decoration: none;
  flex-shrink: 0;
}

@media (max-width: 820px) {
  .why-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .compare-section {
    padding: 1.5rem 1.15rem;
  }
  .compare-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Daily Brain Training Routines & Strategy Playbook (SEO Section)
   ========================================================================== */
.playbook-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--inner-highlight);
}

.playbook-header {
  max-width: 760px;
  margin-bottom: 1.75rem;
}

.playbook-header h2 {
  font-family: var(--font-tile);
  font-size: clamp(1.5rem, 3.6vw, 2.05rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.8rem;
  color: var(--text);
}

.routine-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.routine-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.15rem;
  box-shadow: inset 0 1px 0 var(--inner-highlight);
}

.routine-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.routine-badge {
  font-family: var(--font-tile);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.24rem 0.65rem;
  border-radius: var(--radius-pill);
  color: #FFFFFF;
}

.routine-badge.r-morning { background: linear-gradient(135deg, #10B981, #059669); }
.routine-badge.r-logic   { background: linear-gradient(135deg, #6366F1, #4F46E5); }
.routine-badge.r-speed   { background: linear-gradient(135deg, #F59E0B, #D97706); }

.routine-focus {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.routine-card h3 {
  font-family: var(--font-tile);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.routine-card > p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1rem;
}

.routine-steps {
  margin-top: auto;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.45rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.routine-steps li::marker {
  font-family: var(--font-tile);
  font-weight: 700;
  color: var(--indigo);
}

.routine-steps a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--indigo) 45%, transparent);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.routine-steps a:hover {
  color: var(--indigo);
  border-bottom-color: var(--indigo);
}

[data-theme="dark"] .routine-steps a:hover {
  color: #A5B4FC;
  border-bottom-color: #A5B4FC;
}

/* Strategy Cards */
.strategy-block {
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.strategy-block h3 {
  font-family: var(--font-tile);
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.1rem;
}

.strategy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.strategy-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.2rem;
}

.strategy-card h4 {
  font-family: var(--font-tile);
  font-size: 0.96rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.strategy-card p {
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.62;
}

.strategy-card a {
  color: var(--indigo);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--indigo) 35%, transparent);
}

[data-theme="dark"] .strategy-card a {
  color: #A5B4FC;
}

.strategy-card code {
  font-family: var(--font-tile);
  font-size: 0.8rem;
  padding: 0.08rem 0.34rem;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

@media (max-width: 860px) {
  .routine-grid {
    grid-template-columns: 1fr;
  }
  .strategy-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .playbook-section {
    padding: 1.5rem 1.15rem;
  }
}

/* ==========================================================================
   Puzzle Styles & Free Alternatives Directory (High-Intent SEO Section)
   ========================================================================== */
.match-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--inner-highlight);
}

.match-header {
  max-width: 780px;
  margin-bottom: 1.75rem;
}

.match-header h2 {
  font-family: var(--font-tile);
  font-size: clamp(1.5rem, 3.6vw, 2.05rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.8rem;
  color: var(--text);
}

.match-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
  margin-bottom: 2rem;
}

.match-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.1rem;
  box-shadow: inset 0 1px 0 var(--inner-highlight);
  transition: transform 0.2s var(--ease-smooth), border-color 0.2s ease;
}

.match-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--indigo) 45%, var(--border));
}

.match-kicker {
  font-family: var(--font-tile);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--indigo);
  margin-bottom: 0.35rem;
}

[data-theme="dark"] .match-kicker {
  color: #A5B4FC;
}

.match-card h3 {
  font-family: var(--font-tile);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.match-card p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0.95rem;
}

.match-card p a {
  color: var(--indigo);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--indigo) 35%, transparent);
}

[data-theme="dark"] .match-card p a {
  color: #A5B4FC;
}

.match-card code {
  font-family: var(--font-tile);
  font-size: 0.78rem;
  padding: 0.06rem 0.3rem;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.match-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-tile);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--emerald-dark);
  text-decoration: none;
  transition: transform 0.16s var(--ease-smooth);
}

[data-theme="dark"] .match-link {
  color: #34D399;
}

.match-card:hover .match-link {
  transform: translateX(3px);
}

/* Complete 20-Game Quick Reference Table */
.quick-index-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface-alt);
  -webkit-overflow-scrolling: touch;
}

.quick-index-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.quick-index-table thead th {
  font-family: var(--font-tile);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.8rem 0.95rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface-alt);
}

.quick-index-table tbody td {
  padding: 0.68rem 0.95rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
}

.quick-index-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface-alt) 55%, var(--surface));
}

.quick-index-table tbody tr:last-child td {
  border-bottom: none;
}

.quick-index-table tbody td a {
  font-family: var(--font-tile);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--indigo) 45%, transparent);
}

.quick-index-table tbody td a:hover {
  color: var(--indigo);
}

[data-theme="dark"] .quick-index-table tbody td a:hover {
  color: #A5B4FC;
}

@media (max-width: 900px) {
  .match-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .match-section {
    padding: 1.5rem 1.15rem;
  }
  .match-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Viral 20-Game Daily Scorecard & Live Reset Bar
   ========================================================================== */
.scorecard-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--inner-highlight);
}

.scorecard-info {
  flex: 1 1 280px;
  min-width: 0;
}

.scorecard-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  font-size: 0.88rem;
}

.scorecard-title-row > strong {
  font-family: var(--font-tile);
  font-size: 0.96rem;
  color: var(--text);
}

.scorecard-clock {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.scorecard-clock strong {
  font-family: var(--font-tile);
  font-variant-numeric: tabular-nums;
  color: var(--indigo);
}

[data-theme="dark"] .scorecard-clock strong {
  color: #A5B4FC;
}

.scorecard-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.sc-dot {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  display: inline-block;
  text-decoration: none;
  transition: transform 0.14s var(--ease-spring), border-color 0.15s ease;
}

.sc-dot:hover {
  transform: scale(1.18);
  border-color: var(--indigo);
}

.sc-dot.won {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
  border-color: transparent;
  box-shadow: 0 2px 8px var(--emerald-glow);
}

.sc-dot.lost {
  background: var(--amber);
  border-color: transparent;
}

/* ==========================================================================
   Trust & Support Pages (Privacy, Terms & Contact)
   ========================================================================== */
.legal-main {
  flex: 1;
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  padding: 1.5rem 1.15rem 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.legal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.15rem 2rem;
  box-shadow: var(--shadow-md), inset 0 1px 0 var(--inner-highlight);
}

.legal-hero {
  padding-bottom: 1.4rem;
  margin-bottom: 1.65rem;
  border-bottom: 1px solid var(--border);
}

.legal-hero h1 {
  font-family: var(--font-tile);
  font-size: clamp(1.75rem, 4.4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin: 0.65rem 0 0.55rem;
}

.legal-updated {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.legal-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.legal-toc a {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.72rem;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.legal-toc a:hover {
  color: var(--indigo);
  border-color: var(--indigo);
}

.legal-section {
  margin-bottom: 1.75rem;
}

.legal-section:last-child {
  margin-bottom: 0;
}

.legal-section h2 {
  font-family: var(--font-tile);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.55rem;
  color: var(--text);
}

.legal-section p {
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.68;
  margin-bottom: 0.65rem;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section ul {
  padding-left: 1.25rem;
  display: grid;
  gap: 0.45rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 0.4rem;
}

.legal-section strong {
  color: var(--text);
}

.legal-section a {
  color: var(--indigo);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--indigo) 35%, transparent);
}

[data-theme="dark"] .legal-section a {
  color: #A5B4FC;
}

.legal-section code {
  font-family: var(--font-tile);
  font-size: 0.82rem;
  padding: 0.08rem 0.35rem;
  border-radius: 5px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
}

.privacy-control-box {
  margin-top: 1rem;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.privacy-control-box p {
  margin: 0;
  font-size: 0.86rem;
  max-width: 48ch;
}

.btn-danger {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #FFFFFF;
  box-shadow: 0 6px 16px -4px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* Contact Page Layout */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 1.4rem;
  align-items: start;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.field-group label {
  font-family: var(--font-tile);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  padding: 0.72rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: var(--surface-alt);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.field-textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.55;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--indigo);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--indigo-soft);
  outline: none;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

.contact-side {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.contact-info-box {
  padding: 1.15rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.contact-info-box h3 {
  font-family: var(--font-tile);
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.contact-info-box p,
.contact-info-box li {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.58;
}

.contact-info-box ul {
  padding-left: 1.15rem;
  display: grid;
  gap: 0.32rem;
  margin-top: 0.4rem;
}

.email-copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding: 0.52rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-family: var(--font-tile);
  font-size: 0.86rem;
  font-weight: 700;
}

@media (max-width: 760px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .legal-card {
    padding: 1.45rem 1.15rem;
  }
}

/* ==========================================================================
   High-End Editorial Multi-Column Footer
   ========================================================================== */
.site-footer {
  position: relative;
  margin-top: auto;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
  border-top: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--inner-highlight);
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(680px, 85%);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--indigo), var(--emerald), transparent);
  opacity: 0.65;
  pointer-events: none;
}

.footer-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, 100%);
  height: 220px;
  background: radial-gradient(ellipse at center, var(--bg-glow-1), transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.footer-shell {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 3.1rem 1.25rem 1.75rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.65fr repeat(4, minmax(0, 1fr));
  gap: 2.25rem 1.6rem;
  padding-bottom: 2.25rem;
}

/* Brand Column */
.footer-brand-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding-right: 0.75rem;
}

.footer-logo {
  font-size: 1.42rem;
}

.footer-tagline {
  font-size: 0.87rem;
  line-height: 1.62;
  color: var(--text-muted);
  max-width: 34ch;
}

.footer-live-card {
  width: 100%;
  max-width: 290px;
  padding: 0.82rem 0.95rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--inner-highlight);
}

.footer-live-head {
  display: flex;
  align-items: center;
  gap: 0.48rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.22rem;
}

.footer-live-head strong {
  color: var(--text);
  font-family: var(--font-tile);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
  animation: ftPulse 2.2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes ftPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22); opacity: 1; }
  50%      { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.06); opacity: 0.8; }
}

.footer-live-clock {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 600;
}

.footer-live-clock strong {
  font-family: var(--font-tile);
  font-variant-numeric: tabular-nums;
  color: var(--indigo);
  font-weight: 700;
}

[data-theme="dark"] .footer-live-clock strong {
  color: #A5B4FC;
}

.footer-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ft-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.48rem 0.88rem;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 var(--inner-highlight);
  font-family: var(--font-tile);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  transition: transform 0.14s var(--ease-spring), border-color 0.15s ease, background-color 0.15s ease;
}

.ft-action-btn:hover {
  background: var(--surface-hover);
  border-color: var(--indigo);
  transform: translateY(-1px);
}

.ft-action-btn.primary {
  background: linear-gradient(135deg, var(--indigo), var(--indigo-hover));
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 6px 16px -4px var(--indigo-glow);
}

.ft-action-btn.primary:hover {
  background: linear-gradient(135deg, var(--indigo), var(--indigo-hover));
  filter: brightness(1.06);
}

.ft-action-btn:active {
  transform: scale(0.96);
}

/* Link Columns */
.footer-col-title {
  font-family: var(--font-tile);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text);
  margin-bottom: 0.9rem;
}

.footer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.52rem;
}

.footer-nav-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease, transform 0.16s var(--ease-smooth);
}

.footer-nav-list a:hover {
  color: var(--indigo);
  transform: translateX(3px);
}

[data-theme="dark"] .footer-nav-list a:hover {
  color: #A5B4FC;
}

.ft-tag {
  font-family: var(--font-tile);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.08rem 0.36rem;
  border-radius: 5px;
  background: var(--indigo-soft);
  color: var(--indigo);
  line-height: 1.2;
}

[data-theme="dark"] .ft-tag {
  color: #C7D2FE;
}

/* Trust Strip */
.footer-trust-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.trust-pill {
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0.34rem 0.8rem;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

/* Bottom Craft & Legal Row */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  padding-top: 1.25rem;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.footer-copy strong {
  color: var(--text);
}

.footer-bottom-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.footer-bottom-right a {
  text-decoration: none;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.footer-bottom-right a:hover {
  color: var(--indigo);
}

.ft-sep {
  opacity: 0.4;
}

.ft-top-btn {
  margin-left: 0.35rem;
  padding: 0.36rem 0.78rem;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  font-family: var(--font-tile);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text);
  transition: transform 0.14s var(--ease-spring), border-color 0.15s ease, background-color 0.15s ease;
}

.ft-top-btn:hover {
  border-color: var(--indigo);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.ft-top-btn:active {
  transform: scale(0.95);
}

/* Responsive Footer Breakpoints */
@media (max-width: 960px) {
  .footer-top {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .footer-brand-col {
    grid-column: 1 / -1;
    padding-right: 0;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
  }
  .footer-tagline {
    max-width: 58ch;
  }
}

@media (max-width: 640px) {
  .footer-shell {
    padding: 2.25rem 1rem 1.5rem;
  }
  .footer-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.6rem 1.15rem;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Top-Level Navbar Upgrade (Auto-Hide, Progress Ring, Quick Switcher ⌘K)
   ========================================================================== */
.site-header {
  transition: transform 0.28s var(--ease-smooth), box-shadow 0.22s ease, background-color 0.22s ease;
  will-change: transform;
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.site-header.is-hidden-nav {
  transform: translateY(-100%);
}

.nav-scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--indigo), var(--emerald));
  pointer-events: none;
  transition: width 0.08s linear;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link,
.nav-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  height: 36px;
  padding: 0 0.78rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.nav-link:hover,
.nav-link-btn:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.nav-link-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: inset 0 1px 0 var(--inner-highlight);
}

.nav-link-btn:hover {
  border-color: var(--indigo);
  background: var(--surface-hover);
}

.nav-link-btn svg {
  width: 15px;
  height: 15px;
  stroke: var(--indigo);
  fill: none;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-kbd {
  font-family: var(--font-tile);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.36rem;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  line-height: 1.1;
}

/* Live Daily Progress Ring Pill */
.progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  height: 38px;
  padding: 0 0.78rem 0 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--inner-highlight);
  font-family: var(--font-tile);
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  transition: transform 0.12s var(--ease-spring), border-color 0.15s ease, background-color 0.15s ease;
}

.progress-pill:hover {
  border-color: var(--emerald);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.progress-pill.all-done {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.45);
  color: var(--emerald-dark);
}

[data-theme="dark"] .progress-pill.all-done {
  color: #34D399;
}

.progress-ring {
  width: 22px;
  height: 22px;
  transform: rotate(-90deg);
  flex-shrink: 0;
}

.progress-ring circle {
  fill: none;
  stroke-width: 2.8;
}

.progress-ring .ring-track {
  stroke: var(--border-strong);
}

.progress-ring .ring-fill {
  stroke: var(--emerald);
  stroke-linecap: round;
  stroke-dasharray: 56.55;
  stroke-dashoffset: 56.55;
  transition: stroke-dashoffset 0.55s var(--ease-smooth);
}

.streak-pill {
  cursor: pointer;
  transition: transform 0.12s var(--ease-spring), border-color 0.15s ease, background-color 0.15s ease;
}

.streak-pill:hover {
  border-color: var(--amber);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

/* Smart PWA Install Button */
.nav-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 36px;
  padding: 0 0.82rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--indigo), var(--indigo-hover));
  color: #FFFFFF;
  font-family: var(--font-tile);
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 4px 12px -2px var(--indigo-glow);
  transition: transform 0.12s var(--ease-spring), filter 0.15s ease;
}

.nav-install-btn[hidden] {
  display: none;
}

.nav-install-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.nav-install-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-mobile-games {
  display: none;
}

/* Quick-Switch Command Palette Modal */
.qs-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(8, 10, 18, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid;
  place-items: start center;
  padding: min(8vh, 64px) 1rem 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.qs-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.qs-card {
  width: min(680px, 100%);
  max-height: 82dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--inner-highlight);
  overflow: hidden;
  transform: translateY(-10px) scale(0.97);
  transition: transform 0.24s var(--ease-spring);
}

.qs-overlay.open .qs-card {
  transform: translateY(0) scale(1);
}

.qs-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-elevated);
}

.qs-search-icon {
  position: absolute;
  left: 1.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  z-index: 2;
  transition: stroke 0.15s ease;
}

.qs-head:focus-within .qs-search-icon {
  stroke: var(--indigo);
}

.qs-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 0.95rem 0 2.65rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1.5px solid var(--border-strong);
  box-shadow: inset 0 1px 0 var(--inner-highlight);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.qs-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.qs-input:focus,
.qs-input:focus-visible {
  outline: none;
  border-color: var(--indigo);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--indigo-soft);
}

.qs-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  cursor: pointer;
  background: var(--text-muted);
  opacity: 0.55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") center / 12px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.qs-input::-webkit-search-cancel-button:hover {
  opacity: 1;
}

.qs-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.qs-tabs::-webkit-scrollbar { display: none; }

.qs-tab {
  padding: 0.34rem 0.78rem;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-family: var(--font-tile);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.14s ease;
}

.qs-tab:hover:not(.active) {
  color: var(--text);
  border-color: var(--border-strong);
}

.qs-tab.active {
  background: linear-gradient(135deg, var(--indigo), var(--indigo-hover));
  border-color: transparent;
  color: #FFFFFF;
}

.qs-grid {
  padding: 0.9rem 1rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.qs-item {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: transform 0.14s var(--ease-spring), border-color 0.15s ease, background-color 0.15s ease;
}

.qs-item:hover {
  border-color: var(--indigo);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.qs-item.is-current {
  border-color: var(--indigo);
  background: var(--indigo-soft);
}

.qs-item.is-solved {
  border-color: rgba(16, 185, 129, 0.35);
}

.qs-badge-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: var(--font-tile);
  font-weight: 700;
  font-size: 0.85rem;
  color: #FFFFFF;
  flex-shrink: 0;
}

.qs-item-body {
  min-width: 0;
  flex: 1;
}

.qs-item-name {
  font-family: var(--font-tile);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.qs-item-sub {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

.qs-status {
  font-family: var(--font-tile);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.16rem 0.48rem;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.qs-status.solved {
  background: rgba(16, 185, 129, 0.16);
  color: var(--emerald-dark);
}

[data-theme="dark"] .qs-status.solved {
  color: #34D399;
}

.qs-status.playing {
  background: var(--indigo-soft);
  color: var(--indigo);
}

[data-theme="dark"] .qs-status.playing {
  color: #C7D2FE;
}

.qs-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.qs-foot strong {
  font-family: var(--font-tile);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.qs-foot-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qs-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Responsive Navbar Breakpoints */
@media (max-width: 860px) {
  .nav-links {
    display: none;
  }
  .nav-mobile-games {
    display: inline-flex;
  }
  .nav-next-btn {
    display: none;
  }
}

@media (max-width: 540px) {
  .qs-grid {
    grid-template-columns: 1fr;
  }
  .progress-pill {
    display: none;
  }
  .nav-controls {
    gap: 0.35rem;
  }
  .icon-btn {
    width: 35px;
    height: 35px;
  }
  .streak-pill {
    height: 35px;
    padding: 0 0.62rem;
    font-size: 0.84rem;
  }
  .nav-install-btn span {
    display: none;
  }
  .nav-install-btn {
    padding: 0;
    width: 35px;
    height: 35px;
    justify-content: center;
  }
}

/* Mobile Scroll Performance + Reduced Motion Polish */
@media (hover: none) {
  body {
    background-attachment: scroll;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Custom Image Logo (Navbar & Footer)
   ========================================================================== */
.brand-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 4px 10px var(--indigo-glow));
  transition: transform 0.25s var(--ease-spring);
}

.footer-logo .brand-logo-img {
  width: 40px;
  height: 40px;
}

.brand-logo:hover .brand-logo-img {
  transform: rotate(-4deg) scale(1.06);
}

/* Full Horizontal Wordmark Logo Variant (Option B) */
.brand-logo-wide-img {
  height: 36px;
  width: auto;
  max-width: 165px;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  transition: transform 0.22s var(--ease-spring), opacity 0.15s ease;
}

.footer-logo .brand-logo-wide-img {
  height: 42px;
  max-width: 190px;
}

.brand-logo:hover .brand-logo-wide-img {
  transform: scale(1.03);
}

@media (max-width: 480px) {
  .brand-logo-img {
    width: 32px;
    height: 32px;
  }
  .brand-logo-wide-img {
    height: 30px;
    max-width: 132px;
  }
}

/* ==========================================================================
   Sensory Juice & Accessibility Polish
   (Confetti Canvas, Haptics/Contrast Buttons, Sound Packs, Colorblind Mode)
   ========================================================================== */
.mp-confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 260;
}

.icon-btn.is-active-toggle {
  border-color: color-mix(in srgb, var(--indigo) 42%, var(--border));
}

.icon-btn.is-contrast-on {
  background: linear-gradient(135deg, #F97316, #0284C7);
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 4px 12px -2px rgba(249, 115, 22, 0.35);
}

/* Preferences Controls inside Stats Modal */
.pref-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.pref-label {
  font-family: var(--font-tile);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}

.pref-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.pack-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.pack-pill {
  padding: 0.45rem 0.4rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-family: var(--font-tile);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.pack-pill:hover:not(.active) {
  color: var(--text);
  border-color: var(--indigo);
}

.pack-pill.active {
  background: linear-gradient(135deg, var(--indigo), var(--indigo-hover));
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 4px 12px -3px var(--indigo-glow);
}

.mp-switch {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.mp-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s var(--ease-spring);
}

.mp-switch.on {
  background: linear-gradient(135deg, var(--indigo), var(--indigo-hover));
  border-color: transparent;
}

.mp-switch.on::after {
  transform: translateX(20px);
}

/* High-Contrast / Colorblind Mode (Orange = Correct, Sky Blue = Present) */
[data-contrast="high"] {
  --hc-correct: #EA580C;
  --hc-correct-grad: linear-gradient(145deg, #F97316, #C2410C);
  --hc-correct-bevel: #9A3412;
  --hc-correct-glow: rgba(249, 115, 22, 0.36);

  --hc-present: #0284C7;
  --hc-present-grad: linear-gradient(145deg, #38BDF8, #0369A1);
  --hc-present-bevel: #075985;
  --hc-present-glow: rgba(56, 189, 248, 0.36);
}

/* WordPulse, WaffleSwap & EqPulse Tiles */
[data-contrast="high"] .wp-tile.correct,
[data-contrast="high"] .ep-tile.correct {
  background: var(--hc-correct-grad);
  box-shadow: 0 6px 16px -4px var(--hc-correct-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

[data-contrast="high"] .wp-tile.present,
[data-contrast="high"] .ep-tile.present {
  background: var(--hc-present-grad);
  box-shadow: 0 6px 16px -4px var(--hc-present-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

[data-contrast="high"] .ws-tile.correct {
  background: var(--hc-correct-grad);
  box-shadow: 0 4px 0 var(--hc-correct-bevel), 0 8px 16px -4px var(--hc-correct-glow);
}

[data-contrast="high"] .ws-tile.present {
  background: var(--hc-present-grad);
  box-shadow: 0 4px 0 var(--hc-present-bevel), 0 8px 16px -4px var(--hc-present-glow);
}

/* WordPulse & EqPulse Keyboards */
[data-contrast="high"] .wp-key.correct,
[data-contrast="high"] .ep-key.correct {
  background: var(--hc-correct);
  box-shadow: 0 3px 0 var(--hc-correct-bevel);
  color: #FFFFFF;
}

[data-contrast="high"] .wp-key.present,
[data-contrast="high"] .ep-key.present {
  background: var(--hc-present);
  box-shadow: 0 3px 0 var(--hc-present-bevel);
  color: #FFFFFF;
}

/* Result Banners & Daily Scorecard Dots */
[data-contrast="high"] .wp-result-bar.won,
[data-contrast="high"] .cf-answer-reveal.win {
  background: rgba(249, 115, 22, 0.14);
  border-color: rgba(249, 115, 22, 0.48);
}

[data-contrast="high"] .sc-dot.won {
  background: var(--hc-correct-grad);
  box-shadow: 0 2px 8px var(--hc-correct-glow);
}

[data-contrast="high"] .sc-dot.lost {
  background: var(--hc-present-grad);
}

/* Keep Header Spacious on Small Phones (Contrast remains in Stats modal) */
@media (max-width: 640px) {
  .nav-contrast-btn {
    display: none;
  }
}

@media (max-width: 420px) {
  .header-inner {
    gap: 0.45rem;
    padding: 0.6rem 0.7rem;
  }
  .nav-controls {
    gap: 0.28rem;
  }
  .icon-btn {
    width: 33px;
    height: 33px;
  }
  .streak-pill {
    height: 33px;
    padding: 0 0.52rem;
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   Anchor Scroll Offset, Settings/Backup Boxes & 404 Page
   ========================================================================== */
#games-grid,
#about,
#why-mindpuzz,
#routines,
#puzzle-styles {
  scroll-margin-top: 84px;
}

.backup-box {
  margin-top: 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 0.78rem 0.95rem;
}

.backup-box summary {
  font-family: var(--font-tile);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
}

.backup-box summary::-webkit-details-marker { display: none; }

.backup-box summary::after {
  content: '▾';
  color: var(--indigo);
  transition: transform 0.2s ease;
}

.backup-box[open] summary::after {
  transform: rotate(180deg);
}

.backup-body {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.backup-body p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.backup-import-row {
  display: flex;
  gap: 0.45rem;
}

.backup-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-family: var(--font-tile);
  font-size: 0.8rem;
  color: var(--text);
}

.backup-input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-soft);
  outline: none;
}

.nf-main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 4.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nf-card {
  width: 100%;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.75rem;
  box-shadow: var(--shadow-md), inset 0 1px 0 var(--inner-highlight);
}

.nf-tiles {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1.5rem;
}

.nf-tile {
  width: 68px;
  height: 68px;
  border-radius: 14px;
  font-family: var(--font-tile);
  font-size: 2.15rem;
  font-weight: 700;
  color: #FFFFFF;
  display: grid;
  place-items: center;
  user-select: none;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.nf-tile.t-a { background: linear-gradient(145deg, var(--emerald), var(--emerald-dark)); }
.nf-tile.t-b { background: linear-gradient(145deg, var(--amber), var(--amber-dark)); }
.nf-tile.t-c { background: linear-gradient(145deg, var(--indigo), var(--indigo-hover)); }

.nf-card h1 {
  font-family: var(--font-tile);
  font-size: clamp(1.6rem, 4.5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}

.nf-card p {
  color: var(--text-muted);
  font-size: 0.96rem;
  max-width: 44ch;
  margin: 0 auto 1.65rem;
}

.nf-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.nf-actions a {
  text-decoration: none;
}

/* ==========================================================================
   Custom Tactile Scrollbar (Light, Obsidian Dark & High-Contrast Aware)
   ========================================================================== */
:root {
  color-scheme: light;
  --sb-track: transparent;
  --sb-thumb: rgba(82, 96, 117, 0.34);
  --sb-thumb-hover: var(--indigo);
  --sb-thumb-active: var(--indigo-hover);
}

[data-theme="dark"] {
  color-scheme: dark;
  --sb-thumb: rgba(148, 163, 184, 0.28);
  --sb-thumb-hover: #818CF8;
  --sb-thumb-active: var(--indigo);
}

[data-contrast="high"] {
  --sb-thumb-hover: #F97316;
  --sb-thumb-active: #EA580C;
}

/* Chrome, Edge, Safari & Android */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--sb-track);
}

::-webkit-scrollbar-thumb {
  background-color: var(--sb-thumb);
  border-radius: 999px;
  border: 2.5px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--sb-thumb-hover);
  border-width: 2px;
}

::-webkit-scrollbar-thumb:active {
  background-color: var(--sb-thumb-active);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* Ultra-slim scrollbars inside modals, Quick Switcher, tables & word lists */
.modal-card::-webkit-scrollbar,
.qs-grid::-webkit-scrollbar,
.sh-found-pills::-webkit-scrollbar,
.compare-table-wrap::-webkit-scrollbar,
.quick-index-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.modal-card::-webkit-scrollbar-thumb,
.qs-grid::-webkit-scrollbar-thumb,
.sh-found-pills::-webkit-scrollbar-thumb,
.compare-table-wrap::-webkit-scrollbar-thumb,
.quick-index-wrap::-webkit-scrollbar-thumb {
  border-width: 1px;
}

/* Firefox fallback (scoped so Chromium keeps the floating rounded pill style) */
@supports not selector(::-webkit-scrollbar) {
  html,
  .modal-card,
  .qs-grid,
  .sh-found-pills,
  .compare-table-wrap,
  .quick-index-wrap {
    scrollbar-width: thin;
    scrollbar-color: var(--sb-thumb) var(--sb-track);
  }
}

/* ==========================================================================
   Bottom-Right Floating Privacy & Cookie Consent Banner
   ========================================================================== */
.consent-banner {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 180;
  width: min(392px, calc(100vw - 2rem));
  padding: 1.15rem 1.2rem;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-elevated) 92%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--inner-highlight);
  opacity: 0;
  transform: translateY(18px) scale(0.97);
  transition: opacity 0.25s ease, transform 0.3s var(--ease-spring);
}

.consent-banner.open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.consent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.72rem;
}

.consent-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.consent-brand svg,
.consent-brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px var(--indigo-glow));
}

.consent-brand strong {
  display: block;
  font-family: var(--font-tile);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text);
}

.consent-brand strong em {
  font-style: normal;
  color: var(--indigo);
}

[data-theme="dark"] .consent-brand strong em {
  color: #A5B4FC;
}

.consent-brand span {
  display: block;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-muted);
}

.consent-pill {
  font-family: var(--font-tile);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.32);
  color: var(--emerald-dark);
  white-space: nowrap;
}

[data-theme="dark"] .consent-pill {
  color: #34D399;
}

.consent-text {
  font-size: 0.84rem;
  line-height: 1.56;
  color: var(--text-muted);
  margin-bottom: 0.95rem;
}

.consent-text code {
  font-family: var(--font-tile);
  font-size: 0.78rem;
  padding: 0.06rem 0.32rem;
  border-radius: 5px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
}

.consent-text a {
  color: var(--indigo);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--indigo) 38%, transparent);
  margin-left: 0.2rem;
}

[data-theme="dark"] .consent-text a {
  color: #A5B4FC;
}

.consent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

@media (max-width: 540px) {
  .consent-banner {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 0.75rem;
    width: auto;
    padding: 1rem;
  }
}

/* Privacy Page Live Status Pill & Anchor Scroll Offset */
.legal-section[id] {
  scroll-margin-top: 84px;
}

.privacy-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.privacy-status-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.16rem 0.62rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-family: var(--font-tile);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  vertical-align: middle;
}

.privacy-status-pill.is-on {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--emerald-dark);
}

[data-theme="dark"] .privacy-status-pill.is-on {
  color: #34D399;
}

.privacy-status-pill.is-essential {
  background: var(--indigo-soft);
  border-color: color-mix(in srgb, var(--indigo) 35%, transparent);
  color: var(--indigo);
}

[data-theme="dark"] .privacy-status-pill.is-essential {
  color: #C7D2FE;
}

/* ==========================================================================
   Final Polish: Native Mobile Optimizations, Safe Areas & Modern CSS
   ========================================================================== */

/* 1. Kill native tap flash & prevent accidental long-press popups on game controls */
a, button, summary, [role="button"] {
  -webkit-tap-highlight-color: transparent;
}

.wp-tile, .wp-key, .lg-tile, .tn-num-tile, .tn-op-btn,
.cg-cell, .zl-cell, .sm-cell, .ws-tile, .sg-cell,
.pl-cell, .pl-domino-btn, .sw-cell, .sh-hex, .md-cell,
.md-num-btn, .pg-cell, .br-cell, .br-slot, .cr-tile,
.ep-tile, .ep-key, .rl-stage, .cl-cell {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* 2. Editorial Typography Polish */
h1, h2, h3, .hero-banner h1, .game-heading-row h1 {
  text-wrap: balance;
}

.hero-banner p, .about-lead, .game-card p, .faq-item p {
  text-wrap: pretty;
}

/* 3. Lock Background Scroll & Prevent Pull-to-Refresh Hijacking */
body.mp-scroll-lock {
  overflow: hidden;
  overscroll-behavior: none;
}

.modal-card,
.qs-grid {
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.zl-grid, .sw-grid, .pg-grid, .br-grid, .sg-grid {
  overscroll-behavior: contain;
}

/* 4. Edge-to-Edge PWA Safe Area Insets (Dynamic Island / Gesture Bar) */
@supports (padding-top: env(safe-area-inset-top)) {
  .site-header {
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  .site-footer {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .consent-banner {
    bottom: max(1rem, calc(env(safe-area-inset-bottom) + 0.65rem));
  }
  .toast-container {
    top: calc(74px + env(safe-area-inset-top));
  }
}

/* 5. Skip Off-Screen Paint on Heavy Below-the-Fold SEO Sections */
.about-section,
.compare-section,
.playbook-section,
.match-section,
.faq-section,
.site-footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 560px;
}

/* 6. Touch-Device Craft: Tactile Press Feedback, No Sticky Hover, 60fps Scroll */
@media (hover: none) {
  .game-card:hover,
  .why-card:hover,
  .match-card:hover,
  .icon-btn:hover,
  .btn-primary:hover,
  .btn-secondary:hover,
  .btn-emerald:hover {
    transform: none;
  }
  .game-card:active {
    transform: scale(0.985);
    transition-duration: 0.08s;
  }
  .summary-chip {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--surface);
  }
}

/* 7. Mobile Layout Refinements */
@media (max-width: 600px) {
  /* Prevent iOS Safari auto-zoom on form & search inputs */
  .hub-search-input,
  .cf-input,
  .field-input,
  .field-select,
  .field-textarea,
  .backup-input {
    font-size: 16px;
  }

  /* Single-row swipeable category chips (saves ~100px vertical space) */
  .hub-filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 2px 6px;
    margin-bottom: 1.2rem;
    mask-image: linear-gradient(90deg, #000 90%, transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent);
  }
  .hub-filters::-webkit-scrollbar {
    display: none;
  }
  .filter-pill {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .hub-main {
    padding: 1.75rem 0.95rem 3rem;
  }
  .hero-banner {
    margin-bottom: 1.75rem;
  }
  .game-card {
    padding: 1.25rem;
  }
}

/* 8. Declutter 360px–540px Header (Stats = Tap Streak Pill, Haptics = Inside Settings) */
@media (max-width: 540px) {
  #btn-haptics,
  #btn-stats {
    display: none;
  }
  .header-inner {
    gap: 0.5rem;
  }
  .nav-controls {
    gap: 0.34rem;
  }
  .icon-btn {
    width: 36px;
    height: 36px;
  }
  .streak-pill {
    height: 36px;
    padding: 0 0.68rem;
  }
}

/* 9. Favorite Pin Star & "Resume" Status Badge */
.card-badge-group {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.fav-star {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 0.14s var(--ease-spring), color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.fav-star:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.fav-star.pinned {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
  color: var(--amber-dark);
}

[data-theme="dark"] .fav-star.pinned {
  color: #FBBF24;
}

.fav-star:active {
  transform: scale(0.85);
}

.status-badge.in-progress {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-dark);
  border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .status-badge.in-progress {
  color: #FBBF24;
}

/* ==========================================================================
   Final Additions: 3-Game Blitz, 5-Axis Brain Radar, 14-Day Heatmap & PNG Bar
   ========================================================================== */
.scorecard-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

/* Today's 3-Game Blitz Bar */
.blitz-bar {
  padding: 1.05rem 1.2rem;
  margin-bottom: 1.15rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--indigo) 10%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--indigo) 26%, var(--border));
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--inner-highlight);
}

.blitz-bar.blitz-complete {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), var(--surface));
  border-color: rgba(16, 185, 129, 0.4);
}

.blitz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.blitz-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.blitz-kicker {
  font-family: var(--font-tile);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.62rem;
  border-radius: var(--radius-pill);
  background: var(--indigo-soft);
  color: var(--indigo);
}

[data-theme="dark"] .blitz-kicker {
  color: #C7D2FE;
}

.blitz-title strong {
  font-family: var(--font-tile);
  font-size: 0.96rem;
  color: var(--text);
}

.blitz-count {
  font-family: var(--font-tile);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.blitz-count.done {
  color: var(--emerald-dark);
}

[data-theme="dark"] .blitz-count.done {
  color: #34D399;
}

.blitz-picks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.blitz-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.72rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: transform 0.15s var(--ease-spring), border-color 0.15s ease, background-color 0.15s ease;
}

.blitz-chip:hover {
  border-color: var(--indigo);
  transform: translateY(-2px);
}

.blitz-chip.done {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.4);
}

.blitz-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-family: var(--font-tile);
  font-size: 0.8rem;
  font-weight: 700;
  color: #FFFFFF;
  flex-shrink: 0;
}

.blitz-chip-body {
  min-width: 0;
  flex: 1;
}

.blitz-chip-body strong {
  display: block;
  font-family: var(--font-tile);
  font-size: 0.88rem;
  line-height: 1.15;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blitz-chip-body span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
}

.blitz-state {
  font-family: var(--font-tile);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--indigo);
}

.blitz-chip.done .blitz-state {
  color: var(--emerald-dark);
}

[data-theme="dark"] .blitz-chip.done .blitz-state {
  color: #34D399;
}

@media (max-width: 680px) {
  .blitz-picks {
    grid-template-columns: 1fr;
  }
}

/* 5-Axis Brain Profile Radar & 14-Day Heatmap (Inside Stats Modal) */
.brain-profile-card {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.bp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.bp-rank-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.bp-rank-pill {
  font-family: var(--font-tile);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.22rem 0.68rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--indigo), var(--indigo-hover));
  color: #FFFFFF;
}

.bp-meta {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.bp-freeze-pill {
  font-family: var(--font-tile);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #0284C7;
}

[data-theme="dark"] .bp-freeze-pill {
  color: #7DD3FC;
}

.bp-radar-wrap {
  display: flex;
  justify-content: center;
  margin: 0.15rem 0 0.45rem;
}

.bp-radar-svg {
  width: 215px;
  height: auto;
  overflow: visible;
}

.radar-ring {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1;
}

.radar-spoke {
  stroke: var(--border);
  stroke-width: 1;
}

.radar-area {
  fill: color-mix(in srgb, var(--indigo) 28%, transparent);
  stroke: var(--indigo);
  stroke-width: 2;
  stroke-linejoin: round;
}

.radar-dot {
  fill: var(--emerald);
  stroke: var(--surface);
  stroke-width: 1.5;
}

.radar-lbl {
  fill: var(--text-muted);
  font-family: var(--font-tile);
  font-size: 9.5px;
  font-weight: 700;
}

.bp-xp-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-tile);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.32rem;
}

.bp-xp-track {
  width: 100%;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--border);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.bp-xp-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--indigo), var(--emerald));
  transition: width 0.45s var(--ease-smooth);
}

.bp-heat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.bp-heat-lbl {
  font-family: var(--font-tile);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.bp-heat-grid {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 3.5px;
  flex: 1;
  max-width: 240px;
}

.bp-heat-cell {
  aspect-ratio: 1 / 1;
  border-radius: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.bp-heat-cell.lv-1 { background: rgba(16, 185, 129, 0.3); border-color: transparent; }
.bp-heat-cell.lv-2 { background: rgba(16, 185, 129, 0.62); border-color: transparent; }
.bp-heat-cell.lv-3 { background: var(--emerald); border-color: transparent; }
.bp-heat-cell.lv-4 { background: linear-gradient(135deg, #FACC15, #F59E0B); border-color: transparent; }

/* Fix 360px phone header button spacing after the 540px rule */
@media (max-width: 400px) {
  .header-inner {
    gap: 0.4rem;
    padding: 0.58rem 0.68rem;
  }
  .nav-controls {
    gap: 0.26rem;
  }
  .icon-btn {
    width: 33px;
    height: 33px;
  }
  .streak-pill {
    height: 33px;
    padding: 0 0.52rem;
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   Catchy Navbar Logo Click Animation (Spring Bounce, Ripple & Tile Sparks)
   ========================================================================== */
.site-header .brand-logo {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

.site-header .brand-logo:active {
  transform: scale(0.95);
  transition: transform 0.08s ease;
}

.site-header .brand-logo.is-popping svg,
.site-header .brand-logo.is-popping img {
  animation: mpLogoPop 0.52s var(--ease-spring);
}

.site-header .brand-logo.is-popping span {
  animation: mpLogoTextFlash 0.48s var(--ease-smooth);
}

@keyframes mpLogoPop {
  0%   { transform: scale(1) rotate(0deg); }
  22%  { transform: scale(0.84) rotate(-10deg); filter: drop-shadow(0 0 14px var(--indigo-glow)); }
  55%  { transform: scale(1.18) rotate(8deg); filter: drop-shadow(0 6px 18px var(--emerald-glow)); }
  80%  { transform: scale(0.97) rotate(-2deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes mpLogoTextFlash {
  0%   { filter: brightness(1); }
  40%  { filter: brightness(1.28); }
  100% { filter: brightness(1); }
}

/* Expanding Glow Ring from Logo Icon */
.mp-logo-ring {
  position: fixed;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 2.5px solid var(--indigo);
  pointer-events: none;
  z-index: 260;
  transform: translate(-50%, -50%) scale(0.85);
  animation: mpLogoRingOut 0.48s var(--ease-smooth) forwards;
}

@keyframes mpLogoRingOut {
  0%   { opacity: 0.9; transform: translate(-50%, -50%) scale(0.85); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(2.25); }
}

/* 8 Micro Puzzle-Tile Sparks */
.mp-logo-spark {
  position: fixed;
  width: 7px;
  height: 7px;
  border-radius: 2.5px;
  pointer-events: none;
  z-index: 261;
  transform: translate(-50%, -50%) scale(1);
  animation: mpLogoSparkFly 0.55s var(--ease-smooth) forwards;
}

@keyframes mpLogoSparkFly {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) translate(0, 0) scale(1.1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) scale(0.2) rotate(var(--rot));
  }
}

/* ==========================================================================
   Final Microinteractions Pack (Spotlight, Ripples, Flame, Cascade & Dock)
   ========================================================================== */

/* 1. Cursor-Tracking Specular Spotlight on Game Cards (Desktop Pointer Only) */
@media (hover: hover) and (pointer: fine) {
  .game-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
      260px circle at var(--mx, 50%) var(--my, 50%),
      color-mix(in srgb, var(--card-accent) 18%, transparent),
      transparent 72%
    );
    opacity: 0;
    transition: opacity 0.24s ease;
    pointer-events: none;
    z-index: 0;
  }

  .game-card:hover::after {
    opacity: 1;
  }

  .game-card > * {
    position: relative;
    z-index: 1;
  }
}

/* 2. Tactile Point-of-Click Ripple on All Buttons */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.mp-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.36);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  animation: mpRippleWave 0.52s var(--ease-smooth) forwards;
}

.btn-secondary .mp-ripple {
  background: color-mix(in srgb, var(--indigo) 24%, transparent);
}

@keyframes mpRippleWave {
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

/* 3. Live Streak Flame Glow & +1 Win Float */
.streak-pill.has-streak .flame {
  display: inline-block;
  animation: mpFlamePulse 2.4s ease-in-out infinite;
  transform-origin: center bottom;
}

.streak-pill.streak-bump {
  animation: mpStreakBump 0.55s var(--ease-spring);
  border-color: var(--amber);
}

@keyframes mpFlamePulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%      { transform: scale(1.14) rotate(-4deg); }
}

@keyframes mpStreakBump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.16); box-shadow: 0 0 18px var(--amber-glow); }
  100% { transform: scale(1); }
}

.mp-float-badge {
  position: fixed;
  z-index: 265;
  pointer-events: none;
  font-family: var(--font-tile);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--amber-dark);
  background: var(--surface-elevated);
  border: 1px solid rgba(245, 158, 11, 0.45);
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  transform: translate(-50%, -50%);
  animation: mpFloatUp 0.9s var(--ease-smooth) forwards;
}

[data-theme="dark"] .mp-float-badge {
  color: #FBBF24;
}

@keyframes mpFloatUp {
  0%   { opacity: 0; transform: translate(-50%, 4px) scale(0.8); }
  22%  { opacity: 1; transform: translate(-50%, -10px) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -38px) scale(0.95); }
}

/* 4. Staggered Card Reveal on Category Filter Switch */
.game-card.mp-card-enter {
  animation: mpCardIn 0.34s var(--ease-spring) backwards;
  animation-delay: var(--stagger, 0ms);
}

@keyframes mpCardIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 5. Tactile Icon Button Micro-Animations (Theme Spin / Sound & Gear Wiggle) */
#btn-theme.mp-icon-pop svg {
  animation: mpThemeSpin 0.48s var(--ease-spring);
}

#btn-sound.mp-icon-pop svg,
#btn-haptics.mp-icon-pop svg,
#btn-settings.mp-icon-pop svg {
  animation: mpIconWiggle 0.42s var(--ease-spring);
}

@keyframes mpThemeSpin {
  0%   { transform: rotate(-160deg) scale(0.75); }
  100% { transform: rotate(0deg) scale(1); }
}

@keyframes mpIconWiggle {
  0%   { transform: rotate(0deg) scale(1); }
  25%  { transform: rotate(-14deg) scale(1.12); }
  60%  { transform: rotate(10deg) scale(1.06); }
  100% { transform: rotate(0deg) scale(1); }
}

/* 6. Daily 20-Dot Scorecard Dock Wave on Hover */
@media (hover: hover) {
  .sc-dot:hover {
    transform: translateY(-3px) scale(1.24);
  }
  .sc-dot:has(+ .sc-dot:hover),
  .sc-dot:hover + .sc-dot {
    transform: translateY(-1.5px) scale(1.1);
  }
}

/* ==========================================================================
   Hero Primary "Play Now" CTA Button
   ========================================================================== */
.hero-cta-row {
  display: flex;
  justify-content: center;
  margin: 1.4rem auto 0;
}

.hero-play-btn {
  text-decoration: none;
  padding: 0.85rem 1.85rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-tile);
  font-size: 1rem;
  letter-spacing: -0.01em;
  gap: 0.55rem;
  box-shadow: 0 10px 26px -6px var(--indigo-glow), 0 0 0 0 var(--indigo-glow), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  animation: mpHeroCtaGlow 2.8s ease-in-out infinite;
}

.hero-play-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 30px -6px var(--indigo-glow), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.hero-play-btn .play-ico {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.hero-play-btn .arrow-ico {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.22s var(--ease-spring);
}

.hero-play-btn:hover .arrow-ico {
  transform: translateY(3px);
}

@keyframes mpHeroCtaGlow {
  0%, 100% { box-shadow: 0 10px 26px -6px var(--indigo-glow), 0 0 0 0 rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.28); }
  50%      { box-shadow: 0 12px 28px -4px var(--indigo-glow), 0 0 0 7px rgba(99, 102, 241, 0), inset 0 1px 0 rgba(255, 255, 255, 0.28); }
}

@media (max-width: 600px) {
  .hero-cta-row {
    margin-top: 1.15rem;
  }
  .hero-play-btn {
    padding: 0.78rem 1.6rem;
    font-size: 0.95rem;
  }
}

/* ==========================================================================
   Hero Catchy "Thinking" Cipher-Decode Typography Animation
   ========================================================================== */
.hero-think-wrap {
  display: inline-flex;
  align-items: baseline;
  position: relative;
  cursor: pointer;
  padding-bottom: 4px;
}

.hero-think-word {
  display: inline-block;
  background: linear-gradient(110deg, var(--indigo) 0%, #818CF8 30%, var(--emerald) 60%, var(--indigo) 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: mpNeuralShimmer 5.5s linear infinite;
}

[data-contrast="high"] .hero-think-word {
  background: linear-gradient(110deg, #F97316 0%, #FACC15 35%, #38BDF8 70%, #F97316 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
}

/* Live "Thinking" Blinking Caret */
.hero-think-wrap::after {
  content: '';
  display: inline-block;
  width: 3.5px;
  height: 0.78em;
  margin-left: 5px;
  border-radius: 999px;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald-glow);
  transform: translateY(2px);
  animation: mpThinkBlink 1s steps(1) infinite;
}

[data-contrast="high"] .hero-think-wrap::after {
  background: #F97316;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.45);
}

/* Subtle Neural Pulse Underline */
.hero-think-wrap::before {
  content: '';
  position: absolute;
  left: 0;
  right: 8px;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--indigo), var(--emerald));
  opacity: 0.35;
  transform-origin: left center;
  transition: opacity 0.25s ease, transform 0.35s var(--ease-spring);
}

.hero-think-wrap.is-locked::before {
  opacity: 0.75;
  animation: mpThoughtLock 0.45s var(--ease-spring);
}

@keyframes mpNeuralShimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 220% center; }
}

@keyframes mpThinkBlink {
  0%, 52%  { opacity: 1; }
  53%, 100% { opacity: 0; }
}

@keyframes mpThoughtLock {
  0%   { transform: scaleX(0.35); opacity: 0.25; }
  100% { transform: scaleX(1);    opacity: 0.75; }
}