/* 🎴 reward (r1): celebration + chip + memory game. Mock v2 layout: flex column, dvh, clamp(), scroll fallback; landscape two columns. */
.rw-ov{position:fixed;top:0;right:0;bottom:0;left:0;z-index:60;background:#1d2a5c;color:#fff;overflow-y:auto;-webkit-overflow-scrolling:touch;font-family:inherit}
.rw-ov[hidden],.rw-chip[hidden]{display:none!important}
/* r2 b5fix: .rw-btns sets display:flex, which beats the browser's own [hidden]{display:none}, so the break reminder showed BOTH
   button groups (#rw-bb "יוצאים להפסקה / ממשיכים" and #rw-bbye "סגירה"). Same guard as the overlays above. */
.rw-btns[hidden]{display:none!important}
.rw-ov *,.rw-ov *::before,.rw-ov *::after{box-sizing:border-box}
.rw-ov button{margin:0;padding:0 12px;max-width:100%}
.rw-svg{width:1.1em;height:1.1em;vertical-align:-.18em;flex:none}
.rw-w{min-height:100vh;min-height:100dvh;width:100%;max-width:460px;margin:0 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;
  gap:clamp(6px,2.2vh,16px);padding:max(clamp(12px,4vh,28px),env(safe-area-inset-top)) 20px max(clamp(20px,5vh,32px),env(safe-area-inset-bottom));box-sizing:border-box}
.rw-txt{display:flex;flex-direction:column;align-items:center;gap:clamp(4px,1.2vh,10px);width:100%}
.rw-h{margin:0;font-size:clamp(22px,min(8vw,6.5vh),34px);line-height:1.2}
.rw-sub{margin:0;font-size:clamp(14px,min(4.6vw,3.4vh),19px);opacity:.92}
.rw-nw{margin:0;font-size:clamp(12px,min(3.8vw,2.8vh),15px);opacity:.8}
.rw-art{flex:none;width:clamp(84px,min(46vw,30vh),210px);aspect-ratio:1;border-radius:24px;background:#ffffff1f;display:flex;align-items:center;justify-content:center;overflow:hidden;font-size:clamp(48px,14vw,96px)}
.rw-art img{width:88%;height:88%;object-fit:contain;display:block}
.rw-badge{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:6px 14px;font-size:clamp(13px,min(4vw,3vh),16px);background:#ffd84d;color:#3a2b00;font-weight:700}
.rw-badge.cap{background:#ffffff26;color:#fff;font-weight:500}
.rw-btns{display:flex;flex-direction:column;gap:clamp(6px,1.6vh,10px);width:100%;margin-top:clamp(2px,1vh,8px)}
.rw-ov button{font-family:inherit;border:0;border-radius:16px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:8px}
.rw-go{width:100%;min-height:clamp(48px,9vh,60px);font-size:clamp(17px,min(5.4vw,4.2vh),21px)!important;font-weight:700;background:#38d39f;color:#043d2a}
.rw-later{width:100%;min-height:48px;font-size:clamp(15px,min(4.6vw,3.6vh),18px)!important;font-weight:600;background:transparent;color:#fff;border:2px solid #ffffff66!important}
.rw-ov button:focus-visible,.rw-chip:focus-visible{outline:3px solid #ffd84d;outline-offset:3px}
.rw-ov.play .rw-art{animation:rwp .4s .2s both}.rw-ov.play .rw-h{animation:rwf .5s both}.rw-ov.play .rw-go{animation:rwb 1.2s 2.2s 2}
@media (orientation:landscape) and (max-height:500px){
  .rw-w{max-width:720px;flex-direction:row;gap:clamp(14px,4vw,32px);padding:max(14px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(22px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left))}
  .rw-art{width:clamp(96px,38vh,170px)}.rw-txt{max-width:380px}.rw-btns{flex-direction:row}.rw-go{flex:1.6}.rw-later{flex:1;min-height:clamp(48px,9vh,60px)}
}
.rw-chip{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:6px 12px;border-radius:999px;border:0;background:#ffd84d;color:#3a2b00;font:inherit;font-weight:700;font-size:15px;cursor:pointer;white-space:nowrap}
.rw-chip.in{animation:rwf .4s both}
#screen-end .rw-chip{margin:6px auto 10px}
.rw-chip-ic{min-width:44px;width:44px;height:44px;padding:0;justify-content:center;flex:none;font-size:22px;box-shadow:0 0 0 3px #fff8,0 2px 6px #0003}
.rw-chip-ic span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.rw-mw{min-height:100vh;min-height:100dvh;max-width:560px;margin:0 auto;display:flex;flex-direction:column;gap:clamp(8px,2vh,14px);box-sizing:border-box;
  padding:max(12px,env(safe-area-inset-top)) 14px max(16px,env(safe-area-inset-bottom))}
.rw-mbar{display:flex;align-items:center;justify-content:space-between;gap:8px}
.rw-mh{margin:0;font-size:clamp(18px,min(6vw,5vh),24px);display:flex;align-items:center;gap:8px}
.rw-x{width:44px;height:44px;background:#ffffff1f!important;color:#fff;font-size:20px!important}
.rw-board{flex:1;display:grid;grid-template-columns:repeat(3,1fr);gap:clamp(6px,2vw,12px);align-content:center}
@media (orientation:landscape) and (max-height:500px){ .rw-board{grid-template-columns:repeat(6,1fr)} .rw-mw{max-width:720px} }
.rw-card{padding:0!important;position:relative;aspect-ratio:1;max-height:calc((100dvh - 120px)/4);width:100%;margin:auto;background:#2e4aa8!important;border-radius:14px!important;padding:0;overflow:hidden}
@media (orientation:landscape) and (max-height:500px){ .rw-card{max-height:calc((100dvh - 110px)/2)} }
.rw-card .rw-back{font-size:clamp(26px,9vw,44px)}.rw-card .rw-face{display:none;width:100%;height:100%;align-items:center;justify-content:center;background:#fff;font-size:clamp(28px,9vw,44px)}
.rw-card .rw-face img{width:86%;height:86%;object-fit:contain}
.rw-card.up .rw-back,.rw-card.got .rw-back{display:none}.rw-card.up .rw-face,.rw-card.got .rw-face{display:flex}
.rw-card.got{box-shadow:0 0 0 3px #38d39f inset}
.rw-mend{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;text-align:center}
.rw-mend[hidden],.rw-board[hidden]{display:none!important}
.rw-mend .rw-go{max-width:360px}
@keyframes rwf{from{opacity:0}} @keyframes rwp{from{transform:scale(.6);opacity:0}} @keyframes rwb{50%{transform:scale(1.04)}}
@media (prefers-reduced-motion:reduce){.rw-ov *,.rw-chip{animation:none!important}}
/* r2: board sizes 12 / 18 / 28 (s6 / s9 / s14; s13 was 26 with a half-empty last row), square cards sized by the rows that must fit; the size picker; the per-pair fallback
   drawing and the small level badge (1 / 4) on every open card */
.rw-size{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;text-align:center}
.rw-size[hidden]{display:none!important}
.rw-sizes{display:flex;flex-direction:column;gap:10px;width:100%;max-width:320px}
.rw-sz{min-height:52px;font-size:18px!important;font-weight:700;background:#ffffff1f;color:#fff;border:2px solid #ffffff55!important}
.rw-sz.on{background:#38d39f;color:#043d2a;border-color:#38d39f!important}
@media (orientation:landscape) and (max-height:500px){ .rw-sizes{flex-direction:row;max-width:620px} .rw-sz{flex:1} }
.rw-board{--cols:3;--rows:4;grid-template-columns:repeat(var(--cols),1fr)!important;justify-items:center}
.rw-board.s9{--cols:3;--rows:6;gap:clamp(5px,1.6vw,10px)}
.rw-board.s13,.rw-board.s14{--cols:4;--rows:7;gap:clamp(4px,1.4vw,8px)}
.rw-board .rw-card{max-height:none;width:min(100%,calc((100dvh - 118px)/var(--rows) - 6px));aspect-ratio:1;height:auto}
@media (orientation:landscape) and (max-height:500px){
  .rw-board{--cols:6;--rows:2}.rw-board.s9{--cols:6;--rows:3}.rw-board.s13{--cols:9;--rows:3}.rw-board.s14{--cols:7;--rows:4}
  .rw-board .rw-card{width:min(100%,calc((100dvh - 96px)/var(--rows) - 6px))}
}
.rw-card .rw-face{position:relative}
.rw-fb{width:86%;height:86%;display:block}
.rw-lv{position:absolute;top:3px;inset-inline-end:3px;min-width:18px;height:18px;padding:0 4px;border-radius:9px;background:#1d2a5c;color:#fff;font-size:12px;line-height:18px;font-weight:700;text-align:center}
/* r2 b4fix: the screen-break reminder reuses the celebration layout (.rw-w / .rw-txt / .rw-btns); a calm sun instead of a character */
.rw-bart{font-size:clamp(56px,min(20vw,16vh),120px)}.rw-bart .rw-svg{width:62%;height:62%}
.rw-brk{z-index:61}
/* r2 b4fix: WIDE DESKTOP (1280x800, 1440x900, ...). Phones never match (360x640, 390x844 and 640x360 are all under 900 px wide, or
   under 600 px high), so the phone rules above stay exactly as they were. One centred column with a max width; the memory board
   gets more columns and its square card is the SMALLEST of three sizes: a cap, the row height that leaves room for the title bar
   (--chrome), and the column width of the centred container — so the board never pushes the title or the buttons off screen. */
@media (min-width:900px) and (min-height:600px){
  .rw-w{max-width:520px}
  .rw-sizes{flex-direction:row;max-width:620px}.rw-sz{flex:1}
  .rw-mw{max-width:min(1000px,92vw)}
  .rw-mend .rw-go{max-width:360px}
  .rw-board,.rw-board.s9,.rw-board.s13,.rw-board.s14{--gap:12px;--chrome:150px;--cap:170px;gap:var(--gap)!important;justify-content:center;
    --card:min(var(--cap),calc((100dvh - var(--chrome)) / var(--rows) - var(--gap)),calc((min(1000px,92vw) - 28px - (var(--cols) - 1) * var(--gap)) / var(--cols)));
    grid-template-columns:repeat(var(--cols),var(--card))!important}
  .rw-board{--cols:4;--rows:3}.rw-board.s9{--cols:6;--rows:3}.rw-board.s13,.rw-board.s14{--cols:7;--rows:4}
  .rw-board .rw-card{width:var(--card);height:var(--card)}
}

/* Local invitation candidate: presentation only, unchanged eligibility/reward flow. */
#rw-cel{background:radial-gradient(ellipse at 50% 30%,#5148ae 0%,#29285f 52%,#1d2a5c 100%)}
#rw-cel .rw-art{background:#fff3d0;border:4px solid #ffe581;box-shadow:0 10px 35px #1113,0 0 0 8px #ffffff0e;transform:rotate(-2deg)}
#rw-cel .rw-art img{border-radius:15px}
.rw-earned{font-size:15px;font-weight:700;color:#ffe581;letter-spacing:.01em}
#rw-cel .rw-h{color:#fff5c8;max-width:360px}
#rw-cel .rw-sub{line-height:1.4;max-width:340px}
#rw-cel .rw-go{background:#ffd84d;color:#3a2b00;box-shadow:0 5px 0 #b88a00}
#rw-cel .rw-later{margin-top:5px;border:0!important;text-decoration:underline;text-underline-offset:4px}

#rw-cel .rw-w{max-width:min(460px,100vw);min-width:0}
#rw-cel .rw-txt{min-width:0;max-width:100%}
#rw-cel .rw-h,#rw-cel .rw-sub,#rw-cel .rw-nw{white-space:normal;overflow-wrap:anywhere;max-width:100%}
#rw-cel .rw-btns{min-width:0;max-width:100%}
@media (orientation:landscape) and (max-height:500px){#rw-cel .rw-w{max-width:min(720px,100vw)}#rw-cel .rw-txt{max-width:380px}}
#rw-cel{inset:auto 0 auto auto;top:0;width:100vw;height:100dvh}
