/* דמקה · style.css */
@font-face{font-family:'Secular One';src:url(fonts/secular-he.woff2) format('woff2');unicode-range:U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F;font-display:swap}
@font-face{font-family:'Secular One';src:url(fonts/secular-la.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;font-display:swap}
@font-face{font-family:'Heebo';src:url(fonts/heebo-he.woff2) format('woff2');unicode-range:U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F;font-weight:100 900;font-display:swap}
@font-face{font-family:'Heebo';src:url(fonts/heebo-la.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;font-weight:100 900;font-display:swap}
:root{--paper:#F5F0E6;--ink:#14121F;--lime:#B6F03C;--orange:#FF5B2E;--blue:#3B4BFF;--pink:#FF7CC8;--ink2:#24213A;--ink3:#34304F;
 --sat:env(safe-area-inset-top,0px);--sab:env(safe-area-inset-bottom,0px)}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;background:var(--ink);color:var(--paper);font-family:'Heebo',system-ui,sans-serif;overflow:hidden;overscroll-behavior:none;touch-action:manipulation;user-select:none;-webkit-user-select:none}
button{font:inherit;color:inherit;cursor:pointer}
[hidden]{display:none!important}
h1,h2,h3{font-family:'Secular One','Heebo',sans-serif;font-weight:400;margin:0}
bdi{unicode-bidi:isolate}
/* כפתורים */
.btn{display:flex;align-items:center;justify-content:center;gap:.4em;min-height:48px;padding:10px 18px;border-radius:16px;border:2px solid var(--paper);background:transparent;font-weight:700;font-size:17px;transition:transform .08s,background .15s}
.btn:active{transform:scale(.97)}
.btn.big{min-height:56px;font-size:20px;font-family:'Secular One','Heebo',sans-serif;font-weight:400}
.btn.lime{background:var(--lime);border-color:var(--lime);color:var(--ink)}
.btn.ghost{border-color:transparent;opacity:.85}
.btn.back{min-width:48px;padding:0;font-size:22px;border-color:transparent}
.icon-btn{min-width:48px;min-height:48px;border-radius:14px;border:0;background:var(--ink2);font-size:22px}
/* מסכים */
.screen{position:fixed;inset:0;display:flex;flex-direction:column;align-items:center;overflow-y:auto;padding:calc(16px + var(--sat)) 16px calc(16px + var(--sab));background:radial-gradient(120% 80% at 50% 0%,#2A2546 0%,var(--ink) 60%)}
.title-box{width:100%;max-width:420px;margin:auto;display:flex;flex-direction:column;align-items:center;text-align:center}
#logoCv{width:300px;height:120px;max-width:90vw}
.logo{font-size:64px;line-height:1;margin-top:-6px;color:var(--paper);letter-spacing:1px;text-shadow:0 4px 0 var(--orange),0 8px 0 rgba(0,0,0,.35)}
.tag{margin:12px 0 22px;opacity:.85;font-size:17px}
.menu{display:flex;flex-direction:column;gap:12px;width:100%}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.foot{margin-top:22px;opacity:.55;font-size:13px}
.bar{width:100%;max-width:720px;display:grid;grid-template-columns:56px 1fr 56px;align-items:center;margin-bottom:8px}
.bar h2{text-align:center;font-size:26px}
/* עזרה */
.help{max-width:640px;width:100%;display:flex;flex-direction:column;gap:12px;padding-bottom:24px}
.rule{display:flex;gap:14px;align-items:center;background:var(--ink2);border-radius:18px;padding:12px}
.rule p{margin:0;line-height:1.55;font-size:16px}
.rule.plain{display:block}.rule.plain p+p{margin-top:8px}
.mini{width:110px;height:110px;flex:none;border-radius:10px}
.mini.big{width:220px;height:220px}
/* הישגים */
.stats{max-width:560px;width:100%;display:flex;flex-direction:column;gap:12px}
.st-card{background:var(--ink2);border-radius:18px;padding:14px 16px}
.st-card h3{font-size:20px;margin-bottom:8px}
.st-row{display:flex;justify-content:space-between;padding:6px 0;border-bottom:1px solid rgba(245,240,230,.08);font-size:16px}
.st-row:last-child{border:0}
.st-big{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;text-align:center}
.st-big b{display:block;font-family:'Secular One';font-size:30px;color:var(--lime);font-weight:400}
/* מודלים */
.modal{position:fixed;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(10,9,18,.62);backdrop-filter:blur(3px)}
.card-box{width:100%;max-width:420px;max-height:calc(100% - 8px);overflow-y:auto;background:var(--paper);color:var(--ink);border-radius:24px;padding:20px;display:flex;flex-direction:column;gap:12px;box-shadow:0 18px 0 rgba(0,0,0,.25)}
.card-box h2{font-size:28px;text-align:center}
.card-box .btn{border-color:var(--ink)}
.card-box .btn.lime{border-color:var(--ink)}
.card-box .sub{text-align:center;margin:0;opacity:.75}
.field .lbl{font-weight:800;margin-bottom:6px}
.seg{display:flex;gap:6px;background:#E8E0CF;border-radius:16px;padding:4px}
.seg button{flex:1;min-height:46px;border:0;border-radius:12px;background:transparent;font-weight:700;font-size:16px;display:flex;align-items:center;justify-content:center;gap:6px}
.seg button.on{background:var(--ink);color:var(--paper)}
.dot{width:16px;height:16px;border-radius:50%;display:inline-block;box-shadow:inset 0 -3px 0 rgba(0,0,0,.25)}
.dot.o{background:var(--orange)}.dot.b{background:var(--blue)}
.note{margin:6px 2px 0;font-size:14px;opacity:.75;min-height:1.2em}
.toggle{display:flex;align-items:center;gap:10px;min-height:48px;font-weight:700}
.end-btns{display:flex;flex-direction:column;gap:10px;margin-top:4px}
.end-badge{font-size:56px;text-align:center;line-height:1}
#endText{text-align:center;margin:0;font-size:17px}
.end-score{text-align:center;font-weight:800}
.end-score .pts{display:block;font-family:'Secular One';font-size:34px;color:var(--orange);font-weight:400}
.intro{align-items:center;text-align:center}
.intro p{margin:0;font-size:17px;line-height:1.5}
.dots{display:flex;gap:8px;justify-content:center}.dots i{width:9px;height:9px;border-radius:50%;background:#CFC6B3}.dots i.on{background:var(--ink)}
.intro .end-btns{width:100%}
.floating{position:fixed;z-index:15;left:50%;transform:translateX(-50%);bottom:calc(84px + var(--sab));box-shadow:0 6px 0 rgba(0,0,0,.3)}
.floating:active{transform:translateX(-50%) scale(.97)}
/* משחק */
#game{position:fixed;inset:0;display:flex;justify-content:center;gap:24px;padding:calc(6px + var(--sat)) 8px calc(6px + var(--sab));background:radial-gradient(130% 90% at 50% 40%,#29243F 0%,var(--ink) 70%)}
.col{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-width:0}
.pbar{display:flex;align-items:center;gap:8px;width:100%}
.pbar.top{justify-content:space-between}
.chip{display:flex;align-items:center;gap:8px;min-height:44px;padding:4px 12px 4px 10px;border-radius:22px;background:var(--ink2);border:2px solid transparent;transition:border-color .2s,box-shadow .2s;min-width:0}
.chip.turn{border-color:var(--lime);box-shadow:0 0 0 3px rgba(182,240,60,.18)}
.disc{width:22px;height:22px;border-radius:50%;flex:none;box-shadow:inset 0 -4px 0 rgba(0,0,0,.28),inset 0 2px 0 rgba(255,255,255,.25)}
.disc.orange{background:var(--orange)}.disc.blue{background:var(--blue)}
.pname{font-weight:800;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.caps{font-size:14px;opacity:.85;white-space:nowrap}
.status{flex:1;text-align:center;font-weight:800;font-size:16px;color:var(--lime);min-height:1.2em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.status.warn{color:var(--pink)}
#boardWrap{position:relative;flex:none}
#cv{display:block;touch-action:none;border-radius:14px}
.coach{position:absolute;left:8px;right:8px;top:50%;transform:translateY(-50%);background:var(--paper);color:var(--ink);border-radius:14px;padding:10px 14px;font-weight:700;font-size:15px;line-height:1.4;box-shadow:0 6px 0 rgba(0,0,0,.3);pointer-events:none;text-align:center}
.pbar.bottom{justify-content:space-between}
.actions{display:flex;gap:8px}
.act{display:flex;align-items:center;justify-content:center;gap:6px;min-height:48px;min-width:48px;padding:0 14px;border-radius:14px;border:0;background:var(--ink2);font-weight:800;font-size:15px}
.act .ic{font-size:19px}
.act:disabled{opacity:.35;cursor:default}
.act.pulse{box-shadow:0 0 0 3px var(--lime)}
.side{display:none}
.toast{position:fixed;z-index:30;left:50%;top:calc(70px + var(--sat));transform:translateX(-50%);background:var(--pink);color:var(--ink);font-weight:800;padding:10px 18px;border-radius:14px;box-shadow:0 6px 0 rgba(0,0,0,.25);max-width:90vw;text-align:center}
@media (min-width:900px){
 .side{display:flex;flex-direction:column;width:260px;max-height:calc(100vh - 24px);align-self:center;background:var(--ink2);border-radius:20px;padding:16px;gap:10px}
 .side h3{font-size:22px}
 .moves{flex:1;overflow-y:auto;margin:0;padding:0 26px 0 0;font-size:15px;max-height:46vh;direction:rtl}
 .moves li{padding:3px 0;border-bottom:1px solid rgba(245,240,230,.06)}
 .moves li span{display:inline-block;min-width:76px}
 .moves .o{color:#FF8A63}.moves .b{color:#8D98FF}
 .side-stats{font-size:15px;line-height:1.7;opacity:.9}
 .keys{font-size:13px;opacity:.6;margin:0}
 kbd{background:var(--ink3);border-radius:5px;padding:1px 5px;font-family:inherit}
 .pname{font-size:18px}
 .status{font-size:18px}
 .moves{max-height:none}
}

.toggle{position:relative}
.toggle input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.toggle .sw{width:46px;height:28px;border-radius:14px;background:#CFC6B3;position:relative;flex:none;transition:background .15s}
.toggle .sw::after{content:'';position:absolute;top:3px;right:3px;width:22px;height:22px;border-radius:50%;background:#fff;transition:right .15s}
.toggle input:checked+.sw{background:var(--ink)}
.toggle input:checked+.sw::after{right:21px;background:var(--lime)}
.disc.mini{width:13px;height:13px;display:inline-block;vertical-align:-1px;margin-inline-end:3px}

/* 1.1.3: phone landscape — the board was squeezed between the top and bottom bars (about 240px). Now the board takes the full height and the players, status and buttons sit beside it */
body.land #game .col{display:grid;align-self:stretch;grid-template-columns:auto auto;grid-template-rows:auto auto 1fr;grid-template-areas:"board top" "board bot" "board .";align-content:start;padding-top:4px;column-gap:16px;row-gap:10px;align-items:center;justify-items:stretch}
body.land #boardWrap{grid-area:board}
body.land #barTop{grid-area:top;align-self:start;flex-wrap:wrap;row-gap:8px}
body.land #barTop .status{order:3;flex:1 0 100%;white-space:normal;font-size:15px}
body.land #barBot{grid-area:bot;flex-wrap:wrap;row-gap:8px}
body.land #barBot .actions{flex:1 0 100%;justify-content:stretch}
body.land #barBot .act{flex:1}
body.land .coach{left:auto;right:calc(100% + 16px);width:var(--sideW,230px);top:auto;bottom:0;transform:none}

/* 1.1.3: update corner button 44px and hidden during a game; "בדוק עדכון" stays on the title screen */
body .tu-c{width:44px;height:44px;line-height:44px}
body:has(#game:not([hidden])) .tu-c{display:none}
