@font-face {
  font-family: 'Andika';
  src: url('../fonts/andika-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Andika';
  src: url('../fonts/andika-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #FFF6E9;
  --bg-2: #FFEBD0;
  --ink: #2A2340;
  --muted: #6F6787;
  --card: #FFFFFF;
  --line: #EEDFC6;
  --coral: #FF6F59;
  --coral-d: #D9503B;
  --sun: #FFD23F;
  --sun-l: #FFEDA3;
  --teal: #18A999;
  --teal-d: #0B7A6E;
  --sky: #4EA8DE;
  --sky-d: #2B7DB3;
  --grape: #8C6BF0;
  --grape-d: #6A48CF;
  --rose: #F25F8C;
  --rose-d: #C93D69;
  --good: #3DBB6A;
  --shadow-c: rgba(42, 35, 64, .14);
  --r: 28px;
  --font: 'Andika', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 20px;
  line-height: 1.4;
  /* Keep "ff", "fl" etc. as separate letters, the way children are taught them. */
  font-variant-ligatures: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}
input, select { user-select: text; -webkit-user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus-visible { outline: 4px solid var(--sky); outline-offset: 3px; }

#app { min-height: 100dvh; }
.screen {
  min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- header ---------- */
.top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 64px; }
.top-title { margin: 0; text-align: center; font-size: 30px; }
.top > :last-child { justify-self: end; }
.icon {
  width: 64px; height: 64px; border-radius: 50%; border: 0;
  background: var(--card); font-size: 30px; display: grid; place-items: center;
  box-shadow: 0 4px 0 var(--shadow-c);
}
.icon:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow-c); }
.pill {
  border: 0; background: var(--card); border-radius: 999px; padding: 10px 20px;
  font-size: 22px; font-weight: 700; box-shadow: 0 4px 0 var(--shadow-c); white-space: nowrap;
}
.pill.sel { background: var(--sun-l); }
.pill.stars { color: #8A5A00; background: var(--sun-l); }

/* ---------- buttons ---------- */
.btn {
  border: 0; border-radius: 999px; padding: 16px 32px; font-size: 26px; font-weight: 700;
  background: var(--card); box-shadow: 0 5px 0 var(--shadow-c);
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--shadow-c); }
.btn.primary { background: var(--coral); color: #fff; box-shadow: 0 5px 0 var(--coral-d); }
.btn.primary:active { box-shadow: 0 1px 0 var(--coral-d); }
.btn.small { font-size: 18px; padding: 10px 20px; }
.btn.danger { color: var(--coral-d); }
a.btn { display: inline-block; color: var(--ink); text-decoration: none; }
.text-in.backup { font-size: 15px; max-width: 100%; resize: vertical; word-break: break-all; }
.link { border: 0; background: none; color: var(--muted); font-size: 18px; text-decoration: underline; padding: 12px; }
.actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

.muted { color: var(--muted); }
.small { font-size: 15px; }
.center { text-align: center; }
.lead { font-size: 26px; margin: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- welcome / home ---------- */
.welcome { align-items: center; justify-content: center; text-align: center; }
.welcome h1 { font-size: 56px; margin: 0; }
.logo { font-size: 110px; }
.welcome .muted { max-width: 30em; }

.hello { text-align: center; font-size: clamp(40px, 7vw, 64px); margin: 8px 0 0; }
.tiles {
  flex: 1; display: grid; gap: 22px; grid-template-columns: repeat(2, 1fr);
  align-content: center; max-width: 880px; width: 100%; margin: 0 auto;
}
.tile {
  border: 0; border-radius: 36px; padding: 26px 16px; min-height: 190px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  font-size: 30px; font-weight: 700;
}
.tile:active { transform: translateY(5px); }
.tile-emoji { font-size: 84px; line-height: 1; }
.t-stories { background: #FFE1DA; box-shadow: 0 8px 0 var(--coral); }
.t-match { background: #DCEEFB; box-shadow: 0 8px 0 var(--sky); }
.t-hearts { background: #FDE0EA; box-shadow: 0 8px 0 var(--rose); }
.t-stickers { background: #E9E2FD; box-shadow: 0 8px 0 var(--grape); }
.tile:active.t-stories { box-shadow: 0 3px 0 var(--coral); }
.tile:active.t-match { box-shadow: 0 3px 0 var(--sky); }
.tile:active.t-hearts { box-shadow: 0 3px 0 var(--rose); }
.tile:active.t-stickers { box-shadow: 0 3px 0 var(--grape); }
.grown-link { align-self: center; }

.who { align-items: center; justify-content: center; }
.who-grid { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; }
.who-card {
  border: 0; background: var(--card); border-radius: 32px; width: 220px; padding: 28px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: 0 6px 0 var(--shadow-c);
}
.who-av { font-size: 96px; line-height: 1; }
.who-name { font-size: 32px; font-weight: 700; }

/* ---------- library ---------- */
.level-bar { display: flex; align-items: center; gap: 14px; justify-content: center; flex-wrap: wrap; }
.level-tabs { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.tab {
  width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--card);
  font-size: 26px; font-weight: 700; box-shadow: 0 4px 0 var(--shadow-c);
}
.tab.sel { background: var(--coral); color: #fff; box-shadow: 0 4px 0 var(--coral-d); }
.tab.locked { display: grid; place-items: center; opacity: .5; box-shadow: none; background: transparent; }
.story-grid {
  display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(230px, 260px)); justify-content: center;
  max-width: 1100px; width: 100%; margin: 0 auto;
}
.story-card {
  border: 0; background: var(--card); border-radius: var(--r); padding: 14px 14px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: 0 6px 0 var(--shadow-c);
}
.story-card:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--shadow-c); }
.cover { width: 100%; aspect-ratio: 4 / 3; border-radius: 20px; display: grid; place-items: center; font-size: 86px; }
.story-title { font-size: 26px; font-weight: 700; text-align: center; line-height: 1.2; }
.star-row { font-size: 30px; letter-spacing: 2px; }
.star-row .on { color: var(--sun); text-shadow: 0 2px 0 #E0A800; }
.star-row .off { color: #E6DCCB; }

/* ---------- reader ---------- */
.reader { height: 100dvh; min-height: 0; overflow: hidden; }
.dots { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.dots span { width: 14px; height: 14px; border-radius: 50%; background: #E6DCCB; transition: all .2s; }
.dots span.done { background: var(--teal); }
.dots span.now { background: var(--coral); transform: scale(1.35); }
.page { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.pic {
  flex: 0 1 40%; min-height: 120px; border-radius: 36px; display: grid; place-items: center; overflow: hidden;
}
.pic .emoji { font-size: clamp(48px, min(17vh, 22vw), 190px); line-height: 1; letter-spacing: .05em; white-space: nowrap; }
.text { flex: 1; display: grid; place-items: center; padding: 0 3vw; min-height: 0; }
.sentence {
  margin: 0; text-align: center; line-height: 1.85; word-spacing: .18em;
  font-size: clamp(40px, min(8vw, 8.5vh), 84px);
}
.text[data-len="mid"] .sentence { font-size: clamp(34px, min(6.4vw, 6.6vh), 66px); }
.text[data-len="long"] .sentence { font-size: clamp(28px, min(5vw, 5.4vh), 54px); line-height: 1.8; }
.tok { white-space: nowrap; }
.punct { color: var(--ink); }
.page-nav { display: flex; justify-content: space-between; align-items: center; }
.nav {
  width: 92px; height: 92px; border-radius: 50%; border: 0; font-size: 40px; display: grid; place-items: center;
  background: var(--coral); color: #fff; box-shadow: 0 6px 0 var(--coral-d);
}
.nav:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--coral-d); }
.nav:disabled { opacity: .25; }
.nav.prev { background: var(--card); color: var(--ink); box-shadow: 0 6px 0 var(--shadow-c); }

/* ---------- words & sound buttons ---------- */
.w { position: relative; display: inline-block; line-height: 1.15; border-radius: .16em; padding: 0 .03em; transition: transform .15s, color .15s; cursor: pointer; }
.w.said { color: var(--teal-d); transform: translateY(-.04em) scale(1.06); }
.w.reading { background: var(--sun-l); box-shadow: 0 0 0 .06em var(--sun-l); }
.u { position: relative; display: inline-block; line-height: 1.05; border-radius: .1em; transition: background .12s; }
.u::after {
  content: ''; position: absolute; opacity: 0; transition: opacity .15s;
  background: var(--coral); pointer-events: none;
}
.u.dot::after { width: .17em; height: .17em; border-radius: 50%; left: 50%; bottom: -.22em; transform: translateX(-50%); }
.u.bar::after { left: .07em; right: .07em; height: .11em; border-radius: .06em; bottom: -.19em; }
.u.sv::after, .u.se::after { display: none; }
.split { position: relative; display: inline-block; }
.split::before {
  content: ''; position: absolute; left: .14em; right: .14em; bottom: -.38em; height: .34em;
  border: .08em solid var(--coral); border-top: 0; border-radius: 0 0 .5em .5em; opacity: 0; transition: opacity .15s;
  pointer-events: none;
}
.w.active .u::after, .sb-always .w .u::after, .w.active .split::before, .sb-always .w .split::before { opacity: 1; }
.u.lit { background: var(--sun); box-shadow: 0 0 0 .04em var(--sun); }
.u.lit::after { background: var(--ink); }
.w.tricky::before {
  content: '❤'; position: absolute; top: -.5em; left: 50%; transform: translateX(-50%);
  font-size: .4em; color: var(--rose); opacity: 0; transition: opacity .15s; line-height: 1;
}
.w.tricky.active::before, .sb-always .w.tricky::before { opacity: 1; }

/* ---------- end screens ---------- */
.the-end { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.the-end h1 { font-size: clamp(40px, 7vw, 64px); margin: 0; }
.big-emoji { font-size: 130px; line-height: 1; }
.big-stars .star-row { font-size: 96px; }
.new-sticker { font-weight: 700; }
.sticker-pop { display: inline-block; font-size: 64px; animation: pop .6s ease-out .4s both; vertical-align: middle; }

/* ---------- quiz ---------- */
.quiz-body, .match-body, .heart-body { flex: 1; display: flex; flex-direction: column; gap: 26px; justify-content: center; max-width: 1000px; width: 100%; margin: 0 auto; }
.question { display: flex; align-items: center; gap: 18px; background: var(--card); border-radius: var(--r); padding: 18px 24px; box-shadow: 0 6px 0 var(--shadow-c); }
.question p { margin: 0; font-size: clamp(28px, 4.4vw, 44px); font-weight: 700; }
.answers { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
.answers.two { grid-template-columns: repeat(2, 1fr); max-width: 680px; width: 100%; margin: 0 auto; }
.answer {
  border: 0; border-radius: var(--r); background: var(--card); padding: 22px 14px; min-height: 200px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 6px 0 var(--shadow-c); transition: transform .12s, background .2s, opacity .2s;
}
.answer:active { transform: translateY(4px); }
.a-emoji { font-size: 76px; line-height: 1; }
.a-text { font-size: 26px; font-weight: 700; text-align: center; line-height: 1.2; }
.answer.reading { box-shadow: 0 0 0 6px var(--sun), 0 6px 0 var(--shadow-c); }
.answer.right, .pic-choice.right, .heart-choice.right { background: #D5F5DF; box-shadow: 0 0 0 6px var(--good), 0 6px 0 var(--shadow-c); animation: pop .4s ease-out; }
.answer.wrong, .pic-choice.wrong, .heart-choice.wrong { opacity: .35; animation: shake .4s; }

/* ---------- match ---------- */
.prompt { text-align: center; margin: 0; font-size: 26px; color: var(--muted); }
.word-stage { display: grid; place-items: center; background: var(--card); border-radius: 36px; padding: 18px 20px 34px; box-shadow: 0 6px 0 var(--shadow-c); }
.big-word { font-size: clamp(76px, 14vw, 160px); line-height: 1.3; font-weight: 400; }
.pic-choices { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.pic-choice {
  width: min(28vw, 220px); aspect-ratio: 1; border: 0; border-radius: 36px; background: var(--card);
  font-size: min(15vw, 120px); line-height: 1; box-shadow: 0 6px 0 var(--shadow-c);
}
.pic-choice:active { transform: translateY(4px); }

/* ---------- heart words ---------- */
.heart-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-width: 1000px; width: 100%; margin: 0 auto; }
.heart-card {
  border: 0; background: var(--card); border-radius: 24px; padding: 14px 10px; box-shadow: 0 5px 0 var(--shadow-c);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.hc-icon { font-size: 24px; }
.hc-word { font-size: 38px; }
.heart-choices { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.heart-choice {
  position: relative; border: 0; background: var(--card); border-radius: 32px; min-width: 220px; padding: 34px 30px;
  font-size: clamp(48px, 7vw, 72px); box-shadow: 0 6px 0 var(--shadow-c);
}
.heart-burst { position: absolute; top: -18px; right: -12px; font-size: 52px; animation: pop .5s ease-out; }

/* ---------- stickers ---------- */
.sticker-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); max-width: 1000px; width: 100%; margin: 0 auto; }
.sticker {
  aspect-ratio: 1; border: 0; border-radius: 28px; background: var(--card); font-size: 64px;
  display: grid; place-items: center; box-shadow: 0 5px 0 var(--shadow-c);
}
.sticker.locked { background: #F3E9D8; color: #C9B99E; font-size: 44px; font-weight: 700; box-shadow: none; }

/* ---------- grown-up screens ---------- */
.grown { font-size: 18px; max-width: 900px; margin: 0 auto; width: 100%; }
.grown .top-title { font-size: 26px; }
.card { background: var(--card); border-radius: 24px; padding: 20px 22px; box-shadow: 0 4px 0 var(--shadow-c); }
.card h2 { margin: 0 0 10px; font-size: 24px; }
.card h3 { margin: 18px 0 8px; font-size: 19px; }
.card p { margin: 8px 0; }
.text-in, .select {
  font: inherit; font-size: 22px; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--line);
  background: #FFFDF9; color: var(--ink); width: 100%; max-width: 420px;
}
.select { font-size: 17px; width: auto; max-width: 100%; }
.text-in:focus, .select:focus { outline: none; border-color: var(--sky); }
.avatar-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.avatar { width: 68px; height: 68px; border-radius: 50%; border: 3px solid transparent; background: var(--bg); font-size: 38px; }
.avatar.sel { border-color: var(--coral); background: #FFE1DA; }
.avatar-grid.small .avatar { width: 54px; height: 54px; font-size: 30px; }
.level-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.level-row {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; text-align: left;
  border: 2px solid var(--line); border-radius: 16px; background: #FFFDF9; padding: 10px 14px;
}
.level-row.sel { border-color: var(--coral); background: #FFF0EC; }
.lv-n { width: 44px; height: 44px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; font-weight: 700; font-size: 22px; }
.level-row.sel .lv-n { background: var(--coral); color: #fff; }
.lv-body { display: flex; flex-direction: column; }
.lv-sounds { font-size: 16px; color: var(--muted); }
.lv-sample { font-size: 16px; }
.lv-count { font-size: 14px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 8px 0; }
.stat { background: var(--bg); border-radius: 16px; padding: 12px; text-align: center; display: flex; flex-direction: column; }
.stat b { font-size: 30px; }
.stat span { font-size: 15px; color: var(--muted); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl td:first-child { white-space: nowrap; font-weight: 700; }
.tbl td:nth-child(2) { white-space: nowrap; color: var(--muted); }
.chip { display: inline-block; background: var(--bg); border-radius: 999px; padding: 3px 10px; margin: 2px; font-size: 15px; }
.log { list-style: none; padding: 0; margin: 0; }
.log li { padding: 6px 0; border-top: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.field > span:first-child { font-weight: 700; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--bg); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 10px; padding: 10px 16px; font-size: 17px; }
.seg button.sel { background: var(--card); box-shadow: 0 2px 0 var(--shadow-c); font-weight: 700; }
.notice { border-radius: 16px; padding: 14px 16px; margin: 10px 0; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.notice.good { background: #DDF5E5; }
.reader-list { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.reader-list .pill { font-size: 18px; }
.gate-card { max-width: 420px; margin: 0 auto; width: 100%; text-align: center; }
.gate-card p { font-size: 28px; font-weight: 700; }
.gate-display { font-size: 44px; font-weight: 700; background: var(--bg); border-radius: 16px; padding: 8px; margin: 10px 0 16px; letter-spacing: .1em; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key { border: 0; border-radius: 16px; background: var(--bg); font-size: 28px; padding: 14px 0; font-weight: 700; }
.key:active { background: var(--bg-2); }
.key.ok { background: var(--teal); color: #fff; }

/* ---------- motion ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti span { position: absolute; top: -10vh; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(120vh) rotate(540deg); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg) scale(1.1); } 75% { transform: rotate(12deg) scale(1.1); } }
.pop { animation: pop .45s ease-out; }
.shake { animation: shake .4s; }
.wiggle { animation: wiggle .5s; }

@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
  .pop, .shake, .wiggle, .answer.right, .sticker-pop { animation: none; }
}

/* ---------- smaller screens ---------- */
@media (max-width: 700px) {
  body { font-size: 18px; }
  .tiles { gap: 16px; }
  .tile { min-height: 150px; font-size: 22px; }
  .tile-emoji { font-size: 60px; }
  .answers { grid-template-columns: 1fr; }
  .answer { min-height: 0; flex-direction: row; justify-content: flex-start; padding: 14px 18px; }
  .a-emoji { font-size: 48px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .nav { width: 76px; height: 76px; }
  .icon { width: 54px; height: 54px; font-size: 26px; }
  /* Keep up to 12 page dots on one row between the header buttons. */
  .dots { gap: 6px; }
  .dots span { width: 10px; height: 10px; }
  .story-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .cover { font-size: 60px; }
  .story-title { font-size: 20px; }
}
@media (orientation: landscape) and (max-height: 820px) {
  .pic { flex-basis: 36%; }
}

/* ---------- home: five tiles ---------- */
.tiles { grid-template-columns: repeat(6, 1fr); max-width: 980px; }
.tiles > .tile { grid-column: span 2; }
.tiles > .tile:nth-child(4), .tiles > .tile:nth-child(5) { grid-column: span 3; }
.tiles.two { grid-template-columns: repeat(2, 1fr); max-width: 760px; }
.tiles.two > .tile { grid-column: auto; min-height: 260px; }
.t-cross { background: #D9F2EC; box-shadow: 0 8px 0 var(--teal); }
.tile:active.t-cross { box-shadow: 0 3px 0 var(--teal); }
.t-mine { background: #FFF1C9; box-shadow: 0 8px 0 #E0A800; }
.tile:active.t-mine { box-shadow: 0 3px 0 #E0A800; }

/* ---------- crosswords ---------- */
.xw { height: 100dvh; min-height: 0; overflow: hidden; gap: 10px; }
.xw-wrap { flex: 1; min-height: 0; display: grid; place-items: center; }
.xw-board { display: grid; --cell: 64px; }
.xw-cell {
  position: relative; border: 0; margin: 2px; padding: 0; border-radius: calc(var(--cell) * .16);
  background: var(--card); box-shadow: 0 3px 0 var(--shadow-c), inset 0 0 0 2px var(--line);
  display: grid; place-items: center; color: var(--ink);
  font-size: calc(var(--cell) * .56); line-height: 1;
  transition: background .15s, box-shadow .15s, transform .15s;
}
.xw-cell.multi { font-size: calc(var(--cell) * .42); }
.xw-cell .xw-g, .xw-cell .xw-ghost { grid-area: 1 / 1; transform: translateY(-7%); }
.xw-ghost { color: var(--muted); opacity: 0; }
.xw-cell.ghosted:not(.filled) .xw-ghost { opacity: .35; }
/* Sound marker in each box: a dot for one letter, a bar for two or three. */
.xw-cell::after {
  content: ''; position: absolute; bottom: 8%; left: 50%; transform: translateX(-50%);
  width: calc(var(--cell) * .09); height: calc(var(--cell) * .09); border-radius: 50%;
  background: var(--coral); opacity: .8;
}
.xw-cell.t-bar::after { width: 54%; height: calc(var(--cell) * .065); border-radius: 99px; }
.xw-cell.t-sv::after, .xw-cell.t-se::after, .xw-cell.t-letter::after { display: none; }
.xw-cell.in-word { background: #FFF6CF; box-shadow: 0 3px 0 var(--shadow-c), inset 0 0 0 3px var(--sun); }
.xw-cell.target { box-shadow: 0 3px 0 var(--shadow-c), inset 0 0 0 4px var(--coral); animation: target-pulse 1.4s ease-in-out infinite; }
.xw-cell.drop { background: #FFE1DA; transform: scale(1.06); }
.xw-cell.bad { color: var(--rose-d); background: #FDE0EA; animation: shake .4s; }
.xw-cell.lit { background: var(--sun); transform: scale(1.08); }
.xw-cell.done { background: #D9F2EC; box-shadow: 0 3px 0 var(--shadow-c), inset 0 0 0 2px #9AD9CB; }
@keyframes target-pulse { 50% { box-shadow: 0 3px 0 var(--shadow-c), inset 0 0 0 4px rgba(255, 111, 89, .3); } }
/* Arc joining split vowels (a_e). */
.xw-arc { pointer-events: none; z-index: 1; border: calc(var(--cell) * .05) solid var(--coral); }
.xw-arc.across {
  align-self: end; height: calc(var(--cell) * .2); margin: 0 calc(var(--cell) * .22);
  border-top: 0; border-radius: 0 0 99px 99px; transform: translateY(calc(var(--cell) * .06));
}
.xw-arc.down {
  justify-self: end; width: calc(var(--cell) * .2); margin: calc(var(--cell) * .22) 0;
  border-left: 0; border-radius: 0 99px 99px 0; transform: translateX(calc(var(--cell) * .06));
}
.xw-clue {
  position: relative; border: 0; margin: 2px; padding: 0; background: transparent;
  border-radius: calc(var(--cell) * .2); display: grid; place-items: center;
  font-size: calc(var(--cell) * .62); line-height: 1; transition: transform .15s, background .15s;
}
.xw-clue.sound { font-size: calc(var(--cell) * .46); }
.xw-clue.sel { background: #FFF6CF; box-shadow: inset 0 0 0 3px var(--sun); }
.xw-clue.done { opacity: .5; }
.xw-clue::after { content: ''; position: absolute; border: calc(var(--cell) * .085) solid transparent; }
.xw-clue.across::after { right: -2px; top: 50%; transform: translateY(-50%); border-left-color: var(--muted); border-right-width: 0; }
.xw-clue.down::after { bottom: -2px; left: 50%; transform: translateX(-50%); border-top-color: var(--muted); border-bottom-width: 0; }
.xw-foot { flex: 0 0 auto; }
.xw-tray {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 12px;
  background: #F6EBD9; border-radius: 28px; max-width: 1100px; margin: 0 auto;
}
.xw-tile, .xw-drag {
  min-width: 68px; height: 68px; padding: 0 12px; border: 0; border-radius: 18px;
  background: var(--card); color: var(--ink); font-size: 40px; line-height: 1;
  box-shadow: 0 5px 0 var(--shadow-c); touch-action: none;
}
.xw-tile.v, .xw-drag.v { background: #D9F2EC; color: var(--teal-d); }
.xw-tile:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--shadow-c); }
.xw-tray.many .xw-tile { min-width: 54px; height: 54px; font-size: 30px; padding: 0 8px; }
.xw-drag {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  display: grid; place-items: center; font-family: var(--font); box-shadow: 0 14px 28px rgba(42, 35, 64, .28);
}
.xw-end { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 6px 0; }

/* grown-ups: word list */
.words-in { max-width: 100%; font-size: 19px; line-height: 1.5; }
.word-preview { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0 4px; }
.chip.wp.later { background: #FFF1C9; }
.chip.wp.tricky { background: #FDE0EA; }
.chip.wp.irregular { background: #F3E9D8; }

@media (max-width: 700px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tiles > .tile, .tiles > .tile:nth-child(4) { grid-column: auto; }
  .tiles > .tile:nth-child(5) { grid-column: span 2; }
  .xw-tile { min-width: 50px; height: 50px; font-size: 28px; padding: 0 8px; }
  .xw-tray { gap: 7px; padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .xw-cell.target { animation: none; }
}
