
@font-face{font-family:"HegaHebrew";src:url("fonts/noto-hebrew.woff2") format("woff2");font-weight:100 900;font-display:swap;unicode-range:U+0307-0308,U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F;}
:root{
  --bg:#f6f1e7; --card:#fffdf8; --ink:#2f3b45; --muted:#6b7780;
  --teal:#3f8f86; --teal-soft:#d9eeea; --blue:#5b8db8; --blue-soft:#dfeaf5;
  --sun:#f2c14e; --sun-soft:#fcefc9; --coral:#e8956f; --coral-soft:#fbe3d8;
  --lav:#9c8cc9; --lav-soft:#ebe6f7; --ok:#4caf7d; --ok-soft:#dcf3e6;
  --radius:28px; --shadow:0 6px 0 rgba(47,59,69,.10), 0 10px 24px rgba(47,59,69,.08);
  --tile:clamp(92px, 24vmin, 190px);
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--ink);
  font-family:"HegaHebrew","Noto Sans Hebrew","Arial Hebrew","Arial",system-ui,sans-serif;font-weight:500;
  -webkit-tap-highlight-color:transparent;overscroll-behavior:none}
body{min-height:100dvh}
button{font:inherit;color:inherit;border:0;background:none;cursor:pointer;touch-action:manipulation}
button:focus-visible{outline:5px solid var(--blue);outline-offset:4px}
[hidden]{display:none!important}
.app{min-height:100dvh;display:flex;flex-direction:column;max-width:1400px;margin:0 auto;padding:max(10px,env(safe-area-inset-top)) 14px max(14px,env(safe-area-inset-bottom))}
.topbar{display:flex;align-items:center;gap:10px;min-height:72px}
.icon-btn{width:68px;height:68px;border-radius:22px;background:var(--card);box-shadow:var(--shadow);font-size:34px;display:grid;place-items:center;flex:none}
.icon-btn:active{transform:translateY(3px);box-shadow:0 2px 0 rgba(47,59,69,.12)}
.icon-btn.speak{background:var(--sun-soft);margin-inline-start:auto}
.dots{display:flex;gap:8px;flex:1;justify-content:center;flex-wrap:wrap}
.dots i{width:16px;height:16px;border-radius:50%;background:#e2ddd2;display:block}
.dots i.done{background:var(--ok)}
.dots i.now{background:var(--sun);transform:scale(1.25)}
.stage{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(12px,3vmin,28px);padding:8px 0 4px;outline:none;width:100%}
h1,h2,p{margin:0}
.he{direction:rtl;unicode-bidi:isolate;line-height:1.5}

/* start */
.start-overlay{position:fixed;inset:0;background:var(--bg);display:grid;place-items:center;z-index:50;padding:20px}
.start-card{text-align:center;display:flex;flex-direction:column;gap:22px;align-items:center}
.logo{font-size:clamp(44px,9vmin,96px);font-weight:700;color:var(--teal);line-height:1.4}
.sub{font-size:clamp(22px,4vmin,38px);color:var(--muted)}
.big-btn{min-height:96px;min-width:240px;padding:12px 36px;border-radius:40px;font-size:clamp(30px,5vmin,46px);font-weight:700;box-shadow:var(--shadow);background:var(--card)}
.big-btn.go{background:var(--teal);color:#fff}
.big-btn:active{transform:translateY(3px)}
.credit{font-size:15px;color:var(--muted)}

/* home */
.home-title{font-size:clamp(30px,5.5vmin,54px);font-weight:700;color:var(--teal);text-align:center}
.word-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:16px;width:100%}
.word-card{position:relative;background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:12px 10px 10px;display:flex;flex-direction:column;align-items:center;gap:4px;min-height:200px}
.word-card .sp{width:100%;max-width:130px}
.word-card .w{font-size:clamp(34px,5vmin,48px);font-weight:700;line-height:1.5}
.word-card .num{position:absolute;z-index:3;top:8px;inset-inline-start:12px;background:var(--teal-soft);color:var(--teal);border-radius:50%;width:36px;height:36px;display:grid;place-items:center;font-size:19px;font-weight:700}
.word-card .stars{font-size:16px;color:var(--sun);letter-spacing:1px;min-height:20px}
.word-card.locked{opacity:.55}
.word-card.locked .sp{filter:grayscale(1) blur(1px)}
.word-card .lock{position:absolute;inset:0;display:grid;place-items:center;font-size:44px;z-index:2}
.word-card.next{outline:5px solid var(--sun);outline-offset:2px}
.home-foot{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;align-items:center;margin-top:8px}
.pill{min-height:56px;padding:8px 20px;border-radius:30px;background:var(--card);box-shadow:var(--shadow);font-size:19px}
.pill.on{background:var(--teal-soft);color:var(--teal);font-weight:700}
.foot-credit{width:100%;text-align:center;color:var(--muted);font-size:15px;line-height:1.6}
.foot-credit a{color:var(--teal)}

/* word page */
.word-hero{display:flex;align-items:center;gap:clamp(12px,3vmin,30px);background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:10px 22px}
.word-hero .sp{width:clamp(100px,22vmin,200px)}
.word-hero .w{font-size:clamp(56px,12vmin,120px);font-weight:700;line-height:1.4}
.games{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:14px;width:100%}
.game-btn{background:var(--card);border-radius:24px;box-shadow:var(--shadow);min-height:132px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:10px}
.game-btn .ic{font-size:46px;line-height:1.1}
.game-btn .lb{font-size:20px;font-weight:700;line-height:1.4}
.game-btn .st{font-size:22px;color:var(--sun);min-height:26px}
.game-btn.done{background:var(--ok-soft)}

/* shared game bits */
.prompt-glyph{font-size:clamp(46px,9vmin,90px);font-weight:700;background:var(--sun-soft);border-radius:24px;padding:0 24px;min-width:110px;text-align:center;line-height:1.5}
.sp{display:block;aspect-ratio:1/1;background-image:url("img/pictures.webp");background-size:800% 800%;background-repeat:no-repeat;border-radius:18px}
.pic{width:clamp(170px,46vmin,360px);background-color:#fff;border-radius:var(--radius);box-shadow:var(--shadow)}
.row{display:flex;gap:clamp(12px,3vmin,30px);flex-wrap:wrap;justify-content:center;align-items:center}
.tile{width:var(--tile);height:var(--tile);border-radius:26px;background:var(--card);box-shadow:var(--shadow);font-size:calc(var(--tile)*.52);font-weight:700;display:grid;place-items:center;line-height:1;transition:transform .15s, background .2s}
.tile .g{line-height:1.25;display:block}
.tile:active{transform:scale(.96)}
.tile.ok{background:var(--ok-soft);box-shadow:0 0 0 6px var(--ok) inset, var(--shadow)}
.tile.hint{animation:glow 1.1s ease-in-out infinite}
.tile.dim{opacity:.45}
.tile.wiggle,.choice.wiggle,.pic-choice.wiggle{animation:wiggle .45s}
.grid-find{display:grid;grid-template-columns:repeat(4,var(--tile));gap:clamp(8px,2vmin,18px);--tile:clamp(70px,17vmin,150px)}
.grid-find .tile{font-size:calc(var(--tile)*.55)}
.grid-find .tile.found{color:#fff}
.grid-find .tile.found.c0{background:var(--coral)} .grid-find .tile.found.c1{background:var(--teal)}
.grid-find .tile.found.c2{background:var(--blue)} .grid-find .tile.found.c3{background:var(--lav)}
.pic-choice{background:#fff;border-radius:var(--radius);box-shadow:var(--shadow);padding:6px;width:clamp(150px,40vmin,280px);aspect-ratio:1;display:grid;place-items:center;transition:transform .15s}
.pic-choice .sp{width:100%}
.pic-choice.ok{box-shadow:0 0 0 7px var(--ok) inset, var(--shadow)}
.pic-choice.hint{animation:glow 1.1s ease-in-out infinite}
.pic-choice.dim{opacity:.45}
.yn{display:flex;gap:clamp(16px,5vmin,48px)}
.choice{min-width:clamp(130px,26vmin,240px);min-height:clamp(100px,18vmin,160px);border-radius:32px;box-shadow:var(--shadow);font-size:clamp(34px,6vmin,56px);font-weight:700;display:flex;align-items:center;justify-content:center;gap:10px;padding:8px 22px}
.choice.yes{background:var(--ok-soft);color:#2e7d55}
.choice.no{background:var(--blue-soft);color:#3d6a92}
.choice.word{background:var(--card);font-size:clamp(44px,8vmin,80px);line-height:1.4}
.choice.ok{box-shadow:0 0 0 7px var(--ok) inset, var(--shadow)}
.choice.hint{animation:glow 1.1s ease-in-out infinite}
.choice.dim{opacity:.45}
.sort-card{font-size:clamp(80px,18vmin,170px);font-weight:700;background:var(--card);border-radius:32px;box-shadow:var(--shadow);width:clamp(150px,30vmin,280px);height:clamp(150px,30vmin,280px);display:grid;place-items:center;line-height:1.2}
.sort-card.fly{animation:fly .5s forwards}
.bins{display:flex;gap:clamp(12px,3vmin,30px);flex-wrap:wrap;justify-content:center}
.bin{white-space:nowrap;width:clamp(130px,26vmin,230px);height:clamp(110px,22vmin,200px);border-radius:20px 20px 46px 46px;border:5px dashed rgba(47,59,69,.25);display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:clamp(50px,10vmin,96px);font-weight:700;line-height:1.2}
.bin.b0{background:var(--coral-soft)} .bin.b1{background:var(--teal-soft)} .bin.b2{background:var(--lav-soft)}
.bin .count{font-size:18px;color:var(--muted);font-weight:500}
.bin.ok{border-color:var(--ok);border-style:solid}
.bin.hint{animation:glow 1.1s ease-in-out infinite}
.bin.wiggle{animation:wiggle .45s}
.slots{display:flex;gap:12px;direction:rtl}
.slot{width:clamp(96px,20vmin,170px);height:clamp(96px,20vmin,170px);border-radius:24px;border:5px dashed rgba(47,59,69,.28);display:grid;place-items:center;font-size:clamp(56px,11vmin,100px);font-weight:700;background:rgba(255,255,255,.5);line-height:1.2}
.slot.filled{border-style:solid;border-color:var(--ok);background:var(--ok-soft)}
.slot.next{border-color:var(--sun);background:var(--sun-soft)}
.tile.used{visibility:hidden}
.intro-word{font-size:clamp(80px,17vmin,170px);font-weight:700;line-height:1.4}
.intro-g{font-size:clamp(130px,30vmin,280px);font-weight:700;line-height:1.3;background:var(--card);border-radius:40px;box-shadow:var(--shadow);min-width:clamp(200px,40vmin,380px);text-align:center;padding:0 30px}
.intro-label{font-size:clamp(24px,4vmin,36px);color:var(--muted)}
.next-btn{min-height:90px;min-width:180px;border-radius:40px;background:var(--teal);color:#fff;font-size:44px;box-shadow:var(--shadow);padding:0 30px}
.next-btn:active{transform:translateY(3px)}
.mem-grid{display:grid;grid-template-columns:repeat(4,var(--tile));gap:12px;--tile:clamp(70px,17vmin,150px)}
.mem{width:var(--tile);height:var(--tile);border-radius:22px;box-shadow:var(--shadow);font-size:calc(var(--tile)*.55);font-weight:700;display:grid;place-items:center;background:var(--blue);color:transparent;line-height:1.2;transition:background .2s}
.mem.open{background:var(--card);color:var(--ink)}
.mem.matched{background:var(--ok-soft);color:var(--ink)}
.reward{text-align:center;display:flex;flex-direction:column;align-items:center;gap:22px}
.reward .big-star{font-size:clamp(110px,26vmin,220px);animation:pop .7s ease-out}
.reward h2{font-size:clamp(38px,7vmin,64px);color:var(--teal);font-weight:700}
.reward .acts{display:flex;gap:18px;flex-wrap:wrap;justify-content:center}
.burst{position:fixed;pointer-events:none;font-size:42px;animation:floatup 1s ease-out forwards;z-index:30}
@keyframes wiggle{0%,100%{transform:translateX(0)}20%{transform:translateX(-10px)}40%{transform:translateX(10px)}60%{transform:translateX(-6px)}80%{transform:translateX(6px)}}
@keyframes glow{0%,100%{box-shadow:0 0 0 0 rgba(242,193,78,.0),var(--shadow)}50%{box-shadow:0 0 0 10px rgba(242,193,78,.85),var(--shadow)}}
@keyframes pop{0%{transform:scale(.2);opacity:0}70%{transform:scale(1.12)}100%{transform:scale(1);opacity:1}}
@keyframes fly{to{transform:translateY(40vh) scale(.3);opacity:0}}
@keyframes floatup{from{transform:translateY(0) scale(.6);opacity:1}to{transform:translateY(-120px) scale(1.2);opacity:0}}
@media (max-width:520px){
  .word-grid{grid-template-columns:repeat(2,1fr);gap:12px}
  .games{grid-template-columns:repeat(2,1fr)}
  .grid-find,.mem-grid{grid-template-columns:repeat(3,var(--tile));--tile:clamp(78px,25vw,120px)}
  .icon-btn{width:60px;height:60px;font-size:30px}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

@media (max-width:520px) and (min-height:700px){
  .pic{width:min(62vw,300px)}
  .grid-find,.mem-grid{--tile:clamp(84px,27vw,124px)}
  .pic-choice{width:min(42vw,200px)}
  .stage{justify-content:flex-start;padding-top:4vh}
}

/* ---------- template (תבנית) ---------- */
.tmpl{display:flex;flex-direction:row;direction:rtl;gap:clamp(8px,2vmin,16px);align-items:flex-start;justify-content:center;--tw:clamp(76px,17vmin,150px)}
.tcol{display:flex;flex-direction:column;align-items:center;gap:clamp(6px,1.4vmin,12px)}
.tslot{border:4px solid #b9c2c8;background:#fff;display:grid;place-items:center;font-weight:700;line-height:1.2;color:var(--ink);transition:background .2s,border-color .2s}
.tslot.big{width:var(--tw);height:calc(var(--tw)*1.35);border-radius:18px;font-size:calc(var(--tw)*.68);position:relative}
.tslot.big.start::before{content:"";position:absolute;top:-4px;right:-4px;width:34%;height:26%;background:#7cc49a;border-radius:0 14px 0 14px}
.tslot.big.vpart{background:#fbf8ff}
.tslot.sq{width:calc(var(--tw)*.62);height:calc(var(--tw)*.62);border-radius:12px;font-size:calc(var(--tw)*.5)}
.tslot.sq.ghost{visibility:hidden}
.tslot.next{border-color:var(--sun);background:var(--sun-soft);box-shadow:0 0 0 6px rgba(242,193,78,.45)}
.tslot.filled{border-color:var(--ok);background:var(--ok-soft)}
.tslot.pop{animation:pop .35s ease-out}
.tmpl.complete .tslot{border-color:var(--ok)}
.tmpl-word{font-size:clamp(56px,11vmin,110px);font-weight:700;line-height:1.3;color:var(--teal)}
.tiles-row{--tile:clamp(76px,18vmin,150px)}
.tiles-row.dim-all .tile{opacity:.35;pointer-events:none}
.pic-s{width:clamp(120px,26vmin,230px)!important}
.pic.reveal{animation:pop .5s ease-out}
/* say-it / record cue */
.say-cue{position:fixed;inset:auto 0 0 0;margin:auto;bottom:clamp(20px,6vh,60px);left:50%;transform:translateX(-50%);width:clamp(130px,26vmin,200px);height:clamp(130px,26vmin,200px);border-radius:50%;background:var(--coral-soft);box-shadow:0 0 0 0 rgba(232,149,111,.6),var(--shadow);display:grid;place-items:center;z-index:40;animation:pulse 1s ease-in-out infinite}
.say-cue .mouth{font-size:clamp(64px,13vmin,100px);line-height:1}
.say-cue.rec{background:#fde2e2}
.say-cue .ring{position:absolute;inset:-8px;border-radius:50%;border:8px solid #e57373;border-right-color:transparent;animation:spin 2.5s linear forwards}
@keyframes pulse{0%,100%{box-shadow:0 0 0 0 rgba(232,149,111,.55),var(--shadow);transform:translateX(-50%) scale(1)}50%{box-shadow:0 0 0 22px rgba(232,149,111,0),var(--shadow);transform:translateX(-50%) scale(1.06)}}
@keyframes spin{to{transform:rotate(360deg)}}
.choose-title{font-size:clamp(30px,6vmin,52px);font-weight:700;color:var(--teal)}
.mode-row{display:flex;gap:clamp(14px,4vmin,40px);flex-wrap:wrap;justify-content:center}
.mode-btn{width:clamp(150px,36vmin,300px);min-height:clamp(170px,34vmin,280px);border-radius:32px;background:var(--card);box-shadow:var(--shadow);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:12px;font-size:clamp(22px,4vmin,34px);font-weight:700}
.mode-btn .ic{font-size:clamp(56px,12vmin,96px);line-height:1.1}
.mode-btn small{font-size:clamp(16px,2.6vmin,22px);font-weight:500;color:var(--muted)}
.mode-btn.on{box-shadow:0 0 0 6px var(--teal-soft) inset,var(--shadow)}
.mode-btn.wait{opacity:.6}
.teacher-note{font-size:clamp(16px,2.6vmin,22px);background:var(--blue-soft);color:#3d6a92;border-radius:18px;padding:10px 16px;text-align:center;max-width:640px}
.ear-btn{width:clamp(110px,22vmin,170px);height:clamp(110px,22vmin,170px);border-radius:50%;background:var(--sun-soft);box-shadow:var(--shadow);font-size:clamp(56px,11vmin,90px);display:grid;place-items:center}
.ear-btn:active{transform:scale(.96)}
/* syllables */
.parts{display:flex;align-items:center;gap:clamp(10px,3vmin,26px);direction:rtl}
.part-card{width:clamp(100px,22vmin,180px);height:clamp(110px,24vmin,200px);border-radius:24px;background:var(--card);box-shadow:var(--shadow);font-size:clamp(64px,14vmin,120px);font-weight:700;display:grid;place-items:center;line-height:1.2}
.part-card.v{background:var(--lav-soft)}
.plus{font-size:clamp(40px,8vmin,70px);color:var(--muted)}
.tile.syl{font-size:calc(var(--tile)*.44)}
.syl-scatter{display:grid;grid-template-columns:repeat(3,var(--tile));gap:clamp(10px,2.5vmin,22px);--tile:clamp(90px,20vmin,170px)}
.odd-row{--tile:clamp(76px,19vmin,160px);flex-wrap:nowrap}
.prompt-glyph.big{font-size:clamp(80px,17vmin,150px)}
.snd-card{display:flex;flex-direction:column;align-items:center;gap:10px;background:var(--card);border-radius:28px;box-shadow:var(--shadow);padding:12px;transition:transform .15s}
.snd-card.heard{background:#fffbea}
.snd-card.ok{box-shadow:0 0 0 7px var(--ok) inset,var(--shadow)}
.snd-card.hint{animation:glow 1.1s ease-in-out infinite}
.snd-card.wiggle{animation:wiggle .45s}
.snd-play{width:clamp(84px,18vmin,140px);height:clamp(84px,18vmin,140px);border-radius:50%;background:var(--sun-soft);font-size:clamp(40px,8vmin,64px)}
.snd-pick{width:clamp(84px,18vmin,140px);height:clamp(60px,11vmin,84px);border-radius:22px;background:var(--ok-soft);color:#2e7d55;font-size:clamp(34px,6vmin,50px);font-weight:700}
@media (max-width:520px){
  .tmpl{--tw:clamp(70px,25vw,108px)}
  .tiles-row{--tile:clamp(70px,22vw,100px);gap:10px}
  .syl-scatter{--tile:clamp(80px,26vw,112px)}
  .odd-row{--tile:clamp(66px,20vw,90px);gap:8px}
  .snd-play,.snd-pick{width:clamp(70px,22vw,96px)}
  .snd-card{padding:8px}
}
.tslot.sq{font-size:calc(var(--tw)*.62)}
.mode-row{align-items:stretch}
.mode-note{font-size:clamp(15px,2.4vmin,19px);color:var(--muted);text-align:center;max-width:560px}
.vm{display:block;position:relative;width:1em;height:1em}
.vm.pa::after{content:"";position:absolute;left:12%;right:12%;top:44%;height:14%;border-radius:6px;background:currentColor}
.vm.hi::after{content:"";position:absolute;left:33%;top:33%;width:34%;height:34%;border-radius:50%;background:currentColor}
.ttile.vt .g{font-size:.9em}
.tslot.sq .vm{font-size:.9em}

/* ---- fix round 3 ---- */
/* חלל: a letter with no vowel keeps an EMPTY square under it — visible, never filled, never a step */
.tslot.sq.void{border:3px dashed #d3d9de;background:transparent;box-shadow:none}
.tslot.sq.void.next{border-color:#d3d9de;background:transparent;box-shadow:none}
/* חיריק + י: one piece — the dot square and the י column share one colour and fill together */
.tslot.iy{border-color:#b9a6dc;background:#faf7ff}
.tslot.iy.next{border-color:var(--sun);background:var(--sun-soft)}
.tslot.iy.filled{border-color:var(--ok);background:var(--ok-soft)}
.iyface{line-height:1.25;white-space:nowrap}
/* intro: the word's template, small, filled step by step */
.tmpl-mini{--tw:clamp(52px,11vmin,86px)}
.tmpl-mini .tslot.next{box-shadow:0 0 0 5px rgba(242,193,78,.45)}
.intro-g.known{background:#f4f7f9}
.prompt-glyph.reveal{animation:pop .5s ease-out}
.say-cue.play{background:#e3f1fb}
