/* מִילּוֹת קִישׁוּר · כִתָּה ו׳ · Looly PRODUCT CARD DNA (grades 4–6)
   Soft cream paper · plum ink · rose/lilac/sage/honey — NOT lomdim toddler, NOT corporate navy.
   Strict: no blur, no backdrop-filter, no feathered photo edges. */
@font-face {
  font-family: 'HeeboLooly';
  src: url('../fonts/Heebo.ttf?v=9') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #FFF8F0;
  --panel: #FFFCFA;
  --paper: #FFFFFF;
  --ink: #3D2C3E;
  --ink-soft: #5A4A5C;
  --plum: #3D2C4E;
  --line: #D0C0D8;
  --line-soft: #E8DFF2;
  --rose: #F8D7DA;
  --rose-d: #E8B4BA;
  --peach: #F8D5C8;
  --peach-d: #E8B8A8;
  --lilac: #E8D5F2;
  --lav-mist: #E8DFF2;
  --lav-deep: #C9B8D8;
  --honey: #F2D5A0;
  --honey-d: #E0BC78;
  --sage: #C8D8C0;
  --sage-d: #A8C5B0;
  --sage-ink: #5A7058;
  --ok: #6A8F6A;
  --ok-bg: #E8F0E4;
  --bad: #B86A6A;
  --bad-bg: #F8E8E8;
  --shadow: 0 8px 24px rgba(61, 44, 62, 0.08);
  --shadow-sm: 0 4px 14px rgba(61, 44, 62, 0.07);
  --radius: 22px;
  --radius-sm: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --play-max: 880px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  min-height: 100%;
  font-family: 'HeeboLooly', 'Heebo', 'Rubik', 'IBM Plex Sans Hebrew', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
body { min-height: 100dvh; overflow-x: hidden; position: relative; }
img { -webkit-user-drag: none; user-select: none; max-width: 100%; }
button { font-family: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
.ico { width: 22px; height: 22px; flex: none; }

/* Subtle watercolor washes — calm, not cartoon playground blobs */
.decor { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; opacity: 0.45; }
.b1 { width: 420px; height: 320px; background: var(--rose); top: -160px; right: -120px; opacity: 0.35; }
.b2 { width: 380px; height: 300px; background: var(--sage); bottom: -140px; left: -100px; opacity: 0.32; }
.b3 { width: 220px; height: 180px; background: var(--lav-mist); top: 42%; left: -80px; opacity: 0.28; }
.b4 { width: 200px; height: 160px; background: var(--honey); bottom: 18%; right: -70px; opacity: 0.28; }

.screen {
  position: relative; z-index: 1;
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(16px + var(--safe-top)) 22px calc(18px + var(--safe-bottom));
}
.screen.active { display: flex; animation: screenIn 0.3s ease both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 24px;
  border: 2px solid var(--line); border-radius: 999px;
  font-size: 1.12rem; font-weight: 700; line-height: 1.3;
  background: var(--panel); color: var(--ink);
  touch-action: manipulation; user-select: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s;
}
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:focus-visible, .stage-card:focus-visible, .opt:focus-visible, .say:focus-visible, .gender-btn:focus-visible {
  outline: 3px solid var(--lav-deep); outline-offset: 2px;
}
.btn-main {
  background: var(--sage); color: var(--ink); border-color: var(--sage-d);
}
.btn-main:hover { background: #D4E2CC; }
.btn-soft {
  background: var(--panel); color: var(--ink); border-color: var(--lav-deep);
}
.btn-soft:hover { background: var(--lav-mist); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.say {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid var(--lav-deep); background: var(--lav-mist); color: var(--plum);
  cursor: pointer; touch-action: manipulation; flex: none;
  box-shadow: var(--shadow-sm);
}
.say .ico { width: 22px; height: 22px; }
.say:hover { background: var(--lilac); }
.say.talking { animation: talk 0.55s ease; }
@keyframes talk { 0%,100% { transform: scale(1); } 40% { transform: scale(1.1); } }

/* ---------- HOME — product card hero ---------- */
.home-hero {
  display: flex; flex-direction: column; align-items: stretch;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 28px;
  padding: 20px 24px 22px;
  box-shadow: var(--shadow);
  position: relative;
}
.hero-top {
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.hero-logo { width: 132px; height: auto; }
.hero-text { margin-top: 12px; text-align: center; }
.kicker {
  display: inline-block;
  background: var(--rose);
  color: var(--ink);
  font-size: 0.95rem; font-weight: 700;
  padding: 6px 18px; border-radius: 999px;
  margin-bottom: 10px;
  border: 1.5px solid var(--rose-d);
}
.title {
  font-size: clamp(1.85rem, 3.8vw, 2.6rem);
  font-weight: 800; color: var(--ink); line-height: 1.3;
}
.subtitle {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--ink-soft); font-weight: 600; margin-top: 6px; line-height: 1.55;
  margin-bottom: 16px;
}
.home-form {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: center;
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
}
.gender-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.gender-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; min-height: 46px;
  border-radius: 999px; border: 2px solid var(--line); background: var(--panel);
  font-size: 1.05rem; font-weight: 700; color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.gender-btn[aria-pressed="true"] {
  background: var(--honey); border-color: var(--honey-d); color: var(--ink);
}
.name-field { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 4px; }
.name-label { font-size: 0.88rem; font-weight: 700; color: var(--ink-soft); }
.name-field input {
  width: 100%; min-height: 46px;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 1.1rem; font-weight: 600;
  background: var(--panel); color: var(--ink);
  font-family: inherit;
}
.name-field input:focus { outline: none; border-color: var(--lav-deep); }
.name-field.need-name input { border-color: var(--peach-d); animation: shake 0.35s ease; }
@keyframes shake {
  0%,100% { transform: none; }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.home-body { margin-top: 22px; }
.stages-head {
  font-size: 1.35rem; font-weight: 800; color: var(--ink);
  margin: 4px 4px 16px;
  text-align: center;
}
.stage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .stage-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stage-grid { grid-template-columns: 1fr; } }

/* Stage cards = soft educational product cards */
.stage-card {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  text-align: right;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s;
  min-height: 118px;
}
.stage-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stage-card:active { transform: none; }
/* Soft accent bar (not loud candy fill) */
.stage-card.s1 { border-color: var(--sage-d); background: linear-gradient(180deg, #F4F8F2 0%, var(--panel) 40%); }
.stage-card.s2 { border-color: var(--lav-deep); background: linear-gradient(180deg, #F6F2FA 0%, var(--panel) 40%); }
.stage-card.s3 { border-color: var(--peach-d); background: linear-gradient(180deg, #FBF4F0 0%, var(--panel) 40%); }
.stage-card.s4 { border-color: var(--honey-d); background: linear-gradient(180deg, #FBF6EC 0%, var(--panel) 40%); }
.stage-card.s5 { border-color: var(--rose-d); background: linear-gradient(180deg, #FBF2F3 0%, var(--panel) 40%); }
.stage-card.s6 { border-color: var(--sage-d); background: linear-gradient(180deg, #F4F8F2 0%, var(--panel) 40%); }
.stage-card.s7 { border-color: var(--lav-deep); background: linear-gradient(180deg, #F6F2FA 0%, var(--panel) 40%); }
.stage-card.s8 { border-color: var(--peach-d); background: linear-gradient(180deg, #FBF4F0 0%, var(--panel) 40%); }
.stage-card.s9 { border-color: var(--honey-d); background: linear-gradient(180deg, #FBF6EC 0%, var(--panel) 40%); }
.stage-card.s10 { border-color: var(--rose-d); background: linear-gradient(180deg, #FBF2F3 0%, var(--panel) 40%); }
.stage-card.s11 { border-color: var(--sage-d); background: linear-gradient(180deg, #F4F8F2 0%, var(--panel) 40%); }
.stage-card.s12 { border-color: var(--lav-deep); background: linear-gradient(180deg, #F6F2FA 0%, var(--panel) 40%); }
.stage-card.done { outline: 2px solid var(--sage-d); outline-offset: 0; }
.stage-num {
  position: absolute; top: -11px; right: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 999px;
  background: var(--lav-mist); color: var(--ink);
  border: 1.5px solid var(--lav-deep);
  font-weight: 800; font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}
.stage-card.done .stage-num { background: var(--sage); border-color: var(--sage-d); }
.stage-card-title { font-size: 1.08rem; font-weight: 800; color: var(--ink); line-height: 1.35; margin-top: 4px; }
.stage-card-desc { font-size: 0.92rem; color: var(--ink-soft); font-weight: 600; line-height: 1.4; }
.stage-card-stars { font-size: 0.88rem; color: #8A6A28; font-weight: 700; margin-top: auto; }

/* ---------- TOPBAR — soft cream/lavender panel ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 10px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}
.top-logo { width: 68px; height: auto; }
.top-title {
  flex: 1; display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.05rem; min-width: 0; color: var(--ink);
}
.stage-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 999px;
  background: var(--rose); color: var(--ink); border: 1.5px solid var(--rose-d);
  font-weight: 800; flex: none; font-size: 0.95rem;
}
.top-title span:last-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stars-live {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--honey);
  border: 1.5px solid var(--honey-d);
  padding: 5px 12px; border-radius: 999px;
  font-weight: 800; font-size: 0.98rem; color: var(--ink);
}
.stars-live img { width: 20px; height: 20px; }
.dots { display: flex; gap: 5px; flex-wrap: wrap; max-width: 180px; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--line);
}
.dot.on { background: var(--ink); }
.dot.ok { background: var(--honey-d); }
.btn-home {
  min-height: 42px; padding: 8px 14px; font-size: 0.92rem;
  background: var(--lav-mist); color: var(--ink); border-color: var(--lav-deep);
  box-shadow: none;
}
.btn-home:hover { background: var(--lilac); }

.coach {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 0 auto 14px;
  width: 100%;
  max-width: var(--play-max);
  box-shadow: var(--shadow-sm);
}
.coach-icon {
  width: 40px; height: 40px; border-radius: 999px;
  background: var(--peach); color: var(--ink);
  border: 1.5px solid var(--peach-d);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800; flex: none;
}
.coach-bubble {
  font-size: 1.08rem; font-weight: 700; color: var(--ink); line-height: 1.45;
}

.play-area {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 14px;
  width: 100%;
}
.play-area > * {
  width: 100%;
  max-width: var(--play-max);
}
.feedback {
  min-height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 800;
  border-radius: 14px;
  padding: 10px 16px;
  margin: 8px auto 0;
  width: 100%;
  max-width: var(--play-max);
  border: 1.5px solid transparent;
}
.feedback.ok { background: var(--ok-bg); color: var(--sage-ink); border-color: var(--sage-d); }
.feedback.bad { background: var(--bad-bg); color: var(--bad); border-color: #E8C0C0; }
.feedback:empty { display: none; }

/* ---------- question card — cream product card ---------- */
.q-card {
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 24px;
  padding: 26px 24px 18px;
  box-shadow: var(--shadow);
  margin: 0 auto;
  width: 100%;
  max-width: var(--play-max);
  text-align: center;
}
.q-prompt {
  display: inline-block;
  font-size: clamp(1.12rem, 2.3vw, 1.35rem);
  font-weight: 800; color: var(--ink);
  margin-bottom: 16px; line-height: 1.4;
  background: var(--rose);
  border: 1.5px solid var(--rose-d);
  border-radius: 999px;
  padding: 8px 20px;
}
.q-sentence-row {
  display: flex; align-items: flex-start; justify-content: center; gap: 10px;
  margin-bottom: 18px;
}
.q-sentence {
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 700; line-height: 1.7; color: var(--ink);
  text-align: center;
}
.q-sentence mark {
  background: var(--lav-mist);
  color: var(--ink);
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 800;
  border: 1.5px solid var(--lav-deep);
}

/* Option chips — soft bordered product chips, 2 per row */
.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 auto;
  max-width: 100%;
}
.opt {
  min-height: 62px;
  padding: 14px 16px;
  border: 2px solid var(--lav-deep);
  border-radius: 14px;
  background: var(--paper);
  font-size: clamp(1.18rem, 2.4vw, 1.4rem); font-weight: 800;
  color: var(--ink);
  transition: border-color 0.12s, background 0.12s, transform 0.1s;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.opt:nth-child(4n+1) { border-color: var(--honey-d); }
.opt:nth-child(4n+2) { border-color: var(--sage-d); }
.opt:nth-child(4n+3) { border-color: var(--rose-d); }
.opt:nth-child(4n+4) { border-color: var(--lav-deep); }
.opt:hover:not(:disabled) { background: var(--cream); transform: translateY(-1px); }
.opt.correct {
  background: var(--ok-bg); border-color: var(--sage-d); color: var(--sage-ink);
}
.opt.wrong {
  background: var(--bad-bg); border-color: #E8C0C0; color: var(--bad);
}
.opt:disabled { cursor: default; }
.opt.selected {
  border-color: var(--lav-deep); background: var(--lav-mist);
}

.progress-mini {
  font-size: 0.92rem; font-weight: 700; color: var(--ink-soft);
  text-align: center; margin-top: 12px;
}

.q-nav {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px;
  border-top: 1.5px solid var(--line);
}
.q-nav .btn {
  min-height: 46px; padding: 10px 16px; font-size: 1.02rem;
  flex: 1 1 160px; max-width: 280px;
  background: var(--lav-mist); border-color: var(--lav-deep);
}

/* ---------- Sort — roles on top, words bank BELOW ---------- */
.sort-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: var(--play-max);
  margin: 0 auto;
}
.sort-groups-wrap,
.sort-bank-wrap {
  width: 100%;
}
.bank {
  display: flex; flex-wrap: wrap; gap: 12px;
  background: var(--panel);
  border: 2px dashed var(--lav-deep);
  border-radius: var(--radius);
  padding: 16px 18px;
  min-height: 96px;
  align-content: center;
  justify-content: center;
}
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 20px; min-height: 52px;
  border-radius: 14px;
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--lav-deep);
  font-weight: 800; font-size: 1.18rem;
  cursor: grab; user-select: none;
  touch-action: none;
  box-shadow: var(--shadow-sm);
}
.chip:nth-child(7n+1) { background: #FFF6E8; border-color: var(--honey-d); }
.chip:nth-child(7n+2) { background: #F3EAF8; border-color: var(--lav-deep); }
.chip:nth-child(7n+3) { background: #EEF6EC; border-color: var(--sage-d); }
.chip:nth-child(7n+4) { background: #FCEEEF; border-color: var(--rose-d); }
.chip:nth-child(7n+5) { background: #FFF0E8; border-color: var(--peach-d); }
.chip:nth-child(7n+6) { background: #F5F0FA; border-color: var(--lav-deep); }
.chip:nth-child(7n+7) { background: #F0F5EC; border-color: var(--sage-d); }
.chip:active { cursor: grabbing; }
.chip.picked {
  outline: 3px solid var(--honey-d); outline-offset: 2px;
  background: var(--honey); border-color: var(--honey-d);
}
.chip.placed { background: var(--ok-bg); color: var(--sage-ink); border-color: var(--sage-d); cursor: default; }
.chip.dragging { opacity: 0.5; }
.groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}
.group {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  min-height: 128px;
  transition: border-color 0.15s, background 0.15s;
  box-shadow: var(--shadow-sm);
}
.group:nth-child(7n+1) { border-color: var(--honey-d); background: #FFFBF3; }
.group:nth-child(7n+2) { border-color: var(--lav-deep); background: #FBF7FD; }
.group:nth-child(7n+3) { border-color: var(--sage-d); background: #F5FAF3; }
.group:nth-child(7n+4) { border-color: var(--rose-d); background: #FDF6F7; }
.group:nth-child(7n+5) { border-color: var(--peach-d); background: #FDF7F3; }
.group:nth-child(7n+6) { border-color: var(--lav-deep); background: #F8F4FB; }
.group:nth-child(7n+7) { border-color: var(--sage-d); background: #F3F8F0; }
.group.drag-over { border-color: var(--sage-d); background: var(--ok-bg); }
.group-title {
  font-size: 1.12rem; font-weight: 800; color: var(--ink);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--line);
  text-align: center;
}
.group-drop {
  display: flex; flex-wrap: wrap; gap: 8px; min-height: 52px;
  justify-content: center;
}
.group .chip { font-size: 1.02rem; padding: 10px 14px; min-height: 42px; }
.step-label {
  font-size: 1.12rem; font-weight: 800; color: var(--ink);
  margin-bottom: 12px; text-align: center;
}

/* ---------- Match ---------- */
.match-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .match-cols { grid-template-columns: 1fr; }
}
.match-col { display: flex; flex-direction: column; gap: 8px; }
.match-item {
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  font-weight: 700; font-size: 1.02rem;
  text-align: right;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  transition: border-color 0.12s, background 0.12s;
}
.match-item:hover:not(.paired):not(:disabled) { border-color: var(--lav-deep); background: var(--lav-mist); }
.match-item.active {
  border-color: var(--lav-deep); background: var(--lilac);
}
.match-item.paired {
  border-color: var(--sage-d); background: var(--ok-bg); color: var(--sage-ink);
  cursor: default;
}
.paired-list {
  display: flex; flex-direction: column; gap: 8px; margin-top: 10px;
}
.paired-chip {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  background: var(--ok-bg); border: 1.5px solid var(--sage-d);
  border-radius: 12px; padding: 10px 14px;
  font-weight: 700; color: var(--ink);
  font-size: 0.95rem;
}
.paired-chip .sep { color: var(--sage-ink); font-weight: 800; }

/* ---------- Cloze ---------- */
.cloze-scene {
  width: 100%;
  max-width: 560px;
  margin: 0 auto 16px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--cream);
}
.cloze-scene img {
  display: block; width: 100%; height: auto;
}
.cloze-text {
  background: var(--cream);
  border: 1.5px solid var(--sage-d);
  border-radius: var(--radius);
  padding: 22px 20px;
  font-size: clamp(1.22rem, 2.5vw, 1.5rem);
  font-weight: 700; line-height: 2.15;
  color: var(--ink);
  text-align: center;
  margin: 0 auto;
}
.blank {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 118px; min-height: 44px;
  margin: 6px 10px; padding: 4px 12px;
  border: 2px dashed var(--lav-deep);
  border-radius: 12px;
  background: var(--lav-mist);
  vertical-align: middle;
  cursor: pointer;
  font-weight: 800; color: var(--ink);
}
.blank.filled {
  border-style: solid; border-color: var(--sage-d);
  background: var(--ok-bg); color: var(--sage-ink);
}
.blank.active { outline: 2px solid var(--honey-d); outline-offset: 2px; }
.cloze-bank {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
  max-width: 480px;
  margin-left: auto; margin-right: auto;
}
.cloze-bank .chip {
  background: var(--paper); color: var(--ink); border-color: var(--peach-d);
  width: 100%; justify-content: center;
}
.cloze-bank .chip:nth-child(3n+1) { border-color: var(--honey-d); }
.cloze-bank .chip:nth-child(3n+2) { border-color: var(--sage-d); }
.cloze-bank .chip:nth-child(3n+3) { border-color: var(--rose-d); }
.cloze-bank .chip.used { opacity: 0.35; pointer-events: none; }

/* ---------- Find in text ---------- */
.text-frame {
  background: var(--panel);
  border: 1.5px solid var(--sage-d);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  max-width: var(--play-max);
  margin: 0 auto;
}
.text-clickable {
  font-size: clamp(1.32rem, 2.7vw, 1.65rem);
  font-weight: 700; line-height: 2;
  color: var(--ink);
  text-align: center;
}
.conn-word {
  display: inline;
  padding: 2px 4px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  font-weight: 700;
  color: inherit;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  transition: border-color 0.12s, background 0.12s;
}
.conn-word:hover { background: var(--honey); border-color: var(--honey-d); }
.conn-word.found {
  background: var(--ok-bg); color: var(--sage-ink); border-color: var(--sage-d);
  cursor: default; font-weight: 800;
}
.conn-word.pending {
  border-color: var(--honey-d); background: var(--honey); color: var(--ink);
}

/* ---------- Idea pair ---------- */
.idea-pair {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center;
  margin-bottom: 16px;
}
@media (max-width: 560px) {
  .idea-pair { grid-template-columns: 1fr; }
  .idea-arrow { transform: rotate(90deg); justify-self: center; }
}
.idea-box {
  background: var(--lav-mist); color: var(--ink);
  border: 1.5px solid var(--lav-deep);
  border-radius: 14px; padding: 16px;
  font-weight: 800; font-size: 1.12rem; text-align: center;
}
.idea-arrow { font-size: 1.4rem; color: var(--ink-soft); font-weight: 800; }

/* ---------- Compare ---------- */
.compare-opts {
  display: grid; grid-template-columns: 1fr; gap: 12px;
}
@media (min-width: 640px) {
  .compare-opts { grid-template-columns: 1fr 1fr; }
}
.compare-card {
  padding: 18px 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  font-weight: 700; font-size: 1.1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  line-height: 1.5;
  color: var(--ink);
}
.compare-card:nth-child(1) { border-color: var(--honey-d); }
.compare-card:nth-child(2) { border-color: var(--sage-d); }
.compare-card:hover:not(:disabled) { background: var(--cream); }
.compare-card.correct { background: var(--ok-bg); border-color: var(--sage-d); color: var(--sage-ink); }
.compare-card.wrong { background: var(--bad-bg); border-color: #E8C0C0; color: var(--bad); }

/* ---------- END / certificate ---------- */
.end-card {
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 24px;
  padding: 28px 22px;
  box-shadow: var(--shadow);
  text-align: center;
  max-width: min(720px, 96vw);
  margin: 12px auto;
  width: 100%;
}
.end-head {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 8px;
}
.end-star { width: 44px; height: 44px; }
.end-title {
  font-size: clamp(1.5rem, 3.8vw, 2rem);
  font-weight: 800; color: var(--ink);
}
.end-sub {
  font-size: 1.1rem; color: var(--ink-soft); font-weight: 600;
  margin-bottom: 18px;
}
.end-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.stat {
  background: var(--cream);
  border-radius: 14px;
  padding: 14px 8px;
  border: 1.5px solid var(--line);
}
.stat-val { font-size: 1.45rem; font-weight: 800; color: var(--ink); }
.stat-label { font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); }
.strong-cats {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  margin-bottom: 18px;
}
.cat-pill {
  background: var(--sage); color: var(--ink);
  border: 1.5px solid var(--sage-d);
  border-radius: 999px; padding: 6px 12px;
  font-weight: 700; font-size: 0.88rem;
}
.certificate {
  background: linear-gradient(160deg, var(--lav-mist) 0%, var(--peach) 50%, var(--honey) 100%);
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 22px 18px;
  margin-bottom: 18px;
}
.cert-giraffe {
  width: 68px; height: auto; margin: 0 auto 8px; display: block;
}
.cert-kicker {
  font-size: 0.82rem; font-weight: 800; color: var(--ink-soft);
  letter-spacing: 0.05em; margin-bottom: 4px;
}
.cert-title { font-size: 1.4rem; font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.cert-line { font-size: 0.98rem; color: var(--ink-soft); font-weight: 600; }
.cert-name {
  font-size: 1.5rem; font-weight: 800; color: var(--ink);
  margin: 6px 0 10px;
}
.cert-meta { font-size: 0.95rem; color: var(--ink-soft); font-weight: 600; margin-bottom: 8px; }
.cert-foot { font-size: 0.82rem; color: var(--ink-soft); font-weight: 600; }
.end-actions {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}

/* ---------- FX ---------- */
.fx-layer {
  position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden;
}
.fx-ring {
  position: absolute;
  width: 20px; height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--sage-d);
  border-radius: 50%;
  animation: ringOut 0.7s ease-out forwards;
}
@keyframes ringOut {
  to { width: 80px; height: 80px; margin: -40px 0 0 -40px; opacity: 0; border-width: 1px; }
}
.fx-spark {
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--honey-d);
  animation: sparkFly 0.55s ease-out forwards;
}
@keyframes sparkFly {
  to { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}
.confetti {
  position: absolute; top: -12px;
  width: 9px; height: 12px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}
.confetti.round { border-radius: 50%; width: 9px; height: 9px; }
@keyframes confettiFall {
  to {
    transform: translateY(105vh) translateX(var(--drift)) rotate(var(--spin));
    opacity: 0.85;
  }
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .screen { padding-left: 12px; padding-right: 12px; }
  .btn-home-label { display: none; }
  .hero-logo { width: 84px; }
  .home-form { flex-direction: column; align-items: stretch; }
  .options { grid-template-columns: 1fr 1fr; gap: 10px; }
  .opt { min-height: 52px; font-size: 1.08rem; padding: 12px 10px; }
  .q-card { padding: 18px 14px 14px; }
  .q-prompt { padding: 7px 14px; font-size: 1.05rem; }
}
@media (max-width: 380px) {
  .options { grid-template-columns: 1fr; }
}

/* ---------- desktop: larger centered exercises ---------- */
@media (min-width: 900px) {
  .q-card {
    max-width: 880px;
    padding: 34px 40px 26px;
  }
  .q-sentence {
    font-size: 1.95rem;
    line-height: 1.75;
  }
  .q-prompt {
    font-size: 1.4rem;
    padding: 10px 24px;
  }
  .opt {
    min-height: 72px;
    font-size: 1.45rem;
    padding: 18px 20px;
  }
  .options { gap: 16px; max-width: 820px; }
  .coach-bubble { font-size: 1.18rem; }
  .groups { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
  .group { min-height: 140px; padding: 16px; }
  .group-title { font-size: 1.2rem; }
  .chip { font-size: 1.28rem; min-height: 56px; padding: 14px 22px; }
  .bank { min-height: 110px; padding: 20px; gap: 14px; }
}
