/* ============================================================
   LetsRankSEO — learn SEO by playing
   Warm, playful, one-screen-one-goal.
   ============================================================ */

:root {
  --cream:   #fff6e9;
  --cream-2: #fde6cf;
  --card:    #ffffff;
  --ink:     #4b3a2b;
  --ink-soft:#977f66;
  --crust:   #f4a83a;   /* warm primary */
  --grow:    #43c08a;   /* climb / success */
  --berry:   #ff6f8b;   /* fun accent */
  --gold:    #ffce5c;   /* champion */
  --line:    #f0e0c9;

  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body:    "Nunito", system-ui, sans-serif;

  --shadow:   0 12px 26px -14px rgba(120, 80, 30, 0.4);
  --shadow-lg:0 20px 40px -18px rgba(120, 80, 30, 0.45);
  --r: 22px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(34rem 22rem at 12% -8%, #ffe7c2, transparent 70%),
    radial-gradient(32rem 22rem at 100% 0%, #ffe0e6, transparent 65%),
    var(--cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 11px 16px 36px;
  overflow-x: hidden;
}

/* ---------- top bar ---------- */
.top {
  width: 100vw;                 /* full browser width (content below stays centered) */
  box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 24px;           /* logo 24px from left edge · Levels/moves 24px from right edge */
  margin-bottom: 40px;
}
.logo { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; letter-spacing: -0.01em; display: flex; align-items: center; gap: 7px; }
.logo__img { height: 30px; width: auto; display: block; }   /* the SVG wordmark (images/letsrankseo.svg) */
.logo__seo {
  color: var(--ink); background: var(--gold);
  border-radius: 9px; padding: 0 7px; margin-left: -2px;
  display: inline-block; transform: rotate(-2deg);
  box-shadow: var(--shadow);
}
.status { display: flex; align-items: center; gap: 12px; }
.pill {
  font-weight: 700; font-size: 0.82rem; color: var(--ink);
  background: var(--card); border: 2px solid var(--line); border-radius: 999px;
  padding: 7px 14px; box-shadow: var(--shadow);
}
.moves { font-weight: 700; font-size: 0.82rem; color: var(--ink-soft); display: flex; align-items: center; gap: 7px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--grow); box-shadow: inset 0 -2px 0 rgba(0,0,0,0.08); }
.dots i.off { background: #e7d8c2; }
.dots i.pop { animation: dotPop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1); }   /* newly completed step: pop to green */
@keyframes dotPop {
  0%   { transform: scale(0.4); background: #e7d8c2; }
  55%  { transform: scale(1.5); background: var(--grow); }
  100% { transform: scale(1);   background: var(--grow); }
}

/* ---------- stage ---------- */
.stage { width: 100%; max-width: 680px; display: flex; flex-direction: column; gap: 20px; }

.goal {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.7rem, 5vw, 2.8rem); line-height: 1.12; text-align: center; letter-spacing: -0.01em;
  padding-bottom: 16px;
}
@media (min-width: 561px) { .goal { padding: 0 80px; } }   /* desktop only: inset the title left/right */
.hl-name { color: var(--ink); }   /* business name in the title — same brown as the rest of the heading */
.hl-one {
  color: #7a5a12; background: var(--gold); border-radius: 12px;   /* gold #1 badge — matches the champion (#1) rank in the ladder */
  padding: 0 10px; display: inline-block; transform: rotate(-2deg);
  box-shadow: var(--shadow);
}
.sub { text-align: center; font-size: 1.02rem; font-weight: 600; color: var(--ink-soft); margin-top: -8px; }
@media (min-width: 561px) { .sub { font-size: 1.2rem; padding: 0 80px; } }   /* larger, inset sub on desktop only */
@media (min-width: 561px) { .home > .top { margin-bottom: 0; } }   /* desktop home only: drop the 40px header gap */

/* ---------- the climb ---------- */
.serp-label { font-weight: 700; font-size: 0.78rem; color: var(--ink-soft); margin: 20px 2px 7px; text-align: center; }
/* mobile/desktop text variants (mobile-first; swap on desktop) */
.only-desktop { display: none; }
@media (min-width: 561px) { .only-mobile { display: none; } .only-desktop { display: inline; } }
.customers { text-align: center; font-weight: 700; font-size: 0.95rem; color: var(--ink-soft); margin-top: 11px; }
.customers b { color: var(--grow); font-size: 1.12rem; }
.customers.bump { animation: custPop 0.5s ease; }
@keyframes custPop { 0% { transform: scale(1); } 40% { transform: scale(1.13); } 100% { transform: scale(1); } }
.ladder {
  display: flex; flex-direction: column; gap: 4px;
  background: #f7ecd6; border: 1px solid #eaddc4; border-radius: var(--r);
  padding: 6px; box-shadow: none;   /* flat, recessed board — info you read */
}
.rung {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 13px;
  background: #ffffff63; border: none;   /* a results list, not tappable cards */
  position: relative; border-radius: 18px;
}
.rung:not(:last-child) { /* border-bottom: none; */ }
.rung__body { flex: 1; min-width: 0; display: flex; align-items: center; }   /* name + customers; badge centers against it */
.rung__pos {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  background: #f7efe2; border-radius: 11px; border: 2px solid var(--line); color: var(--ink-soft);
}
.rung__name { font-weight: 800; font-size: 1.05rem; }
.rung__tag { margin-left: auto; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); }

.rung--champ { background: #fff6da; border: 2px solid var(--crust); }
.rung--champ .rung__pos { background: var(--gold); border-color: var(--gold); color: #7a5a12; font-size: 1.2rem; }

.rung--you { background: #e9f9f0; border: 2px solid var(--grow); }
.rung--you .rung__pos { background: var(--grow); border-color: var(--grow); color: #fff; }
.rung--you .rung__name { color: #1f7a52; }
.you {
  font-family: var(--font-display); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em;
  color: #fff; background: var(--grow); border-radius: 6px; padding: 2px 7px; margin-left: 6px;
  vertical-align: middle;
}
.rung__climb { margin-left: auto; font-weight: 800; font-size: 0.85rem; color: var(--grow); }

.rung--gap { display: none; }   /* hidden: the "⋮ N more ⋮" indicator */
.rung__gap { font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); opacity: 0.65; letter-spacing: 0.02em; }

/* YOU-row tooltip: why customers lag your rank (hover desktop / tap mobile) */
.rung--you { cursor: help; }
.rung__info { margin-left: 4px; color: var(--grow); font-size: calc(0.95rem + 1px); opacity: 0.85; }
.rung__tip {
  position: absolute; bottom: calc(100% + 10px); right: 6px; z-index: 40;
  width: max-content; max-width: min(270px, 82vw); text-align: left;
  background: #fffdf8; color: var(--ink); border: 2px solid var(--line); border-radius: 14px;
  padding: 10px 13px; font-size: 0.8rem; font-weight: 600; line-height: 1.45; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(5px); transition: opacity .15s ease, transform .15s ease; pointer-events: none;
}
.rung--you:hover .rung__tip, .rung--you.tip-open .rung__tip { opacity: 1; visibility: visible; transform: translateY(0); }
.rung__tip-close { display: none; }   /* desktop dismisses on hover-out; the ✕ is mobile-only */

.spark { position: absolute; font-size: 0.8rem; animation: float 2.4s ease-in-out infinite; }
.spark--1 { top: -6px; right: 64px; }
.spark--2 { bottom: -4px; right: 96px; animation-delay: 0.8s; }
@keyframes float { 0%,100% { transform: translateY(0); opacity: 0.7; } 50% { transform: translateY(-5px); opacity: 1; } }
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- coach ---------- */
.coach {
  display: none;   /* Pip hidden — climb/customer feedback still shows via the floating ▲ counter */
  position: fixed; right: 24px; bottom: 24px; z-index: 30;
  flex-direction: row-reverse; align-items: flex-end; gap: 10px;
  max-width: min(320px, calc(100vw - 32px));   /* compact, docked bottom-right · icon right, bubble left */
}
.coach__avatar {
  flex: none; width: 56px; height: 56px; display: grid; place-items: center; cursor: pointer;
  font-size: 1.8rem; background: var(--card); border: 3px solid var(--crust);
  border-radius: 50%; box-shadow: var(--shadow); transform: rotate(-4deg);
  animation: bob 3s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(-4deg) translateY(-4px); } }
.coach__bubble {
  position: relative; background: var(--card); border: 2px solid var(--line); border-radius: 16px;
  padding: 13px 16px; font-size: 0.98rem; font-weight: 600; line-height: 1.45; box-shadow: var(--shadow);
  transform-origin: right center;   /* pops out from Pip's side */
}
.coach__bubble b { color: var(--crust); font-weight: 800; }
.coach__bubble::before {
  content: ""; position: absolute; right: -9px; bottom: 20px; width: 16px; height: 16px;
  background: var(--card); border-right: 2px solid var(--line); border-bottom: 2px solid var(--line);
  transform: rotate(-45deg);
}
.coach__close {
  position: absolute; top: -9px; left: -9px; z-index: 2; width: 22px; height: 22px; padding: 0;
  display: grid; place-items: center; line-height: 1; cursor: pointer;
  background: var(--card); border: 2px solid var(--line); border-radius: 50%;
  color: var(--ink-soft); font-size: 0.7rem; font-weight: 800; box-shadow: var(--shadow);
}
.coach__close:hover { color: var(--ink); border-color: var(--crust); }
.coach--collapsed .coach__bubble { display: none; }   /* closed → just the icon (tap it to reopen) */

/* ---------- actions ---------- */
.actions { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
/* slim vertical dividers in the gaps — anchored to the row so they don't move when a card bobs */
.actions::before, .actions::after {
  content: ''; position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 2px; height: 30%; border-radius: 1px; background: rgba(151, 127, 102, 0.3); pointer-events: none;
}
.actions::before { left: calc((100% - 24px) / 3 + 6px); }
.actions::after  { left: calc((100% - 24px) / 3 * 2 + 18px); }
.card {
  font-family: var(--font-body); cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; border-radius: 18px;
  padding: 16px 15px 14px; box-shadow: none;
  transition: transform 0.16s cubic-bezier(0.2,1.3,0.4,1);
}
/* desktop bob (hover + idle attract): transition-based so it eases to rest instead of snapping */
.card.bob { transition: transform 0.55s ease-in-out; }
.actions .card.bob-up:not(.done) { transform: translateY(-6px); }
.actions .card:not(.done):hover .card__title { color: var(--grow); }
.card:active { transform: translateY(-1px); }
.card__icon {
  width: 46px; height: 46px; display: grid; place-items: center; font-size: 1.4rem;
  border-radius: 14px; margin-bottom: 5px;
}
.icon--amber { background: #fff0d6; }
.icon--green { background: #ddf6ea; }
.icon--berry { background: #ffe1e8; }
/* move-card icons: white with a soft shadow (overrides the tints above) */
.card .card__icon { background: #fff; box-shadow: 0 6px 14px -6px rgba(120, 80, 30, 0.35); }
.card__title { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--ink); transition: color 0.16s; }
.card__desc { font-size: 0.86rem; font-weight: 600; color: var(--ink-soft); }
.card__lift {
  margin-top: 9px; align-self: center;
  font-weight: 800; font-size: 0.78rem; color: var(--grow);
  background: #e3f7ee; border-radius: 999px; padding: 3px 10px;
}
/* mobile carousel dots (hidden on desktop) — same look as the header "Steps" dots */
.swipe-dots { display: none; }
.swipe-dot {
  width: 11px; height: 11px; padding: 0; border: none; border-radius: 50%;
  background: #e7d8c2; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.08);   /* not done (matches .dots i.off) */
  cursor: pointer; transition: transform 0.2s, background 0.2s;
}
.swipe-dot.done { background: var(--grow); }                          /* done (matches .dots i) */
.swipe-dot.active { transform: scale(1.35); }                        /* current card */
.swipe-dot.pop { animation: dotPop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1); }   /* just-completed step pops to green */
/* mobile carousel ‹ › arrows — overlaid on the card's LEFT/RIGHT edges, vertically centered (mobile only) */
.actions-wrap { position: relative; }
.swipe-arrow {
  display: none;                                          /* shown on mobile only (below) */
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 1.35rem; line-height: 1; cursor: pointer; place-items: center;
  box-shadow: var(--shadow); transition: border-color 0.15s, opacity 0.15s;
}
.swipe-arrow--prev { left: 0; }
.swipe-arrow--next { right: 0; }
.swipe-arrow:hover:not(:disabled) { border-color: var(--crust); }
.swipe-arrow:active:not(:disabled) { transform: translateY(-50%) scale(0.92); }
.swipe-arrow:disabled { opacity: 0.28; cursor: default; }
@keyframes iconBounce {
  0%   { transform: scale(1)    rotate(0deg); }
  25%  { transform: scale(1.12) rotate(-9deg); }
  50%  { transform: scale(1.2)  rotate(0deg); }
  75%  { transform: scale(1.12) rotate(9deg); }
  100% { transform: scale(1)    rotate(0deg); }
}
.actions .card:not(:disabled):hover .card__icon { animation: iconBounce 0.5s ease; }
.card__icon.land { animation: iconBounce 0.55s ease; }   /* one-time hop when a carousel card lands */
@keyframes wiggle { 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }

/* ---------- footer note ---------- */
.mocknote { margin-top: 26px; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); text-align: center; opacity: 0.8; }

/* ---------- entrance ---------- */
.stage.enter > * { animation: rise 0.55s ease both; }
.stage.enter > *:nth-child(1) { animation-delay: 0.04s; }
.stage.enter > *:nth-child(2) { animation-delay: 0.10s; }
.stage.enter > *:nth-child(3) { animation-delay: 0.16s; }
.stage.enter > *:nth-child(4) { animation-delay: 0.22s; }
.stage.enter > *:nth-child(5) { animation-delay: 0.30s; }
.stage.enter > *:nth-child(6) { animation-delay: 0.38s; }
.stage.enter > *:nth-child(7) { animation-delay: 0.46s; }
/* move cards pop in on level load (staggered via JS animationDelay) */
.actions .card { animation: pop 0.45s cubic-bezier(0.2, 1.3, 0.4, 1) backwards; }   /* backwards (not both) so transform is free for the bob after entrance */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  /* actions become a one-card-at-a-time swipe carousel (cards stay vertical like desktop) */
  .actions { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; scrollbar-width: none; padding-block: 8px; }
  .actions.sliding { scroll-snap-type: none; }   /* spring-scroll running → let it overshoot past the snap point */
  .actions::-webkit-scrollbar { display: none; }
  .actions::before, .actions::after { display: none; }
  .card { flex: 0 0 100%; scroll-snap-align: start; justify-content: center; padding: 4px 0 0 0; }
  /* no hover on touch → the current (not-done) card bobs up/down on its own to invite a tap */
  .actions .card:not(.done) { animation: ctaBob 1.1s ease-in-out infinite; }
  .swipe-arrow { display: grid; }
  .swipe-dots { display: flex; justify-content: center; gap: 5px; margin-top: 14px; }
  .status .pill { display: none; }
  .moves { display: none; }   /* the carousel dots already show step progress on mobile */
  .langbtn__icon { display: none; }   /* drop the 🌐 on mobile — just show "EN" */
  .levelsbtn__word { display: none; }   /* drop "Level" on mobile — just "☰ N" so the buttons fit */
  .status .levelsbtn, .status .langbtn, .status .muteb { padding: 7px 10px; }   /* tighter pills on mobile (scoped so it beats the base rule's source order) */
  .status { gap: 4px; }
  .top { justify-content: space-between; padding-inline: 20px; }   /* tighter side padding on mobile */
  .serp-label { margin-top: 0; }
  .stage { padding-bottom: 40px; }   /* breathing room above the fixed Save/coach corner */
  .goal { font-size: clamp(2.4rem, 5vw, 2.8rem); padding-bottom: 0; }   /* bigger, tighter goal on mobile */
  .home__tag .br-mob { display: inline; }   /* mobile: break after "learn" */
  .home__tag .br-desk { display: none; }    /* mobile: drop the after-"SEO" break → "SEO the fun way." on one line */
  .coach { right: 12px; bottom: 14px; max-width: min(82vw, 320px); align-items: flex-end; }   /* bottom-right corner; close it (×) to reach the Save pill */
  /* ladder: stack the customers text below the name; badge stays centered against the pair */
  .rung__body { flex-direction: column; align-items: flex-start; gap: 0; }
  .rung__tag, .rung__climb { margin-left: 0; }
  /* tap-open YOU tooltip gets a Pip-style ✕ to dismiss */
  .rung--you.tip-open .rung__tip { pointer-events: auto; }
  .rung__tip-close {
    display: grid; position: absolute; top: -10px; right: -10px; z-index: 2;
    width: 22px; height: 22px; padding: 0; place-items: center; line-height: 1; cursor: pointer;
    background: var(--card); border: 2px solid var(--line); border-radius: 50%;
    color: var(--ink-soft); font-size: 0.7rem; font-weight: 800; box-shadow: var(--shadow);
  }
  .ladder { padding: 4px; }                 /* ~30% tighter on mobile */
  .rung { padding: 9px; gap: 10px; }
}

/* Compact task modal — phones AND the 992–1440px laptop band (so the pop-up fits shorter
   screens). Scoped to .task so these beat the base rules at equal specificity. */
@media (max-width: 560px), (min-width: 992px) and (max-width: 1440px) {
  .task .task__card { padding: 16px 16px; }
  .task .gpreview { margin: 10px 0; }
  .task .task__title { font-size: 1.12rem; }
  .task .task__intro { font-size: 0.86rem; }
  .task .checks { gap: 2px; margin: 10px 0; }
  .task .checks li { font-size: 0.82rem; }
  .task .task__pip { font-size: 0.82rem; }
  .task .gpreview__title { font-size: 0.98rem; }
  .task .pagepreview__h1 { font-size: 1.05rem; }
  .task .snippetbox__q, .task .snippetbox__a { font-size: 0.85rem; }
}

/* 992–1440px laptop band: shrink the home/game screen (titles, text, paddings) so the
   content fits in ~640px of height. Modals get the mobile compact sizing above. */
@media (min-width: 992px) and (max-width: 1440px) {
  body { padding-top: 6px; }
  .stage { gap: 12px; }
  .goal { font-size: clamp(1.5rem, 3.4vw, 2rem); }
  .sub { font-size: 1rem; margin-top: -4px; }
  .serp-label { margin: 8px 2px 5px; }
  .ladder { padding: 5px; }
  .rung { padding: 9px 13px; gap: 11px; }
  .rung__pos { width: 30px; height: 30px; font-size: 0.98rem; }
  .rung__name { font-size: 1rem; }
  .customers { margin-top: 6px; }
  .card { padding: 10px 15px 10px; }
  .card__icon { width: 42px; height: 42px; margin-bottom: 3px; }
}

/* ---------- disabled actions ---------- */
.card:disabled { opacity: 0.5; cursor: default; }
.card:disabled:hover { transform: none; box-shadow: var(--shadow); border-color: var(--line); }
.card:disabled:hover .card__icon { animation: none; }
/* completed step — visible but locked */
.card.done { opacity: 0.8; }   /* completed — no bg, still openable for reading */
.card.done .card__lift { background: var(--grow); color: #fff; font-weight: 800; }   /* swapped badge colors */
.task.readonly .task__apply { display: none; }
.task.readonly .choice, .task.readonly .hrow { opacity: 0.65; }
/* one-time celebratory bounce when a step is completed */
.actions .card.shake { animation: shake 0.45s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
.actions .card.did-bounce { animation: successBounce 0.8s ease; }
@keyframes successBounce {
  0% { transform: translateY(0); }   25% { transform: translateY(-14px); }  45% { transform: translateY(0); }
  62% { transform: translateY(-7px); } 80% { transform: translateY(0); }     90% { transform: translateY(-3px); } 100% { transform: translateY(0); }
}

/* ---------- end-day button ---------- */
.endday {
  align-self: center; margin-top: 2px;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: #fff;
  background: var(--grow); border: none; border-radius: 14px; padding: 13px 22px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform 0.16s, box-shadow 0.16s;
}
.endday:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* ---------- win celebration ---------- */
.win {
  position: fixed; inset: 0; z-index: 50; padding: 20px;
  display: grid; place-items: center;
  background: rgba(75, 58, 43, 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: fadein 0.3s ease both;
}
.win[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.win__card {
  background: var(--card); border: 2px solid var(--line); border-radius: 26px;
  padding: 28px 24px; width: 100%; max-width: 440px; max-height: 92vh; overflow-y: auto;   /* match the task modal: wider + scrollable */
  text-align: center; box-shadow: var(--shadow-lg);
  animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.win__emoji { font-size: 3.4rem; animation: bob 2.4s ease-in-out infinite; }
.win__title { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; margin: 6px 0 8px; }
.win__text { font-weight: 600; color: var(--ink-soft); line-height: 1.5; }
.win__text b { color: var(--grow); }
/* shareable #1 certificate — collapsed into a pill by default; tap to view & save */
.cert { margin: 16px 0 4px; }
.cert__summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.92rem; color: var(--ink);
  background: var(--cream-2); border: 2px solid var(--line); border-radius: 999px; padding: 9px 18px;
  transition: border-color 0.15s, transform 0.15s; }
.cert__summary::-webkit-details-marker { display: none; }
.cert__summary:hover { border-color: var(--crust); transform: translateY(-2px); }
.cert__inner { margin-top: 12px; }
.cert__img { width: 100%; max-width: 340px; height: auto; border-radius: 14px; border: 2px solid var(--line); box-shadow: var(--shadow); display: block; margin: 0 auto; }
.cert__btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.cert__btn { font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; cursor: pointer; border-radius: 999px; padding: 9px 16px; border: 2px solid var(--line); background: var(--card); color: var(--ink); transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
.cert__btn:hover { border-color: var(--crust); transform: translateY(-2px); box-shadow: var(--shadow); }
/* end-of-world recap */
.recap { margin: 16px 0 4px; text-align: left; background: #fff8ec; border: 2px solid var(--line); border-radius: 16px; padding: 14px 16px 12px; }
.recap__title { font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--ink); margin-bottom: 9px; text-align: center; }
.recap__list { list-style: none; margin: 0; padding: 0; }
.recap__list li { position: relative; padding-left: 24px; color: var(--ink-soft); font-weight: 600; font-size: 0.87rem; line-height: 1.45; margin: 7px 0; }
.recap__list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--grow); font-weight: 800; }
.win__next {
  flex: 2; font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  border: none; border-radius: 999px; padding: 13px 18px; cursor: pointer;
  background: var(--grow); color: #fff; box-shadow: var(--shadow); transition: transform 0.16s, box-shadow 0.16s;
}
.win__next:hover:not(:disabled) { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.win__next:disabled { background: #efe4d4; color: var(--ink-soft); cursor: default; box-shadow: none; }
/* Next level + Replay share one row */
.win__row { display: flex; gap: 10px; margin-top: 18px; }
.win__pill {
  flex: 1; font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  border: 2px solid var(--line); border-radius: 999px; padding: 11px 14px; cursor: pointer;
  background: var(--card); color: var(--ink); transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.win__pill:hover { transform: translateY(-2px); border-color: var(--crust); box-shadow: var(--shadow); }

/* ---------- confetti ---------- */
.confetti {
  position: fixed; top: -16px; width: 9px; height: 15px; border-radius: 2px;
  z-index: 60; pointer-events: none; animation: fall 2.7s linear forwards;
}
@keyframes fall { to { transform: translateY(106vh) rotate(560deg); opacity: 0.85; } }

/* ---------- teachable task modal ---------- */
.task {
  position: fixed; inset: 0; z-index: 55; padding: 18px;
  display: grid; place-items: center;
  background: rgba(75, 58, 43, 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: fadein 0.25s ease both;
}
.task[hidden] { display: none; }
/* close animation — mirror of the open fadein + pop */
@keyframes fadeout { from { opacity: 1; } to { opacity: 0; } }
@keyframes popout  { from { transform: scale(1); opacity: 1; } to { transform: scale(0.96); opacity: 0; } }
.task.closing { animation: fadeout 0.2s ease forwards; pointer-events: none; }
.task.closing .task__card { animation: popout 0.2s cubic-bezier(0.4, 0, 1, 1) forwards; }
.task__card {
  position: relative; width: 100%; max-width: 440px; max-height: 92vh; overflow: auto;
  background: var(--card); border: 2px solid var(--line); border-radius: 24px;
  padding: 24px 22px; box-shadow: var(--shadow-lg);
  animation: pop 0.45s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.task__close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
  border-radius: 50%; border: 2px solid var(--line); background: #fff;
  cursor: pointer; font-weight: 700; color: var(--ink-soft); line-height: 1;
}
.task__close:hover { border-color: var(--berry); color: var(--berry); }
.task__head { display: flex; align-items: center; gap: 11px; margin-bottom: 8px; }
.task__icon { width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.3rem; border-radius: 13px; }
.task__title { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; }
.task__intro { font-weight: 600; color: var(--ink-soft); line-height: 1.45; font-size: 0.95rem; }
.kwchip { display: inline-block; font-weight: 800; color: #1f7a52; background: #e3f7ee; border-radius: 8px; padding: 1px 8px; }

.gpreview {
  background: #fff; border: 1px solid #ececec; border-radius: 12px;
  padding: 8px 12px; margin: 15px 0; box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.3);
}
/* Every writing modal shows its preview full-size on a dedicated Preview tab (see .task__pills),
   so previews keep their natural height — no compact inline scroll needed. */

/* Edit ⇄ Preview pills — title + description modals: field on one tab, full Google card on the other. */
.task__pills { position: relative; display: grid; grid-template-columns: 1fr 1fr; width: fit-content; margin: 14px 0 6px; gap: 3px; background: #f3e9d7; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.task__pills::before {   /* sliding active-tab highlight — glides between Edit and Preview (equal 1fr pills keep the 50% math language-proof) */
  content: ''; position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 4.5px);
  background: var(--card); border-radius: 999px; box-shadow: var(--shadow);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.task__pills.show-preview::before { transform: translateX(calc(100% + 3px)); }
.task__pill { position: relative; z-index: 1; text-align: center; border: none; background: none; cursor: pointer; font-family: var(--font-body); font-weight: 700; font-size: 0.84rem; color: var(--ink-soft); padding: 6px 18px; border-radius: 999px; transition: color 0.2s; }
.task__pill.on { color: var(--ink); }   /* the white highlight is drawn by .task__pills::before */
.task__view[hidden] { display: none; }
.task__view:not([hidden]) { animation: viewIn 0.28s ease both; }   /* fade the incoming tab content in on each swap */
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.gpreview__title { color: #1a0dab; font-size: 1.08rem; font-weight: 600; line-height: 1.3; word-break: break-word; }
.gpreview__url { color: #0b7a34; font-size: 0.8rem; margin-top: 2px; }
.gpreview__desc { color: #5f6368; font-size: 0.82rem; margin-top: 3px; line-height: 1; }

.task__input {
  width: 100%; font-family: var(--font-body); font-size: 1.02rem; font-weight: 700; color: var(--ink);
  padding: 12px 14px; border: 2px solid var(--line); border-radius: 13px; background: #fffdf9;
}
.task__input:focus { outline: none; border-color: var(--crust); }
.task__input::placeholder { color: var(--ink-soft); font-weight: 600; opacity: 0.9; }   /* visible "e.g. …" example, lighter than typed text */
.task__count { font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); margin: 6px 2px 0; }

.checks { list-style: none; display: flex; flex-direction: column; gap: 7px; margin: 15px 0; }
.checks li { position: relative; padding-left: 28px; font-weight: 700; font-size: 0.9rem; color: var(--ink-soft); transition: color 0.2s; }
.checks li::before { content: '○'; position: absolute; left: 6px; top: -1px; color: #cdba9f; font-weight: 800; }
.checks li.ok { color: var(--ink); }
.checks li.ok::before { content: '✓'; color: var(--grow); }
.checks .muted { font-weight: 600; }

.task__pip {
  background: #fff6e0; border: 1px solid #f4e1bb; border-radius: 12px;
  padding: 10px 13px; font-weight: 700; font-size: 0.9rem; color: #8a6d2f; line-height: 1.4;
}
.task__pip b { color: #b9802a; }
.task__pip:empty { display: none; }   /* hide the feedback box until there's a message */
.task__apply {
  margin-top: 14px; width: 100%; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  color: #fff; background: var(--grow); border: none; border-radius: 14px; padding: 14px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform 0.16s, box-shadow 0.16s;
}
.task__apply:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.task__apply:disabled { background: #e7d8c2; color: var(--ink-soft); cursor: default; box-shadow: none; }
.muted { color: var(--ink-soft); }

/* ---------- content task: textarea + page preview ---------- */
.task__textarea { resize: vertical; min-height: 74px; line-height: 1.45; font-weight: 600; }
.pagepreview {
  background: #fff; border: 1px solid #ececec; border-radius: 12px;
  padding: 14px; margin: 15px 0; box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.3);
}
.pagepreview__bar { display: flex; align-items: center; gap: 5px; font-size: 0.72rem; color: #9aa0a6; margin-bottom: 10px; }
.pagepreview__bar i { width: 8px; height: 8px; border-radius: 50%; background: #e2e2e2; display: inline-block; }
.pagepreview__bar i:last-of-type { margin-right: 6px; }
.pagepreview__h1 { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: #222; margin-bottom: 5px; }
.pagepreview__body { font-size: 0.86rem; color: #444; line-height: 1.5; word-break: break-word; }

/* ---------- link task: choices ---------- */
.choices { display: flex; flex-direction: column; gap: 10px; margin: 15px 0; }
.choice {
  display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  font-family: var(--font-body); background: #fffdf9; border: 2px solid var(--line);
  border-radius: 14px; padding: 13px 14px; transition: transform 0.14s, border-color 0.14s, box-shadow 0.14s;
}
.choice:hover { transform: translateY(-3px); border-color: var(--crust); box-shadow: var(--shadow); }
.choice__emoji { font-size: 1.7rem; flex: none; }
.choice__body { display: flex; flex-direction: column; gap: 1px; }
.choice__body b { font-size: 1rem; font-weight: 800; color: var(--ink); }
.choice__body span { font-size: 0.84rem; font-weight: 600; color: var(--ink-soft); }
/* review mode (re-opening a completed task): options are read-only; the right answer you picked is highlighted */
.choice:disabled { cursor: default; }
.choice:disabled:hover { transform: none; border-color: var(--line); box-shadow: none; }
.choice--picked, .choice--picked:disabled:hover { border-color: var(--grow); background: #e9f9f0; }
.choice--picked::after { content: "✓"; margin-left: auto; flex: none; color: var(--grow); font-weight: 800; font-size: 1.25rem; align-self: center; }
/* wrong pick (try-again flow): red, shake once, ✗ marker; stays visible while disabled */
.choice--wrong, .choice--wrong:disabled:hover { border-color: #e8788f; background: #ffeef1; animation: shake 0.4s; }
.choice--wrong::after { content: "✗"; margin-left: auto; flex: none; color: #c2425d; font-weight: 800; font-size: 1.25rem; align-self: center; }

/* ---------- strength meter ---------- */
.progress { margin: 0 2px; }
.progress__name { font-weight: 700; font-size: 0.78rem; color: var(--ink-soft); }
.progress__track {
  position: relative; height: 22px; margin-top: 9px;
  background: #f3e6d2; border: 2px solid var(--line); border-radius: 999px;
}
.progress__fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(90deg, #57c894, var(--grow)); border-radius: 999px;
  box-shadow: 0 0 12px -2px rgba(67, 192, 138, 0.6);
  transition: width 1.05s cubic-bezier(0.22, 1, 0.36, 1);
}
.progress__marker {
  position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%);
  font-size: 1.6rem; transition: left 1.05s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3)); z-index: 1;
}
.progress__marker.pulse { animation: markPop 1s ease; }
@keyframes markPop {
  0%   { transform: translate(-50%, -50%) scale(1)    rotate(0deg); }
  30%  { transform: translate(-50%, -50%) scale(1.85) rotate(-12deg); }
  55%  { transform: translate(-50%, -50%) scale(1.85) rotate(12deg); }
  100% { transform: translate(-50%, -50%) scale(1)    rotate(0deg); }
}
.progress__crown { position: absolute; right: -4px; top: 50%; transform: translateY(-50%); font-size: 1.45rem; }

/* ---------- per-move feedback ---------- */
.rung--you.bumped { animation: flashYou 1.2s ease; }
@keyframes flashYou {
  0%   { box-shadow: 0 0 0 0 rgba(67, 192, 138, 0); }
  20%  { box-shadow: 0 0 0 10px rgba(67, 192, 138, 0.55); }
  100% { box-shadow: 0 0 0 0 rgba(67, 192, 138, 0); }
}
.float {
  position: fixed; z-index: 40; pointer-events: none;
  font-family: var(--font-display); font-weight: 700; font-size: 1.7rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  animation: floatUp 2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.float--good { color: var(--grow); }
.float--bad { color: #e23b3b; }
@keyframes floatUp {
  0%   { opacity: 0; transform: translateY(14px) scale(0.5); }
  14%  { opacity: 1; transform: translateY(0) scale(1.35); }
  26%  { transform: translateY(-6px) scale(1); }
  78%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-84px) scale(1); }
}
.coach__bubble.said { animation: said 0.35s ease; }
@keyframes said { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Reduce ambient/decorative motion only — keep the feedback motion that
   communicates game state (meter, ladder slide, flash, floats). */
/* ---------- headings task ---------- */
.hlist { display: flex; flex-direction: column; gap: 8px; margin: 15px 0; }
.hrow {
  display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  font-family: var(--font-body); background: #fffdf9; border: 2px solid var(--line);
  border-radius: 12px; padding: 11px 13px;
  transition: margin-left 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.15s, background 0.15s;
}
.hrow.lvl-1 { margin-left: 0; }
.hrow.lvl-2 { margin-left: 24px; }
.hrow.lvl-3 { margin-left: 48px; }
.hrow.ok { border-color: var(--grow); background: #eafaf2; }
.hbadge {
  flex: none; font-family: var(--font-display); font-weight: 700; font-size: 0.8rem;
  color: #fff; background: var(--ink-soft); border-radius: 7px; padding: 3px 9px;
}
.hrow.lvl-1 .hbadge { background: var(--crust); }
.hrow.lvl-2 .hbadge { background: #6fa8dc; }
.hrow.lvl-3 .hbadge { background: #b59bd6; }
.htext { font-weight: 700; font-size: 0.92rem; }
.hrow.ok .htext { color: #1f7a52; }
.hok { margin-left: auto; color: var(--grow); font-weight: 800; }

/* ---------- image tasks (alt / filename / compress) ---------- */
.altimg {
  font-size: 3.6rem; text-align: center; background: #fff;
  border: 2px solid var(--line); border-radius: 16px; padding: 16px; margin: 14px 0 8px;
}
.altread {
  font-size: 0.85rem; font-weight: 700; font-style: italic; color: var(--ink-soft);
  text-align: center; margin-bottom: 8px; word-break: break-word;
}

/* ---------- level select (hub) ---------- */
.levelsbtn, .langbtn, .muteb {
  font-family: var(--font-body); font-weight: 700; font-size: 0.8rem; cursor: pointer; color: var(--ink);
  background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 7px 13px; box-shadow: var(--shadow);
  transition: transform 0.15s, border-color 0.15s;
}
.levelsbtn:hover, .langbtn:hover, .muteb:hover { transform: translateY(-1px); border-color: var(--crust); }
.langbtn { display: inline-flex; align-items: center; }   /* clean icon + text alignment */
.langbtn__icon { width: 0.95em; height: 0.95em; margin-right: 5px; }   /* globe SVG; inherits text colour via currentColor (hidden on mobile) */
.muteb { display: inline-flex; align-items: center; justify-content: center; font-size: 1.125rem; line-height: 1; }   /* icon-only; bigger glyph makes the pill the same height as the rest */
.muteb.is-muted { border-color: #e2483d; background: #fdecea; }   /* red ring when sound is off; same 2px border as the rest */
.muteb.is-muted:hover { border-color: #c5382e; }

/* ---------- save progress (email a resume link) ---------- */
.savebtn {
  position: fixed; left: 24px; bottom: 24px; z-index: 28;   /* below modals */
  font-family: var(--font-display); font-weight: 600; font-size: 0.92rem; cursor: pointer;
  color: var(--ink); background: var(--card); border: 2px solid var(--line);
  border-radius: 999px; padding: 11px 18px; box-shadow: var(--shadow-lg);
  display: inline-flex; align-items: center; gap: 7px;
  transition: transform 0.15s, border-color 0.15s;
}
.savebtn:hover { transform: translateY(-2px); border-color: var(--crust); }
@media (max-width: 560px) { .savebtn { left: 20px; bottom: 20px; } }   /* after the base rule so it wins the cascade */
.save__consent {
  display: flex; align-items: flex-start; gap: 9px; margin-top: 13px;
  font-size: 0.88rem; color: var(--ink-soft); line-height: 1.45; cursor: pointer;
}
.save__consent input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--grow); flex: none; }
.save__privacy { display: block; text-align: center; margin-top: 11px; font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); }
.save__privacy:hover { color: var(--crust); }
.task__pip.ok  { background: #e9f9f0; border-color: #bfe9d3; color: #1f7a52; }
.task__pip.err { background: #ffeef1; border-color: #ffc9d4; color: #c2425d; }
.task__pip.ok b, .task__pip.err b { color: inherit; }   /* bold keyword takes the state colour, not the cream-hint brown */
.task__pip.ok, .task__pip.err { animation: pop 0.3s cubic-bezier(0.2, 1.4, 0.4, 1); }   /* error / success feedback pops in when shown */
/* success = green field border + the success word on the apply button (no over-field badge) */
.task__input.input-ok { border-color: var(--grow); }
.hp { display: none; }   /* honeypot — display:none so browser/password-manager autofill skips it (off-screen fields get auto-filled, which falsely tripped the spam trap) */

/* toast — transient confirmations (save / resume) */
.toast {
  position: fixed; left: 50%; top: 18px; transform: translateX(-50%) translateY(-22px);
  z-index: 80; background: var(--ink); color: #fff; font-weight: 700; font-size: 0.92rem;
  padding: 11px 18px; border-radius: 999px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- home / start screen ---------- */
.home[hidden] { display: none; }   /* the hidden attribute must beat .home's display:flex */
.home {
  position: fixed; inset: 0; z-index: 60; overflow: auto;
  padding-top: 11px;            /* match body's top padding so the .top header lines up with the game */
  display: flex; flex-direction: column;
  background:
    radial-gradient(34rem 22rem at 12% -8%, #ffe7c2, transparent 70%),
    radial-gradient(32rem 22rem at 100% 0%, #ffe0e6, transparent 65%),
    var(--cream);
  animation: fadein 0.3s ease both;
}
.home__inner {
  width: 100%; max-width: 520px; margin: auto; padding: 16px 20px 34px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 13px;
}
/* staggered entrance for the home screen + a bobbing, glowing Start button */
@keyframes glow { 0%, 100% { box-shadow: var(--shadow-lg); } 50% { box-shadow: 0 18px 34px -10px rgba(67, 192, 138, 0.6); } }
@keyframes ctaBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes homeIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: translateY(0); } }
.home > .top { animation: homeIn 0.55s cubic-bezier(0.2, 1.1, 0.3, 1) 0s    both; }
.home__tag   { animation: homeIn 0.55s cubic-bezier(0.2, 1.1, 0.3, 1) 0.12s both; }
.home__intro { animation: homeIn 0.55s cubic-bezier(0.2, 1.1, 0.3, 1) 0.24s both; }
.home__group { animation: homeIn 0.55s cubic-bezier(0.2, 1.1, 0.3, 1) 0.36s both; }
.home__start { animation: homeIn 0.55s cubic-bezier(0.2, 1.1, 0.3, 1) 0.48s both,
               ctaBob 1.9s ease-in-out 1.3s infinite, glow 2.6s ease-in-out 1.6s infinite; }
.home__tag { font-family: var(--font-display); font-weight: 700; font-size: 2.36rem; color: var(--ink); line-height: 1.2; letter-spacing: -0.01em; }
@media (min-width: 561px) { .home__tag .br-mob { display: none; } }   /* desktop: break after "SEO" (.br-desk); mobile (≤560) swaps to break after "learn" (.br-mob) so "SEO the fun way." stays together. Mutually-exclusive queries avoid a source-order clash. */
.home__intro { font-size: 0.98rem; color: var(--ink-soft); font-weight: 600; line-height: 1.5; max-width: 380px; margin-top: -5px; }
/* "this is a game" badge above the tagline */
.home__eyebrow {
  font-family: var(--font-display); font-weight: 500; font-size: 0.62rem; letter-spacing: 0.7em; text-transform: uppercase; line-height: 1.9;
  color: var(--crust); background: transparent; border-radius: 999px; padding: 4px 14px; margin-bottom: 30px;
  animation: homeIn 0.55s cubic-bezier(0.2, 1.1, 0.3, 1) 0.06s both;
}
.home__group { width: 100%; max-width: 380px; margin-top: 4px; }
.home__label { display: block; font-weight: 800; font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 8px; text-align: center; }
.home__select {
  font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; width: 100%;
  text-align: center; text-align-last: center;
  padding: 12px 38px 12px 16px; border: 2px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  -webkit-appearance: none; appearance: none;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23977f66' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.home__select:hover { border-color: var(--crust); }
.home__select:focus { outline: none; border-color: var(--crust); }
.home__start {
  margin-top: 12px; width: 100%; max-width: 380px; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem;
  color: #fff; background: var(--grow); border: none; border-radius: 16px; padding: 15px; cursor: pointer;
  box-shadow: var(--shadow-lg); transition: transform 0.16s, box-shadow 0.16s;
}
.home__start:hover { transform: translateY(-2px); }
/* business type + name read as ONE field: shared border, no gap, a short divider between */
.home__combo {
  display: flex; align-items: stretch; width: 100%;
  border: 2px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); background: var(--card);
  overflow: hidden; transition: border-color 0.16s;
}
.home__combo:hover, .home__combo:focus-within { border-color: var(--crust); }
.home__combo.err { border-color: #e23b3b; animation: shake 0.32s; }
.home__combo .home__select,
.home__combo .home__input { border: none; box-shadow: none; border-radius: 0; }
.home__combo .home__select { flex: 0 0 42%; text-align: left; text-align-last: left; background-color: transparent; }
.home__combo .home__input {
  flex: 1 1 auto; min-width: 0; text-align: left; padding-left: 16px;
  background: linear-gradient(var(--line), var(--line)) left center / 2px 60% no-repeat;   /* 60%-height vertical divider */
}
.home__input { font: inherit; font-weight: 700; color: var(--ink); width: 100%; padding: 12px 16px; }
.home__input::placeholder { color: var(--ink-soft); font-weight: 600; opacity: 0.7; }
.home__input:focus { outline: none; }
.home__combo.err .home__input::placeholder { color: #e23b3b; opacity: 0.85; }

/* ---- Keyboard focus rings — visible for keyboard nav only (:focus-visible), mouse clicks stay clean.
       Placed late + class-specific so it overrides the `outline:none` rules above. ---- */
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible,
.card:focus-visible, .home__input:focus-visible, .home__select:focus-visible {
  outline: 3px solid var(--crust);
  outline-offset: 2px;
}
/* Task input is auto-focused on open, so its ring would show for everyone (not just keyboard nav);
   skip the outer ring there — the 2px border-colour change is focus cue enough. */
.task__input:focus, .task__input:focus-visible { outline: none; }
.hub__home { background: none; border: none; color: var(--ink-soft); font-weight: 700; font-size: 0.8rem; cursor: pointer; text-decoration: underline; margin: 26px 18px 0 0; }
.hub__home:hover { color: var(--crust); }

.hub {
  position: fixed; inset: 0; z-index: 60; overflow: auto; display: flex; align-items: flex-start; justify-content: center;
  background:
    radial-gradient(34rem 22rem at 12% -8%, #ffe7c2, transparent 70%),
    radial-gradient(32rem 22rem at 100% 0%, #ffe0e6, transparent 65%),
    var(--cream);
  animation: fadein 0.3s ease both;
}
.hub[hidden] { display: none; }
.hub__inner { width: 100%; max-width: 700px; padding: 44px 18px 40px; text-align: center; }
.hub__brand { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; display: inline-flex; align-items: center; gap: 7px; }
.hub__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.7rem, 5vw, 2.3rem); margin-top: 12px; }
.hub__sub { font-weight: 600; color: var(--ink-soft); margin: 6px 0 26px; }
.hub__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.lvlcard {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 7px; text-align: left; cursor: pointer;
  font-family: var(--font-body); background: var(--card); border: 2px solid var(--line); border-radius: 18px;
  padding: 16px; box-shadow: var(--shadow); transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
  animation: pop 0.4s cubic-bezier(0.2, 1.3, 0.4, 1) both;   /* stagger delay set per-card in renderHub */
}
.lvlcard:hover:not(:disabled) { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--crust); }
.lvlcard.locked { opacity: 0.55; cursor: default; }
.lvlcard.done { border-color: var(--grow); }
.lvlcard__badge {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; background: #fff0d6; color: var(--ink);
}
.lvlcard.done .lvlcard__badge { background: var(--grow); color: #fff; }
.lvlcard.locked .lvlcard__badge { background: #ece3d4; }
.lvlcard__name { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; }
.lvlcard__status { font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); }
.lvlcard.done .lvlcard__status { color: var(--grow); }
/* in-progress level (resumes where you left off) — amber accent, distinct from done's green */
.lvlcard.active { border-color: var(--crust); }
.lvlcard.active .lvlcard__badge { background: var(--crust); color: #fff; }
.lvlcard.active .lvlcard__status { color: var(--crust); }
/* past-#1 (paid) levels: small yellow "bonus" pill, top-right — like #1 but smaller */
.lvlcard__bonus {
  position: absolute; top: 10px; right: 10px;
  background: var(--gold); color: var(--ink);
  font-family: var(--font-display); font-weight: 700; font-size: 0.66rem; letter-spacing: 0.01em;
  padding: 2px 9px; border-radius: 999px; box-shadow: var(--shadow); transform: rotate(-3deg);
}
/* "Advanced track" section break in the level menu — separates the core game (1–6, reach #1) from the optional post-#1 levels */
.hub-divider { grid-column: 1 / -1; margin: 20px 0 0; padding-top: 20px; border-top: 2px dashed var(--line); text-align: center; }
.hub-divider__label { font-family: var(--font-display); font-weight: 700; color: var(--crust); font-size: 1.02rem; }
.hub-divider__sub { display: block; font-weight: 600; font-size: 0.78rem; color: var(--ink-soft); margin-top: 3px; }
.hub__reset { margin-top: 26px; background: none; border: none; color: var(--ink-soft); font-weight: 700; font-size: 0.8rem; cursor: pointer; text-decoration: underline; }
.hub__reset:hover { color: var(--berry); }

/* Ad slots — #1 between levels (win screen) + #2 level-select hub. Drop an AdSense <ins> in to activate. */
.ad-slot {
  width: 100%; max-width: 336px; min-height: 100px; margin: 18px auto 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: #faf3e6; border: 1px dashed var(--line); border-radius: 14px;
}
.ad-slot--wide { max-width: 728px; }
.ad-slot__ph { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); opacity: 0.5; }

.task__tool { display: block; text-align: center; margin-top: 12px; font-family: var(--font-body); font-weight: 700; font-size: 0.82rem; color: var(--crust); }
.task__tool:hover { color: var(--ink); }
.task__countrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 6px 2px 0; }
.task__countrow .task__count { margin: 0; }
.task__example { padding: 0; background: none; border: none; cursor: pointer; font-family: var(--font-body); font-weight: 700; font-size: 0.82rem; color: var(--crust); white-space: nowrap; }
.task__example:hover { color: var(--ink); }

/* "See hints!" toggle + the panel it reveals (criteria checklist + the example link) */
.task__hintstoggle {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0; background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 700; font-size: 0.82rem; color: var(--crust); white-space: nowrap;
}
.task__hintstoggle:hover { color: var(--ink); }
.task__chev { font-size: 0.66rem; transition: transform 0.28s ease; }
.task__hintstoggle[aria-expanded="true"] .task__chev { transform: rotate(180deg); }
/* smooth open/close: animate the grid row 0fr → 1fr (handles unknown content height) */
.task__hints { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.32s cubic-bezier(0.4, 0, 0.2, 1); margin: 0 0 8px; }
.task__hints.open { grid-template-rows: 1fr; }
.task__hints-inner { overflow: hidden; min-height: 0; }
.task__hints .checks { margin: 12px 0 0; }
.task__hints .task__example { display: inline-block; margin-top: 12px; }
/* "Where do I add this in real life?" — collapsible per task */
.task__where { margin-top: 12px; font-size: 0.84rem; }   /* expand/collapse is animated in JS (animateDetails) */
.task__where summary { cursor: pointer; font-family: var(--font-body); font-weight: 700; color: var(--crust); list-style: none; text-align: center; }
.task__where summary::-webkit-details-marker { display: none; }
.task__where summary:hover { color: var(--ink); }
.task__where > div { margin-top: 8px; padding: 10px 13px; background: #fff8ec; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-soft); font-weight: 600; line-height: 1.5; }
.task__where > div b { color: var(--ink); }

/* share row (win screen) */
.share { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; }
.share[hidden] { display: none; }   /* the class display: flex would otherwise beat the [hidden] attribute */
.share__label { width: 100%; font-size: 0.82rem; font-weight: 800; color: var(--ink-soft); }
.share__btn {
  font: inherit; font-weight: 800; font-size: 0.86rem; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px; min-width: 40px; justify-content: center;
  border: 2px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 7px 14px;
  transition: transform 0.12s, border-color 0.12s;
}
.share__btn:hover { border-color: var(--crust); transform: translateY(-2px); }
.share__btn--li { color: #0a66c2; }
.share__btn--x  { color: #111; font-size: 1rem; }

/* ---------- featured-snippet box (Level 5) ---------- */
.snippetbox {
  background: #fff; border: 1px solid #ececec; border-radius: 12px;
  padding: 14px; margin: 14px 0; box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.3);
}
.snippetbox__q { font-weight: 800; color: #202124; font-size: 0.92rem; margin-bottom: 6px; }
.snippetbox__a { color: #3c4043; font-size: 0.92rem; line-height: 1.5; word-break: break-word; }
.snippetbox__src { color: #0b7a34; font-size: 0.78rem; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  /* Keep only the heavy effects tied to the OS setting; gentle UI motion still plays. */
  .confetti { display: none !important; }
}

/* cookie consent banner styles now live in consent.js (so they apply identically on every page) */

/* ---------- site footer (legal links) ---------- */
.sitefooter {
  width: 100%; max-width: 680px; margin: 8px auto 0; padding: 18px 14px 6px;
  text-align: center; font-size: 0.82rem; font-weight: 700; color: var(--ink-soft);
  display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center;
}
.sitefooter a, .sitefooter button {
  color: var(--ink-soft); text-decoration: none; background: none; border: none;
  font: inherit; cursor: pointer; padding: 0;
}
.sitefooter a:hover, .sitefooter button:hover { color: var(--crust); }
.sitefooter .sitefooter__sep { opacity: 0.4; }
