/* כל הזכויות שמורות לאושרת רון – הקשר המונטסורי
   חברים של עשר – עיצוב. שלוש פריסות: טלפון (עד 767px, עמודה אחת), אייפד (768–1099px), מחשב ואייפד לרוחב (שתי עמודות:
   ההמחשה גדולה בצד אחד, התרגיל והמספרים בצד השני). צבעים במשתנים, עם מצב לילה לפי הגדרת המכשיר. */
.he { --red:#e9503f; --red-d:#b5301f; --yel:#ffc83d; --yel-d:#8a5a00; --pur:#7a52c7; --blue:#2c63b8; --blue-bg:#e4efff; --green:#1f8a4c;
  --ok:#17703c; --okbg:#e3f6ea; --bad:#a8371f; --badbg:#fdebe6; --showbg:#fff3c9; --cell:#fffefb; --frame:#2f2a4a; --gold:#b47a00; --goldbg:#fff4cf;
  display: flex; flex-direction: column; gap: .5rem; flex: 1 1 auto; min-height: 0; }
.he button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
.he button:disabled { cursor: default; }
.he :focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.he [hidden] { display: none !important; }

/* ---- הסרגל: רמזור, שלושת השלבים, הקראה, למבוגר ---- */
.he-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.he-light { display: flex; align-items: center; gap: .4rem; }
.he-light-box { display: grid; gap: 3px; padding: 4px; border-radius: 10px; background: #2b2740; }
.he-lamp { inline-size: 13px; block-size: 13px; border-radius: 50%; background: #5d5870; }
.he-lamp.is-on[data-n="1"] { background: #ff5a4f; box-shadow: 0 0 0 2px #fff, 0 0 8px #ff5a4f; }
.he-lamp.is-on[data-n="2"] { background: #ffc83d; box-shadow: 0 0 0 2px #fff, 0 0 8px #ffc83d; }
.he-lamp.is-on[data-n="3"] { background: #3fcf74; box-shadow: 0 0 0 2px #fff, 0 0 8px #3fcf74; }
.he-light-word { font-weight: 700; font-size: .95rem; min-inline-size: 5.2em; }
.he-tabs { display: flex; gap: .35rem; flex: 1 1 auto; }
.he-tab { display: flex; align-items: center; gap: .4rem; flex: 1 1 0; justify-content: center; min-block-size: 46px; padding: .3rem .6rem; border: 2px solid var(--line); border-radius: 14px; background: var(--card); font-weight: 600; }
.he-tab-n { display: grid; place-items: center; inline-size: 1.7em; block-size: 1.7em; border-radius: 50%; background: var(--card2); font-weight: 800; flex: none; }
.he-tab[aria-selected="true"] { border-color: var(--frame); box-shadow: 0 3px 0 var(--frame); }
.he-tab[data-stage="1"][aria-selected="true"] { background: #ffe1dc; color: #5c1408; }
.he-tab[data-stage="2"][aria-selected="true"] { background: #ffefb8; color: #4d3500; }
.he-tab[data-stage="3"][aria-selected="true"] { background: #d7f5e1; color: #0c4a25; }
.he-tools { display: flex; align-items: center; gap: .5rem; flex: none; }
.he-tab-i { flex: none; }
.he-round { inline-size: 46px; block-size: 46px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); font-size: 1.3rem; flex: none; }
.he-adult-btn { min-block-size: 40px; padding: .2rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--soft); font-size: .9rem; flex: none; }

/* ---- גוף המשימה ---- */
.he-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.he-task { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: .5rem; padding: .7rem; border-radius: 22px; background: var(--card); border: 2px solid var(--line); box-shadow: 0 6px 18px rgba(60, 50, 110, .08); }
.he[data-stage="1"] .he-task { border-color: #f5b8ae; }
.he[data-stage="2"] .he-task { border-color: #f1d477; }
.he[data-stage="3"] .he-task { border-color: #e2b23a; background: linear-gradient(180deg, var(--goldbg), var(--card) 45%); }
.he-head { display: flex; align-items: center; gap: .5rem .8rem; flex-wrap: wrap; }
.he-chip { font-size: .8rem; color: var(--soft); background: var(--card2); border-radius: 999px; padding: .15rem .7rem; white-space: nowrap; }
.he-instr { margin: 0; font-size: clamp(1.05rem, 2.2vw, 1.4rem); font-weight: 600; line-height: 1.35; }
.he-work { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .7rem; align-content: start; }
.he-vis { display: grid; place-items: center; gap: .5rem; min-width: 0; }
.he-side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; min-width: 0; }
.he-row { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; align-items: center; }
.he-live, .he-msg { margin: 0; text-align: center; font-size: clamp(1.05rem, 2.3vw, 1.45rem); min-block-size: 1.5em; }
.he-rule { margin: 0; padding: .5rem .8rem; border-radius: 14px; background: var(--showbg); color: #4a3600; font-weight: 600; font-size: clamp(1rem, 2vw, 1.25rem); }
.he-msg.is-ok { color: var(--ok); font-weight: 700; }
.he-msg.is-bad { color: var(--bad); background: var(--badbg); border-radius: 12px; padding: .3rem .7rem; font-weight: 600; }
.he-msg.is-show { color: #4a3600; background: var(--showbg); border-radius: 12px; padding: .3rem .7rem; }
.he-msg s { color: var(--bad); }

.he-btn { min-block-size: 48px; padding: .4rem 1.1rem; border-radius: 14px; border: 2px solid var(--frame); background: var(--card); font-weight: 700; font-size: 1.1rem; box-shadow: 0 3px 0 var(--frame); }
.he-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--frame); }
.he-btn.is-main { background: var(--blue); border-color: #173a73; color: #fff; box-shadow: 0 3px 0 #173a73; font-size: 1.25rem; padding-inline: 1.6rem; }
.he-btn.is-small { min-block-size: 44px; font-size: .95rem; padding: .2rem .8rem; box-shadow: none; border-width: 1px; font-weight: 600; }
.he-btn:disabled { opacity: .45; }

/* ---- התרגיל ---- */
.he-eq { display: flex; align-items: center; justify-content: center; gap: .18em; font-size: clamp(2.3rem, 9vw, 4.6rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.he-eq.is-small { font-size: clamp(1.6rem, 5vw, 2.6rem); }
.he-n.is-g { color: var(--red-d); }
.he-n.is-m { color: var(--yel-d); }
.he-o { color: var(--soft); font-weight: 600; }
.he-box { display: grid; place-items: center; min-inline-size: 1.25em; block-size: 1.25em; padding-inline: .1em; border: .07em dashed var(--blue); border-radius: .2em; background: var(--blue-bg); color: var(--blue); }
.he-box.is-ok { border-style: solid; border-color: var(--ok); background: var(--okbg); color: var(--ok); }
.he-box.is-show { border-style: solid; border-color: var(--gold); background: var(--showbg); color: #4a3600; }

/* ---- לוח עשר המשבצות ---- */
.he-frame { display: grid; grid-template-columns: repeat(5, 1fr); inline-size: min(100%, 105dvh); aspect-ratio: 5 / 2; border: 4px solid var(--frame); border-radius: 14px; background: var(--frame); gap: 4px; overflow: hidden; }
.he-cell { display: grid; place-items: center; padding: 0; border: 0; background: var(--cell); min-width: 0; min-height: 0; }
button.he-cell[data-s="e"]:hover { background: #fff6d6; }
.he-dot { display: grid; place-items: center; inline-size: 74%; aspect-ratio: 1; border-radius: 50%; font-weight: 800; font-size: clamp(.9rem, 3.2vw, 2rem); line-height: 1; }
.he-cell[data-s="g"] .he-dot { background: radial-gradient(circle at 35% 30%, #ff8a7a, var(--red) 60%, var(--red-d)); box-shadow: 0 3px 6px rgba(0, 0, 0, .25); }
.he-cell[data-s="m"] .he-dot { background: radial-gradient(circle at 35% 30%, #fff0a8, var(--yel) 60%, #e0a300); box-shadow: inset 0 0 0 .22em rgba(255, 255, 255, .75), 0 3px 6px rgba(0, 0, 0, .22); color: #3d2a00; animation: he-pop .25s ease-out; }
.he-cell[data-s="e"] .he-dot { border: 3px dashed #c9c3dc; color: #6a6480; }
.he-frame.is-mini { border-width: 2px; gap: 2px; border-radius: 6px; inline-size: 100%; }
.he-frame.is-mini .he-cell[data-s="e"] .he-dot { border: 0; }
.he-frame.is-mini .he-dot { box-shadow: none !important; inline-size: 70%; }
@keyframes he-pop { from { transform: scale(.4); } to { transform: scale(1); } }

/* ---- ישר המספרים ---- */
.he-line { inline-size: 100%; }
.he-line-svg { display: block; inline-size: 100%; block-size: auto; }
.he-axis { stroke: var(--frame); stroke-width: 6; stroke-linecap: round; }
.he-tick line { stroke: var(--frame); stroke-width: 5; stroke-linecap: round; }
.he-tick circle { fill: var(--cell); stroke: var(--frame); stroke-width: 3; }
.he-tick text { font: 800 54px "Rubik", system-ui, sans-serif; fill: var(--ink); }
.he-tick.he-from circle { fill: #ffd9d3; stroke: var(--red-d); }
.he-tick.he-ten circle { fill: #d7f5e1; stroke: var(--green); stroke-width: 5; }
.he-learn .he-tick { cursor: pointer; }
.he-hop path { fill: none; stroke: var(--pur); stroke-width: 7; stroke-linecap: round; }
.he-hop text { font: 800 44px "Rubik", system-ui, sans-serif; fill: var(--pur); }
.he-ghost path { fill: none; stroke: #b9b2d2; stroke-width: 5; stroke-dasharray: 10 10; stroke-linecap: round; }
.he-frog { font-size: 72px; }

/* ---- שרשרת החרוזים והענן ---- */
.he-string { position: relative; display: grid; grid-template-columns: repeat(10, 1fr); inline-size: 100%; align-items: center; }
.he-string::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: 50%; block-size: 5px; margin-block-start: -2.5px; background: var(--frame); border-radius: 3px; }
.he-bead { position: relative; grid-row: 1; justify-self: center; display: grid; place-items: center; inline-size: 86%; aspect-ratio: 1; border-radius: 50%; font-weight: 800; font-size: clamp(.8rem, 2.6vw, 1.7rem); color: #3d2a00; }
.he-bead[data-s="g"] { background: radial-gradient(circle at 35% 30%, #c3a6ff, var(--pur) 60%, #4d2e94); box-shadow: 0 3px 6px rgba(0, 0, 0, .25); }
.he-bead[data-s="h"] { background: radial-gradient(circle at 35% 30%, #fff0a8, var(--yel) 60%, #e0a300); box-shadow: inset 0 0 0 .2em rgba(255, 255, 255, .7), 0 3px 6px rgba(0, 0, 0, .22); }
.he-cloud { position: relative; grid-row: 1; z-index: 2; align-self: stretch; margin: -10px -4px; display: grid; place-items: center; border-radius: 999px; background: #f4f8ff; border: 3px solid #b8c8e6; box-shadow: 0 6px 14px rgba(40, 60, 120, .25); font-size: clamp(1.6rem, 6vw, 3.4rem); transition: opacity .4s; min-block-size: 3rem; }
.he-string.is-hint .he-cloud { opacity: .28; }

/* ---- פנסים, מספרים, שתי אפשרויות ---- */
.he-lanterns { display: flex; gap: 1px; margin-inline-start: auto; direction: ltr; }
.he-lantern { font-size: 1.15rem; filter: grayscale(1); opacity: .35; }
.he-lantern.is-on { filter: none; opacity: 1; }
.he-lantern.is-half { filter: grayscale(.55); opacity: .8; }
.he-lantern.is-off { opacity: .2; }
.he-strip { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: .3rem; inline-size: 100%; max-inline-size: 46rem; }
.he-num { min-block-size: 52px; padding: 0; border-radius: 12px; border: 2px solid var(--frame); background: var(--card); font-weight: 800; font-size: clamp(1.2rem, 3vw, 1.7rem); box-shadow: 0 3px 0 var(--frame); }
.he-num.is-sel { background: var(--blue); border-color: #173a73; color: #fff; box-shadow: 0 3px 0 #173a73; }
.he-num.is-ok { background: var(--okbg); border-color: var(--ok); color: var(--ok); opacity: 1; box-shadow: none; }
.he-num:disabled:not(.is-ok) { opacity: .4; box-shadow: none; }
.he-two { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; inline-size: 100%; }
.he-opt { flex: 1 1 8rem; max-inline-size: 22rem; min-block-size: 72px; padding: .4rem 1rem; border-radius: 18px; border: 3px solid var(--frame); background: var(--card); font-weight: 800; font-size: clamp(1.6rem, 5vw, 2.6rem); box-shadow: 0 4px 0 var(--frame); }
.he-opt.is-ok { background: var(--okbg); border-color: var(--ok); color: var(--ok); }
.he-opt.is-bad { background: var(--badbg); border-color: var(--bad); color: var(--bad); animation: he-shake .4s; }
@keyframes he-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---- מסכי ההקניה ---- */
.he-steps { display: flex; gap: .3rem; }
.he-step { inline-size: 46px; block-size: 46px; border-radius: 50%; border: 2px solid var(--line); background: var(--card2); font-size: 1.25rem; padding: 0; }
.he-step.is-now { border-color: var(--red-d); background: #ffe1dc; box-shadow: 0 0 0 3px #ffd0c8; }
.he-step.is-done { border-color: var(--ok); background: var(--okbg); }

/* ---- תפריט המשחקים ---- */
.he-games { flex: 1 1 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.he-game { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; padding: .8rem .5rem; border-radius: 22px; border: 3px solid var(--frame); box-shadow: 0 5px 0 var(--frame); min-block-size: 8.5rem; }
.he-game[data-game="frame"] { background: #ffe1dc; }
.he-game[data-game="line"] { background: #d9f5e2; }
.he-game[data-game="beads"] { background: #e6dcff; }
.he-game[data-game="match"] { background: #ffefb8; }
.he-game, .he-game span { color: #2b2540; }
.he-game-icon { font-size: clamp(2.4rem, 7vw, 4.2rem); line-height: 1; }
.he-game-title { font-family: "Suez One", "Rubik", serif; font-size: clamp(1.15rem, 2.8vw, 1.7rem); text-align: center; }
.he-game-best { font-size: .9rem; }

/* ---- זוגות חברים ---- */
.he-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; align-content: center; inline-size: 100%; }
.he-card { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .35rem .3rem .45rem; border-radius: 14px; border: 3px solid var(--frame); background: var(--card); box-shadow: 0 4px 0 var(--frame); min-width: 0; transition: opacity .3s, transform .3s; }
.he-card-n { font-weight: 800; font-size: clamp(1.7rem, 5.5vw, 3.2rem); line-height: 1; }
.he-card.is-sel { background: var(--blue-bg); border-color: var(--blue); box-shadow: 0 4px 0 var(--blue); transform: translateY(-4px); }
.he-card.is-bad { animation: he-shake .4s; border-color: var(--bad); }
.he-card.is-gone { opacity: .16; transform: scale(.92); box-shadow: none; }
.he-banner { display: grid; justify-items: center; gap: .4rem; inline-size: 100%; min-block-size: 2rem; }
.he-banner .he-frame { inline-size: min(100%, 20rem); }

/* ---- שלב המומחים ---- */
.he-path { display: flex; gap: .3rem; margin-inline-start: auto; direction: ltr; }
.he-stone { display: grid; place-items: center; inline-size: 2rem; block-size: 2rem; border-radius: 50%; background: #f1e3b4; border: 2px solid #d9b85a; color: #6b4a00; font-weight: 800; font-size: .95rem; }
.he-stone.is-now { background: var(--yel); border-color: var(--gold); box-shadow: 0 0 0 3px #ffe9a3; }
.he-stone.is-star { background: #fff7d6; }
.he-stone.is-miss { background: var(--card2); border-color: var(--line); color: var(--soft); }
.he-trail { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; align-content: center; direction: ltr; max-inline-size: 34rem; }
.he-trail .he-stone { inline-size: clamp(3.2rem, 7vw, 5.2rem); block-size: clamp(3.2rem, 7vw, 5.2rem); font-size: clamp(1.4rem, 3vw, 2.2rem); border-width: 4px; }
.he-trail .he-stone:nth-child(even) { margin-block-start: 1.6rem; }
.he-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; inline-size: min(100%, 17rem); }
.he-key { min-block-size: 54px; border-radius: 14px; border: 2px solid var(--frame); background: var(--card); font-weight: 800; font-size: 1.6rem; box-shadow: 0 3px 0 var(--frame); padding: 0; }
.he-key.is-del { background: var(--card2); font-size: 1.3rem; }
.he-end { align-items: center; justify-content: center; text-align: center; position: relative; overflow: hidden; }
.he-end-icon { font-size: clamp(3.5rem, 12vw, 6.5rem); line-height: 1; }
.he-end h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.he-end-text { margin: 0; font-size: 1.3rem; }
.he-end .he-lanterns { margin: 0; }
.he-end .he-lantern { font-size: 1.8rem; }
.he-stars { margin: 0; font-size: clamp(1.6rem, 5vw, 2.6rem); letter-spacing: .1em; }
.he-confetti i { position: absolute; inset-block-start: -12px; inline-size: 10px; block-size: 16px; border-radius: 3px; animation: he-fall 2.6s linear 2 both; }
@keyframes he-fall { to { transform: translateY(105vh) rotate(540deg); } }

/* ---- מגירת "למבוגר" ---- */
.he-drawer { inline-size: min(46rem, 96vw); max-block-size: 92dvh; margin: auto; padding: 1rem 1.1rem; border: 2px solid var(--frame); border-radius: 18px; background: var(--card); color: var(--ink); font-size: 1rem; overflow: auto; }
.he-drawer::backdrop { background: rgba(30, 25, 60, .5); }
.he-drawer button, .he-drawer select, .he-drawer input { font: inherit; color: inherit; }
.he-ad-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.he-ad-sec { margin-block-start: .9rem; padding-block-start: .7rem; border-block-start: 1px solid var(--line); }
.he-ad-sec h3 { font-size: 1.15rem; margin-block-end: .4rem; }
.he-ad-sec p { margin: 0 0 .5rem; }
.he-ad-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.he-ad-nums { display: flex; flex-wrap: wrap; gap: .3rem; margin-block-end: .6rem; }
.he-ad-nums label { display: flex; align-items: center; gap: .25rem; padding: .25rem .5rem; min-block-size: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--card2); }
.he-ad-check { display: flex; gap: .5rem; align-items: center; min-block-size: 44px; }
.he-ad-note { color: var(--soft); font-size: .92rem; }
.he-drawer select { min-block-size: 44px; border-radius: 10px; border: 1px solid var(--frame); background: var(--card); padding: 0 .5rem; max-inline-size: 100%; }
.he-report { overflow-x: auto; }
.he-report table { border-collapse: collapse; inline-size: 100%; font-size: .92rem; }
.he-report th, .he-report td { border: 1px solid var(--line); padding: .3rem .5rem; text-align: start; vertical-align: top; }
.he-print { display: none; }

/* ---- טלפון ---- */
@media (max-width: 767px) {
  .he { gap: .35rem; }
  .he-bar { gap: .3rem; flex-wrap: nowrap; align-items: stretch; }
  .he-light { align-items: center; }
  .he-light-word { display: none; }
  .he-tabs { gap: .25rem; min-width: 0; }
  .he-tab { display: grid; grid-template-columns: auto auto; justify-content: center; align-content: center; gap: 0 .25rem; min-block-size: 52px; padding: .15rem .2rem; font-size: .78rem; line-height: 1.15; border-radius: 12px; min-width: 0; }
  .he-tab-n { font-size: .78rem; inline-size: 1.5em; block-size: 1.5em; }
  .he-tab-t { grid-column: 1 / -1; text-align: center; }
  .he-tools { flex-direction: column; gap: 1px; justify-content: center; }
  .he-round { inline-size: 44px; block-size: 34px; border-radius: 12px; font-size: 1.05rem; }
  .he-adult-btn { min-block-size: 20px; font-size: .68rem; padding: 0 .2rem; border: 0; text-decoration: underline; }
  .he-task { padding: .5rem; border-radius: 16px; gap: .4rem; }
  .he-chip { font-size: .72rem; }
  .he-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .he-num { min-block-size: 48px; }
  .he-lantern { font-size: .9rem; }
  .he-step { inline-size: 44px; block-size: 44px; }
  .he-cards { gap: .3rem; }
  .he-card { padding: .25rem .15rem .3rem; border-width: 2px; border-radius: 10px; }
  .he-stone { inline-size: 1.6rem; block-size: 1.6rem; font-size: .8rem; }
  .he-gold:not(.is-done) .he-vis { display: none; }
  .he-gold.is-done .he-pad { display: none; }
  .he-key { min-block-size: 50px; }
  .he-game { min-block-size: 7.2rem; }
}

/* ---- אייפד לאורך: עמודה אחת, והכול גדול יותר כדי למלא את המסך ---- */
@media (min-width: 768px) and (max-width: 1099px) and (orientation: portrait) {
  .he-work { align-content: center; gap: 2rem; }
  .he-side { gap: 1.2rem; }
  .he-instr { font-size: 1.55rem; }
  .he-frame { inline-size: 100%; }
  .he-eq { font-size: 6.2rem; }
  .he-eq.is-small { font-size: 3.4rem; }
  .he-strip { max-inline-size: none; gap: .45rem; }
  .he-num { min-block-size: 84px; font-size: 2.1rem; border-radius: 16px; }
  .he-btn.is-main { min-block-size: 64px; font-size: 1.6rem; padding-inline: 2.4rem; }
  .he-opt { min-block-size: 110px; font-size: 3.2rem; }
  .he-key { min-block-size: 84px; font-size: 2.2rem; }
  .he-pad { inline-size: min(100%, 28rem); gap: .6rem; }
  .he-gold:not(.is-done) .he-vis { display: none; }
  .he-gold.is-done .he-pad { display: none; }
  .he-cards { gap: .9rem; }
  .he-card { padding: 1.1rem .5rem 1.2rem; gap: .7rem; }
  .he-card-n { font-size: 4.6rem; }
  .he-banner .he-frame { inline-size: min(100%, 30rem); }
  .he-games { gap: 1.2rem; }
  .he-game-icon { font-size: 6rem; }
  .he-game-title { font-size: 2rem; }
  .he-msg, .he-live { font-size: 1.7rem; }
  .he-rule { font-size: 1.4rem; }
  .he-stone { inline-size: 2.6rem; block-size: 2.6rem; font-size: 1.2rem; }
  .he-lantern { font-size: 1.5rem; }
}

/* ---- מחשב ואייפד לרוחב: ההמחשה ממלאת את כל הרוחב והגובה שנשאר, והתרגיל, המספרים והכפתור בשורה אחת מתחתיה ---- */
@media (min-width: 1100px), (min-width: 768px) and (orientation: landscape) {
  .he-work { grid-template-rows: minmax(0, 1fr) auto; align-content: stretch; gap: .7rem; }
  .he-vis { container-type: size; align-content: center; }
  .he-frame { inline-size: min(100cqw, 248cqh); }
  .he-line { inline-size: min(100cqw, 360cqh); }
  .he-play[data-game="line"] .he-vis { grid-template-columns: minmax(0, 1fr) auto; }
  .he-play[data-game="line"] .he-line { inline-size: min(100%, 360cqh); justify-self: center; }
  .he-line-btns { flex-direction: column; }
  .he-string { inline-size: min(100cqw, 620cqh); }
  .he-side { flex-direction: row; flex-wrap: wrap; gap: .5rem 1.6rem; }
  .he-side > .he-btn.is-main { order: 3; }
  .he-msg, .he-live { order: 4; flex: 1 0 100%; }
  .he-rule { order: 5; flex: 0 1 46rem; }
  .he-side > .he-rule ~ .he-btn.is-main { order: 6; }
  .he-strip { flex: 0 1 40rem; max-inline-size: 40rem; }
  .he-num { min-block-size: 56px; }
  .he-two { flex: 0 1 40rem; inline-size: auto; }
  .he-pad { grid-template-columns: repeat(11, minmax(0, 1fr)); flex: 0 1 40rem; inline-size: auto; }
  .he-key { min-block-size: 56px; }
  .he-match .he-cards { container-type: size; block-size: 100%; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .he-match .he-card { justify-content: center; gap: .5rem; }
  .he-match .he-card .he-frame { inline-size: min(88%, 95cqh); }
  .he-match .he-card-n { font-size: clamp(1.7rem, 9cqh, 4rem); }
  .he-banner { display: flex; align-items: center; justify-content: center; gap: 1.2rem; inline-size: auto; min-block-size: 5.6rem; }
  .he-banner .he-frame { inline-size: 13rem; }
  .he-games { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .he-game-icon { font-size: clamp(3rem, 16dvh, 7rem); }
  .he-gold .he-head .he-path { display: none; }
  .he-trail { flex-wrap: nowrap; max-inline-size: none; gap: clamp(.6rem, 2.4cqw, 2.2rem); }
  .he-trail .he-stone { inline-size: clamp(3rem, min(9cqw, 34cqh), 8rem); block-size: clamp(3rem, min(9cqw, 34cqh), 8rem); font-size: clamp(1.3rem, min(4cqw, 15cqh), 3.4rem); }
  .he-trail .he-stone:nth-child(even) { margin-block-start: clamp(1rem, 16cqh, 5rem); }
}
/* ---- מסך רחב ונמוך (מחשב נייד קטן, טלפון לרוחב): הכול מצטמצם כדי שההמחשה תישאר גדולה ---- */
@media (min-width: 768px) and (max-height: 700px) and (orientation: landscape) {
  .he-task { gap: .3rem; padding: .45rem .7rem; }
  .he-instr { font-size: 1.05rem; }
  .he-eq { font-size: 3rem; }
  .he-strip, .he-pad, .he-two { flex-basis: 30rem; }
  .he-num, .he-key { min-block-size: 46px; }
  .he-opt { min-block-size: 56px; font-size: 1.8rem; }
  .he-btn.is-main { min-block-size: 46px; font-size: 1.1rem; }
  .he-msg, .he-live { font-size: 1.05rem; min-block-size: 1.3em; }
  .he-rule { font-size: 1rem; padding: .3rem .7rem; }
  .he-banner { min-block-size: 3.6rem; }
  .he-banner .he-frame { inline-size: 8rem; }
  .he-match .he-card { flex-direction: row; gap: .8rem; }
  .he-match .he-card .he-frame { inline-size: 55%; }
}
@media (max-width: 1099px), (orientation: portrait) { .he-trail { display: none; } }

@media (prefers-reduced-motion: reduce) { .he *, .he-confetti i { animation: none !important; transition: none !important; } }

/* ---- מצב לילה ---- */
@media (prefers-color-scheme: dark) {
  .he { --cell: #35314f; --frame: #cfc8ee; --blue: #9ec1ff; --blue-bg: #25324f; --ok: #7be0a2; --okbg: #1d3a2a; --bad: #ffb0a0; --badbg: #4a2019; --showbg: #4a3a10; --goldbg: #3a2f12; --red-d: #ff9a8c; --yel-d: #ffd76a; --pur: #b69cff; --green: #5fd68c; --gold: #f0c04a; }
  .he-rule, .he-msg.is-show, .he-box.is-show { color: #ffe9a8; }
  .he-btn.is-main, .he-num.is-sel { background: #2c63b8; border-color: #9ec1ff; color: #fff; box-shadow: 0 3px 0 #9ec1ff; }
  .he-tab[data-stage="1"][aria-selected="true"] { background: #5a231b; color: #ffe1dc; }
  .he-tab[data-stage="2"][aria-selected="true"] { background: #4d3d0c; color: #ffefb8; }
  .he-tab[data-stage="3"][aria-selected="true"] { background: #173f28; color: #d7f5e1; }
  .he-step.is-now { background: #5a231b; }
  .he-tick.he-from circle { fill: #5a231b; }
  .he-tick.he-ten circle { fill: #173f28; }
  .he-cloud { background: #dfe8fb; }
  .he-stone { background: #4d3d0c; color: #ffe9a8; }
  .he-stone.is-now { color: #3d2a00; }
  .he-opt.is-ok, .he-num.is-ok { color: var(--ok); }
}

/* ---- הדפסת הדוח ---- */
@media print {
  body.he-printing > *:not(.he-print) { display: none !important; }
  body.he-printing { background: #fff; }
  .he-print { display: block; color: #000; font-size: 12pt; padding: 0; }
  .he-print h1 { font-size: 18pt; margin-block-end: 8pt; color: #000; }
  .he-print table { border-collapse: collapse; inline-size: 100%; }
  .he-print th, .he-print td { border: 1px solid #555; padding: 3pt 5pt; text-align: start; }
  .he-credit { margin-block-start: 12pt; font-size: 9pt; }
}
@media (min-width: 1100px), (min-width: 768px) and (orientation: landscape) and (min-height: 701px) { .he-line-btns .he-btn { min-block-size: 60px; font-size: 1.3rem; } }
