:root {
  --family-bg: #f8fafc;
  --family-card: #ffffff;
  --family-card-soft: #f8fbff;
  --family-border: rgba(148, 163, 184, 0.18);
  --family-text: #0f172a;
  --family-muted: #475569;
  --family-blue: #2563eb;
  --family-green: #16a34a;
  --family-yellow: #f59e0b;
  --family-pink: #ec4899;
  --family-purple: #7c3aed;
  --family-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

body.family-page {
  min-height: 100vh;
  color: var(--family-text);
  background:
    radial-gradient(circle at 10% 12%, rgba(59, 130, 246, 0.08), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(236, 72, 153, 0.08), transparent 26%),
    radial-gradient(circle at 18% 84%, rgba(34, 197, 94, 0.08), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, #eef7ff 100%);
}

body.family-page--spelling {
  background:
    radial-gradient(circle at 12% 10%, rgba(59, 130, 246, 0.10), transparent 24%),
    radial-gradient(circle at 86% 12%, rgba(236, 72, 153, 0.09), transparent 24%),
    radial-gradient(circle at 72% 82%, rgba(245, 158, 11, 0.09), transparent 22%),
    linear-gradient(180deg, #fffdf9 0%, #f3f8ff 52%, #eef6ff 100%);
}

body.spelling-beginner {
  background:
    radial-gradient(circle at 12% 10%, rgba(59, 130, 246, 0.12), transparent 24%),
    radial-gradient(circle at 86% 12%, rgba(236, 72, 153, 0.10), transparent 24%),
    radial-gradient(circle at 72% 82%, rgba(245, 158, 11, 0.10), transparent 22%),
    linear-gradient(180deg, #fffdf9 0%, #f3f8ff 52%, #eef6ff 100%);
}

body.spelling-easy {
  background:
    radial-gradient(circle at 12% 10%, rgba(34, 197, 94, 0.12), transparent 24%),
    radial-gradient(circle at 86% 12%, rgba(245, 158, 11, 0.10), transparent 24%),
    radial-gradient(circle at 72% 82%, rgba(59, 130, 246, 0.09), transparent 22%),
    linear-gradient(180deg, #fffdf2 0%, #f2fbf6 52%, #eef7ff 100%);
}

body.spelling-challenge {
  background:
    radial-gradient(circle at 12% 10%, rgba(124, 58, 237, 0.12), transparent 24%),
    radial-gradient(circle at 86% 12%, rgba(59, 130, 246, 0.11), transparent 24%),
    radial-gradient(circle at 72% 82%, rgba(236, 72, 153, 0.09), transparent 22%),
    linear-gradient(180deg, #fffdfd 0%, #f4f6ff 52%, #eef2ff 100%);
}

body.family-page .page-wrap {
  max-width: 1360px;
}

.family-hero,
.family-panel,
.family-card,
.family-recommendation,
.family-faq-item,
.family-board,
.family-print-card {
  background: var(--family-card);
  border: 1px solid var(--family-border);
  border-radius: 24px;
  box-shadow: var(--family-shadow);
}

.family-hero {
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.family-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 18%, rgba(59, 130, 246, 0.10), transparent 18%),
    radial-gradient(circle at 78% 14%, rgba(245, 158, 11, 0.08), transparent 16%),
    radial-gradient(circle at 62% 82%, rgba(22, 163, 74, 0.08), transparent 20%);
  opacity: .85;
}

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

.family-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.family-title {
  margin: 14px 0 8px;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1;
  letter-spacing: -.06em;
  color: var(--family-text);
}

.family-subtitle {
  max-width: 72ch;
  margin: 0;
  color: var(--family-muted);
  font-size: 17px;
  line-height: 1.6;
}

.family-actions,
.family-social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.family-social-row {
  margin-top: 8px;
}

.family-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

.family-btn:hover {
  transform: translateY(-1px);
}

.family-btn:focus-visible,
.spelling-mode-card:focus-visible,
.spelling-category-card:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.42);
  outline-offset: 3px;
}

.family-btn.is-active,
.spelling-mode-card.is-active,
.spelling-category-card.is-active {
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
  transform: translateY(-2px);
}

.spelling-mode-card.is-active,
.spelling-category-card.is-active {
  border-color: rgba(37, 99, 235, 0.35);
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.92), transparent 18%),
    linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.family-btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  box-shadow: 0 14px 24px rgba(37, 99, 235, 0.22);
}

.family-btn--soft {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.family-btn--facebook {
  color: #fff;
  background: linear-gradient(135deg, #1877f2, #0f5fd4);
  box-shadow: 0 14px 24px rgba(24, 119, 242, 0.22);
}

.family-btn--ghost {
  color: #0f172a;
  background: #fff;
  border-color: #cbd5e1;
}

.family-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.family-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

.family-section {
  margin-top: 14px;
}

.spelling-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .95fr);
  gap: 12px;
  align-items: center;
  overflow: hidden;
}

.spelling-hero::after {
  content: "";
  position: absolute;
  inset: auto -20px -30px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.16), transparent 70%);
  pointer-events: none;
}

.spelling-hero__copy,
.spelling-hero__mascot {
  position: relative;
  z-index: 1;
}

.spelling-hero__copy {
  display: grid;
  gap: 10px;
}

.spelling-hero__mascot {
  display: grid;
  place-items: center;
}

.spelling-mascot {
  position: relative;
  width: min(100%, 520px);
  padding: 18px 18px 14px;
  border-radius: 32px;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.88), transparent 14%),
    radial-gradient(circle at 80% 16%, rgba(255, 255, 255, 0.82), transparent 16%),
    linear-gradient(180deg, #fff9ef 0%, #ffe7c4 100%);
  border: 1px solid rgba(248, 180, 66, 0.24);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.10);
}

.spelling-mascot::before,
.spelling-mascot::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.spelling-mascot::before {
  inset: 24px auto auto -8px;
  width: 16px;
  height: 16px;
  background: #f59e0b;
  box-shadow:
    42px 18px 0 0 #f97316,
    78px 2px 0 0 #fde047,
    120px 24px 0 0 #38bdf8,
    180px 10px 0 0 #fb7185,
    248px 18px 0 0 #22c55e,
    310px 4px 0 0 #8b5cf6,
    364px 28px 0 0 #f59e0b;
  animation: spellingDrift 8s ease-in-out infinite;
}

.spelling-mascot::after {
  inset: auto 24px 18px auto;
  width: 18px;
  height: 18px;
  background: #fde68a;
  box-shadow:
    -48px -10px 0 0 #f97316,
    -88px 24px 0 0 #38bdf8,
    -134px 2px 0 0 #f472b6,
    -178px 20px 0 0 #22c55e;
}

.spelling-mascot__tag {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ec4899, #f97316);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 0 12px 24px rgba(236, 72, 153, 0.22);
}

.spelling-mascot__svg {
  width: 100%;
  height: auto;
  display: block;
  transform-origin: 50% 80%;
  animation: spellingFloat 5.8s ease-in-out infinite;
}

.spelling-mascot__tail {
  transform-origin: 80% 55%;
  animation: spellingTail 4.8s ease-in-out infinite;
}

.spelling-mascot__bubble {
  position: absolute;
  z-index: 2;
  max-width: 220px;
  padding: 12px 14px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 28px rgba(15, 23, 42, 0.10);
  color: #1e293b;
  font-weight: 800;
  line-height: 1.45;
}

.spelling-mascot__bubble::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  background: inherit;
  border-right: 1px solid rgba(148, 163, 184, 0.18);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  transform: rotate(45deg);
}

.spelling-mascot__bubble--primary {
  top: 18px;
  right: 18px;
  background: linear-gradient(135deg, #fff7ed, #fff);
}

.spelling-mascot__bubble--primary::after {
  bottom: -8px;
  right: 28px;
}

.spelling-mascot__bubble--soft {
  left: 22px;
  bottom: 30px;
}

.spelling-mascot__bubble--soft::after {
  top: -8px;
  left: 34px;
}

.spelling-mascot__bubble--accent {
  right: 20px;
  bottom: 34px;
  background: linear-gradient(135deg, #eff6ff, #fff);
}

.spelling-mascot__bubble--accent::after {
  top: -8px;
  right: 34px;
}

.spelling-mode-grid,
.spelling-category-grid,
.spelling-step-grid,
.spelling-practice-grid,
.spelling-keep-grid {
  display: grid;
  gap: 12px;
}

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

.spelling-mode-card,
.spelling-category-card {
  width: 100%;
  font: inherit;
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: #fff;
  border-radius: 24px;
  padding: 16px;
  text-align: left;
  color: var(--family-text);
  box-shadow: var(--family-shadow);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

.spelling-mode-card:hover,
.spelling-category-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.24);
  box-shadow: 0 22px 34px rgba(15, 23, 42, 0.12);
}

.spelling-mode-card {
  min-height: 150px;
  display: grid;
  gap: 10px;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.82), transparent 18%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.spelling-mode-card__badge {
  display: inline-flex;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.spelling-mode-card strong,
.spelling-category-card strong {
  font-size: 20px;
  letter-spacing: -.03em;
}

.spelling-mode-card p,
.spelling-category-card p,
.spelling-step-card p,
.spelling-practice-card p,
.spelling-keep-card p {
  margin: 0;
  color: var(--family-muted);
  line-height: 1.65;
}

.spelling-category-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.spelling-category-card {
  min-height: 170px;
  display: grid;
  gap: 10px;
  align-content: start;
}

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

.spelling-step-card,
.spelling-practice-card,
.spelling-keep-card {
  display: grid;
  gap: 10px;
}

.spelling-step-card h3,
.spelling-practice-card h3,
.spelling-keep-card h3 {
  margin: 2px 0 0;
}

.spelling-practice-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.spelling-keep-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.spelling-board {
  position: relative;
}

.spelling-board::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 22px;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 12%, rgba(59, 130, 246, 0.08), transparent 15%),
    radial-gradient(circle at 82% 16%, rgba(236, 72, 153, 0.06), transparent 16%),
    radial-gradient(circle at 50% 84%, rgba(245, 158, 11, 0.06), transparent 18%);
}

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

.spelling-play-grid {
  align-items: start;
}

.spelling-side-panel {
  position: sticky;
  top: 16px;
}

.spelling-parent-spotlight {
  position: relative;
  overflow: hidden;
}

.spelling-parent-spotlight::after {
  content: "";
  position: absolute;
  inset: auto -20px -40px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.10), transparent 68%);
  pointer-events: none;
}

.spelling-parent-spotlight > * {
  position: relative;
  z-index: 1;
}

.spelling-mascot__bubble,
.spelling-mode-card,
.spelling-category-card {
  backdrop-filter: blur(4px);
}

@keyframes spellingFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.01); }
}

@keyframes spellingTail {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(4deg); }
}

@keyframes spellingDrift {
  0%, 100% { transform: translateY(0); opacity: .9; }
  50% { transform: translateY(-4px); opacity: 1; }
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-14px) rotate(4deg); }
}

.family-section__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
}

.family-section__title h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: -.04em;
}

.family-section__title p {
  margin: 0;
  color: var(--family-muted);
}

.family-section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

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

.family-card {
  padding: 14px;
  min-height: 196px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.family-card::before {
  content: "";
  position: absolute;
  inset: auto -20px -30px auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12), transparent 65%);
  pointer-events: none;
}

.family-card__icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.family-card__icon--blue { background: linear-gradient(135deg, #bfdbfe, #93c5fd); }
.family-card__icon--green { background: linear-gradient(135deg, #bbf7d0, #86efac); }
.family-card__icon--yellow { background: linear-gradient(135deg, #fde68a, #fcd34d); }
.family-card__icon--pink { background: linear-gradient(135deg, #fbcfe8, #f9a8d4); }
.family-card__icon--purple { background: linear-gradient(135deg, #ddd6fe, #c4b5fd); }

.family-card h3 {
  margin: 8px 0 6px;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -.04em;
}

.family-card:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.42);
  outline-offset: 4px;
}

.family-card p {
  margin: 0;
  color: var(--family-muted);
  line-height: 1.65;
}

.family-card.is-correct {
  border-color: rgba(34, 197, 94, 0.28);
  box-shadow: 0 20px 34px rgba(34, 197, 94, 0.16);
  animation: familyPop .35s ease;
}

.family-card.is-wrong {
  border-color: rgba(239, 68, 68, 0.22);
  box-shadow: 0 20px 34px rgba(239, 68, 68, 0.14);
  animation: familyShake .28s ease;
}

.family-card__cta {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: #1d4ed8;
}

.family-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: 12px;
  align-items: start;
}

.family-board {
  padding: 16px;
}

.family-board__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.family-board__title {
  font-size: clamp(22px, 2.8vw, 36px);
  letter-spacing: -.04em;
  margin: 0;
}

.family-board__meta {
  color: var(--family-muted);
  font-size: 14px;
}

.family-board__grid {
  display: grid;
  grid-template-columns: repeat(var(--family-grid-size), minmax(0, 1fr));
  gap: 1px;
  background: #dbeafe;
  border-radius: 20px;
  padding: 8px;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.1);
}

.family-cell {
  aspect-ratio: 1;
  min-width: 0;
  border: 0;
  border-radius: 12px;
  background: #fff;
  font-size: clamp(16px, 2vw, 24px);
  font-weight: 900;
  color: #0f172a;
  box-shadow: inset 0 -2px 0 rgba(15, 23, 42, 0.05);
}

.family-cell.is-blocked {
  background: linear-gradient(180deg, #1f2937, #111827);
  color: rgba(255,255,255,.2);
}

.family-cell.is-selected {
  background: #dbeafe;
  color: #1d4ed8;
  transform: scale(.98);
}

.family-cell.is-found {
  background: linear-gradient(180deg, #ecfccb, #d9f99d);
  color: #166534;
}

.family-cell.is-wrong {
  animation: familyShake .28s ease;
}

.family-grid-path {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: -2px;
}

.family-controls,
.family-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.family-control,
.family-stat,
.family-panel,
.family-recommendation,
.family-print-card,
.family-faq-item {
  padding: 14px;
  background: #fff;
  border-radius: 22px;
  border: 1px solid var(--family-border);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.family-stat strong {
  display: block;
  font-size: 26px;
  line-height: 1;
}

.family-stat span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--family-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}

.family-select,
.family-input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  font: inherit;
}

.family-label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: #334155;
  font-weight: 800;
}

.family-panel-grid {
  display: grid;
  gap: 12px;
}

.family-word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.family-word-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-weight: 800;
  font-size: 13px;
}

.family-word-pill.is-found {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border-color: #86efac;
  color: #166534;
}

.family-prompt {
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, #eff6ff, #f5f3ff);
  border: 1px solid #dbeafe;
  color: #1d4ed8;
  font-weight: 800;
}

.family-celebration {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(10px);
  z-index: 70;
}

.family-celebration[hidden] {
  display: none !important;
}

.family-celebration__card {
  width: min(620px, 100%);
  padding: 18px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.22);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.family-celebration__card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 12%, rgba(251, 191, 36, 0.18), transparent 18%),
    radial-gradient(circle at 88% 10%, rgba(59, 130, 246, 0.14), transparent 18%),
    radial-gradient(circle at 48% 88%, rgba(236, 72, 153, 0.12), transparent 18%);
}

.family-celebration__title {
  margin: 12px 0 8px;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -.05em;
}

.family-celebration__copy {
  margin: 0;
  color: var(--family-muted);
  line-height: 1.7;
}

.family-celebration__emoji {
  position: relative;
  z-index: 1;
  font-size: 52px;
}

.family-celebration__actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.family-print-toolbar,
.family-share-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.family-print-preview {
  display: grid;
  gap: 12px;
}

.family-print-sheet {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--family-border);
}

.family-print-grid {
  display: grid;
  grid-template-columns: repeat(var(--family-grid-size), minmax(0, 1fr));
  gap: 2px;
  background: #111827;
  padding: 6px;
  border-radius: 18px;
}

.family-print-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: #fff;
  color: #111827;
  font-weight: 900;
  border-radius: 8px;
  font-size: 18px;
}

.family-print-cell.is-hidden {
  background: #111827;
  color: #111827;
}

.family-faq-list {
  display: grid;
  gap: 10px;
}

.family-faq-item summary {
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.family-faq-item summary::-webkit-details-marker {
  display: none;
}

.family-faq-item p {
  margin: 12px 0 0;
  color: var(--family-muted);
  line-height: 1.7;
}

.family-recommendation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.family-recommendation h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.family-recommendation p {
  margin: 0 0 10px;
  color: var(--family-muted);
}

.family-recommendation__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.family-recommendation__disclosure {
  margin-top: 12px;
  font-size: 13px;
  color: #64748b;
}

.family-footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.family-follow-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #1877f2;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(24, 119, 242, 0.22);
  flex: 0 0 auto;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.family-follow-link:hover,
.family-follow-link:focus-visible {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(24, 119, 242, 0.28);
  filter: brightness(1.03);
}

.family-follow-link svg {
  width: 21px;
  height: 21px;
  display: block;
  color: inherit;
}

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

@keyframes familyShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-1px); }
}

@keyframes familyPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

@media (max-width: 1180px) {
  .family-grid {
    grid-template-columns: 1fr;
  }

  .family-card-grid,
  .family-recommendation-grid {
    grid-template-columns: 1fr;
  }

  .spelling-hero,
  .spelling-mode-grid,
  .spelling-step-grid,
  .spelling-practice-grid,
  .spelling-keep-grid {
    grid-template-columns: 1fr;
  }

  .spelling-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
.family-hero {
    padding: 18px;
  }

  .family-title {
    font-size: clamp(30px, 9vw, 42px);
  }

  .spelling-mascot {
    padding: 14px 12px 10px;
  }

  .spelling-mascot__bubble {
    max-width: 170px;
    font-size: 13px;
  }

  .spelling-category-grid {
    grid-template-columns: 1fr;
  }

  .family-card {
    min-height: 0;
  }

  .family-controls,
  .family-stats {
    grid-template-columns: 1fr;
  }

  .family-board {
    padding: 16px;
  }

  .family-board__grid {
    border-radius: 16px;
    padding: 6px;
  }

  .family-cell {
    font-size: clamp(14px, 4vw, 20px);
  }

  .spelling-side-panel {
    position: static;
  }
}

@media print {
  body.family-page {
    background: #fff !important;
  }

  .site-nav,
  .site-footer,
  .family-social-row,
  .family-actions,
  .family-print-toolbar,
  .family-share-toolbar,
  .family-recommendation,
  .family-faq-card,
  .ad-wrap,
  .family-hero .family-badges {
    display: none !important;
  }

  .family-print-sheet {
    box-shadow: none !important;
  }
}

/* ----------------------------- Spelling redesign override ------------------------------ */
body.family-page--spelling {
  --spelling-hero-top: #b8ecff;
  --spelling-hero-mid: #e8f9ff;
  --spelling-hero-bottom: #fff7d8;
  --spelling-ink: #26324b;
  --spelling-soft: #56627a;
  --spelling-pink: #ff7fb7;
  --spelling-pink-deep: #ef5e9f;
  --spelling-yellow: #ffd964;
  --spelling-yellow-deep: #f7bd2d;
  --spelling-green: #6edb95;
  --spelling-green-deep: #2ba963;
  --spelling-blue: #61bdf7;
  --spelling-blue-deep: #278fd0;
  --spelling-purple: #aa8cff;
  --spelling-purple-deep: #7859db;
  --spelling-card: rgba(255, 255, 255, 0.92);
  --spelling-shadow: 0 22px 60px rgba(56, 82, 125, 0.18);
  --spelling-shadow-soft: 0 14px 30px rgba(56, 82, 125, 0.12);
  --spelling-border: rgba(48, 75, 120, 0.1);
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 255, 255, 0.95) 0 8%, transparent 9%),
    radial-gradient(circle at 90% 7%, rgba(255, 255, 255, 0.9) 0 7%, transparent 8%),
    linear-gradient(180deg, var(--spelling-hero-top) 0%, var(--spelling-hero-mid) 38%, var(--spelling-hero-bottom) 100%);
}

body.family-page--spelling::before,
body.family-page--spelling::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(8px);
}

body.family-page--spelling::before {
  width: 420px;
  height: 420px;
  left: -120px;
  top: 22%;
  background: rgba(255, 185, 220, 0.32);
}

body.family-page--spelling::after {
  width: 480px;
  height: 480px;
  right: -160px;
  top: 52%;
  background: rgba(151, 228, 255, 0.38);
}

body.family-page--spelling .float-letter {
  position: absolute;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 20px;
  font-weight: 900;
  font-size: 1.7rem;
  color: #fff;
  box-shadow: 0 15px 26px rgba(39, 73, 118, 0.18);
  animation: bob 4.8s ease-in-out infinite;
  user-select: none;
  pointer-events: none;
  z-index: 0;
}

body.family-page--spelling .letter-a { left: 1%; top: 120px; background: linear-gradient(135deg, #ff7fb7, #ef5e9f); }
body.family-page--spelling .letter-b { right: 4%; top: 260px; background: linear-gradient(135deg, #aa8cff, #7859db); animation-delay: 0.8s; }
body.family-page--spelling .letter-c { left: 3%; top: 760px; background: linear-gradient(135deg, #6edb95, #2ba963); animation-delay: 1.4s; }
body.family-page--spelling .letter-star { right: 2%; top: 980px; background: linear-gradient(135deg, #ffd964, #f7bd2d); animation-delay: 2s; }

body.family-page--spelling .page-wrap {
  width: min(1220px, calc(100% - 32px));
  max-width: 1220px;
}

body.family-page--spelling .page-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.family-page--spelling .page-main > section {
  margin-top: 0;
}

body.family-page--spelling .page-main > section:nth-of-type(1) { order: 1; }
body.family-page--spelling .page-main > section:nth-of-type(3) { order: 2; }
body.family-page--spelling .page-main > section:nth-of-type(4) { order: 3; }
body.family-page--spelling .page-main > section:nth-of-type(2) { order: 4; }
body.family-page--spelling .page-main > section:nth-of-type(5) { order: 5; }
body.family-page--spelling .page-main > section:nth-of-type(6) { order: 6; }
body.family-page--spelling .page-main > section:nth-of-type(7) { order: 7; }
body.family-page--spelling .page-main > section:nth-of-type(8) { order: 8; }
body.family-page--spelling .page-main > section:nth-of-type(9) { order: 9; }

body.family-page--spelling .family-hero,
body.family-page--spelling .family-section,
body.family-page--spelling .family-board,
body.family-page--spelling .family-panel,
body.family-page--spelling .family-card,
body.family-page--spelling .family-recommendation,
body.family-page--spelling .family-faq-item {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 60px rgba(56, 82, 125, 0.10);
}

body.family-page--spelling .family-section {
  margin-top: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

body.family-page--spelling .family-section > .family-section__title,
body.family-page--spelling .family-section > .spelling-category-grid,
body.family-page--spelling .family-section > .spelling-mode-grid,
body.family-page--spelling .family-section > .spelling-step-grid,
body.family-page--spelling .family-section > .spelling-practice-grid,
body.family-page--spelling .family-section > .spelling-keep-grid,
body.family-page--spelling .family-section > .family-grid,
body.family-page--spelling .family-section > .family-faq-list {
  background: rgba(255, 255, 255, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.94);
  box-shadow: var(--spelling-shadow-soft);
  border-radius: 34px;
  padding: 14px;
}

body.family-page--spelling .family-section__title {
  margin-bottom: 0;
}

body.family-page--spelling .spelling-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 18px;
  align-items: center;
  padding: 20px;
  min-height: 610px;
  border-radius: 48px;
  background:
    radial-gradient(circle at 20% 15%, rgba(255,255,255,0.88) 0 13%, transparent 14%),
    radial-gradient(circle at 88% 18%, rgba(255,255,255,0.8) 0 10%, transparent 11%),
    linear-gradient(140deg, rgba(255,255,255,0.82), rgba(255,244,198,0.86));
  overflow: hidden;
}

body.family-page--spelling .spelling-hero::before {
  content: "";
  position: absolute;
  inset: auto -10% -90px -10%;
  height: 230px;
  background:
    radial-gradient(circle at 20% 0%, #98e9ae 0 28%, transparent 29%),
    radial-gradient(circle at 52% 5%, #8dde9b 0 29%, transparent 30%),
    radial-gradient(circle at 80% 10%, #73d98e 0 30%, transparent 31%);
  opacity: 0.9;
}

body.family-page--spelling .spelling-hero::after {
  content: "";
  position: absolute;
  inset: auto -20px -24px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 185, 79, 0.18), transparent 68%);
  pointer-events: none;
}

body.family-page--spelling .spelling-hero__copy,
body.family-page--spelling .spelling-hero__mascot {
  position: relative;
  z-index: 2;
}

body.family-page--spelling .spelling-hero__copy {
  padding: 12px 4px 12px 6px;
  display: grid;
  gap: 8px;
}

body.family-page--spelling .family-title {
  margin: 12px 0 0;
  font-size: clamp(3rem, 6.2vw, 5.8rem);
  line-height: 0.93;
  letter-spacing: -0.065em;
  max-width: 720px;
}

body.family-page--spelling .family-title span {
  display: block;
  color: var(--spelling-pink-deep);
  text-shadow: 0 4px 0 rgba(255, 255, 255, 0.75);
}

body.family-page--spelling .spelling-hero .family-subtitle {
  max-width: 620px;
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.72;
  color: var(--spelling-soft);
  font-weight: 700;
}

body.family-page--spelling .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

body.family-page--spelling .trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.family-page--spelling .trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.96);
  font-weight: 900;
  color: #536079;
  box-shadow: var(--spelling-shadow-soft);
}

body.family-page--spelling .spelling-hero__mascot {
  min-height: 580px;
  display: grid;
  align-items: center;
}

body.family-page--spelling .scene-shell {
  position: relative;
  min-height: 600px;
  border-radius: 42px;
  padding: 18px;
  background:
    radial-gradient(circle at 20% 14%, rgba(255,255,255,0.95) 0 11%, transparent 12%),
    linear-gradient(180deg, rgba(213,245,255,0.98), rgba(255,240,194,0.95));
  border: 1px solid rgba(255,255,255,0.94);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), var(--spelling-shadow);
  overflow: hidden;
}

body.family-page--spelling .scene-shell::before {
  content: "";
  position: absolute;
  inset: auto -15% -45px -15%;
  height: 190px;
  background:
    radial-gradient(circle at 15% 10%, #84df9c 0 26%, transparent 27%),
    radial-gradient(circle at 44% 5%, #76d78f 0 29%, transparent 30%),
    radial-gradient(circle at 76% 10%, #69cd87 0 28%, transparent 29%);
}

body.family-page--spelling .speech {
  position: absolute;
  top: 20px;
  right: 18px;
  width: min(290px, calc(100% - 44px));
  background: #fff;
  border-radius: 26px;
  padding: 16px 16px 18px;
  box-shadow: var(--spelling-shadow-soft);
  font-weight: 900;
  color: var(--spelling-purple-deep);
  font-size: 1.05rem;
  line-height: 1.35;
  z-index: 5;
}

body.family-page--spelling .speech::after {
  content: "";
  position: absolute;
  left: 24px;
  bottom: -12px;
  width: 24px;
  height: 24px;
  background: #fff;
  transform: rotate(45deg);
}

body.family-page--spelling .mascot-stage {
  position: absolute;
  left: 10px;
  bottom: 58px;
  width: 45%;
  height: 440px;
  display: grid;
  align-items: end;
  justify-items: center;
  z-index: 3;
}

body.family-page--spelling .mascot-img {
  width: 100%;
  max-width: 330px;
  max-height: 460px;
  object-fit: contain;
  filter: drop-shadow(0 24px 24px rgba(65, 72, 100, 0.2));
  animation: mascotFloat 4.2s ease-in-out infinite;
}

body.family-page--spelling .hero-mini-game {
  position: absolute;
  right: 18px;
  bottom: 40px;
  z-index: 4;
  width: min(365px, calc(100% - 36px));
  border-radius: 34px;
  padding: 18px;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(255,255,255,0.98);
  box-shadow: var(--spelling-shadow);
}

body.family-page--spelling .mini-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  background: #fff2cb;
  color: #946000;
  font-weight: 900;
  border-radius: 999px;
  margin-bottom: 10px;
}

body.family-page--spelling .mini-clue {
  margin: 0 0 10px;
  font-size: 1.08rem;
  line-height: 1.48;
  font-weight: 900;
}

body.family-page--spelling .letter-boxes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

body.family-page--spelling .letter-box {
  width: 52px;
  height: 60px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  font-weight: 1000;
  color: var(--spelling-purple-deep);
  background: linear-gradient(180deg, #ffffff, #f4f0ff);
  border: 2px solid rgba(120, 89, 219, 0.18);
  box-shadow: 0 10px 20px rgba(95, 75, 160, 0.12);
}

body.family-page--spelling .star-sparkle {
  position: absolute;
  font-size: 1.7rem;
  animation: sparkle 3.8s ease-in-out infinite;
}

body.family-page--spelling .spark-1 { top: 134px; left: 42%; }
body.family-page--spelling .spark-2 { top: 220px; right: 26px; animation-delay: 1s; }
body.family-page--spelling .spark-3 { bottom: 180px; left: 42%; animation-delay: 1.8s; }

body.family-page--spelling .spelling-mascot {
  position: relative;
  width: min(100%, 520px);
  padding: 16px 16px 12px;
  border-radius: 32px;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.88), transparent 14%),
    radial-gradient(circle at 80% 16%, rgba(255, 255, 255, 0.82), transparent 16%),
    linear-gradient(180deg, #fff9ef 0%, #ffe7c4 100%);
  border: 1px solid rgba(248, 180, 66, 0.24);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.10);
}

body.family-page--spelling .spelling-mascot::before,
body.family-page--spelling .spelling-mascot::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

body.family-page--spelling .spelling-mascot::before {
  inset: 24px auto auto -8px;
  width: 16px;
  height: 16px;
  background: #f59e0b;
  box-shadow:
    42px 18px 0 0 #f97316,
    78px 2px 0 0 #fde047,
    120px 24px 0 0 #38bdf8,
    180px 10px 0 0 #fb7185,
    248px 18px 0 0 #22c55e,
    310px 4px 0 0 #8b5cf6,
    364px 28px 0 0 #f59e0b;
  animation: spellingDrift 8s ease-in-out infinite;
}

body.family-page--spelling .spelling-mascot::after {
  inset: auto 24px 18px auto;
  width: 18px;
  height: 18px;
  background: #fde68a;
  box-shadow:
    -48px -10px 0 0 #f97316,
    -88px 24px 0 0 #38bdf8,
    -134px 2px 0 0 #f472b6,
    -178px 20px 0 0 #22c55e;
}

body.family-page--spelling .spelling-mascot__svg {
  width: 100%;
  height: auto;
  display: block;
  transform-origin: 50% 80%;
  animation: spellingFloat 5.8s ease-in-out infinite;
}

body.family-page--spelling .spelling-mascot__tail {
  transform-origin: 80% 55%;
  animation: spellingTail 4.8s ease-in-out infinite;
}

body.family-page--spelling .spelling-mascot__bubble {
  position: absolute;
  z-index: 2;
  max-width: 220px;
  padding: 10px 12px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 28px rgba(15, 23, 42, 0.10);
  color: #1e293b;
  font-weight: 800;
  line-height: 1.45;
}

body.family-page--spelling .spelling-mascot__bubble--primary {
  top: 18px;
  right: 18px;
  background: linear-gradient(135deg, #fff7ed, #fff);
}

body.family-page--spelling .spelling-mascot__bubble--soft {
  left: 22px;
  bottom: 30px;
}

body.family-page--spelling .spelling-mascot__bubble--accent {
  right: 20px;
  bottom: 34px;
  background: linear-gradient(135deg, #eff6ff, #fff);
}

body.family-page--spelling .spelling-mode-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

body.family-page--spelling .spelling-category-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

body.family-page--spelling .spelling-mode-card,
body.family-page--spelling .spelling-category-card {
  min-height: 140px;
  border-radius: 24px;
  padding: 16px;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.82), transparent 18%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

body.family-page--spelling .spelling-mode-card p,
body.family-page--spelling .spelling-category-card p {
  font-size: 0.97rem;
}

body.family-page--spelling .spelling-game-layout {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  gap: 12px;
  align-items: stretch;
}

body.family-page--spelling .spelling-game-layout .family-board,
body.family-page--spelling .spelling-game-layout .family-panel {
  border-radius: 34px;
  padding: 16px;
}

body.family-page--spelling .spelling-board {
  position: relative;
  background:
    radial-gradient(circle at 92% 8%, rgba(255,255,255,0.88) 0 12%, transparent 13%),
    linear-gradient(145deg, rgba(255,255,255,0.94), rgba(245,249,255,0.93));
}

body.family-page--spelling .spelling-board::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 22px;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 12%, rgba(59, 130, 246, 0.08), transparent 15%),
    radial-gradient(circle at 82% 16%, rgba(236, 72, 153, 0.06), transparent 16%),
    radial-gradient(circle at 50% 84%, rgba(245, 158, 11, 0.06), transparent 18%);
}

body.family-page--spelling .spelling-board > * {
  position: relative;
  z-index: 1;
}

body.family-page--spelling .spelling-side-panel {
  position: sticky;
  top: 12px;
}

body.family-page--spelling .family-board__title {
  font-size: clamp(22px, 2.8vw, 36px);
  letter-spacing: -.04em;
}

body.family-page--spelling .family-board__meta {
  color: var(--family-muted);
  font-size: 14px;
}

body.family-page--spelling .family-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.family-page--spelling .family-stat {
  border-radius: 22px;
  padding: 14px 10px;
  text-align: center;
}

body.family-page--spelling .family-stat strong {
  font-size: 1.75rem;
}

body.family-page--spelling .family-prompt {
  background: linear-gradient(135deg, #eff6ff, #f5f3ff);
  border: 1px solid #dbeafe;
  color: #1d4ed8;
}

body.family-page--spelling .family-word-list {
  min-height: 44px;
}

body.family-page--spelling .spelling-game-layout .family-board .family-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body.family-page--spelling .challenge-section {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

body.family-page--spelling .challenge-section > .surface,
body.family-page--spelling .challenge-section {
  border-radius: 40px;
}

body.family-page--spelling .challenge-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.family-page--spelling .challenge-card {
  border-radius: 34px;
  min-height: 230px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

body.family-page--spelling .learning-strip {
  border-radius: 40px;
  background: rgba(255,255,255,0.88);
  box-shadow: var(--spelling-shadow);
}

body.family-page--spelling .steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.family-page--spelling .parent-panel,
body.family-page--spelling .more-games,
body.family-page--spelling .faq {
  border-radius: 40px;
}

body.family-page--spelling .game-link-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.family-page--spelling .family-faq-list {
  gap: 10px;
}

body.family-page--spelling .family-celebration__card {
  border-radius: 40px;
}

@keyframes mascotFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

@keyframes sparkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
  50% { transform: scale(1.25) rotate(14deg); opacity: 1; }
}

@keyframes spellingFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.01); }
}

@keyframes spellingTail {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(4deg); }
}

@keyframes spellingDrift {
  0%, 100% { transform: translateY(0); opacity: .9; }
  50% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 1180px) {
  body.family-page--spelling .spelling-hero,
  body.family-page--spelling .spelling-game-layout {
    grid-template-columns: 1fr;
  }

  body.family-page--spelling .spelling-category-grid,
  body.family-page--spelling .challenge-grid,
  body.family-page--spelling .game-link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.family-page--spelling .spelling-side-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  body.family-page--spelling .page-wrap {
    width: min(100% - 20px, 1220px);
    padding-top: 12px;
  }

  body.family-page--spelling .family-hero,
  body.family-page--spelling .family-section > .family-section__title,
  body.family-page--spelling .family-section > .spelling-category-grid,
  body.family-page--spelling .family-section > .spelling-mode-grid,
  body.family-page--spelling .family-section > .spelling-step-grid,
  body.family-page--spelling .family-section > .spelling-practice-grid,
  body.family-page--spelling .family-section > .spelling-keep-grid,
  body.family-page--spelling .family-section > .family-grid,
  body.family-page--spelling .family-section > .family-faq-list {
    padding: 16px;
    border-radius: 28px;
  }

  body.family-page--spelling .spelling-hero {
    min-height: unset;
  }

  body.family-page--spelling .spelling-hero__mascot,
  body.family-page--spelling .scene-shell {
    min-height: 640px;
  }

  body.family-page--spelling .spelling-category-grid,
  body.family-page--spelling .spelling-mode-grid,
  body.family-page--spelling .challenge-grid,
  body.family-page--spelling .steps,
  body.family-page--spelling .game-link-grid {
    grid-template-columns: 1fr;
  }

  body.family-page--spelling .float-letter {
    display: none;
  }

  body.family-page--spelling .hero-mini-game {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
  }

  body.family-page--spelling .speech {
    left: 16px;
    right: 16px;
    top: 16px;
    width: auto;
  }

  body.family-page--spelling .mascot-stage {
    width: 100%;
    left: 0;
    bottom: 220px;
    height: 300px;
  }

  body.family-page--spelling .spelling-mascot__bubble {
    max-width: 170px;
    font-size: 13px;
  }
}

@media print {
  body.family-page {
    background: #fff !important;
  }

  .site-nav,
  .site-footer,
  .family-social-row,
  .family-actions,
  .family-print-toolbar,
  .family-share-toolbar,
  .family-recommendation,
  .family-faq-card,
  .ad-wrap,
  .family-hero .family-badges {
    display: none !important;
  }

  .family-print-sheet {
    box-shadow: none !important;
  }
}

/* Compact spacing pass for family and kids game pages. */
body.family-page .page-wrap {
  padding-top: 12px;
  padding-bottom: 30px;
}

.family-hero {
  padding: 22px;
}

.family-title {
  margin: 12px 0 8px;
}

.family-subtitle {
  line-height: 1.58;
}

.family-badges,
.family-social-row {
  margin-top: 10px;
}

.family-section {
  margin-top: 12px;
}

.family-section__title {
  margin-bottom: 8px;
}

.family-card,
.family-board,
.family-panel,
.family-recommendation,
.family-faq-item,
.family-print-card {
  padding: 12px;
}

body.family-page--spelling .spelling-hero {
  gap: 16px;
  padding: 18px;
}

body.family-page--spelling .family-section > .family-section__title,
body.family-page--spelling .family-section > .spelling-category-grid,
body.family-page--spelling .family-section > .spelling-mode-grid,
body.family-page--spelling .family-section > .spelling-step-grid,
body.family-page--spelling .family-section > .spelling-practice-grid,
body.family-page--spelling .family-section > .spelling-keep-grid,
body.family-page--spelling .family-section > .family-grid,
body.family-page--spelling .family-section > .family-faq-list {
  padding: 12px;
}

body.family-page--spelling .spelling-playboard,
body.family-page--spelling .spelling-side-panel,
body.family-page--spelling .challenge-card,
body.family-page--spelling .game-link {
  padding: 12px;
}

@media (max-width: 760px) {
  body.family-page .page-wrap {
    padding-top: 10px;
    padding-bottom: 24px;
  }

  .family-hero,
  body.family-page--spelling .spelling-hero {
    padding: 12px;
  }

  .family-section {
    margin-top: 10px;
  }

  body.family-page--spelling .family-section > .family-section__title,
  body.family-page--spelling .family-section > .spelling-category-grid,
  body.family-page--spelling .family-section > .spelling-mode-grid,
  body.family-page--spelling .family-section > .spelling-step-grid,
  body.family-page--spelling .family-section > .spelling-practice-grid,
  body.family-page--spelling .family-section > .spelling-keep-grid,
  body.family-page--spelling .family-section > .family-grid,
  body.family-page--spelling .family-section > .family-faq-list {
    padding: 12px;
  }
}
