/* =========================================================
   נמליה — סגנון
   ========================================================= */
:root {
  --ink: #f7ecd9;
  --ink-2: #dcc9ab;
  --ink-3: #a99579;
  --glass: rgba(27, 18, 11, 0.70);
  --glass-strong: rgba(24, 16, 10, 0.92);
  --line: rgba(255, 228, 186, 0.13);
  --line-2: rgba(255, 228, 186, 0.24);
  --honey: #f5b83d;
  --honey-2: #ffd47e;
  --honey-ink: #2b1a06;
  --leaf: #9ad66b;
  --leaf-deep: #2f6b2a;
  --red: #ff5a4e;
  --crystal: #b9a2ff;
  --paper: #f1e3c8;
  --paper-ink: #3a2817;
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.38), 0 2px 6px rgba(0, 0, 0, 0.25);
  --f-ui: 'Rubik', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --f-display: 'Secular One', 'Rubik', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: #140d08;
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; }
b { font-weight: 700; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.mono { font-family: var(--f-mono); }

/* ---------- במה ---------- */
#stage { position: fixed; inset: 0; touch-action: none; cursor: grab; }
#stage.dragging { cursor: grabbing; }
#scene { width: 100%; height: 100%; display: block; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; contain: strict; }

/* ---------- זכוכית ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 240, 210, 0.06);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
}
.glass-strong {
  background: var(--glass-strong);
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 240, 210, 0.08);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

/* ---------- כפתורים ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 999px;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: transform .18s var(--spring), background .2s, box-shadow .2s, filter .2s;
}
.btn:active { transform: scale(.96); }
.btn-honey {
  background: linear-gradient(180deg, var(--honey-2), var(--honey));
  color: var(--honey-ink);
  box-shadow: 0 8px 22px rgba(245, 184, 61, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -2px 0 rgba(120, 70, 0, 0.25);
}
.btn-honey:hover { filter: brightness(1.06); }
.btn-glass {
  background: var(--glass); color: var(--ink);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.btn-glass:hover { background: rgba(48, 33, 21, 0.8); }
.btn-dark { background: #120b06; color: var(--ink); height: 36px; padding: 0 14px; font-size: 14px; }
.btn-dark:hover { background: #000; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 16.5px; }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13.5px; }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible,
.viewtoggle button:focus-visible, .neighbors button:focus-visible, .tlink:focus-visible, .sheet-close:focus-visible,
.coach-foot button:focus-visible, .visit-pill:focus-visible, .ticker-track span:focus-visible, .lite .suggest button:focus-visible,
.minimap-head:focus-visible { outline: 2px solid var(--honey); outline-offset: 2px; border-radius: 8px; }
.search:focus-within { outline: 2px solid rgba(245, 184, 61, .7); outline-offset: 2px; }
.sheet:focus { outline: none; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 500; line-height: 1;
  transition: transform .18s var(--spring), background .2s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: rgba(255, 230, 190, 0.08); }

.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--honey); color: var(--honey-ink); font-size: 12px; font-weight: 700;
  display: inline-grid; place-items: center;
}

/* ---------- סימן מותג ---------- */
.brandmark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--honey-2), var(--honey));
  color: var(--honey-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 4px 12px rgba(245, 184, 61, .3);
}
.brandmark svg { width: 70%; height: 70%; }
.brandmark.big { width: 76px; height: 76px; border-radius: 24px; }

/* ---------- טעינה ---------- */
#loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background:
    radial-gradient(1200px 600px at 50% 120%, rgba(245, 184, 61, 0.14), transparent 60%),
    radial-gradient(800px 500px at 50% -10%, rgba(120, 170, 255, 0.10), transparent 60%),
    #140d08;
  transition: opacity .8s ease, visibility .8s;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-inner { display: grid; justify-items: center; gap: 16px; width: min(360px, 82vw); }
.loader-title { font-family: var(--f-display); font-size: 46px; line-height: 1; letter-spacing: .5px; }
.loader-track { position: relative; width: 100%; height: 6px; border-radius: 9px; background: rgba(255, 230, 190, .1); margin-top: 26px; }
.loader-fill { position: absolute; inset: 0 0 0 auto; width: 0%; border-radius: 9px; background: linear-gradient(270deg, var(--honey-2), var(--honey)); transition: width .35s var(--ease-out); }
.loader-ant { position: absolute; top: -27px; right: 0%; width: 30px; height: 30px; color: var(--ink); transform: translateX(50%) scaleX(-1); transition: right .35s var(--ease-out); }
.loader-ant svg { width: 100%; height: 100%; animation: antbob .32s ease-in-out infinite alternate; }
.loader-step { color: var(--ink-3); font-size: 14px; min-height: 20px; }
.loader-fact {
  margin-top: 18px; max-width: 320px; text-align: center; font-size: 13.5px; line-height: 1.55; color: var(--ink-2);
  min-height: 86px; opacity: 0; transition: opacity .5s; /* כותרת + עד 3 שורות — שהמסך לא יקפוץ כשהעובדה מופיעה */
}
.loader-fact.on { opacity: 1; }
.loader-fact b { color: var(--honey-2); font-weight: 600; display: block; font-size: 11.5px; letter-spacing: .5px; margin-bottom: 3px; }
@keyframes antbob { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-1.5px) rotate(2deg); } }
.aw-legs-a { animation: legs .32s steps(2) infinite; transform-origin: 34px 32px; }
@keyframes legs { 0% { transform: scaleX(1); } 100% { transform: scaleX(-1); } }

/* ---------- סרגל עליון ---------- */
.topbar {
  position: fixed; z-index: 20;
  top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%);
  height: 52px; padding: 0 10px 0 8px; border-radius: 18px;
  display: flex; align-items: center; gap: 14px;
  width: min(720px, calc(100vw - 24px));
}
.brand { display: flex; align-items: center; gap: 10px; padding-inline-start: 4px; }
.brand-name { font-family: var(--f-display); font-size: 23px; letter-spacing: .3px; }
.stats { flex: 1; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stats b { color: var(--ink); font-family: var(--f-mono); font-size: 13px; }
.stats .dot { opacity: .45; margin: 0 4px; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.depth-chip .st { font-family: var(--f-ui); font-weight: 500; opacity: .62; margin-inline-start: 4px; }
.depth-chip {
  font-family: var(--f-mono); font-size: 12.5px; font-weight: 700;
  padding: 5px 10px; border-radius: 10px; border: 1px solid var(--line-2);
  color: var(--ink); min-width: 70px; text-align: center; direction: rtl; white-space: nowrap;
  background: rgba(0, 0, 0, .18);
}

/* ---------- טיקר ---------- */
.ticker {
  position: fixed; z-index: 19;
  top: calc(72px + var(--safe-t)); left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100vw - 48px)); height: 30px; border-radius: 99px;
  display: flex; align-items: center; gap: 8px; padding: 0 12px 0 0; overflow: hidden;
  font-size: 12.5px; color: var(--ink-2);
}
.live { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: #ffd0cb; font-size: 11.5px; letter-spacing: .5px; flex: none; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(255, 90, 78, .6); animation: live 1.6s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 78, .6); } 70% { box-shadow: 0 0 0 7px rgba(255, 90, 78, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 78, 0); } }
.ticker-viewport { flex: 1; overflow: hidden; height: 100%; position: relative; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker-track { position: absolute; top: 0; right: 0; height: 100%; display: flex; align-items: center; gap: 36px; white-space: nowrap; will-change: transform; }
.ticker-track span b { color: var(--ink); font-weight: 600; }
.ticker-track span[data-goto] { cursor: pointer; }
.ticker-track span[data-goto]:hover { color: var(--ink); }
.tlink { font-family: var(--f-mono); color: var(--honey-2); text-decoration: underline; text-underline-offset: 3px; direction: ltr; unicode-bidi: isolate; padding: 0 2px; }

/* ---------- בורר תצוגה ---------- */
.viewtoggle {
  position: fixed; z-index: 19;
  top: calc(112px + var(--safe-t)); left: 50%; transform: translateX(-50%);
  display: flex; padding: 4px; border-radius: 14px; gap: 2px;
}
.viewtoggle button {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
  transition: background .25s, color .25s;
}
.viewtoggle button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.viewtoggle button.on { background: var(--ink); color: #1d140c; }

/* ---------- כלים בצד ---------- */
.side-tools {
  position: fixed; z-index: 18; left: 14px; bottom: calc(22px + var(--safe-b));
  display: grid; gap: 8px; transition: opacity .3s;
}
.side-tools .icon-btn { width: 44px; height: 44px; border-radius: 14px; }

.minimap {
  position: fixed; z-index: 18; left: 14px; top: calc(160px + var(--safe-t));
  width: 112px; border-radius: 16px; padding: 8px; display: grid; gap: 6px; transition: opacity .3s;
}
.minimap-me {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; display: none;
  background: #ff8fa3; border: 2px solid #fff; box-shadow: 0 0 0 0 rgba(255, 143, 163, .7); animation: live 1.4s infinite; pointer-events: none;
}
body.worm .minimap-me { display: block; }
.minimap-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); font-weight: 600; padding: 0 2px; }
.minimap-head span:last-child { font-family: var(--f-mono); }
.minimap-body { position: relative; border-radius: 10px; overflow: hidden; cursor: pointer; background: #0e0905; max-height: calc(100vh - 485px); }
#minimapCanvas { display: block; width: 100%; image-rendering: auto; }
.minimap-view { position: absolute; border: 1.5px solid var(--honey-2); border-radius: 3px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .28), 0 0 12px rgba(255, 212, 126, .5); pointer-events: none; }

/* ---------- תחתית ---------- */
.bottom {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + var(--safe-b));
  display: grid; gap: 10px; justify-items: center;
  width: min(520px, calc(100vw - 24px));
  transition: opacity .35s, transform .35s var(--ease-out);
}
.search {
  position: relative; width: 100%; height: 52px; border-radius: 16px;
  display: flex; align-items: center; gap: 8px; padding: 0 14px 0 8px;
}
.search .at {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: rgba(154, 214, 107, .18); color: var(--leaf); font-weight: 700; font-family: var(--f-mono); font-size: 14px;
}
.search input {
  flex: 1; min-width: 0; height: 100%; background: none; border: 0; color: var(--ink);
  font-family: var(--f-mono); font-size: 15px; text-align: right;
}
.search input::placeholder { font-family: var(--f-ui); color: var(--ink-3); }
.search input:focus { outline: none; }
.search input:not(:placeholder-shown) { text-align: left; }
.suggest {
  position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
  border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); display: none; max-height: 240px; overflow: auto;
}
.suggest.open { display: block; }
.suggest li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 13.5px;
}
.suggest li:hover, .suggest li.active { background: rgba(255, 230, 190, .09); }
.suggest li .h { font-family: var(--f-mono); direction: ltr; }
.suggest li .m { color: var(--ink-3); font-size: 12px; }
.navrow { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ---------- כרטיס פתיחה ---------- */
.intro {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(ellipse at 50% 50%, rgba(10, 6, 3, .15), rgba(10, 6, 3, .55));
  transition: opacity .7s ease, visibility .7s;
}
.intro.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-card {
  position: relative; width: min(520px, 100%); border-radius: 28px; padding: 34px 32px 28px;
  animation: cardIn 1s .2s var(--ease-out) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
.kicker { font-family: var(--f-mono); font-size: 12px; letter-spacing: 1.5px; color: var(--honey-2); font-weight: 700; direction: rtl; }
.intro-title {
  font-family: var(--f-display); font-weight: 400; margin: 6px 0 10px;
  font-size: clamp(56px, 13vw, 84px); line-height: .95; letter-spacing: .5px;
  background: linear-gradient(180deg, #fff6e5 20%, #f2cf8f 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 10px 40px rgba(245, 184, 61, .15);
}
.intro-sub { margin: 0 0 22px; color: var(--ink-2); font-size: 16.5px; line-height: 1.6; text-wrap: pretty; }
.intro-sub b { color: var(--ink); }
.progress { margin-bottom: 24px; }
.progress-bar { position: relative; height: 12px; border-radius: 99px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line-2); overflow: hidden; }
.progress-fill {
  position: absolute; inset: 0 0 0 auto; width: 0; border-radius: 99px;
  background: repeating-linear-gradient(-45deg, var(--honey) 0 8px, var(--honey-2) 8px 16px);
  background-size: 22.6px 100%;
  animation: stripes 1.2s linear infinite;
  transition: width 1.6s 1s var(--ease-out);
}
@keyframes stripes { to { background-position: 22.6px 0; } }
.progress-text { margin-top: 9px; font-size: 13.5px; color: var(--ink-3); line-height: 1.55; }
.progress-text b { color: var(--ink); }
.intro-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.marchers { position: absolute; inset: 0; pointer-events: none; }
.marcher {
  position: absolute; top: 0; left: 0; width: 18px; height: 18px; color: #f5d9a8; opacity: .9;
  offset-rotate: auto; animation: march 26s linear infinite;
}
.marcher svg { width: 100%; height: 100%; display: block; }
@keyframes march { from { offset-distance: 0%; } to { offset-distance: 100%; } }

/* ---------- גיליון ---------- */
.sheet {
  position: fixed; z-index: 30; top: calc(12px + var(--safe-t)); bottom: 12px; right: 12px;
  width: min(400px, calc(100vw - 24px)); border-radius: 24px;
  display: flex; flex-direction: column;
  transform: translateX(calc(100% + 30px)); transition: transform .5s var(--ease-out), visibility .5s;
  visibility: hidden;
}
/* בפתיחה נראה מיד (כדי שאפשר יהיה להעביר אליו פוקוס); בסגירה נעלם רק אחרי שהחליק החוצה */
.sheet.open { transform: none; visibility: visible; transition: transform .5s var(--ease-out), visibility 0s; }
.sheet-grip { display: none; }
.sheet-close {
  position: absolute; top: 14px; left: 14px; width: 34px; height: 34px; border-radius: 11px; z-index: 2;
  background: rgba(255, 230, 190, .08); display: grid; place-items: center; font-size: 14px;
}
.sheet-close:hover { background: rgba(255, 230, 190, .16); }
.sheet-body { overflow-y: auto; padding: 24px 22px 26px; flex: 1; overscroll-behavior: contain; user-select: text; -webkit-user-select: text; }
.sheet-body::-webkit-scrollbar { width: 6px; }
.sheet-body::-webkit-scrollbar-thumb { background: rgba(255, 230, 190, .15); border-radius: 9px; }

.sheet h2 { font-family: var(--f-display); font-weight: 400; font-size: 30px; line-height: 1.1; margin: 4px 0 4px; padding-inline-end: 40px; }
.sheet .sub { color: var(--ink-3); font-size: 13.5px; margin-bottom: 18px; }
.sheet p { color: var(--ink-2); line-height: 1.6; margin: 0 0 12px; }

.steps { list-style: none; margin: 8px 0 18px; padding: 0; display: grid; gap: 4px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--ink-2); line-height: 1.55; }
.steps li::before {
  counter-increment: s; content: counter(s);
  width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(154, 214, 107, .15); color: var(--leaf); font-weight: 700; font-family: var(--f-mono); font-size: 13px;
}
.steps li b { color: var(--ink); }
.fineprint { font-size: 12.5px; color: var(--ink-3); text-align: center; margin: 4px 0 14px; }

.ccard {
  border: 1px solid var(--line-2); border-radius: 18px; padding: 15px 16px; margin-bottom: 12px;
  background: linear-gradient(180deg, rgba(255, 230, 190, .05), rgba(255, 230, 190, .02));
}
.ccard h3 { margin: 0 0 6px; font-size: 16.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ccard h3 .emoji { font-size: 18px; }
.ccard p { font-size: 14px; margin-bottom: 10px; }
.ccard .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ccard .state { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); }
.ccard .state.ok { color: var(--leaf); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 7px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line-2); font-family: var(--f-mono); font-size: 12px; color: var(--ink); }
.bar { height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .35); overflow: hidden; margin: 8px 0 10px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(270deg, var(--honey-2), var(--honey)); }
.bar.red i { background: linear-gradient(270deg, #ff8a7f, var(--red)); }
.bar.leaf i { background: linear-gradient(270deg, #c6f09e, var(--leaf)); }
.vote-list { display: grid; gap: 6px; margin: 4px 0 10px; }
.vote-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-size: 13.5px; }
.vote-item .bar { grid-column: 1 / -1; margin: 0; height: 5px; }
.vote-item .likes { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); }
.vote-item.lead .likes { color: var(--honey-2); }

/* ספריית חדרים */
.dir-filters { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -4px 6px; scrollbar-width: none; }
.dir-filters::-webkit-scrollbar { display: none; }
.dir-filters button {
  flex: none; padding: 6px 11px; border-radius: 99px; font-size: 13px; border: 1px solid var(--line-2);
  background: rgba(255, 230, 190, .05); color: var(--ink-2); white-space: nowrap;
}
.dir-filters button.on { background: var(--ink); color: #1d140c; border-color: transparent; font-weight: 600; }
.dir-count { font-size: 12.5px; color: var(--ink-3); margin: 2px 0 8px; }
.dir-list { display: grid; gap: 2px; }
.dir-row {
  display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 8px; padding: 9px 8px; border-radius: 10px; text-align: right; width: 100%;
}
.dir-row:hover, .dir-row:focus-visible { background: rgba(255, 230, 190, .07); }
.dir-row .n { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); }
.dir-row .h { font-family: var(--f-mono); font-size: 14px; direction: ltr; text-align: right; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.dir-row .m { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.dir-more { margin-top: 10px; width: 100%; }

/* כרטיס חדר */
.chamber-hero {
  position: relative; border-radius: 18px; padding: 16px; margin: 6px 0 14px; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, rgba(245, 184, 61, .22), transparent 55%), rgba(0, 0, 0, .25);
  border: 1px solid var(--line-2);
}
.chamber-hero.crystal { background: radial-gradient(120% 140% at 100% 0%, rgba(185, 162, 255, .35), transparent 55%), rgba(0, 0, 0, .25); }
.chamber-hero.gold { background: radial-gradient(120% 140% at 100% 0%, rgba(255, 205, 80, .4), transparent 55%), rgba(0, 0, 0, .25); }
.chamber-num { font-family: var(--f-mono); font-size: 12px; color: var(--honey-2); letter-spacing: 1px; font-weight: 700; }
.chamber-handle { font-family: var(--f-mono); font-size: 24px; font-weight: 700; direction: ltr; text-align: right; margin: 4px 0 2px; word-break: break-all; }
.chamber-meta { color: var(--ink-3); font-size: 13px; }
.rar { position: absolute; top: 14px; left: 14px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 8px; background: rgba(0, 0, 0, .4); border: 1px solid var(--line-2); }
.rar.r3 { color: var(--crystal); border-color: rgba(185, 162, 255, .5); }
.rar.r4 { color: #ffd76a; border-color: rgba(255, 215, 106, .5); }
.rar.r2 { color: #8fe0ff; }
.rar.r1 { color: var(--leaf); }
.kv { display: grid; gap: 10px; margin-bottom: 16px; }
.kv-item { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; }
.kv-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: rgba(255, 230, 190, .06); border: 1px solid var(--line); }
.kv-label { font-size: 12px; color: var(--ink-3); }
.kv-value { font-size: 15px; font-weight: 600; color: var(--ink); }
.kv-desc { font-size: 13px; color: var(--ink-2); font-weight: 400; }
.neighbors { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.neighbors button { font-family: var(--f-mono); font-size: 12.5px; padding: 5px 10px; border-radius: 9px; background: var(--paper); color: var(--paper-ink); direction: ltr; box-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.actions { display: grid; gap: 8px; }
.actions .btn { width: 100%; }
.status-line { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); font-size: 14px; margin-bottom: 14px; }
.status-line .pulse { flex: none; }
.section-title { font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .5px; margin: 6px 0 8px; }

/* ---------- תוויות במרחב ---------- */
.lbl {
  position: absolute; top: 0; left: 0; pointer-events: auto; cursor: pointer;
  transform-origin: 0 0; will-change: transform, opacity; transition: opacity .22s;
  white-space: nowrap; display: none;
}
.lbl.v { display: block; }
.lbl-chamber {
  font-family: var(--f-mono); font-size: 11px; font-weight: 500; line-height: 1;
  padding: 4px 7px 4px; border-radius: 6px; direction: ltr;
  background: var(--paper); color: var(--paper-ink);
  border: 1px solid rgba(60, 40, 20, .25);
  box-shadow: 0 2px 0 rgba(30, 18, 8, .35), 0 6px 12px rgba(0, 0, 0, .18);
}
.lbl-chamber.long { font-size: 9.5px; letter-spacing: -.2px; }
.lbl-chamber.hover, .lbl-vacant.hover { background: #fff7e6; box-shadow: 0 0 0 2px rgba(245, 184, 61, .75), 0 8px 18px rgba(0, 0, 0, .3); }
.lbl-vacant.hover { background: rgba(245, 184, 61, .3); }
.lbl-chamber.sel { background: var(--honey); color: var(--honey-ink); box-shadow: 0 0 0 3px rgba(255, 212, 126, .4), 0 6px 18px rgba(245, 184, 61, .5); }
.lbl-chamber.crystal { background: #e7defe; color: #34206e; }
.lbl-chamber.gold { background: linear-gradient(180deg, #ffe7a0, #f5c04b); color: #3e2600; }
.lbl-vacant {
  font-family: var(--f-ui); font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 7px; direction: rtl;
  background: rgba(245, 184, 61, .16); color: var(--honey-2); border: 1px dashed rgba(255, 212, 126, .7);
}
.lbl-room {
  font-family: var(--f-ui); direction: rtl; text-align: center;
  padding: 6px 11px 6px; border-radius: 9px; line-height: 1.15;
  background: linear-gradient(180deg, #3d8a36, var(--leaf-deep)); color: #effbe4;
  border: 1px solid rgba(190, 255, 150, .3);
  box-shadow: 0 3px 0 rgba(10, 40, 8, .55), 0 8px 18px rgba(0, 0, 0, .3);
}
.lbl-room .t { font-weight: 700; font-size: 12.5px; letter-spacing: .2px; }
.lbl-room .s { font-size: 10px; opacity: .8; margin-top: 2px; }
.lbl-room.queen { background: linear-gradient(180deg, #ffd978, #e6a92a); color: #3a2400; border-color: rgba(255, 240, 190, .6); box-shadow: 0 3px 0 rgba(90, 55, 0, .55), 0 0 26px rgba(255, 200, 80, .35); }
.lbl-room.warn { background: linear-gradient(180deg, #ffcb47, #f0a300); color: #2a1a00; border-color: rgba(255, 240, 190, .5); box-shadow: 0 3px 0 rgba(90, 55, 0, .55); }
.lbl-room.danger { background: linear-gradient(180deg, #c8463c, #8f241d); color: #ffe9e5; border-color: rgba(255, 180, 170, .4); box-shadow: 0 3px 0 rgba(60, 10, 5, .55); }
.lbl-room.mystery { background: rgba(10, 8, 20, .55); color: #d8ccff; border: 1px solid rgba(185, 162, 255, .5); box-shadow: 0 0 30px rgba(185, 162, 255, .35); backdrop-filter: blur(6px); }
.lbl-room.sky { background: rgba(255, 255, 255, .78); color: #2b2015; border-color: rgba(255, 255, 255, .9); box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.lbl-room.find {
  background: linear-gradient(180deg, #2a2118, #17110b); color: #f1d9a6; border: 1px solid rgba(241, 217, 166, .45);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .5), 0 8px 18px rgba(0, 0, 0, .35); font-family: var(--f-ui);
}
.lbl-room.find .t::before { content: '🏺 '; }
.minimap-head { cursor: pointer; user-select: none; }
.minimap-head span:first-child::after { content: ' ▾'; opacity: .6; }
.minimap.collapsed .minimap-head span:first-child::after { content: ' ▸'; }
.minimap.collapsed .minimap-body { display: none; }
.lbl-floor {
  pointer-events: none; font-family: var(--f-display); color: rgba(255, 240, 215, .9); font-size: 22px; direction: rtl; text-align: right;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
}
.lbl-floor .s { font-family: var(--f-mono); font-size: 11px; color: rgba(255, 235, 200, .65); margin-top: 2px; }
.lbl-ant {
  font-family: var(--f-mono); font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 99px; direction: ltr;
  background: var(--honey); color: var(--honey-ink); box-shadow: 0 4px 14px rgba(245, 184, 61, .45);
  pointer-events: none;
}
.lbl-ant::after { content: ''; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; background: var(--honey); transform: translateX(-50%) rotate(45deg); border-radius: 2px; z-index: -1; }
/* נמלה מדברת: בועת דיבור לבנה */
/* (האנימציה על הטקסט הפנימי — לתווית עצמה יש transform של המיקום על המסך) */
.lbl-ant.talk { background: #fffaf0; color: #2b1a06; font-family: var(--f-ui); font-weight: 600; font-size: 12.5px; padding: 6px 11px; border-radius: 12px; white-space: nowrap; }
.lbl-ant.talk::after { background: #fffaf0; }
.lbl-ant.talk span { display: inline-block; animation: talkIn .35s var(--spring); }
@keyframes talkIn { from { opacity: 0; transform: translateY(5px) scale(.7); } to { opacity: 1; transform: none; } }
.lbl-crumb { font-size: 18px; filter: drop-shadow(0 0 8px rgba(255, 210, 90, .9)); }

/* ---------- מעקב / תולעת ---------- */
.follow-chip {
  position: fixed; z-index: 21; left: 50%; transform: translate(-50%, 20px); bottom: calc(150px + var(--safe-b));
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 99px; font-size: 13.5px;
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .4s var(--spring);
}
.follow-chip.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.follow-chip button { width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 230, 190, .1); font-size: 12px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--honey); box-shadow: 0 0 0 0 rgba(245, 184, 61, .6); animation: live 1.6s infinite; display: inline-block; }

.worm-hud { position: fixed; z-index: 21; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); display: none; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 20px); }
body.worm .worm-hud { display: flex; }
.worm-hint {
  position: fixed; left: 50%; top: calc(160px + var(--safe-t)); transform: translate(-50%, -6px);
  padding: 8px 14px; border-radius: 99px; font-size: 13px; color: var(--ink-2); white-space: nowrap;
  opacity: 0; transition: opacity .5s, transform .5s var(--ease-out); pointer-events: none;
}
.worm-hint.on { opacity: 1; transform: translate(-50%, 0); }
.worm-exit { flex: none; }
.drops {
  position: fixed; z-index: 21; right: 14px; top: calc(160px + var(--safe-t)); display: none; align-items: center; gap: 6px;
  padding: 7px 12px 7px 10px; border-radius: 99px; font-size: 14px; direction: ltr;
}
body.worm .drops { display: flex; }
.drops b { font-family: var(--f-mono); font-size: 15px; color: var(--honey-2); }
.drop-total { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); }
.drop-time { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.drop-time:not(:empty) { margin-inline-start: 4px; padding-inline-start: 8px; border-inline-start: 1px solid var(--line-2); }
.drop-arrow { display: inline-block; color: var(--honey); font-size: 13px; transition: transform .15s linear; width: 14px; text-align: center; }
.drops.pop { animation: pop .5s var(--spring); }
.drops.done .drop-arrow { display: none; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.minimap-dots { position: absolute; inset: 0; pointer-events: none; display: none; }
body.worm .minimap-dots { display: block; }
.minimap-dots i { position: absolute; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: #ffc23d; box-shadow: 0 0 6px #ffb000; }
.minimap-sel { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--honey); border: 2px solid #fff; display: none; pointer-events: none; box-shadow: 0 0 8px rgba(245, 184, 61, .9); }
.minimap-sel.on { display: block; }
body.worm .minimap-sel { display: none; }
.visit-pill {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 16px; border-radius: 99px; font-size: 14px; color: var(--ink);
  min-width: 0; white-space: nowrap; overflow: hidden;
  opacity: 0; transform: translateY(10px) scale(.96); pointer-events: none; transition: opacity .35s, transform .45s var(--spring);
}
.visit-pill.on { opacity: 1; transform: none; pointer-events: auto; }
.visit-pill .go { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 99px; background: var(--honey); color: var(--honey-ink); }
.visit-pill .count { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); }
/* הטקסט נחתך עם … — המונה והכפתור תמיד נשארים גלויים */
.visit-pill > span:first-child { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.visit-pill .count, .visit-pill .go { flex: none; }
body.worm .bottom, body.worm .side-tools { opacity: 0; pointer-events: none; }
body.worm .bottom { transform: translate(-50%, 30px); }
.joystick {
  position: fixed; z-index: 22; width: 120px; height: 120px; border-radius: 50%; display: none;
  border: 1.5px solid rgba(255, 230, 190, .35); background: rgba(20, 12, 6, .35); backdrop-filter: blur(6px);
  transform: translate(-50%, -50%); pointer-events: none;
}
.joystick.on { display: block; }
.joystick .knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: linear-gradient(180deg, var(--honey-2), var(--honey)); box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }

/* ---------- טיפים לביקור ראשון ---------- */
.coach {
  position: fixed; z-index: 60; width: min(280px, calc(100vw - 32px)); padding: 14px 16px 10px; border-radius: 16px;
  opacity: 0; transform: translateY(6px) scale(.97); pointer-events: none; transition: opacity .3s, transform .4s var(--spring);
}
.coach.on { opacity: 1; transform: none; pointer-events: auto; }
.coach-text { font-size: 15px; line-height: 1.5; color: var(--ink); }
.coach-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; color: var(--ink-3); }
.coach-foot button { font-size: 12.5px; color: var(--ink-3); padding: 4px 8px; border-radius: 8px; }
.coach-foot .coach-next { background: var(--honey); color: var(--honey-ink); font-weight: 700; margin-inline-start: 4px; }
.coach-arrow { position: absolute; width: 14px; height: 14px; background: var(--glass-strong); border: 1px solid var(--line-2); transform: rotate(45deg); }
.coach-target { box-shadow: 0 0 0 3px rgba(245, 184, 61, .9), 0 0 0 8px rgba(245, 184, 61, .25) !important; animation: coachPulse 1.4s infinite; }
@keyframes coachPulse { 50% { box-shadow: 0 0 0 3px rgba(245, 184, 61, .9), 0 0 0 14px rgba(245, 184, 61, 0) !important; } }

/* ---------- תצוגת תמונה (שמירה בלחיצה ארוכה בדפדפנים בתוך אפליקציות) ---------- */
.imgview { position: fixed; inset: 0; z-index: 95; display: none; place-items: center; padding: 16px; background: rgba(8, 5, 3, .78); }
.imgview.on { display: grid; }
.imgview-card { width: min(420px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 22px; padding: 14px; display: grid; gap: 12px; justify-items: center; }
.imgview-card img { display: block; max-height: 60vh; max-width: 100%; border-radius: 14px; -webkit-touch-callout: default; user-select: auto; -webkit-user-select: auto; }
.imgview-card p { margin: 0; text-align: center; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.imgview-card p b { color: var(--ink); }
.imgview-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }

/* ---------- טוסטים ---------- */
.toasts { position: fixed; z-index: 50; top: calc(160px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: min(440px, calc(100vw - 32px)); }
.toast {
  padding: 11px 16px; border-radius: 14px; font-size: 14px; text-align: center;
  background: var(--glass-strong); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  animation: toastIn .45s var(--spring) both; pointer-events: auto;
}
.toast b { color: var(--honey-2); }
.toast.out { animation: toastOut .35s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

.busy { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; background: rgba(10, 6, 3, .45); }
.busy.on { display: grid; }
.busy-card { padding: 18px 22px; border-radius: 18px; display: flex; gap: 12px; align-items: center; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 230, 190, .2); border-top-color: var(--honey); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.fatal { position: fixed; inset: 0; z-index: 200; display: none; place-items: center; padding: 24px; background: #140d08; }
.fatal.on { display: grid; }
.fatal-card { padding: 28px; border-radius: 22px; max-width: 420px; text-align: center; }
.fatal-card h2 { font-family: var(--f-display); font-weight: 400; margin: 0 0 8px; }
.fatal-card p { color: var(--ink-2); margin: 0; }

/* ---------- הגרסה הקלה (מכשירים בלי WebGL2) ---------- */
.fatal.lite-on {
  place-items: start center; overflow-y: auto; padding: calc(16px + var(--safe-t)) 14px calc(28px + var(--safe-b));
  background: radial-gradient(ellipse at 50% 0%, #3a2414, #140d08 70%);
}
.lite { width: min(480px, 100%); border-radius: 24px; padding: 20px 18px 22px; }
.lite-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lite-head .brandmark { width: 42px; height: 42px; border-radius: 12px; }
.lite-sub { font-size: 12.5px; color: var(--ink-3); }
.lite-note { color: var(--ink-2); margin: 0 0 12px; line-height: 1.55; }
.lite-tip { margin: 0 0 12px; padding: 9px 12px; border-radius: 12px; background: rgba(245, 184, 61, .1); border: 1px solid rgba(245, 184, 61, .3); font-size: 13.5px; color: var(--ink-2); }
.lite-tip b { color: var(--ink); }
.lite .search { margin-bottom: 14px; }
.lite a.btn { text-decoration: none; }
.lite .suggest { top: calc(100% + 6px); bottom: auto; z-index: 3; }
.lite .suggest li { padding: 0; }
.lite .suggest li button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; color: inherit; font: inherit; }
body.lite .toasts { z-index: 210; }

/* ---------- מצב ריל ---------- */
.reel { position: fixed; inset: 0; z-index: 70; pointer-events: none; display: none; }
body.reel .reel { display: block; }
body.reel .topbar, body.reel .ticker, body.reel .viewtoggle, body.reel .side-tools, body.reel .minimap, body.reel .bottom,
body.reel .sheet, body.reel .toasts, body.reel .follow-chip, body.reel .coach, body.reel .intro, body.reel .worm-hud, body.reel .drops { display: none !important; }
body.reel #stage { cursor: default; }
/* מחוץ למסגרת 9:16 — מוחשך, כדי שיהיה קל לחתוך לריל */
.reel-side { position: absolute; top: 0; bottom: 0; width: max(0px, calc((100vw - 56.25vh) / 2)); background: rgba(8, 5, 3, .72); }
.reel-side.l { left: 0; } .reel-side.r { right: 0; }
.reel-title {
  position: absolute; left: 50%; top: 13%; width: min(52vh, 92vw); transform: translate(-50%, 14px); text-align: center;
  opacity: 0; filter: blur(6px); transition: opacity .55s ease, transform .7s var(--ease-out), filter .55s ease;
}
.reel-title.on { opacity: 1; transform: translate(-50%, 0); filter: none; }
.reel-title .k { font-family: var(--f-mono); font-weight: 700; font-size: clamp(14px, 2.1vh, 20px); color: var(--honey-2); letter-spacing: 1px; text-shadow: 0 2px 12px rgba(0, 0, 0, .7); }
.reel-title .t {
  font-family: var(--f-display); font-size: clamp(36px, 6.6vh, 68px); line-height: 1.05; margin: 6px 0 8px; color: #fff6e6;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .75), 0 2px 4px rgba(0, 0, 0, .6); overflow-wrap: anywhere;
}
.reel-title .t.handle { font-family: var(--f-mono); font-weight: 700; direction: ltr; font-size: clamp(28px, 4.8vh, 50px); }
.reel-title .s { font-size: clamp(16px, 2.5vh, 24px); color: var(--ink); text-shadow: 0 2px 14px rgba(0, 0, 0, .8); }
.reel-mark {
  position: absolute; left: 50%; bottom: 4.5%; transform: translateX(-50%); padding: 8px 16px; border-radius: 99px;
  background: rgba(20, 13, 8, .55); border: 1px solid var(--line-2); font-weight: 600; font-size: clamp(13px, 1.9vh, 18px); white-space: nowrap;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.reel-mark .h { font-family: var(--f-mono); direction: ltr; unicode-bidi: isolate; color: var(--honey-2); }

/* הקלטת הריל כווידאו: הקנבס מצויר ב-1080×1920 ומוצג בפס אנכי */
body.rec #scene { object-fit: contain; background: #000; }
.rec-chip {
  position: fixed; z-index: 75; top: calc(14px + var(--safe-t)); left: 14px; display: none;
  padding: 7px 14px 7px 12px; border-radius: 99px; background: rgba(20, 8, 6, .78); border: 1px solid rgba(255, 90, 78, .5);
  color: #ffd6d1; font: 600 13px var(--f-ui); direction: rtl;
}
body.rec .rec-chip { display: block; }
.vidview { position: fixed; inset: 0; z-index: 96; display: grid; place-items: center; padding: 16px; background: rgba(8, 5, 3, .8); }
.vidview-card { width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 22px; padding: 16px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.vidview-card h3 { margin: 0; font-size: 20px; }
.vidview-card p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.vidview-card p b { color: var(--ink); }
.vidview-card video { display: block; max-height: 58vh; max-width: 100%; border-radius: 14px; background: #000; }
.vidview-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }

/* =========================================================
   מובייל
   ========================================================= */
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .topbar { height: 48px; gap: 8px; top: calc(8px + var(--safe-t)); width: calc(100vw - 16px); border-radius: 16px; }
  .brand-name { font-size: 20px; }
  .brandmark { width: 28px; height: 28px; }
  .stats { font-size: 12px; text-align: center; }
  .stats b { font-size: 12px; }
  .depth-chip { min-width: 0; padding: 4px 7px; font-size: 11.5px; }
  .icon-btn { width: 36px; height: 36px; }
  .ticker { top: calc(62px + var(--safe-t)); height: 28px; width: calc(100vw - 32px); }
  .viewtoggle { top: calc(98px + var(--safe-t)); }
  .viewtoggle button { height: 32px; padding: 0 12px; font-size: 13px; }
  .minimap { display: none; }
  body.worm .minimap { display: grid; width: 74px; padding: 5px; left: 8px; top: calc(140px + var(--safe-t)); }
  body.worm .minimap-head { display: none; }
  .drops { right: 8px; top: calc(140px + var(--safe-t)); padding: 6px 10px; font-size: 13px; }
  .depth-chip .st { display: none; }
  .side-tools { left: 8px; top: auto; bottom: calc(150px + var(--safe-b)); transform: none; }
  .side-tools .icon-btn { width: 40px; height: 40px; }
  .bottom { width: calc(100vw - 16px); bottom: calc(10px + var(--safe-b)); gap: 8px; }
  .search { height: 48px; }
  .navrow { display: grid; grid-template-columns: 1.1fr 1fr 1fr; width: 100%; gap: 6px; }
  .navrow .btn { padding: 0 8px; font-size: 14px; height: 42px; }
  .intro { padding: 12px; align-items: end; padding-bottom: calc(18px + var(--safe-b)); overflow-y: auto; }
  .intro-card { padding: 26px 20px 20px; border-radius: 24px; margin-top: auto; }
  .intro-card > .kicker { letter-spacing: .4px; }
  .intro-sub { font-size: 15px; margin-bottom: 16px; }
  .intro-actions { grid-template-columns: 1fr; }
  .btn-lg { height: 50px; }
  .sheet {
    top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 82vh; border-radius: 24px;
    transform: translateY(calc(100% + 30px));
  }
  .sheet.open { transform: none; }
  .sheet-grip { display: block; width: 44px; height: 5px; border-radius: 9px; background: rgba(255, 230, 190, .25); margin: 10px auto 0; flex: none; }
  .sheet-body { padding: 14px 18px 22px; }
  .sheet h2 { font-size: 26px; }
  .follow-chip { bottom: calc(140px + var(--safe-b)); }
  .toasts { top: calc(140px + var(--safe-t)); }
}

/* טלפון קטן בתוך הדפדפן של אינסטגרם: הסרגלים של האפליקציה אוכלים גובה */
@media (max-width: 720px) and (max-height: 620px) {
  .intro-card { padding: 20px 18px 16px; }
  .intro-title { font-size: 46px; margin: 4px 0 8px; }
  .intro-sub { font-size: 14px; line-height: 1.5; margin-bottom: 12px; }
  .progress { margin-bottom: 14px; }
  .intro-actions { gap: 8px; }
  .btn-lg { height: 44px; }
}

@media (max-width: 400px) {
  .brand-name { font-size: 18px; }
  .stats { font-size: 11.5px; }
  .viewtoggle button { padding: 0 9px; font-size: 12.5px; gap: 5px; }
}

/* טלפון לרוחב (או חלון נמוך): טיקר ובורר בשורה אחת, תחתית בשורה אחת — שיישאר מקום למושבה */
@media (max-height: 520px) and (min-width: 600px) {
  :root { --row-w: min(720px, calc(100vw - 16px - var(--safe-l) - var(--safe-r))); --row-x: calc((100vw - var(--row-w)) / 2); }
  .topbar { top: calc(6px + var(--safe-t)); height: 44px; width: var(--row-w); border-radius: 14px; }
  .brand-name { font-size: 20px; }
  .brandmark { width: 28px; height: 28px; }
  .icon-btn { width: 36px; height: 36px; }
  .ticker { top: calc(56px + var(--safe-t)); height: 30px; left: auto; right: var(--row-x); transform: none; width: calc(var(--row-w) - 232px); }
  .viewtoggle { top: calc(56px + var(--safe-t)); left: var(--row-x); transform: none; padding: 2px; border-radius: 12px; }
  .viewtoggle button { height: 26px; padding: 0 10px; font-size: 12.5px; gap: 5px; }
  .viewtoggle button svg { width: 15px; height: 15px; }
  .side-tools { left: calc(8px + var(--safe-l)); bottom: calc(8px + var(--safe-b)); gap: 6px; }
  .side-tools .icon-btn { width: 38px; height: 38px; border-radius: 12px; }
  .bottom {
    left: calc(56px + var(--safe-l)); right: calc(8px + var(--safe-r)); width: auto; transform: none;
    bottom: calc(8px + var(--safe-b)); grid-template-columns: 1fr auto; align-items: center; gap: 8px;
  }
  body.worm .bottom { transform: translateY(30px); }
  .search { height: 44px; border-radius: 14px; }
  .suggest { max-height: 52vh; }
  .navrow { flex-wrap: nowrap; gap: 6px; }
  .navrow .btn { height: 44px; padding: 0 14px; font-size: 14px; }
  .minimap { display: none; }
  body.worm .minimap { display: grid; width: 74px; padding: 5px; left: calc(8px + var(--safe-l)); top: calc(96px + var(--safe-t)); }
  body.worm .minimap-head { display: none; }
  .minimap-body { max-height: calc(100vh - 150px); }
  .toasts, .worm-hint { top: calc(98px + var(--safe-t)); }
  .drops { top: calc(96px + var(--safe-t)); right: calc(8px + var(--safe-r)); padding: 6px 10px; font-size: 13px; }
  .follow-chip { bottom: calc(62px + var(--safe-b)); }
  .worm-hud { bottom: calc(8px + var(--safe-b)); }
  .sheet { top: calc(8px + var(--safe-t)); bottom: 8px; right: calc(8px + var(--safe-r)); width: min(370px, 47vw); }
  /* כרטיס הפתיחה בשתי עמודות: הסיפור מימין, ההתקדמות והכפתורים משמאל */
  .intro { padding: 10px; overflow-y: auto; }
  .intro-card { margin: auto; width: min(800px, 100%); padding: 20px 24px; display: grid; grid-template-columns: 1.15fr 1fr; column-gap: 28px; }
  .intro-card > .kicker, .intro-title, .intro-sub { grid-column: 1; }
  .intro-title { font-size: 50px; margin: 4px 0 8px; }
  .intro-sub { font-size: 14px; line-height: 1.55; margin: 0; }
  .progress { grid-column: 2; grid-row: 1 / 3; align-self: end; margin-bottom: 12px; }
  .intro-actions { grid-column: 2; grid-row: 3; align-self: end; grid-template-columns: 1fr; gap: 8px; }
  .btn-lg { height: 44px; }
}

/* בטלפונים: טשטוש רקע מעל קנבס מונפש עולה ביוקר בכל פריים — רקע אטום יותר במקום */
@media (pointer: coarse) {
  .glass, .btn-glass, .lbl-room.mystery, .joystick, .reel-mark { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  .glass, .btn-glass { background: rgba(26, 17, 10, 0.9); }
  .glass-strong { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: rgba(22, 15, 9, 0.97); }
  .lbl-room.mystery { background: rgba(14, 11, 26, .88); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
