@font-face{font-family:"Noto Sans Hebrew";src:url("fonts/noto-hebrew-hebrew.woff2") format("woff2");font-weight:500 800;font-display:swap;unicode-range:U+0307-0308,U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}
@font-face{font-family:"Noto Sans Hebrew";src:url("fonts/noto-hebrew-latin.woff2") format("woff2");font-weight:500 800;font-display:swap;unicode-range:U+0000-00FF,U+2000-206F,U+2212}
:root{--sat:env(safe-area-inset-top,0px);--sab:env(safe-area-inset-bottom,0px);--ink:#3b2410;--wood:#8a4a12}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}
html,body{margin:0;height:100%;overflow:hidden;background:#2f7a3a;font-family:"Noto Sans Hebrew",Arial,sans-serif;color:var(--ink);overscroll-behavior:none}
button{font-family:inherit;border:0;cursor:pointer;touch-action:manipulation;color:inherit}
input{font-family:inherit;-webkit-user-select:text;user-select:text}
#app{position:fixed;inset:0;overflow:hidden}
.screen{position:absolute;inset:0;display:none;align-items:center;justify-content:center;flex-direction:column;overflow:hidden}
.screen.active{display:flex}
.bg{position:absolute;inset:0;background:url(img/bg.webp) center/cover no-repeat}
.bg.dim::after{content:"";position:absolute;inset:0;background:rgba(255,250,230,.18)}
.big-btn{position:relative;z-index:3;background:linear-gradient(#ffe066,#ffb300);color:#5a3200;font-size:26px;font-weight:800;padding:12px 34px;border-radius:40px;box-shadow:0 6px 0 #c77d00,0 10px 22px rgba(90,50,0,.3),inset 0 2px 0 rgba(255,255,255,.7);min-height:60px;line-height:1.3}
.big-btn:active{transform:translateY(4px);box-shadow:0 2px 0 #c77d00}
.big-btn:disabled{filter:grayscale(.7) opacity(.55)}
.big-btn.small{font-size:19px;padding:9px 20px;min-height:50px}
.big-btn.alt{background:linear-gradient(#a8e1ff,#4fb3ff);color:#0c3a66;box-shadow:0 6px 0 #2a7fc4,inset 0 2px 0 rgba(255,255,255,.7)}
.small-btn{background:rgba(255,255,255,.92);font-size:17px;font-weight:700;padding:9px 18px;border-radius:24px;box-shadow:0 3px 0 rgba(0,0,0,.14);margin-top:10px}
.pulse{animation:pulse 1.6s ease-in-out infinite}
@keyframes pulse{50%{transform:scale(1.06)}}
.card{position:relative;z-index:2;background:rgba(255,253,245,.95);border-radius:28px;padding:18px 16px;width:min(92vw,460px);max-height:calc(100% - 90px - var(--sat));overflow:auto;text-align:center;box-shadow:0 12px 40px rgba(20,60,20,.3);margin-top:calc(var(--sat) + 40px)}
.card.wide{width:min(94vw,620px)}
.card h2{margin:0 0 10px;font-size:24px;line-height:1.55;color:#6b3a10}
.say{background:#fff1b8;border-radius:50%;width:42px;height:42px;font-size:21px;vertical-align:middle;box-shadow:0 2px 0 #e0c060;padding:0}
.row{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}
/* title */
#s-title{background:#9fd6ff;justify-content:flex-end}
.splash-wrap{position:absolute;inset:0;overflow:hidden;animation:zoomIn 2.4s cubic-bezier(.2,.8,.2,1) both}
.splash{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 70%}
.scene-box{position:absolute;pointer-events:none}
.scene-box img{-webkit-user-drag:none;will-change:transform,opacity}
@keyframes zoomIn{from{transform:scale(1.12)}to{transform:none}}
.splash-fade{position:absolute;left:0;right:0;top:0;height:42%;background:linear-gradient(rgba(10,60,110,.35),rgba(10,60,110,0))}
.t-head{position:absolute;top:calc(var(--sat) + 4vh);left:0;right:0;text-align:center;z-index:2;animation:drop .9s .2s cubic-bezier(.3,1.5,.5,1) both}
@keyframes drop{from{transform:translateY(-120%);opacity:0}}
.t-world{display:inline-block;font-size:17px;font-weight:800;color:#fff;background:rgba(40,110,40,.75);padding:3px 16px 5px;border-radius:999px;border:2px solid rgba(255,255,255,.8);margin-bottom:6px}
.t-title{margin:0;font-size:min(15vw,66px);line-height:1.12;font-weight:800;color:#ffd21f;-webkit-text-stroke:2px #7a3c00;paint-order:stroke fill;text-shadow:0 4px 0 #7a3c00,0 8px 16px rgba(0,0,0,.45)}
#t-start{margin-bottom:calc(var(--sab) + 9vh)}
.noa-credit{position:absolute;left:0;right:0;bottom:calc(var(--sab) + 6px);margin:0;text-align:center;font-size:12px;font-weight:700;color:rgba(255,255,255,.95);text-shadow:0 1px 3px rgba(0,0,0,.7);pointer-events:none;z-index:5}
/* mode */
.stars-total{font-size:19px;font-weight:800;color:#a05a00;margin:-4px 0 10px}
.menu-grid{display:flex;flex-direction:column;gap:12px}
.mode-btn{background:linear-gradient(#fffaf0,#ffe6b8);border-radius:22px;padding:12px 10px;display:grid;grid-template-columns:64px 1fr;grid-template-rows:auto auto;align-items:center;text-align:right;column-gap:10px;box-shadow:0 5px 0 #dfae63,0 8px 16px rgba(0,0,0,.1);min-height:86px}
.mode-btn:active{transform:translateY(3px)}
.mode-btn .ico{grid-row:1/3;font-size:38px;text-align:center}
.mode-btn .mt{font-size:23px;font-weight:800;color:#6b3a10}
.mode-btn .ms{font-size:15px;font-weight:600;color:#8a6a4a}
/* pick */
.pick-players{display:flex;flex-direction:column;gap:12px;margin-bottom:14px}
.pl-box{background:#fff4dc;border-radius:20px;padding:10px 10px 12px}
.pl-t{font-weight:800;font-size:18px;color:#8a5a2a;margin-bottom:6px}
.pl-box input{width:min(100%,280px);font-size:22px;font-weight:700;text-align:center;padding:8px 10px;border-radius:14px;border:3px solid #f0c27a;background:#fff;color:#3b2410;outline:none}
.pl-box input:focus{border-color:#ff9f1a}
.heroes{display:flex;gap:12px;justify-content:center;margin-top:10px}
.hero{background:#fff;border-radius:20px;padding:6px 8px 4px;width:122px;border:4px solid transparent;box-shadow:0 4px 0 #e6c78f;display:flex;flex-direction:column;align-items:center}
.hero img{height:130px;width:auto;display:block;filter:drop-shadow(0 6px 6px rgba(0,0,0,.2))}
.hero span{font-size:20px;font-weight:800}
.hero.b span{color:#1d5bd6}.hero.g span{color:#e0408a}
.hero.sel.b{border-color:#2f7cff;background:#e8f1ff}.hero.sel.g{border-color:#ff5aa5;background:#ffeaf4}
.hero.sel{transform:scale(1.04)}
.split-pick .hero img{height:96px}.split-pick .hero{width:104px}
/* level */
.lvl-list{display:flex;flex-direction:column;gap:10px}
.lvl-btn{position:relative;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto auto;text-align:right;background:linear-gradient(#fffaf0,#ffe6b8);border-radius:20px;padding:10px 14px;box-shadow:0 5px 0 #dfae63;min-height:78px;align-items:center}
.lvl-btn:active{transform:translateY(3px)}
.lvl-btn b{font-size:24px;color:#6b3a10}.lvl-btn span{font-size:16px;font-weight:700;color:#8a6a4a}
.lv-ic{grid-column:2;grid-row:1/3;display:flex;gap:2px;align-items:center}
.lv-ic img{height:46px}
.lvl-btn .done{position:absolute;top:-6px;left:-4px;font-style:normal;font-size:24px}
/* learn */
.learn-stage{position:relative;height:200px;margin:4px auto 6px;width:100%;max-width:400px}
.learn-stage .li{position:absolute;transition:all .7s cubic-bezier(.4,1.3,.6,1);transform:translate(-50%,-50%)}
.learn-stage .li img{width:100%;display:block;filter:drop-shadow(0 4px 4px rgba(0,0,0,.25))}
.learn-text{font-size:22px;font-weight:800;line-height:1.55;color:#6b3a10;min-height:70px}
.learn-text .eq{display:inline-block;direction:ltr;background:#fff1c9;border-radius:14px;padding:0 12px;margin-top:4px;color:#b34a00}
/* tags */
.tag{position:absolute;min-width:28px;height:24px;padding:0 6px;border-radius:12px;font-size:15px;font-weight:800;line-height:24px;color:#fff;text-align:center;direction:ltr;border:2px solid #fff;box-shadow:0 2px 4px rgba(0,0,0,.35)}
.t1{background:#e8a200}.t10{background:#e53935}.t100{background:#1e7be0}.t1000{background:#2e9e3e}
/* game */
#s-game{background:#2f7a3a}
#views{position:absolute;inset:0}
.view{position:absolute;left:0;right:0;overflow:hidden;background:url(img/bg.webp) center bottom/cover no-repeat;touch-action:none}
.view.flip{transform:rotate(180deg)}
.view.cpu-view{filter:saturate(.9)}
.divider{position:absolute;left:0;right:0;height:6px;margin-top:-3px;background:linear-gradient(#5a3a10,#c58a3a,#5a3a10);z-index:20;box-shadow:0 0 8px rgba(0,0,0,.5)}
.sign{position:absolute;left:50%;transform:translateX(-50%);background:url(img/sign.webp) center/100% 100% no-repeat;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:6;pointer-events:none}
.sign .num{font-weight:800;color:#5a2c05;direction:ltr;line-height:1;text-shadow:0 2px 0 rgba(255,230,170,.8);margin-top:10%}
.sign .dots{display:grid;grid-template-columns:repeat(5,1fr);gap:3px;margin-top:4px;direction:ltr}
.sign .dots i{width:var(--d);height:var(--d);border-radius:50%;background:#5a2c05;opacity:.15}
.sign .dots i.on{opacity:1;background:#e53935}
.hudrow{position:absolute;left:0;right:0;display:flex;justify-content:center;align-items:stretch;gap:8px;z-index:7;pointer-events:none}
.counter{display:flex;direction:ltr;background:rgba(255,255,255,.93);border-radius:16px;box-shadow:0 3px 8px rgba(0,0,0,.25);overflow:hidden;pointer-events:none}
.counter .col{display:flex;flex-direction:column;align-items:center;padding:2px 6px 3px;border-left:2px solid #f0dcb0;min-width:56px}
.counter .col:first-child{border-left:0}
.counter .cl{font-size:12px;font-weight:800;color:#8a5a2a;direction:rtl;white-space:nowrap}
.counter .cv{display:flex;align-items:center;gap:3px;font-size:22px;font-weight:800;line-height:1.1}
.counter .cv img{height:22px}
.counter .col.bump .cv{animation:bump .35s}
@keyframes bump{40%{transform:scale(1.35)}}
.chk{pointer-events:auto;background:linear-gradient(#7ee07e,#2fae3f);color:#fff;font-size:19px;font-weight:800;border-radius:16px;padding:4px 12px;box-shadow:0 4px 0 #1d7a2a;text-shadow:0 1px 2px rgba(0,0,0,.3);white-space:nowrap}
.chk:active{transform:translateY(3px);box-shadow:0 1px 0 #1d7a2a}
.vstars{position:absolute;z-index:7;font-size:18px;font-weight:800;background:rgba(255,255,255,.88);border-radius:999px;padding:1px 10px;direction:ltr;pointer-events:none;color:#a05a00}
.vname{position:absolute;z-index:7;font-size:14px;font-weight:800;color:#fff;background:rgba(0,0,0,.35);border-radius:999px;padding:1px 10px;pointer-events:none}
.vsay{position:absolute;z-index:8;width:40px;height:40px;border-radius:50%;background:rgba(255,255,255,.92);font-size:20px;box-shadow:0 2px 0 rgba(0,0,0,.18);padding:0}
.item{position:absolute;left:0;top:0;z-index:4;pointer-events:none;will-change:transform;animation:fadeIn .4s}@keyframes fadeIn{from{opacity:0}}
.item img{width:100%;display:block;filter:drop-shadow(0 5px 5px rgba(0,0,0,.3))}
.item .tag{top:-6px;right:-8px}
.monkey{position:absolute;left:0;bottom:0;z-index:5;pointer-events:none;will-change:transform}
.monkey img.ms{width:100%;display:block;filter:drop-shadow(0 8px 8px rgba(0,0,0,.35))}
.monkey .pile{position:absolute;z-index:2;height:80px;overflow:hidden;pointer-events:none}
.monkey .pile img{filter:drop-shadow(0 2px 2px rgba(0,0,0,.3))}
.monkey.hop{animation:hop .5s 2}
@keyframes hop{50%{transform:var(--tx) translateY(-16%)}}
.pop{position:absolute;z-index:9;font-weight:800;color:#fff;-webkit-text-stroke:1.5px #7a3c00;paint-order:stroke fill;pointer-events:none;animation:popup 1s ease-out forwards;direction:ltr}
@keyframes popup{from{transform:translate(-50%,0) scale(.6);opacity:1}to{transform:translate(-50%,-70px) scale(1.2);opacity:0}}
.instr{position:absolute;left:50%;transform:translateX(-50%);z-index:8;background:rgba(255,253,240,.95);border-radius:18px;padding:6px 14px;font-size:19px;font-weight:800;color:#6b3a10;text-align:center;width:max-content;max-width:88%;box-shadow:0 4px 12px rgba(0,0,0,.25);pointer-events:none;transition:opacity .5s}
.instr.off{opacity:0}
/* feedback panel inside a view */
.fb{position:absolute;inset:0;z-index:15;display:none;align-items:center;justify-content:center;background:rgba(20,40,10,.35)}
.fb.on{display:flex}
.fb-card{background:#fffdf3;border-radius:24px;padding:12px 14px 14px;width:min(92%,380px);text-align:center;box-shadow:0 10px 30px rgba(0,0,0,.35);max-height:96%;overflow:auto;animation:pin .35s cubic-bezier(.3,1.5,.5,1)}
@keyframes pin{from{transform:scale(.6);opacity:0}}
.fb-h{font-size:26px;font-weight:800;line-height:1.4}
.fb-h.ok{color:#1f9a3a}.fb-h.few{color:#e07b00}.fb-h.many{color:#d23a3a}
.eqn{direction:ltr;display:inline-block;font-size:30px;font-weight:800;background:#fff1c9;border-radius:16px;padding:2px 14px;margin:6px 0;color:#5a2c05;white-space:nowrap}
.eqn b{color:#1f9a3a}.eqn .mn{color:#d23a3a}.eqn .pl{color:#e07b00}
.fb-t{font-size:18px;font-weight:700;color:#6b3a10;line-height:1.45}
.need{direction:ltr;display:flex;flex-wrap:wrap;justify-content:center;gap:4px 10px;margin:6px 0}
.need .nk{display:flex;align-items:center;gap:2px;font-size:22px;font-weight:800;direction:ltr}
.need img{height:40px}
.bitems{direction:ltr;display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin:8px 0 4px}
.bit{position:relative;background:#fff4dc;border-radius:14px;padding:6px 8px 4px;box-shadow:0 3px 0 #e6c78f;width:66px;height:62px;display:flex;align-items:center;justify-content:center}
.bit img{max-width:52px;max-height:46px}
.bit .tag{top:-8px;right:-6px;font-size:13px;height:20px;line-height:17px;min-width:24px}
.bit:active{transform:scale(.92)}
.bit.gone{animation:out .45s forwards}
@keyframes out{to{transform:translateY(-40px) scale(.3);opacity:0}}
.fb-go{margin-top:6px}
.fb-star{font-size:54px;line-height:1;animation:spinIn .7s}
@keyframes spinIn{from{transform:scale(0) rotate(-180deg)}}
.vconf{position:absolute;inset:0;pointer-events:none;z-index:16;overflow:hidden}
.vconf i{position:absolute;top:-20px;width:10px;height:14px;border-radius:3px;animation:fall 1.6s linear forwards}
@keyframes fall{to{transform:translateY(110vh) rotate(720deg)}}
.vwait{position:absolute;inset:0;z-index:14;display:none;align-items:center;justify-content:center;background:rgba(0,0,0,.25);font-size:24px;font-weight:800;color:#fff;text-shadow:0 2px 4px rgba(0,0,0,.6)}
.vwait.on{display:flex}
/* end */
.end-wrap{position:relative;z-index:2;text-align:center;display:flex;flex-direction:column;align-items:center;gap:8px;padding:20px;background:rgba(255,253,243,.93);border-radius:28px;width:min(92vw,440px);box-shadow:0 12px 40px rgba(0,0,0,.3)}
.end-chars{display:flex;gap:10px;align-items:flex-end;justify-content:center}
.end-chars img{height:150px;filter:drop-shadow(0 8px 8px rgba(0,0,0,.3));animation:bob 1.6s ease-in-out infinite}
.end-chars img.lose{height:110px;opacity:.85;animation:none}
@keyframes bob{50%{transform:translateY(-8px)}}
#end-h{margin:4px 0 0;font-size:28px;line-height:1.45;color:#1f7a2a}
.end-sub{font-size:20px;font-weight:700;color:#6b3a10;line-height:1.5}
/* cert */
.cert-wrap{position:relative;z-index:2;display:flex;flex-direction:column;align-items:center;gap:10px;padding:calc(var(--sat) + 60px) 12px calc(var(--sab) + 12px);height:100%;width:100%;justify-content:center}
.cert-img{max-width:min(92vw,440px);max-height:calc(100% - 210px);border-radius:16px;box-shadow:0 10px 30px rgba(0,0,0,.4);background:#fffdf7;min-height:120px}
.cert-btns{display:flex;gap:10px}
.save-btn{font-size:28px;padding:10px 46px}
.sheet{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:80;display:none;align-items:flex-end;justify-content:center}
.sheet.on{display:flex}
.sheet-card{position:relative;background:#fff;border-radius:28px 28px 0 0;padding:20px 16px calc(var(--sab) + 22px);width:min(100%,520px);display:flex;flex-direction:column;gap:12px;align-items:center}
.sheet-x{position:absolute;top:10px;left:12px;width:40px;height:40px;border-radius:50%;background:#eee;font-size:20px}
.sheet-prev{max-height:38vh;max-width:80%;border-radius:12px;box-shadow:0 4px 14px rgba(0,0,0,.2)}
.sh-btn{width:100%;font-size:22px;font-weight:800;padding:14px;border-radius:20px;display:flex;gap:10px;align-items:center;justify-content:center}
.sh-btn.save{background:#e8f3ff;color:#0c3a66}
.sh-btn.wa{background:#25d366;color:#fff}
/* back + ask */
.noa-back{position:fixed;z-index:72;top:calc(var(--sat) + 10px);right:10px;display:none;width:44px;height:44px;padding:0;border-radius:50%;border:3px solid #fff;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12h14M12.5 5.5 19 12l-6.5 6.5'/%3E%3C/svg%3E") center/22px 22px no-repeat,radial-gradient(circle at 32% 26%,rgba(255,255,255,.95) 0 8%,rgba(255,255,255,0) 28%),linear-gradient(180deg,#5d74d6 0%,#34489a 55%,#1d2b6b 100%);box-shadow:0 5px 14px rgba(20,30,110,.35),inset 0 -4px 0 rgba(10,20,90,.28)}
.noa-back.on{display:block}
.noa-back:active{transform:scale(.92)}
body.split-game .noa-back{top:var(--midy,50%);right:6px;margin-top:-22px}
.ask{position:fixed;inset:0;z-index:90;background:rgba(0,0,0,.45);display:none;align-items:center;justify-content:center}
.ask.on{display:flex}
.ask-card{background:#fff;border-radius:26px;padding:18px 22px;text-align:center;width:min(84vw,330px);box-shadow:0 10px 30px rgba(0,0,0,.35)}
.ask-ic{font-size:40px}
.ask-q{font-size:22px;font-weight:800;line-height:1.5;margin:6px 0 12px;color:#3b2410}
.ask-row{display:flex;gap:12px;justify-content:center}
.ask-row button{font-size:22px;font-weight:800;padding:10px 26px;border-radius:20px}
.ask-yes{background:linear-gradient(#ffe066,#ffb300);color:#5a3200;box-shadow:0 4px 0 #c77d00}
.ask-no{background:#e8f3ff;color:#0c3a66;box-shadow:0 4px 0 #9fc3e8}
@media (min-width:700px){.view.single{left:50%;right:auto;width:520px;margin-left:-260px;box-shadow:0 0 60px rgba(0,0,0,.5)}}

/* ---- two phones ---- */
.lobby-card .sh-btn{margin:6px 0 4px}
.code-big{font-size:60px;font-weight:800;letter-spacing:12px;color:#6b3a10;margin:0 0 6px;line-height:1.1;font-family:Arial,sans-serif}
.code-big.in{display:flex;gap:8px;justify-content:center;letter-spacing:0}
.code-big.in span{width:58px;height:70px;border-radius:16px;background:#fff3c4;border:3px solid #f0c27a;display:flex;align-items:center;justify-content:center}
.keypad{display:grid;grid-template-columns:repeat(3,76px);gap:9px;justify-content:center;margin:10px 0 4px}
.keypad button{height:56px;border-radius:16px;background:#fff;font-size:28px;font-weight:800;color:#3b2410;box-shadow:0 4px 0 #e0c48f;font-family:Arial,sans-serif}
.keypad button:active{transform:translateY(3px);box-shadow:0 1px 0 #e0c48f}
.keypad button[data-k="✓"]{background:linear-gradient(#ffe066,#ffb300);color:#5a3200}
.hint{font-size:16px;font-weight:600;color:#6a5a4a;line-height:1.6;margin-top:4px}
.status{margin:10px 0 6px;font-weight:800;font-size:18px;display:flex;gap:8px;justify-content:center;align-items:center;line-height:1.5;color:#3b2410}
.status:empty{display:none}
.status .dot{flex:none;width:12px;height:12px;border-radius:50%;background:#f0b400;animation:npulse 1s infinite}
.status.ok .dot{background:#2bb24c;animation:none}.status.bad .dot{background:#e5484d;animation:none}
@keyframes npulse{50%{opacity:.3}}
.vs{display:flex;align-items:flex-end;justify-content:center;gap:14px;font-weight:800;font-size:19px;color:#3b2410}
.vs:empty{display:none}
.vs .p{display:flex;flex-direction:column;align-items:center;gap:2px}
.vs img{height:110px;filter:drop-shadow(0 5px 5px rgba(0,0,0,.2))}
.vs .x{font-size:32px;align-self:center}
.lobby-card .big-btn{margin-top:10px}
.fail p{font-weight:700;line-height:1.6}
.net-ic{animation:npulse 1.2s infinite}
.vopp{position:absolute;z-index:7;display:flex;align-items:center;gap:5px;background:rgba(255,255,255,.92);border-radius:999px;padding:2px 12px 2px 6px;font-size:17px;box-shadow:0 2px 6px rgba(0,0,0,.15);font-weight:800;color:#6b3a10;pointer-events:none;max-width:230px;white-space:nowrap;overflow:hidden}
.vopp img{height:34px;width:auto}
.vopp .on{direction:ltr;color:#a05a00}

/* ===== elephants game ===== */
html,body{background:#c98a2e}
#s-title{background:#f3c66b}
.t-world{background:rgba(150,90,20,.78)}
.t-title{color:#fff2c4;-webkit-text-stroke:2px #6b3a10;text-shadow:0 4px 0 #6b3a10,0 8px 18px rgba(0,0,0,.45);font-size:min(13vw,58px)}
.splash{object-position:50% 50%}
.splash-fade{height:38%;background:linear-gradient(rgba(90,50,10,.45),rgba(90,50,10,0))}
#end-h{color:#b8500f}
.rules{font-size:17px;font-weight:700;color:#7a5a3a;line-height:1.6;margin:10px 4px 14px}
.lv-ex{font-style:normal;font-size:19px;font-weight:800;color:#1d5bd6;background:#fff;border-radius:12px;padding:2px 10px;grid-row:1/3;grid-column:2;white-space:nowrap;box-shadow:0 2px 0 #e6c78f}
.vs .p .vpc{height:30px;width:30px;margin:0 2px}
/* mark screen */
.mk-row{display:flex;align-items:center;justify-content:center;gap:12px;background:#fff4dc;border-radius:20px;padding:10px;margin-bottom:10px}
.mk-who{display:flex;flex-direction:column;align-items:center;min-width:84px;font-weight:800;font-size:18px;color:#6b3a10}
.mk-who img{height:86px;filter:drop-shadow(0 4px 4px rgba(0,0,0,.2))}
.mk-btn{width:104px;height:104px;border-radius:24px;background:#fff;border:4px solid transparent;box-shadow:0 5px 0 #e6c78f;padding:8px}
.mk-btn img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 4px 4px rgba(0,0,0,.25))}
.mk-btn.sel{border-color:#ff9f1a;background:#fff3d0;transform:scale(1.06)}
.mk-row.two .mk-btn{width:88px;height:88px}
/* game */
.game-bg::after{content:"";position:absolute;inset:0;background:linear-gradient(rgba(255,240,200,.05),rgba(80,40,0,.12))}
.game{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:space-evenly;padding:calc(var(--sat) + 6px) 8px calc(var(--sab) + 8px)}
.g-top{width:100%;height:58px;display:flex;justify-content:flex-start;align-items:center;padding-left:4px;padding-right:62px;direction:ltr}
.badge{position:relative;display:flex;align-items:center;gap:6px;background:rgba(255,253,245,.94);border-radius:999px;padding:4px 12px 4px 6px;box-shadow:0 4px 12px rgba(60,30,0,.25);border:3px solid #fff;transition:box-shadow .3s,border-color .3s;direction:rtl;max-width:100%}
.badge .av{height:52px;width:auto;margin-top:-14px;filter:drop-shadow(0 3px 3px rgba(0,0,0,.25))}
.badge .pc{height:28px;width:28px;object-fit:contain}
.badge .bn{font-size:18px;font-weight:800;color:#5a3200;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:130px}
.badge .think{font-size:22px;min-width:0}
.badge.turn{border-color:#ffb300;box-shadow:0 0 0 4px rgba(255,179,0,.45),0 4px 12px rgba(60,30,0,.25)}
.ex-card{position:relative;display:flex;align-items:center;justify-content:center;gap:10px;min-width:min(80vw,330px);max-width:94vw;padding:8px 14px 8px 58px;border-radius:20px;background:linear-gradient(#fffaf0,#f4e2b8);border:5px solid #8a5a2a;box-shadow:0 6px 0 #5e3a16,0 12px 24px rgba(60,30,0,.35)}
.ex-card .say{position:absolute;left:8px;top:50%;transform:translateY(-50%)}
.ex,.ex-mini{display:flex;align-items:center;justify-content:center;gap:.28em;font-weight:800;color:#2a1a08;font-size:clamp(30px,10vw,44px);line-height:1.2;white-space:nowrap}
.ex i,.ex-mini i{font-style:normal;color:#b8650f}
.ex .blank,.ex-mini .blank{display:inline-flex;align-items:center;justify-content:center;min-width:1.5em;padding:0 .12em;height:1.25em;border:3px dashed #e07b00;border-radius:12px;color:#e07b00;background:#fff}
.blank.fill{border-style:solid;border-color:#2e9b46;color:#1f7a32;background:#e6ffe9}
.board-wrap{display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.board{--bw:min(88vw,44vh,420px);width:var(--bw);height:var(--bw);display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);gap:4.2%;padding:4.6%;border-radius:26px;
  background:url(img/stone.webp) center/cover;box-shadow:inset 0 3px 0 rgba(255,255,255,.55),inset 0 -6px 10px rgba(110,60,20,.35),0 10px 0 #9a6530,0 12px 0 #7a4d22,0 22px 34px rgba(50,25,0,.45);filter:saturate(.92) brightness(1.04)}
.cell{position:relative;border-radius:16px;padding:0;background:url(img/stone.webp) center/260%;box-shadow:inset 0 7px 12px rgba(90,50,15,.55),inset 0 -3px 3px rgba(255,255,255,.45),0 1px 0 rgba(255,255,255,.5);display:flex;align-items:center;justify-content:center;filter:brightness(.9)}
.cell img{width:84%;height:84%;object-fit:contain;filter:drop-shadow(0 6px 5px rgba(40,20,0,.45));pointer-events:none}
.cell img:not([src]){visibility:hidden}
.cell.drop img{animation:dropin .45s cubic-bezier(.3,1.6,.5,1)}
@keyframes dropin{from{transform:scale(.2) translateY(-30%);opacity:0}}
.cell.can{animation:canp 1.1s ease-in-out infinite;cursor:pointer}
@keyframes canp{50%{box-shadow:inset 0 7px 12px rgba(90,50,15,.55),0 0 0 4px rgba(255,200,40,.9),0 0 18px rgba(255,200,40,.9)}}
.cell.glow{filter:none;animation:glow 0.9s ease-in-out infinite;background-color:#fff2a8}
@keyframes glow{0%,100%{box-shadow:0 0 0 4px #ffd21f,0 0 22px 6px rgba(255,210,31,.95)}50%{box-shadow:0 0 0 6px #fff,0 0 38px 14px rgba(255,190,0,1);transform:scale(1.06)}}
.board.won .cell:not(.glow){filter:brightness(.8) saturate(.8)}
.panel{width:100%;max-width:520px;display:flex;flex-direction:column;align-items:center;gap:6px;background:rgba(255,250,236,.55);border-radius:24px;padding:8px 8px 10px;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);transition:background .3s,box-shadow .3s}
.panel.turn{background:rgba(255,236,170,.85);box-shadow:0 0 0 3px #ffb300}
.p-head{display:flex;align-items:center;gap:8px;width:100%;justify-content:space-between}
.panel .badge{flex:0 1 auto}
.msg{min-height:30px;font-size:19px;font-weight:800;color:#5a3200;text-align:center;line-height:1.5;padding:0 6px;border-radius:14px}
.msg.ok{color:#1f7a32}.msg.soft{color:#b4561a}.msg.info{color:#1d4fa8}
.tiles{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;width:100%}
.tile{height:clamp(56px,8.6vh,76px);border-radius:18px;background:linear-gradient(#ffffff,#fff0cf);box-shadow:0 5px 0 #d79a3d,0 8px 14px rgba(60,30,0,.2);font-size:clamp(26px,8vw,34px);font-weight:800;color:#2a1a08;padding:0 2px;white-space:nowrap;overflow:hidden}
.tile:active:not(:disabled){transform:translateY(3px);box-shadow:0 2px 0 #d79a3d}
.tile:disabled{opacity:.6}
.tile.bad{background:#f3e3dc;color:#b9a69a;box-shadow:0 3px 0 #cdb3a6;text-decoration:line-through;opacity:1}
.tile.good{background:linear-gradient(#eaffef,#b7f0c4);box-shadow:0 5px 0 #4dbb66;color:#14682b;opacity:1}
.panel.locked .tiles{filter:grayscale(.5)}
/* duel */
.game.duel{justify-content:space-between;padding-top:calc(var(--sat) + 6px)}
.game.duel .panel{gap:4px;padding:6px 8px 8px}
.game.duel .panel.flip{transform:rotate(180deg);padding-bottom:62px}
.game.duel .ex-mini{font-size:clamp(24px,7.4vw,34px);flex:1}
.game.duel .say.sm{width:38px;height:38px;font-size:18px;flex:0 0 auto}
.game.duel .badge .av{height:44px;margin-top:-10px}.game.duel .badge .bn{font-size:16px;max-width:86px}
.game.duel .board{--bw:min(84vw,calc(100vh - 470px),400px)}
.game.duel .tile{height:clamp(50px,7.4vh,68px)}
.game.one .panel.mine .p-head{justify-content:center}
@media (max-height:700px){.game.one .board{--bw:min(84vw,40vh)}.ex,.ex-mini{font-size:32px}.g-top{height:50px}}

#m-duel .ico,#m-net .ico{font-size:25px;white-space:nowrap;letter-spacing:-4px}
.game.one .badge .av{height:64px;margin-top:-20px}
.game.one .panel.mine .badge .bn{font-size:20px}
.ex i,.ex-mini i,.lv-ex{font-family:Arial,Helvetica,sans-serif}
.ex i,.ex-mini i{font-weight:700}

/* ===== v2: rules screen, who-is-who, status line, turn banners ===== */
.rules-card{padding:16px 14px 18px}
.rules-card h2{margin-bottom:8px}
.who-row{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin:2px 0 10px}
.who{display:flex;align-items:center;gap:6px;background:#fff;border-radius:999px;padding:4px 12px 4px 8px;border:3px solid #ddd;box-shadow:0 3px 0 rgba(0,0,0,.08);font-size:20px;font-weight:800}
.who.mx{border-color:#2f7cff;color:#1d4fb8}.who.mo{border-color:#ff5aa5;color:#c02a75}
.who .wav{height:46px;width:auto;margin-top:-10px;filter:drop-shadow(0 3px 3px rgba(0,0,0,.2))}
.who .wav.ph{font-size:28px;height:auto;margin:0}
.who b{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.who .eq{font-size:22px;color:#6b3a10}
.who .ipc{height:38px;width:38px}
.ipc{height:30px;width:30px;object-fit:contain;vertical-align:middle;filter:drop-shadow(0 2px 2px rgba(0,0,0,.25))}
.who-row.small .who{font-size:18px}.who-row.small .wav{height:40px}
#mark-assign{min-height:58px;margin:4px 0 12px}
.rules-list{list-style:none;margin:6px 0 14px;padding:0;display:flex;flex-direction:column;gap:8px;text-align:right}
.rules-list li{display:flex;align-items:center;gap:10px;background:#fff6e0;border-radius:18px;padding:8px 10px;font-size:19px;font-weight:700;line-height:1.5;color:#4a2a0a;animation:rin .45s both}
@keyframes rin{from{transform:translateY(12px);opacity:0}}
.rules-list .ric{flex:0 0 40px;height:40px;border-radius:50%;background:#fff;display:flex;align-items:center;justify-content:center;font-size:24px;box-shadow:0 2px 0 #ecd29a}
.rules-list li:nth-child(3){background:#ffeede}
#rules-go{font-size:30px;padding:12px 48px}
.rules-ov{position:fixed;inset:0;z-index:70;background:rgba(20,30,10,.55);display:none;align-items:center;justify-content:center;padding:calc(var(--sat) + 60px) 10px calc(var(--sab) + 10px)}
.rules-ov.on{display:flex}
.ov-card{background:rgba(255,253,245,.98);border-radius:26px;width:min(94vw,560px);max-height:100%;overflow:auto;text-align:center;box-shadow:0 12px 40px rgba(0,0,0,.4);animation:pin .3s cubic-bezier(.3,1.5,.5,1)}
.ov-card h2{margin:0 0 8px;font-size:24px;color:#6b3a10}
.ov-card .rules-list li{font-size:18px}
.noa-help{position:fixed;z-index:72;top:calc(var(--sat) + 10px);right:62px;display:none;width:44px;height:44px;padding:0;border-radius:50%;border:3px solid #fff;font-size:24px;font-weight:800;color:#fff;line-height:1;background:radial-gradient(circle at 32% 26%,rgba(255,255,255,.9) 0 8%,rgba(255,255,255,0) 28%),linear-gradient(180deg,#ffb84d 0%,#f08a00 55%,#b85f00 100%);box-shadow:0 5px 14px rgba(110,60,0,.35),inset 0 -4px 0 rgba(90,40,0,.28);text-shadow:0 1px 2px rgba(0,0,0,.35)}
.noa-help.on{display:block}
.noa-help:active{transform:scale(.92)}
.game.one .g-top{padding-right:116px}
/* status */
.status-line,.game.duel .panel .msg{display:flex;align-items:center;justify-content:center;gap:6px;min-height:46px;width:min(94vw,440px);padding:4px 12px;border-radius:999px;background:rgba(255,253,245,.95);border:3px solid #fff;box-shadow:0 4px 12px rgba(60,30,0,.22);font-size:20px;font-weight:800;color:#5a3200;text-align:center;line-height:1.3;transition:background .25s,border-color .25s}
.game.duel .panel .msg{width:100%;min-height:42px;font-size:18px}
.game.one .panel .msg{display:none}
.status-line .spc,.panel .msg .spc{height:32px;width:32px;object-fit:contain;filter:drop-shadow(0 2px 2px rgba(0,0,0,.25))}
.s-race{background:#fff3c4;border-color:#ffb300}
.s-turn.cx,.s-mine.cx{background:#e3efff;border-color:#2f7cff;color:#1546a8}
.s-turn.co,.s-mine.co{background:#ffe6f2;border-color:#ff5aa5;color:#b01f69}
.s-turn{animation:stp 1.2s ease-in-out infinite}
@keyframes stp{50%{transform:scale(1.04)}}
.s-lock{background:#efe9e4;border-color:#b9a69a;color:#5c4a3e}
.s-ok{background:#e6ffe9;border-color:#4dbb66;color:#14682b}
.s-info{background:#e6f1ff;border-color:#6fa8ff;color:#1d4fa8}
.s-soft{background:#fff0e3;border-color:#f0a060;color:#a4501a}
/* badges: name = mark, lock */
.badge .eq{font-size:18px;font-weight:800;color:#8a5a2a}
.badge.mx{border-color:#9cc3ff}.badge.mo{border-color:#ffb3d6}
.badge .pc{height:34px;width:34px}
.badge .lk{display:none;font-size:18px}
.badge.locked{filter:grayscale(.6);opacity:.85}.badge.locked .lk{display:inline}
.panel{position:relative}
.panel.locked .tiles{position:relative;filter:grayscale(.85) opacity(.7)}
.panel.locked .tiles::after{content:"🔒";position:absolute;left:50%;top:0;transform:translate(-50%,-62%);font-size:22px;background:rgba(255,255,255,.95);border-radius:50%;width:38px;height:38px;display:flex;align-items:center;justify-content:center;box-shadow:0 3px 10px rgba(0,0,0,.3);filter:none;z-index:2}
/* board: pulse in the placing player's colour */
.board.pl-x{--pc:rgba(47,124,255,.95)}.board.pl-o{--pc:rgba(255,90,165,.95)}
.board.placing .cell:not(.full){animation:freep 1.1s ease-in-out infinite}
@keyframes freep{50%{box-shadow:inset 0 7px 12px rgba(90,50,15,.55),0 0 0 4px var(--pc),0 0 18px var(--pc)}}
/* banners over the board */
.board-wrap{position:relative}
.g-banner{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:30;width:min(92vw,420px);display:flex;flex-direction:column;gap:10px;pointer-events:none;animation:bnin .4s cubic-bezier(.3,1.5,.5,1)}
.g-banner.out{animation:bnout .4s forwards}
@keyframes bnin{from{transform:translate(-50%,-50%) scale(.5);opacity:0}}
@keyframes bnout{to{transform:translate(-50%,-50%) scale(.85);opacity:0}}
.bn-in{background:rgba(255,253,245,.97);border-radius:24px;padding:12px 14px;text-align:center;box-shadow:0 10px 30px rgba(0,0,0,.4);border:4px solid #ffb300}
.bn-in.flip{transform:rotate(180deg)}
.g-banner.cx .bn-in{border-color:#2f7cff}.g-banner.co .bn-in{border-color:#ff5aa5}
.g-banner.reveal .bn-in{border-color:#6fa8ff}
.bn-h{font-size:26px;font-weight:800;color:#5a3200;line-height:1.35;display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap}
.g-banner.cx .bn-h{color:#1546a8}.g-banner.co .bn-h{color:#b01f69}
.bn-h .spc{height:40px;width:40px;object-fit:contain}
.bn-h b{background:#e6ffe9;color:#14682b;border-radius:12px;padding:0 12px;font-size:32px}
.bn-s{font-size:18px;font-weight:700;color:#6b3a10;margin-top:4px;line-height:1.4}
.g-banner.two .bn-h{font-size:22px}.g-banner.two .bn-s{font-size:16px}
.who-row.in-bn{margin:8px 0 0}.who-row.in-bn .who{font-size:18px}

/* v3: title never covers the characters — sits on the parchment card (right), compact */
#s-title .t-head{left:auto;right:2.5vw;width:62%;top:calc(var(--sat) + 1.6vh)}
#s-title .t-world{font-size:13px;padding:2px 12px 4px;margin-bottom:3px}
#s-title .t-title{font-size:min(9.2vw,42px);line-height:1.1;-webkit-text-stroke:1.5px #6b3a10;text-shadow:0 3px 0 #6b3a10,0 6px 12px rgba(0,0,0,.4)}
@media (min-aspect-ratio:4/5){
  #s-title::before{content:"";position:absolute;inset:-30px;background:url("img/scene/el-plate.webp?v=1") center/cover;filter:blur(16px) brightness(.9)}
  #s-title .splash{object-fit:contain;object-position:50% 50%}
  #s-title .splash-fade{display:none}
  #s-title .t-head{right:2vw;width:calc(50vw - 28.1vh - 3vw);top:18vh}
  #s-title .t-title{font-size:min(4.2vw,40px)}
  #s-title #t-start{margin-bottom:6vh}
}
