:root {
  --navy: #14213d; --navy2: #1d2f57; --ink: #0d1626;
  --gold: #f2b818; --gold2: #ffd95a; --goldD: #a57712;
  --blue: #2c62d6; --blue2: #4f8dff; --green: #2fb37a; --green2: #5ee0a0;
  --red: #e63946; --cream: #fff8e1; --paper: #fdf3d7;
  --grass: #7cc65a; --text: #fff;
  --shadow: 0 6px 0 rgba(0,0,0,.28);
  --font: 'Rubik', 'Arial Hebrew', Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0f1b33; color: var(--text); font-family: var(--font); user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
button { font-family: inherit; cursor: pointer; border: 0; }
.ico { display: inline-flex; width: 1.4em; height: 1.4em; vertical-align: middle; }
.ico svg { width: 100%; height: 100%; }
.en, [dir=ltr] { direction: ltr; unicode-bidi: isolate; }

/* ---------- כפתורים ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .45em; padding: .7em 1.4em; border-radius: 16px; font-weight: 900; font-size: 1.05rem; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35); background: linear-gradient(#5ee0a0, #22985f); border: 3px solid #0e4d30; box-shadow: 0 5px 0 #0e4d30, inset 0 2px 0 rgba(255,255,255,.45); transition: transform .08s; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #0e4d30, inset 0 2px 0 rgba(255,255,255,.45); }
.btn.gold { background: linear-gradient(#ffe27a, #f0a90c); border-color: #7a5208; box-shadow: 0 5px 0 #7a5208, inset 0 2px 0 rgba(255,255,255,.6); color: #4a2c00; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.btn.blue { background: linear-gradient(#6fa3ff, #2c62d6); border-color: #12306e; box-shadow: 0 5px 0 #12306e, inset 0 2px 0 rgba(255,255,255,.45); }
.btn.red { background: linear-gradient(#ff7a85, #c9182a); border-color: #6b0612; box-shadow: 0 5px 0 #6b0612, inset 0 2px 0 rgba(255,255,255,.45); }
.btn.ghost { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); box-shadow: none; }
.btn[disabled] { filter: grayscale(.9) brightness(.85); pointer-events: none; }
.btn.big { font-size: 1.35rem; padding: .8em 1.8em; border-radius: 20px; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0 0 auto 0; z-index: 40; display: flex; align-items: center; gap: 8px; padding: 8px 10px 14px; background: linear-gradient(rgba(10,18,36,.92), rgba(10,18,36,0)); pointer-events: none; }
#hud > * { pointer-events: auto; }
.hud-av { position: relative; width: 50px; height: 50px; border-radius: 50%; background: radial-gradient(circle at 50% 30%, #6fa3ff, #1d3f8f); border: 3px solid var(--gold); overflow: hidden; flex: 0 0 auto; box-shadow: var(--shadow); }
.hud-av .char, .hud-av .char-sprite { width: 120%; height: 120%; margin: -2px 0 0 -10%; }
.hud-lv { position: absolute; bottom: -2px; left: -4px; z-index: 2; background: var(--gold); color: #4a2c00; font-weight: 900; font-size: .78rem; border: 2px solid #7a5208; border-radius: 10px; padding: 0 5px; }
.hud-lvwrap { position: relative; }
.hud-res { display: flex; gap: 6px; flex: 1; justify-content: center; flex-wrap: nowrap; }
.pill { display: flex; align-items: center; gap: 5px; min-width: 0; background: rgba(5,12,28,.75); border: 2px solid rgba(255,255,255,.18); border-radius: 999px; padding: 3px 10px 3px 4px; font-weight: 800; font-size: .95rem; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.pill .ico { width: 1.6em; height: 1.6em; }
.pill.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.22); } }
.hud-btn { width: 40px; height: 40px; border-radius: 12px; background: rgba(5,12,28,.75); border: 2px solid rgba(255,255,255,.2); display: grid; place-items: center; padding: 8px; }
.hud-btn .ico { width: 100%; height: 100%; }

/* ---------- תצוגות ---------- */
.view { position: fixed; inset: 0; display: none; }
.view.active { display: block; }

/* ---------- הקריה (בסיס איזומטרי) ---------- */
#view-base { background: radial-gradient(ellipse at 50% 40%, #3f7f3a, #12301c 75%); }
#base-viewport { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; }
#base-viewport.dragging { cursor: grabbing; }
#base-world { position: absolute; left: 0; top: 0; width: 1600px; height: 1100px; transform-origin: 0 0; will-change: transform; }
#base-world.anim { transition: transform .7s cubic-bezier(.2,.8,.2,1); }
#iso-ground { position: absolute; inset: 0; }
.deco { position: absolute; pointer-events: none; transform: translate(-50%, -88%); }
.deco.late { opacity: 0; transform: translate(-50%, -88%) scale(.2); transition: opacity .8s, transform .8s cubic-bezier(.3,1.6,.5,1); }
.deco.late.on { opacity: 1; transform: translate(-50%, -88%) scale(1); }
.bld { position: absolute; width: 230px; height: 230px; transform: translate(-50%, -82%); cursor: pointer; }
.bld .bld-art { width: 100%; height: 100%; transition: transform .15s; filter: drop-shadow(0 10px 8px rgba(0,0,0,.3)); }
.bld:hover .bld-art { transform: scale(1.03); }
.bld.pressed .bld-art { transform: scale(.95); }
.bld .bld-svg, .bld .bld-sprite { width: 100%; height: 100%; object-fit: contain; }
.bld-name { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); white-space: nowrap; background: rgba(10,18,36,.82); border: 2px solid var(--gold); border-radius: 12px; padding: 3px 10px; font-weight: 800; font-size: .9rem; }
.bld-name b { color: var(--gold2); margin-inline-start: 4px; }
.bld.building .bld-art { animation: shakeBuild .5s infinite; }
@keyframes shakeBuild { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-1deg) translateY(-1px); } 75% { transform: rotate(1deg); } }
.bld-timer { position: absolute; left: 50%; top: 4px; transform: translateX(-50%); width: 150px; display: none; }
.bld.building .bld-timer { display: block; }
.bar { height: 16px; border-radius: 10px; background: rgba(0,0,0,.55); border: 2px solid #fff; overflow: hidden; position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(#ffe27a, #f0a90c); transition: width .25s linear; }
[dir=rtl] .bar > i { left: auto; right: 0; }
.bar > span { position: absolute; inset: 0; text-align: center; font-size: .72rem; font-weight: 900; line-height: 12px; text-shadow: 0 1px 2px #000; }
.collect { position: absolute; left: 50%; top: -10px; width: 64px; height: 64px; margin-left: -32px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #fff, #ffe9a8 60%, #f2b818); border: 3px solid #7a5208; display: none; place-items: center; padding: 10px; box-shadow: 0 0 0 6px rgba(255,217,90,.35), 0 8px 0 rgba(0,0,0,.25); animation: floaty 1.4s ease-in-out infinite; z-index: 3; }
.collect .ico { width: 100%; height: 100%; }
.collect.on { display: grid; }
.collect .amt { position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%); background: var(--navy); border: 2px solid var(--gold); border-radius: 10px; padding: 0 6px; font-size: .78rem; font-weight: 900; color: #fff; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.bld.locked { filter: grayscale(.8) brightness(.7); }
.red-dot { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; border-radius: 11px; background: #ff2d3f; border: 2.5px solid #fff; color: #fff; font-size: .75rem; font-weight: 900; display: none; place-items: center; padding: 0 4px; animation: dotBounce 1s ease-in-out infinite; z-index: 5; box-shadow: 0 2px 4px rgba(0,0,0,.4); }
.red-dot.on { display: grid; }
@keyframes dotBounce { 0%,100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-5px) scale(1.12); } 60% { transform: translateY(0) scale(.95); } }
.bld > .red-dot { top: 40px; right: 30px; }
.target-ring { position: absolute; left: 50%; top: 58%; width: 200px; height: 100px; margin: -50px 0 0 -100px; border-radius: 50%; border: 4px solid var(--gold2); box-shadow: 0 0 24px var(--gold2); animation: ring 1.1s ease-out infinite; pointer-events: none; display: none; }
.bld.target .target-ring { display: block; }
@keyframes ring { 0% { transform: scale(.7); opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }

/* ערפל השכחה */
#fog { position: absolute; left: 800px; top: 520px; width: 0; height: 0; pointer-events: none; z-index: 5000; }
.fog-ring { position: absolute; left: -2200px; top: -1600px; width: 4400px; height: 3200px; transform: scale(var(--fog, 1)); transition: transform 2.4s cubic-bezier(.3,.7,.2,1); }
.fog-ring::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(200,210,230,0) 9%, rgba(200,210,230,.55) 11.5%, rgba(214,222,238,.97) 14%, #d6deee 100%); }
.puff { position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(240,244,252,.95) 0, rgba(225,232,245,.75) 45%, rgba(225,232,245,0) 70%); animation: drift var(--d, 9s) ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate(-18px, 6px) scale(1); } to { transform: translate(18px, -8px) scale(1.12); } }
.fog-label { position: absolute; transform: translate(-50%, -50%); color: #5a6b8a; font-weight: 900; font-size: 1.3rem; letter-spacing: .02em; opacity: .9; text-shadow: 0 1px 0 #fff; white-space: nowrap; }

/* ---------- טאבים ---------- */
#tabs { position: fixed; left: 12px; bottom: calc(92px + var(--safe-b)); z-index: 45; display: flex; flex-direction: column; gap: 10px; }
.tab { position: relative; width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(#2a4685, #14244a); border: 3px solid #0a1530; box-shadow: 0 5px 0 #0a1530, inset 0 2px 0 rgba(255,255,255,.25); display: grid; place-items: center; padding: 6px 6px 16px; }
.tab .ico { width: 34px; height: 34px; }
.tab small { position: absolute; bottom: 3px; left: 0; right: 0; text-align: center; font-size: .66rem; font-weight: 800; }
.tab.active { background: linear-gradient(#ffe27a, #f0a90c); border-color: #7a5208; box-shadow: 0 5px 0 #7a5208; color: #4a2c00; }

/* ---------- המצפן ---------- */
#compass { position: fixed; z-index: 46; left: 50%; bottom: calc(12px + var(--safe-b)); transform: translateX(-50%); width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 14px; background: linear-gradient(#24407e, #14244a); border: 3px solid var(--gold); border-radius: 20px; box-shadow: 0 6px 0 #7a5208, 0 0 0 0 rgba(255,217,90,.6); color: #fff; text-align: start; animation: compassGlow 2s ease-in-out infinite; }
#compass:active { transform: translateX(-50%) translateY(3px); }
@keyframes compassGlow { 50% { box-shadow: 0 6px 0 #7a5208, 0 0 22px 4px rgba(255,217,90,.55); } }
#compass .c-ico { width: 44px; height: 44px; flex: 0 0 auto; animation: spinSlow 6s linear infinite; }
#compass .c-ico .ico { width: 100%; height: 100%; }
@keyframes spinSlow { 0%,80% { transform: rotate(0); } 90% { transform: rotate(-20deg); } 100% { transform: rotate(0); } }
.c-body { flex: 1; min-width: 0; }
.c-body > span { display: block; }
.c-kicker { font-size: .7rem; font-weight: 800; color: var(--gold2); letter-spacing: .03em; }
.c-text { font-weight: 900; font-size: 1rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-bar { margin-top: 4px; height: 9px; border-radius: 6px; background: rgba(0,0,0,.45); overflow: hidden; }
.c-bar i { display: block; height: 100%; width: 0; margin-inline-start: 0; background: linear-gradient(90deg, #5ee0a0, #22985f); border-radius: 6px; transition: width .6s cubic-bezier(.3,1.4,.5,1); }
.c-go { flex: 0 0 auto; font-weight: 900; background: var(--gold); color: #4a2c00; border-radius: 12px; padding: 8px 12px; border: 2px solid #7a5208; font-size: .9rem; }
#compass.claim { background: linear-gradient(#ffe27a, #f0a90c); color: #4a2c00; animation: compassGlow 1s infinite, wiggle 1.2s infinite; }
#compass.claim .c-kicker { color: #7a3a00; }
#compass.claim .c-go { background: var(--green); color: #fff; border-color: #0e4d30; }
@keyframes wiggle { 0%,60%,100% { transform: translateX(-50%) rotate(0); } 70% { transform: translateX(-50%) rotate(-1.5deg); } 80% { transform: translateX(-50%) rotate(1.5deg); } 90% { transform: translateX(-50%) rotate(-1deg); } }
#compass .red-dot { top: -9px; right: -6px; }
.hidden-ui #compass, .hidden-ui #tabs { display: none; }

/* ---------- מפת העולם ---------- */
#view-map { background: radial-gradient(ellipse at 50% 0%, #7ec8ff 0, #4a90d9 40%, #1c3f7a 100%); overflow: hidden; }
#map-inner { position: absolute; left: 50%; top: 50%; width: 420px; height: 720px; transform-origin: 50% 50%; }
#map-svg { position: absolute; inset: 0; }
.node { position: absolute; width: 112px; height: 112px; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle at 50% 35%, #fff8e1, #f2d48a 70%, #c9a14a); border: 5px solid #7a5208; box-shadow: 0 8px 0 #5a3c06, 0 0 0 0 rgba(255,217,90,.7); padding: 8px; }
.node .mon, .node .mon-sprite { width: 100%; height: 100%; }
.node.boss { width: 140px; height: 140px; border-color: #6b0612; background: radial-gradient(circle at 50% 35%, #ffd1d6, #e66a77 70%, #8f1a28); box-shadow: 0 8px 0 #4a0410; }
.node.open { animation: nodePulse 1.4s infinite; }
@keyframes nodePulse { 50% { box-shadow: 0 8px 0 #5a3c06, 0 0 0 14px rgba(255,217,90,.0), 0 0 30px 8px rgba(255,217,90,.7); } }
.node.locked { filter: grayscale(1) brightness(.6); }
.node.locked::after { content: ''; position: absolute; inset: 30%; background: no-repeat center/contain; }
.node .lock { position: absolute; inset: 0; display: none; place-items: center; }
.node.locked .lock { display: grid; filter: none; }
.node .lock .ico { width: 48px; height: 48px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.5)); }
.node-label { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 12px; white-space: nowrap; text-align: center; background: rgba(10,18,36,.85); border: 2px solid var(--gold); border-radius: 12px; padding: 4px 10px; font-weight: 900; font-size: .9rem; }
.node-label small { display: block; font-weight: 600; font-size: .72rem; color: #c8d4ee; }
.node-stars { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; }
.node-stars .ico { width: 24px; height: 24px; }
.node-stars .ico.off { filter: grayscale(1) brightness(.5); }
.node-num { position: absolute; top: -8px; right: -8px; width: 34px; height: 34px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; display: grid; place-items: center; font-weight: 900; }
.node > .red-dot { top: -6px; left: -6px; right: auto; }
.map-guide { position: absolute; width: 74px; height: 92px; transform: translate(-50%, -50%); }
.map-guide .char, .map-guide .char-sprite { width: 100%; height: 100%; }
.map-title { position: absolute; top: 72px; left: 0; right: 0; text-align: center; font-weight: 900; font-size: 1.5rem; text-shadow: 0 3px 0 rgba(0,0,0,.35); }
.map-title small { display: block; font-size: .85rem; font-weight: 600; opacity: .85; }
.cloud { position: absolute; background: #fff; border-radius: 50px; opacity: .8; animation: cloudMove linear infinite; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 50%; height: 140%; top: -60%; left: 15%; }
.cloud::after { width: 40%; height: 120%; top: -45%; right: 15%; }
@keyframes cloudMove { from { transform: translateX(-30vw); } to { transform: translateX(130vw); } }

/* ---------- קרב ---------- */
#view-battle { background: #1a1036; }
.arena { position: absolute; inset: 0 0 auto 0; height: 44%; min-height: 300px; overflow: hidden; }
.arena-bg { position: absolute; inset: 0; }
.lv1 .arena-bg { background: linear-gradient(#7fd0ff, #c8ecff 60%, #6bbf4e 60%, #3f8a2e); }
.lv2 .arena-bg { background: linear-gradient(#ffb36b, #ffe1b0 58%, #2f8fd0 58%, #1d5c9c); }
.lv3 .arena-bg { background: linear-gradient(#2b1055, #7597de 58%, #4b5263 58%, #252a36); }
.arena-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 42%; }
.fighter { position: absolute; bottom: 10%; width: 32%; max-width: 200px; aspect-ratio: 1; }
.fighter.enemy { left: 6%; }
.fighter.hero { right: 8%; width: 24%; max-width: 150px; }
.fighter .mon, .fighter .mon-sprite, .fighter .char, .fighter .char-sprite { width: 100%; height: 100%; }
.fighter.enemy .f-art { animation: idle 2.2s ease-in-out infinite; transform-origin: 50% 100%; }
.fighter.hero .f-art { animation: idle 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes idle { 50% { transform: scaleY(.96) translateY(2px); } }
.fighter.enemy.hurt .f-art { animation: hurt .45s; }
@keyframes hurt { 0% { filter: brightness(3); transform: translateX(0); } 30% { transform: translateX(-14px) rotate(-6deg); } 60% { transform: translateX(8px); filter: none; } 100% { transform: none; } }
.fighter.enemy.lunge .f-art { animation: lunge .55s; }
@keyframes lunge { 40% { transform: translateX(45%) scale(1.1); } }
.fighter.enemy.dead .f-art { animation: die .9s forwards; }
@keyframes die { 30% { transform: scale(1.15) rotate(-6deg); filter: brightness(2); } 100% { transform: scale(.1) rotate(30deg) translateY(40px); opacity: 0; } }
.fighter.hero.attack .f-art { animation: attack .45s; }
@keyframes attack { 40% { transform: translateX(-22px) scale(1.06); } }
.fighter.hero.ouch .f-art { animation: hurt .45s; }
.hp { position: absolute; top: 74px; width: 44%; max-width: 300px; }
.hp.enemy-hp { left: 4%; }
.hp-name { font-weight: 900; font-size: .9rem; text-shadow: 0 2px 2px rgba(0,0,0,.6); margin-bottom: 3px; display: flex; justify-content: space-between; gap: 6px; }
.hp .bar { height: 20px; border-color: #000; border-width: 3px; }
.hp .bar > i { background: linear-gradient(#ff7a85, #c9182a); transition: width .5s cubic-bezier(.3,1.4,.5,1); }
.hp .bar .seg { position: absolute; top: 0; bottom: 0; width: 3px; background: #000; }
.hearts { position: absolute; top: 76px; right: 4%; display: flex; gap: 3px; }
.hearts .ico { width: 30px; height: 30px; transition: transform .3s, filter .3s; }
.hearts .ico.off { filter: grayscale(1) brightness(.5); transform: scale(.8); }
.stage-banner { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(0); background: linear-gradient(#ff7a85, #c9182a); border: 4px solid #fff; border-radius: 18px; padding: 10px 22px; font-weight: 900; font-size: 1.3rem; white-space: nowrap; box-shadow: 0 6px 0 #6b0612; z-index: 5; }
.stage-banner.show { animation: banner 1.8s forwards; }
@keyframes banner { 15% { transform: translate(-50%, -50%) scale(1.15); } 25%, 80% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(.6); opacity: 0; } }
.dmg { position: absolute; direction: ltr; font-weight: 900; font-size: 2rem; color: #fff; -webkit-text-stroke: 2px #c9182a; pointer-events: none; animation: dmg 1s forwards; z-index: 6; }
@keyframes dmg { from { transform: translateY(0) scale(.6); opacity: 1; } 30% { transform: translateY(-30px) scale(1.3); } to { transform: translateY(-70px) scale(1); opacity: 0; } }
.projectile { position: fixed; width: 46px; height: 46px; z-index: 60; pointer-events: none; filter: drop-shadow(0 0 10px #ffe27a); }
.btn-retreat { position: absolute; top: 116px; right: 4%; z-index: 4; font-size: .8rem; padding: .4em .9em; border-radius: 12px; }
.shake { animation: shake .45s; }
@keyframes shake { 10%,90% { transform: translate(-2px, 1px); } 20%,80% { transform: translate(5px, -3px); } 30%,50%,70% { transform: translate(-8px, 4px); } 40%,60% { transform: translate(8px, -2px); } }
.flash-red { animation: flashRed .5s; }
@keyframes flashRed { 30% { box-shadow: inset 0 0 120px 40px rgba(230,57,70,.7); } }

.qcard { position: absolute; left: 0; right: 0; bottom: 0; top: max(44%, 300px); min-height: 0; background: linear-gradient(#fdf6e3, #f4e7c3); color: #2a1d0e; border-top: 5px solid #7a5208; border-radius: 26px 26px 0 0; padding: 14px 16px calc(16px + var(--safe-b)); overflow-y: auto; box-shadow: 0 -8px 20px rgba(0,0,0,.35); }
.qcard.enter { animation: qin .35s cubic-bezier(.2,1.3,.4,1); }
@keyframes qin { from { transform: translateY(40px); opacity: 0; } }
.q-wrap { max-width: 620px; margin: 0 auto; }
.q-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.chip { font-size: .78rem; font-weight: 900; padding: 3px 10px; border-radius: 10px; color: #fff; }
.chip.torah { background: #2c62d6; } .chip.math { background: #f08a24; } .chip.en { background: #2fb37a; }
.q-guide { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; font-size: .8rem; font-weight: 700; color: #7a5a2a; }
.q-guide .g-av { width: 34px; height: 40px; }
.q-guide .g-av .char, .q-guide .g-av .char-sprite { width: 100%; height: 100%; }
.q-text { font-size: 1.2rem; font-weight: 700; line-height: 1.45; margin: 4px 0 8px; }
.q-text b { color: #c9182a; }
.q-en { direction: ltr; text-align: center; font-size: 1.45rem; font-weight: 900; color: #12306e; background: #fff; border: 2px dashed #8fb3ff; border-radius: 14px; padding: 8px 12px; margin: 6px 0 10px; }
.q-visual { display: flex; justify-content: center; margin: 4px 0 10px; }
.qsvg { width: 100%; max-width: 330px; height: auto; background: #fff; border-radius: 16px; border: 2px solid #e5d6ae; padding: 4px; }
.q-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt { min-height: 54px; padding: 10px; border-radius: 14px; font-size: 1.05rem; font-weight: 800; color: #1d2f57; background: linear-gradient(#ffffff, #e9eef8); border: 3px solid #9fb0cf; box-shadow: 0 4px 0 #9fb0cf; transition: transform .08s; }
.opt:active { transform: translateY(3px); box-shadow: 0 1px 0 #9fb0cf; }
.opt.ltr { direction: ltr; }
.opt.right { background: linear-gradient(#8ff0bf, #2fb37a); border-color: #0e4d30; box-shadow: 0 4px 0 #0e4d30; color: #fff; animation: pop .3s; }
.opt.wrong { background: linear-gradient(#ff9aa3, #e63946); border-color: #6b0612; box-shadow: 0 4px 0 #6b0612; color: #fff; animation: shake .4s; }
.opt.dim { opacity: .45; }
@keyframes pop { 50% { transform: scale(1.07); } }
.q-explain { margin-top: 12px; padding: 10px 12px; border-radius: 14px; font-weight: 600; line-height: 1.5; display: none; }
.q-explain.on { display: block; animation: qin .3s; }
.q-explain.good { background: #dcf7e8; border: 2px solid #2fb37a; }
.q-explain.bad { background: #ffe3e6; border: 2px solid #e63946; }
.q-next { margin-top: 10px; width: 100%; }

/* ---------- מודאלים ---------- */
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(5,10,25,.72); display: grid; place-items: center; padding: 16px; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { position: relative; width: min(440px, 100%); max-height: calc(100% - 20px); overflow-x: hidden; overflow-y: auto; background: linear-gradient(#24407e, #14244a); border: 4px solid var(--gold); border-radius: 26px; padding: 22px 18px 20px; text-align: center; box-shadow: 0 10px 0 #7a5208, 0 20px 50px rgba(0,0,0,.5); animation: modalIn .45s cubic-bezier(.2,1.5,.4,1); }
@keyframes modalIn { from { transform: scale(.4) translateY(40px); opacity: 0; } }
.modal h2 { margin: 6px 0 6px; font-size: 1.7rem; font-weight: 900; color: var(--gold2); text-shadow: 0 3px 0 rgba(0,0,0,.4); }
.modal p { margin: 6px 0 12px; line-height: 1.5; font-weight: 500; color: #e6ecfa; }
.modal .rays { position: absolute; left: 50%; top: 90px; width: 520px; height: 520px; margin: -260px 0 0 -260px; background: repeating-conic-gradient(rgba(255,217,90,.16) 0 10deg, transparent 10deg 20deg); border-radius: 50%; animation: spin 14s linear infinite; pointer-events: none; mask-image: radial-gradient(circle, #000 30%, transparent 70%); -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 70%); }
@keyframes spin { to { transform: rotate(360deg); } }
.rays-clip { position: absolute; inset: 0; overflow: hidden; border-radius: 22px; pointer-events: none; }
.modal > *:not(.rays-clip) { position: relative; }
.reward-hero { width: 110px; height: 110px; margin: 0 auto; display: grid; place-items: center; }
.reward-hero .ico { width: 100%; height: 100%; animation: floaty 1.6s infinite; filter: drop-shadow(0 6px 10px rgba(0,0,0,.4)); }
.rewards { display: flex; justify-content: center; gap: 10px; margin: 12px 0 18px; flex-wrap: wrap; }
.rw { min-width: 86px; background: rgba(0,0,0,.35); border: 2px solid rgba(255,255,255,.2); border-radius: 16px; padding: 8px 10px; }
.rw .ico { width: 40px; height: 40px; }
.rw b { display: block; font-size: 1.4rem; font-weight: 900; color: #fff; }
.rw small { font-size: .72rem; color: #c8d4ee; font-weight: 700; }
.claim-btn { animation: claimShake 1.3s infinite; }
@keyframes claimShake { 0%,55%,100% { transform: rotate(0) scale(1); box-shadow: 0 5px 0 #7a5208, 0 0 0 rgba(255,217,90,0); } 60% { transform: rotate(-4deg) scale(1.06); } 70% { transform: rotate(4deg) scale(1.08); box-shadow: 0 5px 0 #7a5208, 0 0 30px 6px rgba(255,217,90,.8); } 80% { transform: rotate(-3deg) scale(1.05); } 90% { transform: rotate(2deg); } }
.stars-row { display: flex; justify-content: center; gap: 6px; margin: 6px 0; }
.stars-row .ico { width: 54px; height: 54px; transform: scale(0); }
.stars-row .ico.in { animation: starIn .5s cubic-bezier(.2,1.8,.4,1) forwards; }
.stars-row .ico.off { filter: grayscale(1) brightness(.45); }
@keyframes starIn { to { transform: scale(1); } }
.npc-talk { display: flex; align-items: flex-end; gap: 10px; text-align: start; }
.npc-talk .npc-av { width: 96px; height: 120px; flex: 0 0 auto; }
.npc-talk .npc-av .char, .npc-talk .npc-av .char-sprite { width: 100%; height: 100%; }
.bubble { position: relative; flex: 1; background: #fff; color: #1d2f57; border-radius: 18px; padding: 12px 14px; font-weight: 600; line-height: 1.5; box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.bubble::after { content: ''; position: absolute; bottom: 14px; right: -10px; border: 10px solid transparent; border-left-color: #fff; border-right: 0; }
.bubble b { color: #c9182a; }
.bubble .who { display: block; font-weight: 900; color: var(--blue); font-size: .85rem; margin-bottom: 2px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* גיליון מבנה */
.sheet-back { position: fixed; inset: 0; z-index: 70; background: rgba(5,10,25,.45); animation: fadeIn .2s; }
.sheet { position: fixed; z-index: 71; left: 50%; bottom: 0; transform: translateX(-50%); width: min(560px, 100%); background: linear-gradient(#24407e, #14244a); border: 4px solid var(--gold); border-bottom: 0; border-radius: 26px 26px 0 0; padding: 16px 16px calc(20px + var(--safe-b)); animation: sheetIn .35s cubic-bezier(.2,1.2,.4,1); }
@keyframes sheetIn { from { transform: translate(-50%, 100%); } }
.sheet-head { display: flex; gap: 12px; align-items: center; }
.sheet-art { width: 110px; height: 110px; flex: 0 0 auto; }
.sheet-art .bld-svg, .sheet-art .bld-sprite { width: 100%; height: 100%; }
.sheet h3 { margin: 0; font-size: 1.3rem; font-weight: 900; color: var(--gold2); }
.sheet .lvtag { display: inline-block; background: var(--blue); border-radius: 10px; padding: 1px 8px; font-size: .8rem; font-weight: 900; margin-inline-start: 6px; color: #fff; vertical-align: middle; }
.sheet p { margin: 4px 0; color: #dbe4f7; font-size: .92rem; line-height: 1.45; }
.sheet-stats { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.stat { flex: 1; min-width: 120px; background: rgba(0,0,0,.3); border-radius: 14px; padding: 8px 10px; font-size: .82rem; color: #c8d4ee; font-weight: 700; }
.stat b { display: block; color: #fff; font-size: 1rem; }
.cost { display: inline-flex; align-items: center; gap: 3px; margin-inline-end: 8px; font-weight: 900; }
.cost.short { color: #ff8a95; }
.cost .ico { width: 1.3em; height: 1.3em; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; }
.sheet-actions .btn { width: 100%; }
.sheet .bar { height: 22px; }
.sheet .bar > span { line-height: 18px; font-size: .85rem; }
.close-x { position: absolute; top: 10px; left: 12px; width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,.35); color: #fff; font-size: 1.3rem; font-weight: 900; line-height: 1; }

/* ---------- זרקור FTUE ---------- */
#spot-root { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.spot-hole { position: fixed; border-radius: 22px; pointer-events: none; box-shadow: 0 0 0 4px var(--gold2), 0 0 30px 8px rgba(255,217,90,.8); transition: all .25s; animation: holePulse 1.2s infinite; }
.spot-hole.dark { box-shadow: 0 0 0 4px var(--gold2), 0 0 30px 8px rgba(255,217,90,.8), 0 0 0 200vmax rgba(4,8,22,.74); }
@keyframes holePulse { 50% { outline: 6px solid rgba(255,217,90,.35); outline-offset: 6px; } }
.spot-block { position: fixed; pointer-events: auto; background: transparent; }
.spot-arrow { position: fixed; width: 54px; height: 64px; margin-left: -27px; pointer-events: none; animation: arrowBounce .7s ease-in-out infinite alternate; filter: drop-shadow(0 4px 4px rgba(0,0,0,.5)); }
.spot-arrow.up { animation-name: arrowBounceUp; }
@keyframes arrowBounce { from { transform: translateY(-14px); } to { transform: translateY(0); } }
@keyframes arrowBounceUp { from { transform: translateY(14px) rotate(180deg); } to { transform: translateY(0) rotate(180deg); } }
.spot-tip { position: fixed; max-width: min(320px, calc(100% - 24px)); transform: translateX(-50%); background: #fff; color: #1d2f57; border: 3px solid var(--gold); border-radius: 16px; padding: 10px 14px; font-weight: 800; line-height: 1.4; text-align: center; box-shadow: 0 6px 0 rgba(0,0,0,.3); }

/* ---------- מסך פתיחה ---------- */
#start { position: fixed; inset: 0; z-index: 100; overflow-y: auto; background: radial-gradient(ellipse at 50% 0%, #3d6fd0 0, #1d2f57 55%, #0d1626 100%); padding: 24px 16px 40px; display: none; }
#start.on { display: block; }
.start-wrap { max-width: 560px; margin: 0 auto; text-align: center; }
.logo { font-size: clamp(2.2rem, 9vw, 3.4rem); font-weight: 900; margin: 6px 0 0; line-height: 1; background: linear-gradient(#fff6c2, #f2b818 60%, #c98a0c); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #5a3c06); }
.tagline { margin: 8px 0 18px; color: #c8d4ee; font-weight: 600; }
.pick-title { font-weight: 900; font-size: 1.1rem; margin: 18px 0 10px; color: var(--gold2); }
.av-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.av-card { background: linear-gradient(#2a4685, #14244a); border: 3px solid #0a1530; border-radius: 20px; padding: 8px 6px 10px; color: #fff; box-shadow: 0 5px 0 #0a1530; transition: transform .15s; }
.av-card .char, .av-card .char-sprite { width: 100%; height: 120px; }
.av-card b { display: block; font-weight: 900; }
.av-card.sel { border-color: var(--gold); background: linear-gradient(#3d6fd0, #1d3f8f); transform: translateY(-4px) scale(1.03); box-shadow: 0 9px 0 #7a5208, 0 0 24px rgba(255,217,90,.6); }
.age-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.age-chip { padding: .7em 1.1em; border-radius: 14px; font-weight: 900; font-size: 1rem; background: #1d3f8f; color: #fff; border: 3px solid #0a1530; box-shadow: 0 4px 0 #0a1530; }
.age-chip.sel { background: var(--gold); color: #4a2c00; border-color: #7a5208; box-shadow: 0 4px 0 #7a5208; }
.start-go { margin-top: 26px; }

/* ---------- אפקטים ---------- */
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 95; pointer-events: none; }
.flyer { position: fixed; z-index: 96; width: 34px; height: 34px; pointer-events: none; }
.flyer .ico { width: 100%; height: 100%; }
.toast { position: fixed; z-index: 97; left: 50%; top: 76px; transform: translateX(-50%); background: linear-gradient(#ffe27a, #f0a90c); color: #4a2c00; border: 3px solid #7a5208; border-radius: 16px; padding: 10px 18px; font-weight: 900; box-shadow: 0 5px 0 #7a5208; animation: toast 2.6s forwards; white-space: nowrap; }
@keyframes toast { 0% { transform: translate(-50%, -30px) scale(.6); opacity: 0; } 10%, 85% { transform: translate(-50%, 0) scale(1); opacity: 1; } 100% { transform: translate(-50%, -20px); opacity: 0; } }

.zzz text { animation: zz 2s infinite; }
.zzz text:nth-child(2) { animation-delay: .3s; } .zzz text:nth-child(3) { animation-delay: .6s; }
@keyframes zz { 50% { opacity: .3; transform: translateY(-4px); } }
.golem .glitch-r { animation: gl 1.6s steps(2) infinite; }
.golem .glitch-c { animation: gl 1.6s steps(2) infinite reverse; }
@keyframes gl { 0%, 70% { transform: translate(0); } 75% { transform: translate(-6px, 2px); } 85% { transform: translate(5px, -2px); } 100% { transform: translate(0); } }
.golem .eye { animation: blinkEye 2.4s infinite; }
@keyframes blinkEye { 50% { fill: #ff2a6d; } }
.gear { animation: spin 5s linear infinite; }
.smoke circle { animation: smoke 3s ease-out infinite; }
.smoke circle:nth-child(2) { animation-delay: 1s; } .smoke circle:nth-child(3) { animation-delay: 2s; }
@keyframes smoke { from { opacity: .9; transform: translateY(6px); } to { opacity: 0; transform: translateY(-14px); } }
.ship { animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(3px) rotate(1deg); } }
.glow-dot { animation: blinkEye 1.6s infinite; }
svg .gear, svg .ship, svg .smoke circle { transform-box: fill-box; transform-origin: center; }

@media (max-width: 420px) {
  .pill { font-size: .82rem; padding: 2px 8px 2px 3px; }
  .hud-av { width: 44px; height: 44px; }
  .q-text { font-size: 1.05rem; }
  .opt { font-size: .95rem; min-height: 50px; }
  .c-text { font-size: .9rem; }
}
@media (min-height: 760px) { .arena { height: 42%; } .qcard { top: max(42%, 300px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
.modal, .qcard, .sheet { scrollbar-width: none; }
.modal::-webkit-scrollbar, .qcard::-webkit-scrollbar, .sheet::-webkit-scrollbar { width: 0; height: 0; }

/* ספרייטים מ-Gemini (כשקיימים) */
.sprite { display: block; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; }
.hud-av .char-sprite { width: 100%; height: 100%; margin: 0; object-fit: cover; object-position: 50% 6%; transform: scale(1.5); transform-origin: 50% 0; }
.bld[data-lv="1"] .bld-sprite { transform: scale(.84); transform-origin: 50% 100%; }
.bld[data-lv="2"] .bld-sprite { transform: scale(.93); transform-origin: 50% 100%; }
.bld[data-lv="3"] .bld-sprite { transform: scale(1.03); transform-origin: 50% 100%; filter: drop-shadow(0 0 14px rgba(255,217,90,.7)); }

/* ---------- מסך התחברות ---------- */
.gate { position: fixed; inset: 0; z-index: 101; overflow-y: auto; background: radial-gradient(ellipse at 50% 0%, #3d6fd0 0, #1d2f57 55%, #0d1626 100%); padding: 24px 16px 40px; display: none; }
.gate.on { display: block; }
.gate-heroes { display: flex; justify-content: center; align-items: flex-end; gap: 4px; margin: 6px 0 14px; }
.gate-heroes span { width: 92px; height: 116px; }
.gate-heroes span:nth-child(2) { width: 112px; height: 140px; }
.gate-heroes .char, .gate-heroes .char-sprite { width: 100%; height: 100%; }
.gate-box { max-width: 400px; margin: 0 auto; background: rgba(8,16,36,.55); border: 2px solid rgba(255,217,90,.45); border-radius: 22px; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.gate-box > *, .gate-fb > * { margin: 0; }
.gate-fb { display: flex; flex-direction: column; gap: 10px; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: .8em 1em; border-radius: 14px; background: #fff; color: #1f1f1f; font-weight: 800; font-size: 1.05rem; border: 2px solid #dadce0; box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.btn-google:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.or { display: flex; align-items: center; gap: 10px; color: #9fb0cf; font-size: .8rem; font-weight: 700; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.2); }
.email-form { display: flex; flex-direction: column; gap: 8px; }
.email-form input { width: 100%; padding: .75em .9em; border-radius: 12px; border: 2px solid #3b5390; background: #0f1d3d; color: #fff; font: inherit; font-size: 1rem; text-align: left; }
.email-form input::placeholder { color: #8394b8; text-align: right; }
.email-form input:focus { outline: none; border-color: var(--gold); }
.email-row { display: flex; gap: 8px; }
.email-row .btn { flex: 1; padding: .65em .6em; font-size: .98rem; }
.link-btn { background: none; color: #9fc0ff; font-weight: 700; font-size: .88rem; text-decoration: underline; padding: 2px; align-self: center; }
.gate-err { min-height: 0; color: #ffb3ba; font-weight: 700; font-size: .9rem; line-height: 1.5; text-align: center; }
.gate-err:empty { display: none; }
.gate-err.ok { color: #9ff0c8; }
.guest-btn { width: 100%; }
.guest-warn { background: #3a2a06; border: 2px solid var(--gold); border-radius: 16px; padding: 12px; text-align: center; animation: qin .3s; }
.guest-warn p { margin: 0 0 10px; line-height: 1.5; font-weight: 600; color: #ffeec2; }
.gate-loading, .gate-nofb, .gate-carry-note, .gate-cancel { display: none; }
.gate-loading { text-align: center; font-weight: 800; color: var(--gold2); padding: 30px 0; animation: blinkEye 1.2s infinite; }
.gate.loading .gate-box > :not(.gate-loading) { display: none !important; }
.gate.loading .gate-loading { display: block; }
.gate.no-fb .gate-fb { display: none; }
.gate.no-fb .gate-nofb { display: block; color: #ffd28a; text-align: center; font-weight: 700; }
.gate.carry .gate-carry-note { display: block; color: #ffe27a; font-weight: 800; text-align: center; }
.gate.carry .gate-cancel, .gate.carry ~ * .gate-cancel { display: block; }
.gate.carry .guest-btn, .gate.carry .guest-btn + *, .gate.carry .or:last-of-type { display: none; }
.gate.busy .gate-box button, .gate.busy .gate-box input { pointer-events: none; opacity: .6; }
button.hud-av { padding: 0; cursor: pointer; }
.hud-guest { position: absolute; bottom: -6px; right: -6px; background: #e63946; color: #fff; border: 2px solid #fff; border-radius: 8px; font-size: .62rem; font-weight: 900; padding: 0 4px; animation: dotBounce 1.6s infinite; }

/* ---------- קרב: הבמה, ופריסת מחשב ---------- */
.fighter .f-art { width: 100%; height: 100%; }
.arena-stage { position: absolute; inset: 0; margin: 0 auto; max-width: 1040px; }
@media (min-width: 900px) {
  .arena { height: 50%; }
  .qcard { top: 50%; padding-top: 18px; }
  .fighter { bottom: 8%; }
  .fighter.enemy { width: 28%; max-width: 270px; left: 4%; }
  .fighter.hero { width: 22%; max-width: 230px; right: 6%; }
  .hp { max-width: 340px; }
  .q-wrap { max-width: 980px; }
  .q-wrap.has-visual { display: grid; grid-template-columns: minmax(0, 1fr) 380px; column-gap: 28px; align-items: start;
    grid-template-areas: "top vis" "text vis" "en vis" "opts vis" "ex vis"; }
  .q-wrap.has-visual > .q-top { grid-area: top; }
  .q-wrap.has-visual > .q-text { grid-area: text; }
  .q-wrap.has-visual > .q-en { grid-area: en; }
  .q-wrap.has-visual > .q-opts { grid-area: opts; }
  .q-wrap.has-visual > .q-explain { grid-area: ex; }
  .q-wrap.has-visual > .q-visual { grid-area: vis; margin: 0; }
  .q-wrap.has-visual .qsvg { max-width: 380px; }
  .q-text { font-size: 1.35rem; }
  .opt { min-height: 60px; font-size: 1.12rem; }
}
@media (min-width: 900px) and (max-height: 760px) {
  .q-wrap.has-visual .qsvg { max-height: calc(50vh - 60px); }
}

/* ---------- הדמויות שלי ---------- */
.acc-who { font-size: .9rem; }
.char-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 12px; text-align: start; }
.char-card { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.3); border: 2px solid rgba(255,255,255,.15); border-radius: 16px; padding: 6px 10px 6px 6px; }
.char-card.on { border-color: var(--gold); box-shadow: 0 0 14px rgba(255,217,90,.35); }
.cc-av { width: 52px; height: 62px; flex: 0 0 auto; }
.cc-av .char, .cc-av .char-sprite { width: 100%; height: 100%; }
.cc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cc-body b { font-weight: 900; }
.cc-body small { color: #c8d4ee; font-size: .78rem; }
.cc-body em { font-style: normal; color: var(--gold2); font-size: .74rem; font-weight: 800; }
.cc-act { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.btn.sm { padding: .35em .7em; font-size: .8rem; border-radius: 10px; border-width: 2px; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.new-char { width: 100%; }
.new-char small { font-weight: 600; opacity: .8; }
.modal .fine { font-size: .85rem; color: #c8d4ee; }
@media (max-width: 420px) { .cc-act { flex-direction: column; } }

/* ============================================================
   הרחבה (21.10): אורח־קודם, 10 שלבים, "גלה לי את הסוד", ארון הספרים, הגייה
   ============================================================ */
/* מסך טעינה קצר */
#boot { position: fixed; inset: 0; z-index: 120; display: grid; place-content: center; gap: 18px; justify-items: center; background: radial-gradient(ellipse at 50% 0%, #3d6fd0 0, #1d2f57 55%, #0d1626 100%); transition: opacity .5s; }
#boot.done { opacity: 0; pointer-events: none; }
.boot-logo { font-size: clamp(2rem, 9vw, 3rem); font-weight: 900; background: linear-gradient(#fff6c2, #f2b818 60%, #c98a0c); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #5a3c06); }
.boot-spin { width: 44px; height: 44px; border-radius: 50%; border: 5px solid rgba(255,255,255,.2); border-top-color: var(--gold); animation: spin 0.9s linear infinite; }
.start-note { margin-top: 14px; color: #9fb0cf; font-size: .85rem; font-weight: 600; }
#btn-settings { font-size: 1.3rem; line-height: 1; color: #fff; }
.hud-cloud { position: absolute; bottom: -6px; right: -6px; background: #2fb37a; color: #fff; border: 2px solid #fff; border-radius: 10px; font-size: .7rem; padding: 0 4px; }

/* ⚙ הגדרות */
.set-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; text-align: start; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border-radius: 14px; background: rgba(0,0,0,.3); border: 2px solid rgba(255,255,255,.15); color: #fff; font: inherit; font-weight: 700; text-align: start; }
.set-row b { color: var(--gold2); font-size: .85rem; white-space: nowrap; }
.set-row:active { transform: translateY(2px); }
.set-row.backup { border-color: rgba(47,179,122,.6); }
.logo.small { font-size: clamp(1.6rem, 7vw, 2.4rem); }
.gate-x { position: fixed; top: 14px; left: 14px; z-index: 2; }
.gate .gate-cancel { display: block; width: 100%; }

/* 💡 כרטיס הסוד */
.secret-btn { margin-inline-start: auto; border: 2px solid #f2b818; background: linear-gradient(#fff6c2, #ffe27a); color: #7a5208; font-weight: 900; font-size: .8rem; padding: 4px 10px; border-radius: 999px; box-shadow: 0 0 0 0 rgba(242,184,24,.7); animation: secretGlow 2.2s ease-in-out infinite; cursor: pointer; font-family: inherit; }
@keyframes secretGlow { 50% { box-shadow: 0 0 14px 3px rgba(242,184,24,.75); } }
.q-top { flex-wrap: wrap; }
.q-top .q-guide { margin-inline-start: 0; }
.modal.teach { width: min(500px, 100%); }
.teach-head { text-align: center; }
.teach-realm { display: inline-block; background: var(--rc); color: #fff; font-weight: 900; font-size: .78rem; padding: 3px 12px; border-radius: 999px; }
.teach-head h2 { margin-top: 8px; }
.modal .bubble p { margin: 0 0 6px; color: #1d2f57; font-weight: 600; }
.modal .bubble p:last-child { margin-bottom: 0; }
.teach-visual { margin: 12px auto 4px; background: #fff; border-radius: 16px; padding: 6px; max-width: 340px; }
.teach-svg { width: 100%; height: auto; display: block; }
.teach-fence { animation: fence 1.6s linear infinite; }
@keyframes fence { to { stroke-dashoffset: -32; } }

/* אנגלית: הקראה והגייה */
.q-en-wrap { margin: 6px 0 10px; }
.q-en-wrap .q-en { margin: 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
.say { border: 0; background: #2fb37a; color: #fff; width: 38px; height: 38px; border-radius: 50%; font-size: 1.1rem; flex: 0 0 auto; box-shadow: 0 3px 0 #0e4d30; cursor: pointer; }
.say:active { transform: translateY(2px); box-shadow: 0 1px 0 #0e4d30; }
.q-ph { text-align: center; color: #0e4d30; font-weight: 800; font-size: 1.05rem; margin-top: 4px; letter-spacing: .02em; }
.opt.has-ph { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.opt-ph { font-size: .8rem; font-weight: 700; color: #2f7a52; }
.opt.right .opt-ph, .opt.wrong .opt-ph { color: #fff; }

/* אפס בושה: המדריך עוזר */
.q-explain.soft { background: #fff6dd; border: 2px solid #f2b818; }
.mentor-help { display: flex; gap: 10px; align-items: flex-start; }
.mh-av { width: 54px; height: 64px; flex: 0 0 auto; }
.mh-av .char, .mh-av .char-sprite { width: 100%; height: 100%; }
.mh-body { flex: 1; }
.mh-more { margin-top: 8px; }
.mh-more summary { cursor: pointer; font-weight: 800; color: #7a5208; }
.mh-more .teach-svg { max-width: 320px; margin: 6px auto 0; background: #fff; border-radius: 12px; }

/* 📚 ארון הספרים */
.modal.codex { width: min(640px, 100%); }
.codex-total { margin: 8px 0 14px; }
.codex-total .bar { height: 22px; }
.codex-total .bar > span { line-height: 18px; font-size: .82rem; }
.codex-total b { display: block; margin-top: 6px; color: #9ff0c8; }
.shelves { display: flex; flex-direction: column; gap: 12px; text-align: start; }
.shelf { background: linear-gradient(#6b4423, #4a2a10); border: 3px solid #2a1606; border-radius: 16px; padding: 8px 10px 10px; box-shadow: inset 0 -6px 0 rgba(0,0,0,.25); }
.shelf-head { display: flex; align-items: center; gap: 8px; color: #fff; margin-bottom: 6px; }
.shelf-head b { flex: 1; }
.shelf-head small { color: #ffe27a; font-weight: 900; }
.shelf-av { width: 34px; height: 40px; }
.shelf-av .char, .shelf-av .char-sprite { width: 100%; height: 100%; }
.scrolls { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.scroll { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; border: 2px dashed rgba(255,255,255,.25); background: rgba(0,0,0,.25); color: #9a8a76; font: inherit; font-size: .76rem; font-weight: 800; cursor: pointer; }
.scroll small { font-size: .66rem; font-weight: 700; opacity: .85; }
.scroll-art { width: 44px; height: 30px; border-radius: 6px; background: linear-gradient(90deg, #6d6253 0 12%, #8f8573 12% 88%, #6d6253 88%); filter: grayscale(1); opacity: .6; }
.scroll.on { border: 2px solid #ffd95a; background: radial-gradient(circle at 50% 30%, rgba(255,217,90,.35), rgba(0,0,0,.2)); color: #fff6c2; box-shadow: 0 0 14px rgba(255,217,90,.55); }
.scroll.on .scroll-art { filter: none; opacity: 1; background: linear-gradient(90deg, #8a5a2b 0 12%, #fff1c9 12% 88%, #8a5a2b 88%); box-shadow: 0 0 10px #ffd95a; animation: floaty 2.4s ease-in-out infinite; }
.scroll.on small { color: #9ff0c8; }
#tab-codex .ico { width: 34px; height: 34px; }

/* מאיצים */
.boost-ico { width: 40px; height: 40px; font-size: 30px; display: inline-grid; place-items: center; }

/* 🗺 מפה עם גלילה (10 שלבים) */
#map-scroll { position: absolute; top: 118px; bottom: 0; left: 0; right: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
#map-scroll::-webkit-scrollbar { width: 0; }
#map-sizer { position: relative; width: 100%; padding-bottom: 110px; }
#map-inner { position: absolute; top: 10px; left: 50%; width: 420px; height: 1500px; transform-origin: top center; }
.map-title { z-index: 2; pointer-events: none; }

/* רקעי קרב לפי אזור */
.bg-valley0 .arena-bg { background: linear-gradient(#7fd0ff, #c8ecff 60%, #6bbf4e 60%, #3f8a2e); }
.bg-valley1 .arena-bg { background: linear-gradient(#ffd38a, #fff1c9 58%, #8fd36a 58%, #4f9a2a); }
.bg-boss1 .arena-bg { background: linear-gradient(#2b1055, #7597de 58%, #4b5263 58%, #252a36); }
.bg-port0 .arena-bg { background: linear-gradient(#ffb36b, #ffe1b0 58%, #2f8fd0 58%, #1d5c9c); }
.bg-port1 .arena-bg { background: linear-gradient(#7ad7f0, #d8f6ff 56%, #e9d9a6 56%, #c9a96a 66%, #2f8fd0 66%, #1d5c9c); }
.bg-boss2 .arena-bg { background: linear-gradient(#1a0b3a, #5b3fa8 56%, #2a3a66 56%, #10182e); }
#view-map .map-title { top: 58px; padding: 10px 0 18px; background: linear-gradient(rgba(84,154,224,.97) 60%, rgba(84,154,224,0)); }
.av-row { grid-template-columns: repeat(4, 1fr); }
.av-card .char, .av-card .char-sprite { height: 108px; }
.pick-title small { font-weight: 600; color: #c8d4ee; font-size: .8rem; }
@media (max-width: 420px) { .av-row { grid-template-columns: repeat(2, 1fr); } }
