:root {
  --font-sans: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  /* Soft lilac base #f3e9ff + violet / indigo accents */
  --bg: #f3e9ff;
  --cream-dim: #e4d7f5;
  --bg-elevated: #faf7ff;
  --surface: rgba(255, 252, 255, 0.9);
  --surface-strong: #fffdff;
  --text: #2f2640;
  --text-muted: #6d6485;
  --accent: #7c3aed;
  --accent-strong: #5b21b6;
  --accent-soft: #ede4ff;
  --accent-glow: rgba(124, 58, 237, 0.22);
  --accent-2: #6366f1;
  --accent-2-soft: rgba(99, 102, 241, 0.16);
  --warm: #c026d3;
  --warm-soft: rgba(192, 38, 211, 0.1);
  --success: #0d9488;
  --link-hover-bg: color-mix(in srgb, #e8dcfb 82%, #ffffff);
  --nav-menu-hover: color-mix(in srgb, var(--accent-soft) 72%, var(--surface-strong));
  --nav-menu-bg: linear-gradient(168deg, #ebe3fb 0%, #e4d7f5 48%, #ddd0f2 100%);
  --game-surface: #e9dff8;
  --border: rgba(91, 33, 182, 0.1);
  --shadow-sm: 0 4px 16px rgba(47, 38, 80, 0.07), 0 1px 3px rgba(47, 38, 80, 0.05);
  --shadow-md: 0 20px 50px rgba(47, 38, 80, 0.1), 0 8px 20px rgba(47, 38, 80, 0.06);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --container: 96rem;
  --tap-target: 44px;
}

[data-theme="dark"] {
  --bg: #120c1a;
  --cream-dim: #2a2238;
  --bg-elevated: #1c1526;
  --surface: rgba(28, 21, 38, 0.92);
  --surface-strong: #261f33;
  --text: #f7f2ff;
  --text-muted: #b4abc8;
  --accent: #c4b5fd;
  --accent-strong: #e9e0ff;
  --accent-soft: rgba(196, 181, 253, 0.16);
  --accent-glow: rgba(196, 181, 253, 0.14);
  --accent-2: #a5b4fc;
  --accent-2-soft: rgba(165, 180, 252, 0.14);
  --warm: #f0abfc;
  --warm-soft: rgba(240, 171, 252, 0.12);
  --success: #5eead4;
  --link-hover-bg: rgba(196, 181, 253, 0.16);
  --nav-menu-hover: color-mix(in srgb, var(--accent-soft) 55%, var(--surface-strong));
  --nav-menu-bg: linear-gradient(168deg, #322a42 0%, #231c30 100%);
  --game-surface: #252030;
  --border: rgba(233, 224, 255, 0.1);
  --shadow-sm: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 24px 48px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(ellipse 100% 82% at 100% 0%, var(--accent-glow), transparent 52%),
    radial-gradient(ellipse 72% 52% at 0% 100%, var(--accent-2-soft), transparent 46%),
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--cream-dim) 35%, transparent), transparent 58%),
    var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
  border-radius: 6px;
  transition:
    color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent);
}

.main-content a:not(.btn):not(.feature-card):not(.nav-link):not(.hero-game-tile):hover,
.site-footer a:not(.btn):hover {
  background-color: var(--link-hover-bg);
  text-decoration: none;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-strong) 18%, transparent);
  color: color-mix(in srgb, var(--accent-strong) 88%, var(--text));
}

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.theme-toggle:focus-visible,
.search-btn:focus-visible,
.btn:focus-visible {
  outline-offset: 3px;
}

.site-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin-inline: auto;
}

.main-content {
  flex: 1;
  padding-top: calc(1rem + env(safe-area-inset-top, 0px));
  padding-bottom: 3rem;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding-top: env(safe-area-inset-top, 0px);
  z-index: 1100;
  backdrop-filter: blur(16px) saturate(1.35);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
  transform: translate3d(0, 0, 0);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.site-header.site-header--scroll-hidden {
  transform: translate3d(0, -100%, 0);
  pointer-events: none;
}

[data-theme="dark"] .site-header {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

@media (prefers-reduced-motion: reduce) {
  .site-header {
    transition: none;
  }

  .site-header.site-header--scroll-hidden {
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
  }
}

.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: clamp(0.65rem, 2vw, 1.1rem);
  flex-wrap: nowrap;
}

/* Desktop: primary row + toolbar flatten so links/search/theme share one flex row */
.nav-primary {
  display: contents;
}

.nav-menu-toggle {
  display: none;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  width: var(--tap-target);
  height: var(--tap-target);
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.nav-menu-toggle:hover {
  border-color: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

.nav-menu-toggle__bars {
  position: relative;
  display: block;
  width: 1.1rem;
  height: 0.75rem;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 50% / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat;
  transition: background 0.2s ease, transform 0.2s ease;
}

.site-header.is-nav-open .nav-menu-toggle__bars {
  background: none;
  transform: rotate(45deg);
}

.site-header.is-nav-open .nav-menu-toggle__bars::before,
.site-header.is-nav-open .nav-menu-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 2px;
  margin-top: -1px;
  border-radius: 1px;
  background: currentColor;
}

.site-header.is-nav-open .nav-menu-toggle__bars::after {
  transform: rotate(90deg);
}

.nav-util-row {
  display: contents;
}

.nav-toolbar {
  display: flex;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin-left: auto;
  flex: 1 1 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-width: 0;
}

.brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.2rem 0.45rem;
  margin: -0.2rem -0.45rem;
  border-radius: 999px;
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.site-header .brand.logo-wrap:hover {
  background-color: var(--link-hover-bg);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-strong) 12%, transparent);
  text-decoration: none;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 55%, var(--accent-strong) 100%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: var(--nav-menu-bg);
  padding: 0.3rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--cream-dim) 55%, var(--border));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 2px 8px rgba(58, 52, 40, 0.06);
  max-width: min(100%, 42rem);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  flex: 0 1 auto;
  min-width: 0;
}

.nav-links::-webkit-scrollbar {
  height: 4px;
}

.nav-links::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

[data-theme="dark"] .nav-links {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 2px 12px rgba(0, 0, 0, 0.28);
}

.nav-link {
  min-height: calc(var(--tap-target) - 6px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--nav-menu-hover);
  text-decoration: none;
  color: var(--accent-strong);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link:focus-visible {
  box-shadow: none;
}

.theme-toggle {
  min-height: var(--tap-target);
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--accent-soft);
}

.header-search {
  display: inline-flex;
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 999px;
  min-height: var(--tap-target);
  padding: 0.2rem;
  flex: 1 1 160px;
  max-width: min(280px, 100%);
  min-width: 0;
}

.header-search input {
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  padding: 0 0.65rem;
  min-width: 0;
  width: 100%;
  flex: 1;
}

.search-btn {
  border: 0;
  background: linear-gradient(135deg, var(--accent-soft), var(--warm-soft));
  color: var(--text);
  border-radius: 999px;
  min-width: 38px;
  min-height: 38px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.search-btn:hover {
  transform: scale(1.05);
}

.search-btn__icon {
  display: block;
  color: var(--accent-strong);
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(
      145deg,
      var(--surface-strong) 0%,
      color-mix(in srgb, var(--bg) 70%, #ffffff) 36%,
      color-mix(in srgb, var(--accent-soft) 55%, var(--cream-dim)) 118%
    );
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.35rem;
}

.hero::after {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: min(420px, 70vw);
  height: min(320px, 50vw);
  background: radial-gradient(circle, var(--accent-2-soft), transparent 70%);
  pointer-events: none;
  opacity: 0.85;
}

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

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.85rem, 4.5vw, 2.65rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.hero p {
  margin: 0.5rem 0 1.15rem;
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.08rem);
  max-width: 42rem;
}

[data-theme="dark"] .hero {
  background: linear-gradient(145deg, var(--surface-strong) 0%, var(--bg-elevated) 45%, var(--accent-soft) 130%);
}

[data-theme="dark"] .feature-card:hover {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
}

/* Homepage hero hub: curved transition + game launcher tiles */
.hero-hub {
  position: relative;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
}

.hero-hub__sky {
  position: relative;
  padding: clamp(1.75rem, 5vw, 2.75rem) clamp(1.25rem, 4vw, 2rem) 2rem;
  background:
    radial-gradient(ellipse 90% 120% at 18% 0%, rgba(250, 245, 255, 0.65), transparent 52%),
    radial-gradient(ellipse 70% 90% at 92% 12%, rgba(196, 181, 253, 0.45), transparent 48%),
    linear-gradient(168deg, #4c1d95 0%, #6d28d9 42%, #7c3aed 72%, #8b5cf6 100%);
  color: #faf5ff;
}

.hero-hub__glow {
  position: absolute;
  inset: auto -18% -30% 42%;
  height: min(220px, 48vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.35), transparent 68%);
  pointer-events: none;
}

.hero-hub__intro {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 36rem;
  margin-inline: auto;
}

.hero-hub__eyebrow {
  margin: 0 0 0.35rem;
  font-size: clamp(0.92rem, 2.35vw, 1.12rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(250, 245, 255, 0.72);
}

.hero-hub__title {
  margin: 0;
  font-size: clamp(1.95rem, 5vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  text-wrap: balance;
}

.hero-hub__subtitle {
  margin: 0.65rem 0 0;
  font-size: clamp(0.98rem, 2.4vw, 1.12rem);
  line-height: 1.55;
  color: rgba(237, 233, 254, 0.92);
}

.hero-hub__wave {
  display: block;
  line-height: 0;
  margin-top: -1px;
  background: var(--bg-elevated);
}

.hero-hub__wave-svg {
  display: block;
  width: 100%;
  height: clamp(52px, 10vw, 76px);
}

.hero-hub__wave-path {
  fill: var(--bg-elevated);
}

.hero-hub__sheet {
  padding: 1rem clamp(1rem, 3vw, 1.75rem) clamp(1.35rem, 4vw, 2rem);
  background: var(--bg-elevated);
}

.hero-hub__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.85rem, 3vw, 1.15rem);
  max-width: 52rem;
  margin-inline: auto;
}

@media (min-width: 720px) {
  .hero-hub__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
}

.hero-game-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.35rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(0.82rem, 2vw, 0.92rem);
  letter-spacing: -0.02em;
  text-align: center;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.hero-game-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
  text-decoration: none;
  color: var(--accent-strong);
}

.hero-game-tile:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

.hero-game-tile__icon {
  display: grid;
  place-items: center;
  width: min(88px, 26vw);
  height: min(88px, 26vw);
}

.hero-game-tile__icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 14px rgba(47, 38, 80, 0.14));
}

[data-theme="dark"] .hero-game-tile__icon svg {
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.35));
}

.hero-game-tile__label {
  line-height: 1.25;
  padding-inline: 0.2rem;
}

[data-theme="dark"] .hero-hub__wave-path {
  fill: var(--bg-elevated);
}

[data-theme="dark"] .hero-hub__sky {
  background:
    radial-gradient(ellipse 88% 100% at 14% 0%, rgba(88, 28, 135, 0.55), transparent 52%),
    linear-gradient(168deg, #2e1064 0%, #4c1d95 45%, #5b21b6 100%);
}

[data-theme="dark"] .hero-hub__subtitle {
  color: rgba(221, 214, 254, 0.88);
}

.stack {
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
}

.panel h2,
.panel h3 {
  margin-top: 0;
  letter-spacing: -0.02em;
}

.panel h2 {
  font-weight: 800;
  font-size: clamp(1.25rem, 2.5vw, 1.45rem);
}

.panel > p {
  font-size: clamp(0.95rem, 2.4vw + 0.35rem, 1.05rem);
  line-height: 1.6;
}

.panel ul {
  margin: 0.25rem 0 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.panel ul li {
  margin-bottom: 0.35rem;
}

.panel ul a {
  font-weight: 600;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card {
  display: block;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.15rem;
  color: inherit;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  text-decoration: none;
}

.feature-card h3 {
  margin: 0.35rem 0 0.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(0.94rem, 2.2vw + 0.38rem, 1rem);
  line-height: 1.55;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent-soft), var(--warm-soft));
  color: var(--accent-strong);
  border: 1px solid var(--border);
}

[data-theme="dark"] .pill {
  color: var(--accent-strong);
}

.faq-list {
  display: grid;
  gap: 0.65rem;
}

.faq-list details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  padding: 0.75rem 0.9rem;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 700;
}

.faq-list p {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
}

.cta-band {
  background: linear-gradient(155deg, var(--surface-strong), var(--accent-soft), var(--accent-2-soft));
  border: 1px solid var(--border);
}

.btn {
  min-height: var(--tap-target);
  border: 0;
  padding: 0 1.35rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  gap: 0.35rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, filter 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 45%, var(--accent-strong) 100%);
  color: #ffffff;
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 24px var(--accent-glow);
  filter: brightness(1.05);
  text-decoration: none;
}

.btn-secondary {
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  text-decoration: none;
}

.btn:active:not(:disabled) {
  transform: scale(0.975);
  transition-duration: 0.1s;
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.975);
  filter: brightness(0.96);
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.btn-secondary:active:not(:disabled) {
  transform: scale(0.975);
  filter: brightness(0.97);
}

@media (prefers-reduced-motion: reduce) {
  .btn:hover,
  .btn:active:not(:disabled),
  .btn-primary:hover,
  .btn-primary:active:not(:disabled),
  .btn-secondary:hover,
  .btn-secondary:active:not(:disabled) {
    transform: none;
    filter: none;
  }

  .word-search-game-shell,
  .word-search-game-shell:hover {
    transition: none;
  }
}

.ad-slot,
.dynamic-slot {
  margin-top: 0.9rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border));
  background: linear-gradient(180deg, var(--surface-strong), var(--accent-soft));
  border-radius: var(--radius-md);
  padding: 1.1rem;
  color: var(--text-muted);
}

.ad-safe {
  margin-block: 1rem;
}

.ad-label {
  display: inline-block;
  margin: 0 0 0.45rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--accent-soft);
  color: var(--text-muted);
}

.game-shell {
  display: grid;
  gap: 1rem;
}

.game-board {
  min-height: 280px;
  border: 1px solid color-mix(in srgb, var(--cream-dim) 45%, var(--border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--game-surface) 92%, #fff) 0%, var(--game-surface) 100%);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.game-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.game-toolbar select {
  min-height: var(--tap-target);
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--cream-dim) 22%, var(--bg-elevated));
  color: var(--text);
  padding: 0 0.6rem;
}

.game-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.game-stats .panel {
  padding: 0.7rem;
  margin: 0;
  text-align: center;
}

/* Word search page: main scrolls so tall layouts never cover the footer */
main.main-content:has(.word-search-page) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(120% 85% at 88% 0%, color-mix(in srgb, var(--accent-soft) 55%, transparent), transparent 55%),
    radial-gradient(95% 70% at 0% 100%, color-mix(in srgb, var(--accent-2-soft) 70%, transparent), transparent 48%),
    radial-gradient(80% 50% at 50% 100%, color-mix(in srgb, var(--cream-dim) 42%, transparent), transparent 52%),
    var(--bg);
  transition: background 0.35s ease;
}

[data-theme="dark"] main.main-content:has(.word-search-page) {
  background:
    radial-gradient(100% 65% at 75% -5%, var(--accent-glow), transparent 52%),
    radial-gradient(85% 55% at 0% 105%, var(--accent-2-soft), transparent 46%),
    var(--bg);
}

.word-search-page {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  width: 100%;
  max-width: none;
  margin-inline: 0;
  overflow-x: auto;
  overflow-y: visible;
}

.word-search-scale-outer {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

[data-theme="dark"] .word-search-scale-outer {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* --- Word Search: fixed frame 831×586 px --- */
.word-search-game-shell {
  --ws-surface: #e9dff8;
  --ws-surface-2: #f6f1ff;
  --ws-border: rgba(91, 33, 182, 0.1);
  --ws-border-strong: rgba(91, 33, 182, 0.16);
  --ws-text: #2f2640;
  --ws-muted: #6d6485;
  --ws-subtle: #ebe3fb;
  --ws-accent: #6d28d9;
  --ws-accent-on: #fffdff;
  --ws-focus: #5b21b6;
  --ws-board: #faf7ff;
  width: 831px;
  height: min(586px, var(--ws-shell-fit-height, 586px));
  flex-shrink: 0;
  margin-inline: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--ws-border);
  border-radius: 12px;
  background: var(--ws-surface-2);
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(47, 38, 80, 0.06),
    0 12px 32px rgba(91, 33, 182, 0.08);
  transition: box-shadow 0.28s ease, border-color 0.28s ease;
}

.word-search-game-shell:hover {
  box-shadow:
    0 2px 4px rgba(47, 38, 80, 0.07),
    0 18px 40px rgba(91, 33, 182, 0.11);
}

[data-theme="dark"] .word-search-game-shell {
  --ws-surface: #2a2238;
  --ws-surface-2: #1a1424;
  --ws-border: rgba(233, 224, 255, 0.1);
  --ws-border-strong: rgba(233, 224, 255, 0.14);
  --ws-text: #f7f2ff;
  --ws-muted: #b4abc8;
  --ws-subtle: #231c30;
  --ws-accent: #c4b5fd;
  --ws-accent-on: #120c1a;
  --ws-focus: #a78bfa;
  --ws-board: #1c1526;
  background: var(--ws-surface-2);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 16px 40px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .word-search-game-shell:hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 20px 48px rgba(0, 0, 0, 0.42);
}

.word-search-game-shell__header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem 0.45rem;
  background: var(--ws-surface-2);
  border-bottom: 1px solid var(--ws-border);
}

.word-search-game-shell__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--ws-text);
}

.word-search-game-shell__toolbar {
  --ws-toolbar-font: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ws-toolbar-label-size: 0.65rem;
  --ws-toolbar-control-size: 0.82rem;
  --ws-toolbar-control-height: 36px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  padding: 0.45rem 0.85rem 0.55rem;
  background: var(--ws-subtle);
  border-bottom: 1px solid var(--ws-border);
  font-family: var(--ws-toolbar-font);
  font-size: var(--ws-toolbar-control-size);
}

[data-theme="dark"] .word-search-game-shell__toolbar {
  background: color-mix(in srgb, var(--ws-subtle) 88%, #020617);
}

.word-search-game-shell .btn {
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.2s ease,
    filter 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.word-search-game-shell .btn-primary {
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 45%, var(--accent-strong) 100%);
  color: #fffef8;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.word-search-game-shell .btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.word-search-game-shell .btn-secondary {
  background: var(--ws-surface-2);
  color: var(--ws-text);
  border: 1px solid var(--ws-border-strong);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

[data-theme="dark"] .word-search-game-shell .btn-secondary {
  box-shadow: none;
}

.word-search-game-shell__toolbar-left,
.word-search-game-shell__toolbar-center,
.word-search-game-shell__toolbar-right {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.word-search-game-shell__toolbar-left {
  align-items: center;
  flex-wrap: nowrap;
  row-gap: 0;
  column-gap: 0.65rem;
}

.word-search-game-shell__grid-font {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.word-search-game-shell__grid-font-label {
  display: none;
}

.word-search-game-shell__grid-font-select {
  box-sizing: border-box;
  height: var(--ws-toolbar-control-height);
  min-height: var(--ws-toolbar-control-height);
  min-width: 0;
  max-width: 9.5rem;
  padding: 0 1.75rem 0 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--ws-border-strong);
  background: var(--ws-surface-2);
  color: var(--ws-text);
  font-size: var(--ws-toolbar-control-size);
  font-weight: 700;
  font-family: var(--ws-toolbar-font);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%236d6485' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
  background-size: 0.65rem;
}

[data-theme="dark"] .word-search-game-shell__grid-font-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23b4abc8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.word-search-game-shell__grid-font-select:focus-visible {
  outline: 2px solid var(--ws-focus);
  outline-offset: 2px;
}

.word-search-game-shell__words-stat {
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
  flex-shrink: 0;
}

.word-search-game-shell__words-stat-label {
  display: none;
}

.word-search-game-shell__words-stat-value {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--ws-toolbar-control-height);
  height: var(--ws-toolbar-control-height);
  padding: 0 0.75rem;
  border-radius: 999px;
  background: var(--ws-surface-2);
  border: 1px solid var(--ws-border-strong);
  font-weight: 700;
  font-size: var(--ws-toolbar-control-size);
  font-family: var(--ws-toolbar-font);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: 0.02em;
  color: var(--ws-text);
  line-height: 1.2;
}

.word-search-game-shell__toolbar-center {
  flex: 1 1 200px;
  justify-content: center;
  min-width: 0;
}

.word-search-game-shell__toolbar-center-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-width: 0;
  max-width: 100%;
}

.word-search-game-shell__status--toolbar {
  margin: 0;
  padding: 0 0.35rem;
  min-height: 0;
  font-size: var(--ws-toolbar-control-size);
  line-height: 1.35;
  font-weight: 600;
  font-family: var(--ws-toolbar-font);
  text-align: center;
  color: var(--ws-muted);
  max-width: 100%;
}

.word-search-game-shell__status--toolbar:empty {
  display: none;
}

.word-search-game-shell__timer {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--ws-toolbar-control-height);
  height: var(--ws-toolbar-control-height);
  padding: 0 0.95rem;
  border-radius: 999px;
  background: var(--ws-surface-2);
  border: 1px solid var(--ws-border-strong);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  font-family: var(--ws-toolbar-font);
}

[data-theme="dark"] .word-search-game-shell__timer {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.word-search-game-shell__timer-icon {
  font-size: var(--ws-toolbar-control-size);
  line-height: 1;
  opacity: 0.85;
}

.word-search-game-shell__timer-digits {
  font-weight: 700;
  font-size: var(--ws-toolbar-control-size);
  font-family: var(--ws-toolbar-font);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: 0.04em;
  color: var(--ws-text);
  line-height: 1.2;
}

.word-search-game-shell__toolbar-right {
  flex-direction: column;
  align-items: flex-end;
  align-self: center;
  justify-content: center;
  gap: 0.35rem;
}

.word-search-game-shell__actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.word-search-game-shell__hint-placeholder {
  display: block;
  max-width: 18rem;
  font-size: var(--ws-toolbar-label-size);
  font-weight: 600;
  font-family: var(--ws-toolbar-font);
  line-height: 1.35;
  text-align: right;
  color: var(--ws-muted);
}

.word-search-game-shell .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}

.word-search-game-shell__toolbar-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ws-muted);
}

.word-search-game-shell__toolbar-value {
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1;
  color: var(--ws-text);
}

.word-search-game-shell__toolbar-mono {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.word-search-game-shell__toolbar-icon {
  font-size: 0.82rem;
  opacity: 0.95;
}

.word-search-game-shell__btn {
  box-sizing: border-box;
  min-height: var(--ws-toolbar-control-height);
  height: var(--ws-toolbar-control-height);
  min-width: 4.75rem;
  padding-inline: 0.85rem;
  font-size: var(--ws-toolbar-control-size);
  font-weight: 700;
  font-family: var(--ws-toolbar-font);
  border-radius: 8px;
}

.word-search-game-shell__body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.word-search-game-shell__sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 0.55rem 0.65rem 0.65rem;
  background: var(--ws-surface);
  border-right: 1px solid var(--ws-border);
}

[data-theme="dark"] .word-search-game-shell__sidebar {
  background: color-mix(in srgb, var(--ws-surface) 92%, #020617);
}

.word-search-game-shell__sidebar-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-bottom: 0.35rem;
  margin-bottom: 0.25rem;
  background: linear-gradient(180deg, var(--ws-surface) 70%, transparent);
}

[data-theme="dark"] .word-search-game-shell__sidebar-head {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--ws-surface) 92%, #020617) 70%,
    transparent
  );
}

.word-search-game-shell__bank-heading {
  margin: 0 0 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ws-muted);
}

.word-search-game-shell__sidebar-tip {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--ws-muted);
}

.word-search-game-shell__bank-list {
  flex: 1;
  min-height: 0;
}

.word-search-game-shell__play.word-search-page__main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  border: none;
  border-radius: 0;
  padding: 0;
  background: var(--ws-board);
  overflow: hidden;
}

[data-theme="dark"] .word-search-game-shell__play.word-search-page__main {
  background: var(--ws-board);
}

.word-search-game-shell__grid.word-search-page__grid {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 0;
  border-radius: 0;
  background: var(--ws-board);
  border: none;
}

[data-theme="dark"] .word-search-game-shell__grid.word-search-page__grid {
  background: var(--ws-board);
}

.word-bank {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text) 22%, transparent) transparent;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0 0.25rem 0.25rem 0;
}

.word-bank li {
  font-weight: 600;
  font-size: clamp(0.72rem, 1.4vw, 0.82rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--surface-strong);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.word-bank li.is-found {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--text-muted) 80%, transparent);
  color: var(--text-muted);
  opacity: 0.88;
}

.word-search-game-shell .word-bank li.is-found {
  color: var(--ws-muted);
}

.word-bank li.is-found::before {
  content: "";
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-strong) 22%, var(--surface-strong));
  border: 1px solid color-mix(in srgb, var(--accent-strong) 35%, transparent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.2 6.4 11 12.5 4.8' stroke='%23059669' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 0.65rem;
  background-position: center;
  background-repeat: no-repeat;
}

[data-theme="dark"] .word-bank li.is-found::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.2 6.4 11 12.5 4.8' stroke='%2334d399' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.word-search-game-shell .word-bank {
  gap: 0.22rem;
}

.word-search-game-shell .word-bank li {
  font-size: clamp(0.74rem, 1.35vw, 0.88rem);
  font-weight: 600;
  letter-spacing: 0.045em;
  padding: 0.38rem 0.42rem;
  border-radius: 2px;
  border: none;
  background: transparent;
  color: var(--ws-text);
}

.word-search-game-shell .word-bank li.is-found {
  background: transparent;
  border: none;
}

@media (min-width: 721px) and (max-width: 1024px) {
  .word-search-game-shell__body {
    grid-template-columns: min(268px, 32%) minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .word-search-game-shell__actions-row {
    width: 100%;
    justify-content: stretch;
  }

  .word-search-game-shell__actions-row .word-search-game-shell__btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  .word-search-game-shell__hint-placeholder {
    text-align: left;
    max-width: none;
  }
}

.word-grid-wrap {
  position: relative;
  flex-shrink: 0;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  aspect-ratio: 1 / 1;
  border-radius: 0;
  background: var(--ws-board, #ffffff);
  box-shadow: none;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* Win celebration card (matches Zip .zip-solved-overlay) */
.word-search-win-panel[hidden] {
  display: none;
}

.word-search-win-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(86%, 450px);
  z-index: 6;
}

.word-search-win-panel__modal {
  position: relative;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(115, 76, 226, 0.36);
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 224, 143, 0.32) 0 24px, transparent 25px),
    radial-gradient(circle at 88% 18%, rgba(255, 170, 226, 0.24) 0 20px, transparent 21px),
    radial-gradient(circle at 84% 82%, rgba(132, 214, 255, 0.22) 0 22px, transparent 23px),
    rgba(255, 255, 255, 0.92);
  color: #22133f;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 12px 34px rgba(36, 24, 85, 0.18);
  backdrop-filter: blur(1.5px);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  overflow: hidden;
  pointer-events: auto;
}

.word-search-win-panel:not([hidden]) .word-search-win-panel__modal {
  animation: word-search-win-pop 0.55s ease-out;
}

.word-search-win-panel__modal::before,
.word-search-win-panel__modal::after {
  content: "✦";
  position: absolute;
  color: rgba(116, 75, 232, 0.7);
  font-size: 1rem;
  pointer-events: none;
  animation: word-search-win-sparkle-float 1.8s ease-in-out infinite;
}

.word-search-win-panel__modal::before {
  left: 0.85rem;
  top: 0.5rem;
}

.word-search-win-panel__modal::after {
  right: 0.85rem;
  bottom: 0.5rem;
  animation-delay: 0.45s;
}

@keyframes word-search-win-pop {
  0% { opacity: 0; transform: scale(0.94); filter: saturate(0.7) brightness(0.95); }
  100% { opacity: 1; transform: scale(1); filter: saturate(1.08) brightness(1); }
}

@keyframes word-search-win-sparkle-float {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.65; }
  50% { transform: translateY(-4px) rotate(10deg); opacity: 1; }
}

.word-search-win-panel__title,
.word-search-win-panel__detail {
  margin: 0;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
}

.word-search-win-panel__btn {
  margin-top: 0.55rem;
  border: 1px solid rgba(115, 76, 226, 0.36);
  background: var(--surface-strong);
  border-radius: 10px;
  min-height: 36px;
  padding: 0.2rem 0.75rem;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: #22133f;
}

[data-theme="dark"] .word-search-win-panel__modal {
  border-color: rgba(185, 160, 255, 0.62);
  color: #f2f5ff;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 224, 143, 0.24) 0 24px, transparent 25px),
    radial-gradient(circle at 88% 18%, rgba(255, 170, 226, 0.18) 0 20px, transparent 21px),
    radial-gradient(circle at 84% 82%, rgba(132, 214, 255, 0.18) 0 22px, transparent 23px),
    rgba(20, 24, 48, 0.9);
  box-shadow: 0 14px 36px rgba(4, 6, 18, 0.5);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .word-search-win-panel__title,
[data-theme="dark"] .word-search-win-panel__detail {
  color: #f2f5ff;
}

.word-search-game-shell .word-grid-wrap {
  background: var(--ws-board);
  aspect-ratio: 16 / 14;
}

[data-theme="dark"] .word-grid-wrap {
  box-shadow: none;
}

.word-search-highlights {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.word-grid {
  --cell-size: 32px;
  --ws-cell-gap: 4px;
  display: grid;
  gap: var(--ws-cell-gap);
  width: fit-content;
  height: fit-content;
  max-width: 100%;
  margin: 0 auto;
  touch-action: none;
  position: relative;
  z-index: 2;
  background: transparent;
  font-family:
    ui-sans-serif,
    system-ui,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Helvetica,
    Arial,
    sans-serif;
}

.word-grid--premium {
  --ws-cell-gap: 5px;
}

@media (min-width: 900px) {
  .word-grid--premium {
    --ws-cell-gap: 6px;
  }
}

/* Tighter grid + larger letters (grid only — word bank unchanged) */
.word-search-game-shell .word-grid--premium {
  --ws-cell-gap: 2px;
  --ws-grid-font-weight: 600;
}

@media (min-width: 900px) {
  .word-search-game-shell .word-grid--premium {
    --ws-cell-gap: 3px;
  }
}

/* Letters sit on the board; pastel “pills” draw in SVG beneath this layer */
.word-cell {
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  width: var(--cell-size);
  height: var(--cell-size);
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  border: none;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
  color: #0a0a0a;
  user-select: none;
  position: relative;
  z-index: 1;
  font-size: clamp(0.84rem, calc(var(--cell-size) * 0.58), 1.48rem);
  cursor: pointer;
  transition:
    background 0.14s ease,
    color 0.14s ease,
    transform 0.12s ease;
}

[data-theme="dark"] .word-cell {
  color: #fafafa;
  background: transparent;
}

.word-search-game-shell .word-cell {
  color: var(--ws-text);
  font-weight: var(--ws-grid-font-weight, 600);
  /* Larger glyphs + tighter gap (scoped); --cell-size from JS increases when gap shrinks */
  font-size: clamp(0.92rem, calc(var(--cell-size) * 0.76), 1.78rem);
}

.word-search-game-shell .word-cell.is-found {
  font-weight: var(--ws-grid-font-weight, 600);
}

.word-cell:hover:not(.is-found) {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .word-cell:hover:not(.is-found) {
  background: rgba(255, 255, 255, 0.06);
}

.word-cell:active:not(.is-found) {
  transform: scale(0.97);
}

.word-cell:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.word-cell.is-active {
  background: color-mix(in srgb, var(--accent-strong) 16%, transparent);
  box-shadow: none;
  z-index: 2;
}

[data-theme="dark"] .word-cell.is-active {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

.word-cell.is-found {
  font-weight: 800;
  border: none;
  background: transparent;
  z-index: 1;
}

.word-cell.is-found[data-found-tone="0"],
.word-cell.is-found[data-found-tone="1"],
.word-cell.is-found[data-found-tone="2"],
.word-cell.is-found[data-found-tone="3"],
.word-cell.is-found[data-found-tone="4"],
.word-cell.is-found[data-found-tone="5"],
.word-cell.is-found[data-found-tone="6"],
.word-cell.is-found[data-found-tone="7"] {
  background: transparent;
}

[data-theme="dark"] .word-cell.is-found[data-found-tone="0"],
[data-theme="dark"] .word-cell.is-found[data-found-tone="1"],
[data-theme="dark"] .word-cell.is-found[data-found-tone="2"],
[data-theme="dark"] .word-cell.is-found[data-found-tone="3"],
[data-theme="dark"] .word-cell.is-found[data-found-tone="4"],
[data-theme="dark"] .word-cell.is-found[data-found-tone="5"],
[data-theme="dark"] .word-cell.is-found[data-found-tone="6"],
[data-theme="dark"] .word-cell.is-found[data-found-tone="7"] {
  background: transparent;
}

@keyframes ws-cell-found-pop {
  0% {
    transform: scale(0.88);
  }
  55% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

.word-cell.is-found-pop {
  animation: ws-cell-found-pop 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

.word-cell.is-hint {
  outline: 2px dashed var(--accent-strong);
  outline-offset: 2px;
  animation: ws-hint-pulse 1.1s ease-in-out infinite;
}

@keyframes ws-hint-pulse {
  0%,
  100% {
    outline-color: var(--accent-strong);
  }
  50% {
    outline-color: color-mix(in srgb, var(--accent-strong) 45%, var(--surface-strong));
  }
}

/* Number Search desktop drag: disable hover repaint while selecting (touch unchanged). */
.word-search-page[data-grid-mode="digits"] .word-grid.is-dragging .word-cell,
.word-search-page[data-grid-mode="digits"] .word-grid:has(.word-cell.is-active) .word-cell {
  transition: none;
}

.word-search-page[data-grid-mode="digits"] .word-grid.is-dragging .word-cell:hover:not(.is-found),
.word-search-page[data-grid-mode="digits"] .word-grid:has(.word-cell.is-active) .word-cell:hover:not(.is-found) {
  background: transparent;
}

.word-search-page[data-grid-mode="digits"] .word-grid.is-dragging .word-cell:active:not(.is-found),
.word-search-page[data-grid-mode="digits"] .word-grid:has(.word-cell.is-active) .word-cell:active:not(.is-found) {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .word-cell,
  .word-cell.is-found-pop,
  .word-cell.is-hint {
    animation: none !important;
    transition: none !important;
  }

  .word-cell:active:not(.is-found) {
    transform: none;
  }
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-footer {
  flex-shrink: 0;
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 2rem 0 2.25rem;
  background: linear-gradient(180deg, transparent, var(--accent-soft));
}

[data-theme="dark"] .site-footer {
  background: linear-gradient(180deg, transparent, rgba(38, 28, 58, 0.78));
}

.site-footer h3 {
  margin-top: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-footer .footer-grid p {
  color: var(--text-muted);
  margin-block: 0.35rem 0;
  max-width: 36rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 2.75rem);
  align-items: start;
  justify-items: stretch;
  margin-bottom: 1.5rem;
}

.footer-block h3 {
  margin-bottom: 0.5rem;
}

.footer-about p {
  margin-top: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.footer-links--stack {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.45rem;
}

.footer-links a {
  font-weight: 600;
  font-size: 0.92rem;
}

.footer-links a:hover {
  color: color-mix(in srgb, var(--accent-strong) 88%, var(--text));
}

.footer-bottom {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-bottom--toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.85rem 1.25rem;
}

.footer-bottom p {
  margin: 0;
  width: 100%;
  max-width: none;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-bottom--toolbar p {
  width: auto;
  flex: 1 1 12rem;
  text-align: center;
}

.theme-toggle--footer {
  min-height: 42px;
  padding: 0 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 2rem;
  }

  .footer-about {
    grid-column: 1 / -1;
    max-width: 40rem;
  }

  .nav {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    row-gap: 0.55rem;
    padding-block: 0.5rem;
    min-height: 0;
  }

  .nav-primary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.65rem;
  }

  .nav-menu-toggle {
    display: inline-flex;
  }

  .nav-toolbar {
    flex: 1 1 auto;
    width: 100%;
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }

  .site-header:not(.is-nav-open) .nav-links {
    display: none;
  }

  .site-header.is-nav-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    width: 100%;
    max-width: none;
    padding: 0.45rem;
    overflow-x: visible;
    overscroll-behavior-x: auto;
    border-radius: var(--radius-md);
  }

  .site-header.is-nav-open .nav-link {
    justify-content: flex-start;
    border-radius: var(--radius-sm);
    white-space: normal;
    text-align: left;
    width: 100%;
  }

  .nav-util-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
  }

  .header-search {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    min-height: 44px;
    max-height: 48px;
  }

  .theme-toggle {
    flex-shrink: 0;
  }

  .card-grid,
  .three-col {
    grid-template-columns: 1fr;
  }

  .game-stats {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 1024px) {
  /* Word search: fluid shell so the grid uses real viewport width (no horizontal page scroll) */
  main.main-content:has(.word-search-page) {
    min-height: 0;
  }

  .word-search-page {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.5rem clamp(0.45rem, 2.2vw, 0.85rem);
    overflow-x: hidden;
  }

  .word-search-scale-outer {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    width: 100%;
  }

  .word-search-game-shell {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: min(586px, var(--ws-shell-fit-height, 586px), calc(100dvh - 10.5rem - env(safe-area-inset-top, 0px)));
    flex: 1 1 auto;
    margin-inline: auto;
  }

  .word-search-game-shell__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .word-search-game-shell__sidebar {
    order: 2;
    width: 100%;
    border-right: none;
    border-top: 1px solid var(--ws-border);
    border-bottom: none;
  }

  .word-search-page:not(.word-search-page--play-focus) .word-search-game-shell__sidebar {
    flex: 0 1 auto;
    max-height: min(42vh, 280px);
    min-height: min(28vh, 200px);
    overflow: hidden;
  }

  .word-search-page:not(.word-search-page--play-focus) .word-search-game-shell__bank-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  [data-theme="dark"] .word-search-game-shell__sidebar {
    border-top-color: var(--ws-border);
  }

  .word-search-game-shell__play.word-search-page__main {
    order: 1;
    flex: 0 0 auto;
    min-height: 0;
    padding: 0;
  }

  .word-search-game-shell__grid.word-search-page__grid {
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: center;
    overflow: visible;
  }

  .word-search-game-shell__sidebar-head {
    position: relative;
    background: transparent;
  }

  [data-theme="dark"] .word-search-game-shell__sidebar-head {
    background: transparent;
  }
}

/* Focus mode: mobile/tablet play without below-the-fold SEO or footer */
.word-search-game-shell__expand-btn {
  display: none;
}

@media (max-width: 1024px) {
  .word-search-game-shell__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.4rem;
    padding: 0.45rem 0.7rem 0.5rem;
  }

  .word-search-game-shell__toolbar-center,
  .word-search-game-shell__toolbar-center-inner,
  .word-search-game-shell__toolbar-right {
    display: contents;
  }

  .word-search-game-shell__toolbar-left {
    order: 1;
    flex: 0 1 auto;
    align-items: center;
    flex-wrap: nowrap;
    column-gap: 0.5rem;
    row-gap: 0;
    min-width: 0;
  }

  .word-search-game-shell__grid-font-select {
    max-width: 6.75rem;
  }

  .word-search-game-shell__timer {
    order: 2;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .word-search-game-shell__actions-row {
    order: 4;
    flex-basis: 100%;
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
  }

  .word-search-game-shell__hint-placeholder {
    order: 11;
    flex: 1 1 100%;
    width: 100%;
    line-height: 1.25;
    font-size: 0.62rem;
    text-align: left;
  }

  .word-search-game-shell__status--toolbar:not(:empty) {
    order: 10;
    flex: 1 1 100%;
    width: 100%;
    text-align: left;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .word-search-game-shell__expand-btn {
    order: 3;
    flex: 0 0 auto;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--ws-toolbar-control-height);
    height: var(--ws-toolbar-control-height);
    margin: 0;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--ws-border-strong);
    background: var(--ws-surface-2);
    color: var(--ws-text);
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  }

  [data-theme="dark"] .word-search-game-shell__expand-btn {
    box-shadow: none;
  }

  .word-search-game-shell__expand-btn:focus-visible {
    outline: 2px solid var(--ws-focus);
    outline-offset: 2px;
  }

  .word-search-game-shell__expand-btn-icon {
    display: block;
    flex-shrink: 0;
  }

  .word-search-game-shell__expand-btn-icon--compress {
    display: none;
  }

  .word-search-game-shell__expand-btn--active .word-search-game-shell__expand-btn-icon--expand {
    display: none;
  }

  .word-search-game-shell__expand-btn--active .word-search-game-shell__expand-btn-icon--compress {
    display: block;
  }

  body.site-shell--ws-play-focus {
    overflow: hidden;
  }

  body.site-shell--ws-play-focus .site-footer {
    display: none;
  }

  body.site-shell--ws-play-focus main.main-content:has(.word-search-page--play-focus) {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
    overflow: hidden;
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
    box-sizing: border-box;
  }

  .word-search-page--play-focus {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    padding: 0;
    overflow: hidden;
  }

  .word-search-page--play-focus .word-search-page__seo {
    display: none !important;
    content-visibility: hidden;
  }

  .word-search-page--play-focus .word-search-scale-outer {
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
    justify-content: stretch;
    width: 100%;
    max-width: 100%;
    height: 100%;
  }

  .word-search-page--play-focus .word-search-game-shell {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
    margin-inline: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .word-search-page--play-focus .word-search-game-shell__header {
    flex: 0 0 auto;
    display: flex;
    padding: 0.35rem 0.5rem;
  }

  .word-search-page--play-focus .word-search-game-shell__title {
    font-size: 1.05rem;
  }

  .word-search-page--play-focus .word-search-game-shell__sidebar {
    max-height: none;
    flex: 1 1 auto;
    min-height: min(32vh, 220px);
  }

  .word-search-page--play-focus .word-search-game-shell__play.word-search-page__main {
    flex: 0 0 auto;
    min-height: 0;
  }
}

/* Tablet only: fullscreen toggle last in toolbar (Word Search + Number Search) */
@media (min-width: 721px) and (max-width: 1024px) {
  .word-search-game-shell__expand-btn {
    order: 99;
    margin-left: auto;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(var(--container), calc(100% - 1.2rem));
  }

  .main-content {
    padding-bottom: 2.2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.35rem;
  }

  .site-footer {
    padding-block: 1.65rem 2rem;
  }

  .nav-link {
    font-size: 0.9rem;
    padding: 0.42rem 0.72rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* Word search: supplementary copy below the game (SEO, no interaction with grid) */
.word-search-page__seo {
  --ws-seo-accent: color-mix(in srgb, var(--accent-strong) 88%, var(--text));
  position: relative;
  width: 100%;
  max-width: min(831px, 100%);
  margin-inline: auto;
  margin-top: clamp(1.25rem, 3vw, 2rem);
  padding: clamp(1.35rem, 2.6vw, 1.85rem) clamp(1.15rem, 2.8vw, 1.75rem);
  padding-top: calc(clamp(1.35rem, 2.6vw, 1.85rem) + 3px);
  box-sizing: border-box;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent-strong) 14%, var(--border));
  background:
    linear-gradient(
      165deg,
      color-mix(in srgb, var(--accent-strong) 6%, var(--surface)) 0%,
      color-mix(in srgb, var(--surface) 94%, var(--bg)) 42%,
      var(--bg) 100%
    );
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 10px 36px rgba(91, 33, 182, 0.09);
  color: var(--text);
  overflow: hidden;
}

.word-search-page__seo::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent-strong) 65%, #c4b5fd),
    color-mix(in srgb, var(--accent-strong) 35%, #a78bfa),
    color-mix(in srgb, var(--accent-strong) 55%, #e9d5ff)
  );
}

[data-theme="dark"] .word-search-page__seo {
  border-color: color-mix(in srgb, var(--accent-strong) 22%, var(--border));
  background:
    linear-gradient(
      165deg,
      color-mix(in srgb, var(--accent-strong) 12%, var(--surface)) 0%,
      color-mix(in srgb, var(--surface) 76%, var(--bg)) 55%,
      var(--bg) 100%
    );
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 14px 40px rgba(0, 0, 0, 0.35);
  /* Subheadings use --ws-seo-accent; in dark theme default accent mix was too close to body text */
  --ws-seo-accent: color-mix(in srgb, var(--accent-2) 62%, #f8fafc);
}

[data-theme="dark"] .word-search-page__seo::before {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent-strong) 75%, #1a1424),
    color-mix(in srgb, var(--accent-strong) 45%, #2d2640),
    color-mix(in srgb, var(--accent-strong) 60%, #120c1a)
  );
}

/* Dark mode: body text and default "accent-strong" are both very light — lift headings
   and in-copy links so hierarchy and internal links stay obvious. */
[data-theme="dark"] .word-search-page__seo-title {
  color: color-mix(in srgb, #f8fafc 82%, var(--accent-2));
}

[data-theme="dark"] .word-search-page__seo-heading-sm {
  color: color-mix(in srgb, var(--text) 72%, var(--accent-2));
  border-left-color: color-mix(in srgb, var(--accent-2) 70%, transparent);
}

[data-theme="dark"] .word-search-page__seo-faq-q {
  color: color-mix(in srgb, var(--text) 78%, var(--accent-2));
}

[data-theme="dark"] .word-search-page__seo a {
  color: var(--accent-2);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent-2) 45%, transparent);
  text-underline-offset: 0.14em;
}

[data-theme="dark"] .word-search-page__seo a:hover,
html[data-theme="dark"] body.site-shell main.main-content .word-search-page__seo a:hover {
  color: #dbe4ff;
  text-decoration-color: color-mix(in srgb, var(--accent-2) 85%, #ffffff);
  background-color: color-mix(in srgb, var(--accent-2) 14%, transparent);
  box-shadow: none;
}

.word-search-page__seo-title {
  margin: 0 0 1.05rem;
  font-size: clamp(1.22rem, 2.5vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.28;
  color: var(--text);
}

.word-search-page__seo-title-inner {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.word-search-page__seo-hero-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 14px;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent-strong) 58%, #faf5ff),
    color-mix(in srgb, var(--accent-strong) 38%, #e9d5ff)
  );
  color: #fff;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.35) inset,
    0 8px 22px rgba(109, 40, 217, 0.28);
}

.word-search-page__seo-hero-icon svg {
  display: block;
  width: 1.85rem;
  height: 1.85rem;
  filter: drop-shadow(0 1px 1px rgba(58, 30, 118, 0.2));
}

[data-theme="dark"] .word-search-page__seo-hero-icon {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent-strong) 72%, #1c1526),
    color-mix(in srgb, var(--accent-strong) 48%, #2a2238)
  );
  color: color-mix(in srgb, var(--accent-strong) 90%, #f7f2ff);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 10px 28px rgba(0, 0, 0, 0.45);
}

.word-search-page__seo-title-text {
  flex: 1;
  min-width: 0;
}

.word-search-page__seo-subtitle {
  --ws-seo-sub-ico-size: 2.35rem;
  display: block;
  position: relative;
  margin: 1.55rem 0 0.6rem;
  padding-left: calc(var(--ws-seo-sub-ico-size) + 0.7rem);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent-strong) 16%, transparent);
  font-size: clamp(1.06rem, 2vw, 1.22rem);
  font-weight: 650;
  letter-spacing: -0.018em;
  line-height: 1.32;
  color: var(--ws-seo-accent);
}

.word-search-page__seo-subtitle::before {
  content: "";
  position: absolute;
  left: 0;
  /* First-line optical center (fallback, then lh-aware; half icon = 1.175rem at 2.35rem) */
  top: 0.18em;
  top: calc(0.5lh - var(--ws-seo-sub-ico-size) / 2);
  width: var(--ws-seo-sub-ico-size);
  height: var(--ws-seo-sub-ico-size);
  border-radius: 12px;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent-strong) 44%, var(--surface)),
    color-mix(in srgb, var(--accent-strong) 24%, var(--surface))
  );
  -webkit-mask-image: var(--ws-seo-ico);
  mask-image: var(--ws-seo-ico);
  -webkit-mask-size: 72%;
  mask-size: 72%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

[data-theme="dark"] .word-search-page__seo-subtitle::before {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent-strong) 52%, var(--surface)),
    color-mix(in srgb, var(--accent-strong) 28%, var(--surface))
  );
}

.word-search-page__seo-subtitle--how {
  --ws-seo-ico: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M4%2010.5c-.83%200-1.5.67-1.5%201.5s.67%201.5%201.5%201.5%201.5-.67%201.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83%200-1.5.67-1.5%201.5S3.17%207.5%204%207.5%205.5%206.83%205.5%206%204.83%204%204%204zm0%2012c-.83%200-1.5.67-1.5%201.5s.67%201.5%201.5%201.5%201.5-.67%201.5-1.5-.67-1.5-1.5-1.5zM7%2019h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z%22/%3E%3C/svg%3E");
}

.word-search-page__seo-subtitle--features {
  --ws-seo-ico: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M9%2016.17L4.83%2012l-1.42%201.41L9%2019%2021%207l-1.41-1.41L9%2016.17z%22/%3E%3C/svg%3E");
}

.word-search-page__seo-subtitle--different {
  --ws-seo-ico: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M12%202l3.09%206.26L22%209.27l-5%204.87%201.18%206.88L12%2017.77l-6.18%203.25L7%2014.14%202%209.27l6.91-1.01L12%202z%22/%3E%3C/svg%3E");
}

.word-search-page__seo-subtitle--benefits {
  --ws-seo-ico: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M12%2021.35l-1.45-1.32C5.4%2015.36%202%2012.28%202%208.5%202%205.42%204.42%203%207.5%203c1.74%200%203.41.81%204.5%202.09C13.09%203.81%2014.76%203%2016.5%203%2019.58%203%2022%205.42%2022%208.5c0%203.78-3.4%206.86-8.55%2011.54L12%2021.35z%22/%3E%3C/svg%3E");
}

.word-search-page__seo-subtitle--enjoy {
  --ws-seo-ico: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M11.99%202C6.47%202%202%206.48%202%2012s4.47%2010%209.99%2010C17.52%2022%2022%2017.52%2022%2012S17.52%202%2011.99%202zM12%2020c-4.42%200-8-3.58-8-8s3.58-8%208-8%208%203.58%208%208-3.58%208-8%208zm3.5-9c.83%200%201.5-.67%201.5-1.5S16.33%208%2015.5%208%2014%208.67%2014%209.5s.67%201.5%201.5%201.5zm-7%200c.83%200%201.5-.67%201.5-1.5S9.33%208%208.5%208%207%208.67%207%209.5%207.67%2011%208.5%2011zm3.5%206.5c2.33%200%204.31-1.46%205.11-3.5H6.89c.8%202.04%202.78%203.5%205.11%203.5z%22/%3E%3C/svg%3E");
}

.word-search-page__seo-subtitle--tips {
  --ws-seo-ico: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M9%2021c0%20.55.45%201%201%201h4c.55%200%201-.45%201-1v-1H9v1zm3-19C8.14%202%205%205.14%205%209c0%202.38%201.19%204.47%203%205.74V17c0%20.55.45%201%201%201h6c.55%200%201-.45%201-1v-2.26c1.81-1.27%203-3.36%203-5.74%200-3.86-3.14-7-7-7z%22/%3E%3C/svg%3E");
}

.word-search-page__seo-subtitle--categories {
  --ws-seo-ico: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M17.63%205.84C17.27%205.33%2016.67%205%2016%205L5%205.01C3.9%205.01%203%205.9%203%207v10c0%201.1.9%201.99%202%201.99L16%2019c.67%200%201.27-.33%201.63-.84L22%2012l-4.37-6.16z%22/%3E%3C/svg%3E");
}

.word-search-page__seo-subtitle--duration {
  --ws-seo-ico: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M11.99%202C6.47%202%202%206.48%202%2012s4.47%2010%209.99%2010C17.52%2022%2022%2017.52%2022%2012S17.52%202%2011.99%202zM12%2020c-4.42%200-8-3.58-8-8s3.58-8%208-8%208%203.58%208%208-3.58%208-8%208zm.5-13H11v6l5.25%203.15.75-1.23-4.5-2.67z%22/%3E%3C/svg%3E");
}

.word-search-page__seo-subtitle--online {
  --ws-seo-ico: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M12%202C6.48%202%202%206.48%202%2012s4.48%2010%2010%2010%2010-4.48%2010-10S17.52%202%2012%202zm-1%2017.93c-3.95-.49-7-3.85-7-7.93%200-.62.08-1.21.21-1.79L9%2015v1c0%201.1.9%202%202%202v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55%200%201-.45%201-1V7h2c1.1%200%202-.9%202-2v-.41c2.93%201.19%205%204.06%205%207.41%200%202.08-.8%203.97-2.1%205.39z%22/%3E%3C/svg%3E");
}

.word-search-page__seo-subtitle--faq {
  --ws-seo-ico: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M12%202C6.48%202%202%206.48%202%2012s4.48%2010%2010%2010%2010-4.48%2010-10S17.52%202%2012%202zm1%2017h-2v-2h2v2zm2.07-7.75l-.9.92C13.45%2012.9%2013%2013.5%2013%2015h-2v-.5c0-1.1.45-2.1%201.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41%200-1.1-.9-2-2-2s-2%20.9-2%202H8c0-2.21%201.79-4%204-4s4%201.79%204%204c0%20.88-.36%201.68-.93%202.25z%22/%3E%3C/svg%3E");
}

.word-search-page__seo-heading-sm {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.05rem 0 0.4rem;
  padding: 0.2rem 0 0.2rem 0.55rem;
  border-left: 3px solid color-mix(in srgb, var(--accent-strong) 55%, transparent);
  border-radius: 0 6px 6px 0;
  font-size: 1.02rem;
  font-weight: 650;
  color: var(--text);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent-strong) 9%, transparent),
    transparent 72%
  );
}

.word-search-page__seo-heading-sm::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--accent-strong) 85%, var(--text));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-strong) 18%, transparent);
}

.word-search-page__seo-body {
  font-size: 0.96rem;
  line-height: 1.68;
  color: color-mix(in srgb, var(--text) 91%, var(--text-muted));
}

.word-search-page__seo-body > p {
  margin: 0 0 0.9rem;
}

.word-search-page__seo-body > p:last-child {
  margin-bottom: 0;
}

.word-search-page__seo-list {
  margin: 0 0 1rem;
  padding-left: 0;
  list-style: none;
}

.word-search-page__seo-list li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.48rem;
  line-height: 1.55;
}

.word-search-page__seo-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  top: calc(0.5lh - 0.575rem);
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 6px;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent-strong) 38%, var(--surface)),
    color-mix(in srgb, var(--accent-strong) 22%, var(--surface))
  );
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M9%2016.17L4.83%2012l-1.42%201.41L9%2019%2021%207l-1.41-1.41L9%2016.17z%22/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M9%2016.17L4.83%2012l-1.42%201.41L9%2019%2021%207l-1.41-1.41L9%2016.17z%22/%3E%3C/svg%3E");
  -webkit-mask-size: 62%;
  mask-size: 62%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.word-search-page__seo-list li:last-child {
  margin-bottom: 0;
}

.word-search-page__seo-faq {
  --faq-ico: 1.85rem;
  margin: 0;
}

.word-search-page__seo-faq-q {
  display: block;
  position: relative;
  margin: 1.05rem 0 0.38rem;
  padding-left: calc(var(--faq-ico) + 0.65rem);
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.38;
  color: var(--text);
}

.word-search-page__seo-faq-q:first-child {
  margin-top: 0.35rem;
}

.word-search-page__seo-faq-q::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.14em;
  top: calc(0.5lh - var(--faq-ico) / 2);
  width: var(--faq-ico);
  height: var(--faq-ico);
  border-radius: 50%;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent-strong) 40%, var(--surface)),
    color-mix(in srgb, var(--accent-strong) 22%, var(--surface))
  );
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M12%202C6.48%202%202%206.48%202%2012s4.48%2010%2010%2010%2010-4.48%2010-10S17.52%202%2012%202zm1%2017h-2v-2h2v2zm2.07-7.75l-.9.92C13.45%2012.9%2013%2013.5%2013%2015h-2v-.5c0-1.1.45-2.1%201.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41%200-1.1-.9-2-2-2s-2%20.9-2%202H8c0-2.21%201.79-4%204-4s4%201.79%204%204c0%20.88-.36%201.68-.93%202.25z%22/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M12%202C6.48%202%202%206.48%202%2012s4.48%2010%2010%2010%2010-4.48%2010-10S17.52%202%2012%202zm1%2017h-2v-2h2v2zm2.07-7.75l-.9.92C13.45%2012.9%2013%2013.5%2013%2015h-2v-.5c0-1.1.45-2.1%201.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41%200-1.1-.9-2-2-2s-2%20.9-2%202H8c0-2.21%201.79-4%204-4s4%201.79%204%204c0%20.88-.36%201.68-.93%202.25z%22/%3E%3C/svg%3E");
  -webkit-mask-size: 68%;
  mask-size: 68%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

/* Rule sits under the icon center; answer text lines up with question text */
.word-search-page__seo-faq-a {
  margin: 0 0 0.85rem;
  margin-left: calc(var(--faq-ico) / 2 - 1px);
  padding: 0 0 0 calc(var(--faq-ico) / 2 + 0.65rem - 1px);
  font-size: 0.95rem;
  line-height: 1.62;
  color: color-mix(in srgb, var(--text) 89%, var(--text-muted));
  border-left: 2px solid color-mix(in srgb, var(--accent-strong) 18%, transparent);
}

.word-search-page__seo-faq-a:last-child {
  margin-bottom: 0;
}

/* Below-the-fold sections: skip layout work until needed */
.content-defer {
  content-visibility: auto;
  contain-intrinsic-size: 0 420px;
}

/* Unified premium control buttons across all games (excluding puzzle grid cells). */
:is(
  .qg-page .qg-controls button,
  .zip-game-page .zip-new-game,
  .zip-game-page .zip-controls button,
  .word-search-page .word-search-game-shell__btn,
  .word-search-page .fill-ins-header__new-game,
  .word-search-page .word-search-win-panel__btn,
  .word-search-page .fill-ins-win-panel__btn,
  .color-rush-page .color-rush-shell__new-game,
  .color-rush-page .color-rush-win-panel__btn
) {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent-strong) 35%, var(--border));
  background: transparent;
  color: color-mix(in srgb, var(--accent-strong) 88%, var(--text));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.34) inset,
    0 5px 12px rgba(58, 30, 118, 0.08);
  transition:
    transform 0.16s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    filter 0.2s ease;
}

:is(
  .qg-page .qg-controls button,
  .zip-game-page .zip-new-game,
  .zip-game-page .zip-controls button,
  .word-search-page .word-search-game-shell__btn,
  .word-search-page .fill-ins-header__new-game,
  .word-search-page .word-search-win-panel__btn,
  .word-search-page .fill-ins-win-panel__btn,
  .color-rush-page .color-rush-shell__new-game,
  .color-rush-page .color-rush-win-panel__btn
):hover:not(:disabled) {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--accent-soft) 46%, transparent);
  border-color: color-mix(in srgb, var(--accent-strong) 55%, var(--border));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.42) inset,
    0 10px 22px rgba(58, 30, 118, 0.16);
  filter: saturate(1.04);
}

:is(
  .qg-page .qg-controls button,
  .zip-game-page .zip-new-game,
  .zip-game-page .zip-controls button,
  .word-search-page .word-search-game-shell__btn,
  .word-search-page .fill-ins-header__new-game,
  .word-search-page .word-search-win-panel__btn,
  .word-search-page .fill-ins-win-panel__btn,
  .color-rush-page .color-rush-shell__new-game,
  .color-rush-page .color-rush-win-panel__btn
):active:not(:disabled) {
  transform: translateY(0);
  background: color-mix(in srgb, var(--accent-soft) 62%, transparent);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.36) inset,
    0 4px 10px rgba(58, 30, 118, 0.12);
}

/* Unified transparent "option/stat" cards across games. */
:is(
  .qg-page .qg-chip,
  .zip-game-page .zip-timer-top,
  .word-search-page .word-search-game-shell__timer,
  .word-search-page .fill-ins-header__timer,
  .color-rush-page .color-rush-stat
) {
  background: transparent;
  border-color: color-mix(in srgb, var(--accent-strong) 28%, var(--border));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 4px 10px rgba(58, 30, 118, 0.06);
}

/* Global dropdown option highlight background (font color unchanged). */
select option:hover,
select option:focus,
select option:checked {
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--surface-strong)) !important;
  box-shadow: inset 0 0 0 9999px color-mix(in srgb, var(--accent-soft) 72%, var(--surface-strong)) !important;
  -webkit-text-fill-color: currentColor;
}

/* Match Queens "How to Play" typography across other game help sections. */
.zip-game-page .zip-help,
.color-rush-page .color-rush-help__line {
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.zip-game-page .zip-help {
  margin-top: 0.7rem;
}

.zip-game-page .zip-help strong,
.color-rush-page .color-rush-help__title {
  color: var(--text);
}

/* Force black text only for game control/action buttons. */
:is(
  .qg-page .qg-controls button,
  .zip-game-page .zip-new-game,
  .zip-game-page .zip-controls button,
  .word-search-page .word-search-game-shell__btn,
  .word-search-page .fill-ins-header__new-game,
  .word-search-page .word-search-win-panel__btn,
  .word-search-page .fill-ins-win-panel__btn,
  .color-rush-page .color-rush-shell__new-game,
  .color-rush-page .color-rush-win-panel__btn
) {
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
}

/* Keep game button text readable in dark mode. */
[data-theme="dark"] :is(
  .qg-page .qg-controls button,
  .zip-game-page .zip-new-game,
  .zip-game-page .zip-controls button,
  .word-search-page .word-search-game-shell__btn,
  .word-search-page .fill-ins-header__new-game,
  .word-search-page .word-search-win-panel__btn,
  .word-search-page .fill-ins-win-panel__btn,
  .color-rush-page .color-rush-shell__new-game,
  .color-rush-page .color-rush-win-panel__btn
) {
  color: #f3e8ff !important;
  -webkit-text-fill-color: #f3e8ff !important;
}

/* Celebration-card New game buttons (match Zip header button in dark mode). */
[data-theme="dark"] :is(
  .word-search-page .word-search-win-panel__btn,
  .word-search-page .fill-ins-win-panel__btn,
  .color-rush-page .color-rush-win-panel__btn
) {
  color: #e6ebff !important;
  -webkit-text-fill-color: #e6ebff !important;
  background: rgba(18, 24, 43, 0.48) !important;
  border-color: rgba(150, 168, 218, 0.4) !important;
  box-shadow: none !important;
  filter: none;
}

[data-theme="dark"] :is(
  .word-search-page .word-search-win-panel__btn,
  .word-search-page .fill-ins-win-panel__btn,
  .color-rush-page .color-rush-win-panel__btn
):hover:not(:disabled) {
  background: rgba(31, 45, 79, 0.62) !important;
  border-color: rgba(172, 188, 233, 0.6) !important;
}
