/* Begin Mah'ar games א–ג — scoped to .bga */
.bga{--bga-navy:#1f3a73;--bga-lime:#8cc63f;--bga-ink:#14213d;--bga-soft:#f4f7fc;--bga-line:#dbe3f0;
  direction:rtl;text-align:right;font-family:inherit;color:var(--bga-ink);background:#fff;border:1px solid var(--bga-line);
  border-radius:22px;padding:clamp(14px,3vw,26px);box-shadow:0 10px 30px rgba(31,58,115,.08);max-width:860px;margin:0 auto;box-sizing:border-box;overflow:hidden}
.bga *,.bga *::before,.bga *::after{box-sizing:border-box}
.bga-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;justify-content:space-between}
.bga-badge{background:var(--bga-lime);color:#17320a;font-weight:700;border-radius:999px;padding:4px 12px;font-size:.85rem}
.bga-title{margin:0;font-size:clamp(1.15rem,3.6vw,1.5rem);color:var(--bga-navy);flex:1 1 220px;line-height:1.5}
.bga-meta{display:flex;gap:10px;font-size:.92rem;font-weight:700;color:var(--bga-navy)}
.bga-score{background:var(--bga-soft);border-radius:999px;padding:3px 10px}
.bga-bar{height:8px;background:var(--bga-soft);border-radius:99px;margin:12px 0 16px;overflow:hidden}
.bga-bar span{display:block;height:100%;background:linear-gradient(90deg,var(--bga-lime),#5fae2f);border-radius:99px;transition:width .4s ease;margin-inline-start:0}
.bga-body{min-height:200px}
.bga-role{display:inline-block;font-size:.85rem;font-weight:700;color:var(--bga-navy);background:#eaf4dc;border-radius:8px;padding:3px 10px;margin-bottom:6px}
.bga-step-title{margin:4px 0 10px;font-size:clamp(1.1rem,3.4vw,1.35rem);color:var(--bga-navy);line-height:1.5;outline:none}
.bga-guide{display:flex;gap:10px;align-items:flex-start;margin:8px 0 14px}
.bga-avatar{width:56px;height:56px;flex:0 0 56px;border-radius:50%;background:var(--bga-soft);object-fit:contain;border:2px solid var(--bga-lime)}
.bga-avatar-fb{display:flex;align-items:center;justify-content:center;font-size:30px}
.bga-bubble{background:var(--bga-soft);border-radius:16px;border-start-start-radius:4px;padding:10px 14px;line-height:1.85;font-size:1.08rem}
.bga-guide-a .bga-bubble{background:#f1f8e8}
.bga-note,.bga-legend{font-size:.95rem;color:#475569;line-height:1.8;margin:6px 0}
.bga-note{background:#fff8e6;border-radius:12px;padding:8px 12px}
.bga-stage{margin:6px 0}
.bga-center{display:flex;justify-content:center;align-items:flex-end;gap:16px;flex-wrap:wrap;margin:6px 0}
.bga-choices{display:grid;gap:10px;margin:10px 0}
.bga-choices.bga-row{grid-template-columns:repeat(auto-fit,minmax(110px,1fr))}
.bga-choices.bga-grid{grid-template-columns:repeat(auto-fit,minmax(130px,1fr))}
.bga-choices.bga-pics{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
.bga-choice{font:inherit;font-size:1.05rem;line-height:1.7;text-align:right;display:flex;flex-direction:column;align-items:center;gap:4px;
  min-height:52px;padding:10px 14px;border:2px solid var(--bga-line);border-radius:16px;background:#fff;color:var(--bga-ink);cursor:pointer;
  transition:transform .12s,border-color .15s,background .15s;touch-action:manipulation}
.bga-choices:not(.bga-row):not(.bga-grid):not(.bga-pics) .bga-choice{align-items:flex-start}
.bga-choice:hover{border-color:var(--bga-navy)}
.bga-choice:active{transform:scale(.98)}
.bga-choice.bga-sel{border-color:var(--bga-navy);background:#eef3fb;box-shadow:inset 0 0 0 1px var(--bga-navy)}
.bga-choice.bga-right{border-color:#4f9a1f;background:#eef8e3}
.bga-choice.bga-wrong{border-color:#d97706;background:#fff4e5}
.bga-choice:disabled{cursor:default;opacity:1}
.bga-choice svg{max-width:100%;height:auto}
.bga-top{width:min(240px,100%);height:auto}
.bga-raft{width:min(420px,100%);height:auto;border-radius:14px}
.bga-btn{font:inherit;font-weight:700;font-size:1.02rem;min-height:48px;padding:10px 20px;border-radius:14px;border:2px solid transparent;cursor:pointer;touch-action:manipulation}
.bga-primary{background:var(--bga-navy);color:#fff}
.bga-primary:disabled{background:#9aa9c4;cursor:not-allowed}
.bga-next{background:var(--bga-lime);color:#17320a}
.bga-secondary{background:#fff;border-color:var(--bga-navy);color:var(--bga-navy)}
.bga-secondary:disabled{opacity:.5}
.bga-ghost{background:transparent;color:var(--bga-navy);border-color:var(--bga-line);font-size:.92rem;min-height:42px}
.bga-btn:focus-visible,.bga-choice:focus-visible,.bga-mini:focus-visible,.bga-range:focus-visible{outline:3px solid #f59e0b;outline-offset:2px}
.bga-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}
.bga-foot{margin-top:16px;border-top:1px dashed var(--bga-line);padding-top:10px;display:flex;justify-content:flex-start}
.bga-feedback{margin-top:10px;line-height:1.85;border-radius:14px;font-size:1.02rem}
.bga-feedback:empty{display:none}
.bga-feedback.bga-good,.bga-feedback.bga-mid,.bga-feedback.bga-try{padding:10px 14px}
.bga-good{background:#eef8e3;border-inline-start:5px solid #4f9a1f}
.bga-mid{background:#eef3fb;border-inline-start:5px solid var(--bga-navy)}
.bga-try{background:#fff4e5;border-inline-start:5px solid #d97706}
.bga-sort{list-style:none;padding:0;margin:8px 0;display:grid;gap:8px}
.bga-sort-item{display:grid;grid-template-columns:auto auto 1fr auto auto auto;align-items:center;gap:8px;border:1px solid var(--bga-line);border-radius:14px;padding:6px 10px;background:#fff}
.bga-pos{width:28px;height:28px;border-radius:50%;background:var(--bga-navy);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700}
.bga-fname{font-weight:700;font-size:1.05rem}
.bga-val{font-weight:700;color:var(--bga-navy);white-space:nowrap}
.bga-arrows{display:flex;flex-direction:column;gap:4px}
.bga-mini{font:inherit;font-weight:700;min-width:44px;min-height:40px;border-radius:10px;border:2px solid var(--bga-line);background:#fff;color:var(--bga-navy);cursor:pointer;touch-action:manipulation}
.bga-mini:disabled{opacity:.35;cursor:default}
.bga-bottles{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}
.bga-mini-fig{margin:0;text-align:center;font-size:.85rem}
.bga-count{text-align:center;font-weight:700;font-size:1.1rem;color:var(--bga-navy);margin:6px 0}
.bga-range-wrap{display:flex;align-items:center;gap:8px;justify-content:center;flex-wrap:wrap}
.bga-range-row{display:flex;align-items:center;gap:8px;flex:1 1 200px;max-width:420px;direction:ltr}
.bga-range{flex:1;accent-color:var(--bga-navy);height:36px;min-width:120px}
.bga-split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:14px;align-items:start}
.bga-floors{list-style:none;padding:0;margin:6px 0;display:grid;gap:6px}
.bga-floor{display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--bga-line);border-radius:12px;padding:6px 10px}
.bga-floor-lab{font-size:.95rem;line-height:1.6}
.bga-rot{min-height:44px;padding:6px 12px;white-space:nowrap}
.bga-end{text-align:center}
.bga-end .bga-guide{text-align:right}
.bga-stars{font-size:2.6rem;color:#f5b301;letter-spacing:6px}
.bga-roles-recap{text-align:right;line-height:1.9;padding-inline-start:1.2em;margin:10px auto;max-width:560px}
.bga-locked .bga-choice:not(.bga-right):not(.bga-wrong){opacity:.75}
.bga-juice{transition:height .3s}
@media (max-width:560px){
  .bga-split{grid-template-columns:1fr}
  .bga-sort-item{grid-template-columns:auto auto 1fr auto;grid-template-areas:none}
  .bga-sort-item .bga-bottle{display:none}
  .bga-bubble{font-size:1rem}
}
@media (prefers-reduced-motion:reduce){.bga *{transition:none!important}}

/* בגין המח"ר – משחקי כיתות ד׳–ו׳ (games-def). Scoped under .gdef */
.gdef{--gd-navy:#1f3a73;--gd-navy2:#2b4f96;--gd-lime:#8cc63f;--gd-lime2:#6fa52a;--gd-ink:#1b2333;--gd-soft:#f4f8ee;--gd-line:#d9e2ef;--gd-red:#c0392b;--gd-amber:#e6a817;
  direction:rtl;font-family:inherit;color:var(--gd-ink);background:#fff;border:2px solid var(--gd-line);border-radius:20px;padding:clamp(14px,3vw,26px);box-shadow:0 10px 30px rgba(31,58,115,.08);max-width:900px;margin:1.5rem auto;line-height:1.6}
.gdef *{box-sizing:border-box}
.gdef-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.gdef-title{margin:0;font-size:clamp(1.25rem,3.4vw,1.7rem);color:var(--gd-navy)}
.gdef-score{background:var(--gd-navy);color:#fff;border-radius:999px;padding:6px 16px;font-weight:700;white-space:nowrap}
.gdef-progress{display:flex;gap:6px;margin:4px 0 16px}
.gdef-dot{flex:1;height:8px;border-radius:8px;background:var(--gd-line)}
.gdef-dot.is-done{background:var(--gd-lime)}
.gdef-dot.is-now{background:var(--gd-navy2)}
.gdef-intro{background:var(--gd-soft);border-radius:14px;padding:12px 16px;margin-bottom:14px}
.gdef-step h4{margin:.2rem 0 .5rem;color:var(--gd-navy);font-size:1.15rem}
.gdef-step p{margin:.35rem 0}
.gdef-note{font-size:.9rem;color:#4a5568;background:#fff8e6;border-inline-start:4px solid var(--gd-amber);padding:6px 10px;border-radius:8px;margin:.6rem 0}
.gdef-opts{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin:10px 0}
.gdef-btn{font:inherit;font-weight:600;min-height:48px;padding:10px 14px;border-radius:14px;border:2px solid var(--gd-navy);background:#fff;color:var(--gd-navy);cursor:pointer;touch-action:manipulation;transition:background .15s,transform .1s}
.gdef-btn:hover{background:#eef3fb}
.gdef-btn:active{transform:scale(.97)}
.gdef-btn:focus-visible,.gdef input:focus-visible,.gdef select:focus-visible{outline:3px solid var(--gd-lime);outline-offset:2px}
.gdef-btn[aria-pressed="true"]{background:var(--gd-navy);color:#fff}
.gdef-btn.is-right{background:var(--gd-lime);border-color:var(--gd-lime2);color:#13250a}
.gdef-btn.is-wrong{background:#fdecea;border-color:var(--gd-red);color:var(--gd-red)}
.gdef-btn:disabled{cursor:default;opacity:.85}
.gdef-primary{background:var(--gd-navy);color:#fff}
.gdef-primary:hover{background:var(--gd-navy2)}
.gdef-go{background:var(--gd-lime);border-color:var(--gd-lime2);color:#13250a}
.gdef-go:hover{background:#9fd357}
.gdef-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:10px 0}
.gdef label{font-weight:600}
.gdef input[type=number],.gdef select{font:inherit;min-height:44px;padding:6px 10px;border:2px solid var(--gd-line);border-radius:10px;width:9.5em;direction:ltr;text-align:center}
.gdef input[type=range]{width:min(100%,360px);accent-color:var(--gd-navy);min-height:36px}
.gdef-stage{background:#f8fafc;border:1px solid var(--gd-line);border-radius:14px;padding:10px;margin:10px 0;overflow:hidden}
.gdef-stage svg{display:block;width:100%;height:auto;max-height:340px}
.gdef-table{width:100%;border-collapse:collapse;margin:8px 0;font-size:.95rem}
.gdef-table th,.gdef-table td{border:1px solid var(--gd-line);padding:6px 8px;text-align:center}
.gdef-table th{background:var(--gd-navy);color:#fff}
.gdef-table tr.is-best td{background:#eaf6db;font-weight:700}
.gdef-meter{height:18px;border-radius:9px;background:var(--gd-line);overflow:hidden;margin:6px 0}
.gdef-meter>span{display:block;height:100%;background:linear-gradient(90deg,var(--gd-lime2),var(--gd-lime));transition:width .25s}
.gdef-say{display:flex;gap:10px;align-items:flex-start;margin:12px 0}
.gdef-ava{flex:0 0 44px;height:44px;border-radius:50%;display:grid;place-items:center;font-size:1.5rem;background:var(--gd-soft);border:2px solid var(--gd-lime)}
.gdef-bubble{background:#eef3fb;border-radius:16px;border-start-start-radius:4px;padding:10px 14px;flex:1}
.gdef-bubble b{color:var(--gd-navy)}
.gdef-bubble.is-good{background:#eaf6db}
.gdef-bubble.is-mid{background:#fff6dd}
.gdef-roles{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:6px;margin:8px 0;font-size:.9rem}
.gdef-roles div{background:#fff;border:1px solid var(--gd-line);border-radius:10px;padding:6px 8px}
.gdef-chips{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}
.gdef-chip{font:inherit;min-height:44px;padding:8px 12px;border-radius:999px;border:2px dashed var(--gd-navy2);background:#fff;color:var(--gd-navy);cursor:pointer}
.gdef-chip:disabled{opacity:.35;cursor:default}
.gdef-stack{list-style:none;padding:0;margin:8px 0;display:flex;flex-direction:column-reverse;gap:4px}
.gdef-stack li{padding:8px 12px;border-radius:8px;color:#fff;font-weight:600;text-align:center}
.gdef-final{text-align:center;padding:10px}
.gdef-final .gdef-big{font-size:clamp(2.4rem,9vw,3.6rem);font-weight:800;color:var(--gd-navy);line-height:1.1}
.gdef-stars{font-size:2rem;letter-spacing:4px}
.gdef-actions{display:flex;flex-wrap:wrap;gap:10px;justify-content:flex-start;margin-top:12px}
.gdef-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.gdef-ltr{direction:ltr;unicode-bidi:isolate;display:inline-block}
@media (prefers-reduced-motion:reduce){.gdef *{transition:none!important}}
@media print{.gdef-btn,.gdef-actions{display:none}}
