/* ===== THE GUIDE (tools/32-fieldguide.js): the flower with 9 neurons around it + full-screen pages + tab bar =====
   Cognose's own look: one color (your accent) on the page color, dark or light like the rest of the app. */
body{
  --fg-acc-soft: color-mix(in srgb, var(--accent) 16%, var(--card));
  --fg-acc-line: color-mix(in srgb, var(--accent) 45%, var(--border));
  --fg-glow: color-mix(in srgb, var(--accent) 40%, transparent);
}

/* The old canvas stays underneath, quiet */
body.fg #main{height:100vh !important;width:100% !important;min-height:0;overflow:hidden}
body.fg #neuronLinks{display:none}
body.fg .neuron-node:not(.fg-page){display:none !important}
body.fg #navDock,body.fg #topDock .nav-switch,body.fg .neuron-tray{display:none !important}
body.fg.has-dock{padding-bottom:0}
body.fg{overflow:hidden}

/* ---------- Home: the flower and its 9 neurons ---------- */
.fg-home-screen{position:fixed;inset:0;z-index:100;overflow:hidden auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.8rem;
  padding:1rem 1rem calc(1.6rem + env(safe-area-inset-bottom));
  background:radial-gradient(circle at 50% 44%, color-mix(in srgb, var(--accent) 10%, var(--bg)) 0%, var(--bg) 58%)}
.fg-home-screen[hidden]{display:none}
.fg-rays{position:absolute;inset:0;pointer-events:none;opacity:.6;
  background:repeating-conic-gradient(from 0deg at 50% 44%, color-mix(in srgb, var(--accent) 9%, transparent) 0 .6deg, transparent .6deg 10deg);
  -webkit-mask:radial-gradient(circle at 50% 44%, #000 0 6%, rgba(0,0,0,.5) 20%, transparent 46%);
          mask:radial-gradient(circle at 50% 44%, #000 0 6%, rgba(0,0,0,.5) 20%, transparent 46%);
  animation:fgRays 160s linear infinite}
@keyframes fgRays{to{transform:rotate(360deg)}}

.fg-book{position:relative;width:900px;height:700px;zoom:var(--fgs, 1);flex-shrink:0}
.fg-cover{display:none}
/* the orbit the neurons travel on */
.fg-orbit{position:absolute;left:450px;top:330px;width:476px;height:476px;margin:-238px 0 0 -238px;border-radius:50%;pointer-events:none;
  border:1px dashed var(--fg-acc-line);animation:fgSpin 120s linear infinite}
.fg-orbit::before{content:'';position:absolute;inset:44px;border-radius:50%;border:1px solid color-mix(in srgb, var(--accent) 14%, transparent)}
.fg-orbit::after{content:'';position:absolute;top:-4px;left:calc(50% - 4px);width:8px;height:8px;border-radius:50%;background:var(--accent);box-shadow:0 0 12px var(--accent)}
@keyframes fgSpin{to{transform:rotate(360deg)}}

.fg-center{position:absolute;left:450px;top:330px;width:0;height:0}
.fg-center .neuron-core{position:absolute;left:0 !important;top:0 !important;transform:scale(2);transform-origin:center;z-index:1}
.fg-center .neuron-core:hover{transform:scale(2.12)}
.fg-center .neuron-core .core-hint{display:none}
.fg-center .core-orbit.o3{display:none}

/* hero level: a small pill, top left of the circle */
.fg-level{position:absolute;left:96px;top:64px;display:inline-flex;align-items:baseline;gap:.45rem;padding:.45rem .9rem;border-radius:999px;cursor:pointer;z-index:2;
  border:1.5px solid var(--fg-acc-line);background:var(--card);color:var(--text);box-shadow:0 8px 22px rgba(0,0,0,.18)}
.fg-level small{font-size:.66rem;font-weight:800;letter-spacing:.12em;color:var(--muted)}
.fg-level b{font-size:1.35rem;line-height:1;color:var(--accent)}
.fg-level i{font-style:normal;font-size:.78rem}
.fg-level:hover{border-color:var(--accent)}

/* the 9 neurons: round, one color */
.fg-dia{position:absolute;left:var(--x);top:var(--y);width:0;height:0;z-index:2}
.fg-gem{position:absolute;left:-44px;top:-44px;width:88px;height:88px;border-radius:50%;cursor:pointer;padding:0;color:var(--accent);
  border:2px solid var(--fg-acc-line);background:radial-gradient(circle at 50% 30%, var(--fg-acc-soft), var(--card) 75%);
  box-shadow:0 10px 26px rgba(0,0,0,.22);transition:transform .2s ease, border-color .2s ease, box-shadow .2s ease}
.fg-gem::before{content:'';position:absolute;inset:6px;border-radius:50%;border:1px solid color-mix(in srgb, var(--accent) 22%, transparent);pointer-events:none}
.fg-gem-in{position:relative;display:grid;place-items:center;width:100%;height:100%}
.fg-gem .nav-ic{width:32px;height:32px}
.fg-gem:hover,.fg-gem:focus-visible{border-color:var(--accent);box-shadow:0 0 0 4px var(--fg-glow), 0 12px 30px rgba(0,0,0,.25);transform:scale(1.07);outline:none}
.fg-gem:active{transform:scale(.95)}
.fg-gem kbd{position:absolute;right:-2px;top:-2px;background:var(--card);color:var(--accent);border-color:var(--fg-acc-line)}
.fg-alert{position:absolute;right:-4px;bottom:-2px;width:24px;height:24px;border-radius:50%;font-style:normal;font-weight:900;font-size:.8rem;
  display:grid;place-items:center;color:var(--bg);background:var(--accent);box-shadow:0 0 0 3px var(--bg);animation:fgPulse 1.8s ease-in-out infinite}
@keyframes fgPulse{50%{box-shadow:0 0 0 3px var(--bg), 0 0 14px var(--accent)}}
.fg-lbl{position:absolute;left:50%;top:52px;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:.1rem;text-align:center;white-space:nowrap;pointer-events:none}
.fg-lbl b{font-size:.8rem;font-weight:800;letter-spacing:.04em;color:var(--text)}
.fg-lbl small{font-size:.7rem;color:var(--muted)}
.fg-dia.locked .fg-gem{color:var(--muted);border-style:dashed;filter:grayscale(1);opacity:.6}
.fg-dia.locked .fg-lbl b{color:var(--muted)}
.fg-dia.locked .fg-lbl small{font-style:italic}

/* small round buttons under the circle: create, shop, gems, search, help, settings, edit */
.fg-orbs{position:relative;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:.45rem;max-width:min(900px, 100%);z-index:2}
.fg-orb{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:.35rem;min-width:44px;height:44px;padding:0 .75rem;border-radius:999px;cursor:pointer;
  border:1px solid var(--border);background:var(--card);color:var(--text);font-weight:800;font-size:.8rem;text-decoration:none;
  box-shadow:0 6px 16px rgba(0,0,0,.14);transition:transform .15s ease, border-color .15s}
.fg-orb:hover{transform:translateY(-2px);border-color:var(--accent);color:var(--accent)}
.fg-orb .nav-ic{width:18px;height:18px}
.fg-orb.shop,.fg-orb.edit{border-color:var(--fg-acc-line);color:var(--accent)}
.fg-orb-sep{width:1px;height:26px;background:var(--border);margin:0 .2rem}
.fg-brand{position:absolute;left:50%;bottom:calc(.5rem + env(safe-area-inset-bottom));transform:translateX(-50%);display:flex;align-items:center;gap:.4rem;
  font-size:.66rem;font-weight:800;letter-spacing:.3em;text-transform:uppercase;color:var(--muted);opacity:.7;pointer-events:none}
.fg-brand i{width:6px;height:6px;border-radius:50%;background:var(--accent);box-shadow:0 0 8px var(--accent)}

/* ---------- Pages: a neuron full screen ---------- */
body.fg .neuron-node.fg-page{position:fixed !important;left:0 !important;right:0 !important;top:var(--fg-bar, 60px) !important;bottom:0 !important;width:auto !important;height:auto !important;
  z-index:150 !important;border-radius:0 !important;border:none !important;box-shadow:none !important;display:flex !important;background:var(--bg) !important}
body.fg .neuron-node.fg-page .neuron-head,body.fg .neuron-node.fg-page .neuron-resize{display:none !important}
body.fg .neuron-node.fg-page .neuron-body{width:100%;max-width:var(--fg-max, 100%);margin:0 auto;padding:1.4rem 1.6rem 2.4rem;overflow:auto !important}
body.fg .neuron-node.fg-page.fg-enter{animation:fgPage .3s cubic-bezier(.2,.8,.2,1)}
@keyframes fgPage{from{opacity:0;transform:scale(.985) translateY(10px)}to{opacity:1;transform:none}}

/* the tab bar: the 9 neurons, the open one lit (Q / E move; tap the lit one again to go back to the flower) */
.fg-bar:empty{display:none}
.fg-bar{position:fixed;left:0;right:0;top:0;height:var(--fg-bar, 60px);z-index:160;display:flex;align-items:center;gap:.4rem;padding:0 .8rem;
  background:color-mix(in srgb, var(--card) 92%, transparent);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-bottom:1px solid var(--border)}
.fg-tabs{flex:1;min-width:0;display:flex;align-items:stretch;justify-content:center;gap:.15rem;overflow-x:auto;scrollbar-width:none;height:100%}
.fg-tabs::-webkit-scrollbar{display:none}
.fg-tab{position:relative;display:inline-flex;align-items:center;gap:.45rem;border:none;background:none;cursor:pointer;color:var(--muted);padding:0 .8rem;white-space:nowrap;
  font-weight:800;font-size:.8rem;transition:color .15s}
.fg-tab .nav-ic{width:18px;height:18px}
.fg-tab:hover{color:var(--text)}
.fg-tab.on{color:var(--accent)}
.fg-tab.on::after{content:'';position:absolute;left:16%;right:16%;bottom:7px;height:3px;border-radius:3px;background:var(--accent);box-shadow:0 0 10px var(--fg-glow)}
.fg-tab .nb-badge{position:static;margin-left:-.2rem}
.fg-step{border:none;background:none;cursor:pointer;padding:.2rem}
.fg-step kbd{display:inline-block;min-width:28px;text-align:center;color:var(--accent);border-color:var(--fg-acc-line);background:var(--bg);font-size:.7rem;padding:.15rem .4rem;border-radius:8px}
.fg-home,.fg-close,.fg-gear{flex:0 0 auto;width:40px;height:40px;border-radius:50%;border:1px solid var(--border);background:var(--bg);color:var(--text);display:grid;place-items:center;cursor:pointer;font-size:1rem}
.fg-home:hover,.fg-close:hover,.fg-gear:hover,.fg-gear.on{border-color:var(--accent);color:var(--accent)}
.fg-gear .nav-ic{width:18px;height:18px}
.fg-home svg{width:26px;height:26px}
.fg-edit{flex:0 0 auto;display:inline-flex;align-items:center;gap:.35rem;height:36px;padding:0 .85rem;border-radius:999px;cursor:pointer;
  border:1px solid var(--fg-acc-line);background:var(--bg);color:var(--accent);font-weight:800;font-size:.76rem}
.fg-edit:hover{border-color:var(--accent)}
@media (hover:none){ .fg-step{display:none} }
@media (max-width: 1100px){ .fg-tab span{display:none} .fg-tab{padding:0 .7rem} .fg-tab.on span{display:inline} .fg-edit span{display:none} .fg-edit{width:36px;padding:0;justify-content:center} }

/* ---------- The shop pop-up ---------- */
.modal.fg-shop-modal{width:min(620px, 94vw)}
.fg-shop-head{display:flex;align-items:center;gap:.6rem}
.fg-shop-head h3{flex:1}
.fg-shop-money{display:flex;gap:.6rem;font-weight:800}
.fg-shop-money a{color:inherit;text-decoration:none}
.fg-shop-list{display:flex;flex-direction:column;gap:.45rem;max-height:min(60vh, 560px);overflow:auto;margin:.6rem 0}
.fg-shop-item{display:flex;align-items:center;gap:.6rem;padding:.5rem .6rem;border-radius:12px;border:1px solid var(--border);background:var(--bg)}
.fg-shop-ic{font-size:1.6rem;width:2.2rem;text-align:center}
.fg-shop-txt{flex:1;min-width:0;display:flex;flex-direction:column}
.fg-shop-txt small{color:var(--muted);font-size:.74rem}
.fg-shop-txt em{font-style:normal;color:var(--accent);font-size:.78rem}
.fg-shop-foot{display:flex;gap:.5rem;justify-content:flex-end;flex-wrap:wrap}
.fg-count{color:var(--accent);white-space:nowrap}

/* the e-mail reminder goes on top, away from the buttons */
body.fg .verify-bar{top:calc(.7rem + env(safe-area-inset-top));bottom:auto !important;z-index:170}
body.fg.fg-in .verify-bar{top:calc(var(--fg-bar, 60px) + .6rem)}
/* One menu now: no "quick menu / classic bar" choice, no "arrange" */
body.fg .me-modes,body.fg .menu-mode-btn,body.fg .theme-btns:has(.menu-mode-btn){display:none !important}
body.fg .quick-corner[onclick*="navSetMode"],body.fg .quick-corner[onclick*="neuronArrange"]{display:none}

/* ---------- Animations: the neurons orbit out of the flower into their places ---------- */
@property --fga{syntax:'<angle>';inherits:false;initial-value:0deg}
@property --fgr{syntax:'<length>';inherits:false;initial-value:0px}
@supports (transform: translateX(calc(cos(0deg) * 1px))){
  .fg-dia{left:450px;top:330px;--fga:var(--a);--fgr:var(--r);transform:translate(calc(cos(var(--fga)) * var(--fgr)), calc(sin(var(--fga)) * var(--fgr) * var(--sy, 1)))}
  .fg-anim .fg-dia{animation:fgOrbitIn 1.05s cubic-bezier(.22,.9,.24,1) both;animation-delay:calc(var(--i) * 70ms + 120ms)}
  @keyframes fgOrbitIn{
    from{--fga:calc(var(--a) - 230deg);--fgr:0px;opacity:0}
    25%{opacity:1}
    to{--fga:var(--a);--fgr:var(--r);opacity:1}
  }
}
.fg-anim .fg-gem{animation:fgGemIn 1.05s cubic-bezier(.22,.9,.24,1) both;animation-delay:calc(var(--i) * 70ms + 120ms)}
@keyframes fgGemIn{from{transform:scale(.2) rotate(-200deg);box-shadow:0 0 30px var(--accent)}to{transform:none}}
.fg-anim .fg-lbl{animation:fgLblIn .4s ease-out both;animation-delay:calc(var(--i) * 70ms + 900ms)}
@keyframes fgLblIn{from{opacity:0;transform:translate(-50%, -6px)}to{opacity:1;transform:translate(-50%, 0)}}
.fg-anim .fg-center .neuron-core{animation:fgBloom .7s cubic-bezier(.2,1.3,.4,1) both}
@keyframes fgBloom{from{transform:scale(.2) rotate(-120deg);opacity:0}to{transform:scale(2);opacity:1}}
.fg-anim .fg-orbit{animation:fgRing 1.2s ease-out both, fgSpin 120s linear 1.2s infinite}
@keyframes fgRing{from{transform:scale(.1) rotate(-90deg);opacity:0}to{transform:none;opacity:1}}
.fg-anim .fg-level{animation:fgDrop .5s cubic-bezier(.2,1.4,.4,1) .8s both}
@keyframes fgDrop{from{transform:translateY(-24px);opacity:0}to{transform:none;opacity:1}}
.fg-anim .fg-orb{animation:fgPop .4s cubic-bezier(.2,1.5,.4,1) both;animation-delay:calc(var(--k, 0) * 25ms)}
@keyframes fgPop{from{transform:scale(0);opacity:0}to{transform:none;opacity:1}}
.fg-anim .fg-rays{animation:fgRaysIn 1.4s ease-out both, fgRays 160s linear infinite}
@keyframes fgRaysIn{from{opacity:0}to{opacity:.6}}
/* always: the neurons breathe softly, each at its own pace */
.fg-gem-in{animation:fgFloat 4.6s ease-in-out infinite;animation-delay:calc(var(--i, 0) * -.5s)}
@keyframes fgFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
.fg-gem:hover .fg-gem-in{animation-play-state:paused}

/* ---------- Micro tutorial: the lit part of the page ---------- */
.mt-spot{position:relative;z-index:30;border-radius:14px;outline:3px solid var(--accent);outline-offset:4px;
  box-shadow:0 0 0 9999px rgba(0,0,0,.55), 0 0 26px var(--fg-glow);transition:box-shadow .25s ease}
.fg-bar.mt-spot{position:fixed;z-index:200;border-radius:0;outline-offset:-3px}   /* the whole bar lit by the tutorial: it stays where it is */
body.theme-light .mt-spot{box-shadow:0 0 0 9999px rgba(0,0,0,.35), 0 0 26px var(--fg-glow)}
body.mt-running .tour-card.mt-card{z-index:9600;max-width:min(420px, calc(100vw - 24px))}
.mt-wait{font-size:.78rem;font-weight:700;color:var(--accent);animation:fgPulseText 1.4s ease-in-out infinite}
@keyframes fgPulseText{50%{opacity:.5}}

/* ---------- Phones & tablets upright: a 3 × 3 grid around the flower, the tab bar at the bottom ---------- */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){
  .fg-home-screen{justify-content:flex-start;padding-top:calc(.8rem + env(safe-area-inset-top));padding-bottom:calc(2.4rem + env(safe-area-inset-bottom))}
  .fg-book{zoom:1 !important;width:100%;max-width:520px;height:auto;display:grid;grid-template-columns:repeat(3, 1fr);gap:1.2rem .4rem;padding-top:.4rem}
  .fg-orbit{display:none}
  .fg-level{position:relative;left:auto;top:auto;grid-column:1 / -1;justify-self:center}
  .fg-center{position:relative;left:auto;top:auto;grid-column:1 / -1;width:100%;height:130px}
  .fg-center .neuron-core{left:50% !important;top:50% !important;transform:scale(1.5)}
  .fg-dia{position:relative;left:auto !important;top:auto !important;transform:none !important;width:auto;height:auto;display:flex;flex-direction:column;align-items:center;gap:.45rem}
  .fg-gem{position:relative;left:auto;top:auto;width:76px;height:76px}
  .fg-gem .nav-ic{width:28px;height:28px}
  .fg-gem kbd{display:none}
  .fg-lbl{position:static;transform:none;white-space:normal}
  .fg-lbl b{font-size:.72rem}
  .fg-lbl small{font-size:.62rem}
  .fg-orbs{flex-wrap:nowrap;overflow-x:auto;justify-content:flex-start;width:100%;padding:.2rem .1rem;scrollbar-width:none}
  .fg-orbs::-webkit-scrollbar{display:none}
  .fg-orb{flex:0 0 auto}
  .fg-orb span{display:none}
  .fg-anim .fg-dia{animation:fgGridIn .8s cubic-bezier(.22,.9,.24,1) both !important;animation-delay:calc(var(--i) * 60ms + 150ms) !important}
  @keyframes fgGridIn{from{transform:translateY(-120px) scale(.2) rotate(-180deg);opacity:0}to{transform:none;opacity:1}}
  .fg-anim .fg-lbl{animation-name:fgLblInM}
  @keyframes fgLblInM{from{opacity:0}to{opacity:1}}
  .fg-anim .fg-center .neuron-core{animation:fgBloomM .7s cubic-bezier(.2,1.3,.4,1) both}
  @keyframes fgBloomM{from{transform:scale(.2) rotate(-120deg);opacity:0}to{transform:scale(1.5);opacity:1}}

  body.fg .neuron-node.fg-page{top:0 !important;bottom:calc(var(--fg-bar, 60px) + env(safe-area-inset-bottom)) !important}
  body.fg .neuron-node.fg-page .neuron-body{padding:.9rem .8rem 1.6rem}
  .fg-bar{top:auto;bottom:0;height:calc(var(--fg-bar, 60px) + env(safe-area-inset-bottom));padding:0 .4rem env(safe-area-inset-bottom);border-bottom:none;border-top:1px solid var(--border)}
  .fg-tabs{justify-content:flex-start}
  .fg-tab{padding:0 .75rem}
  .fg-tab span,.fg-tab.on span{display:none}
  .fg-tab .nav-ic{width:22px;height:22px}
  .fg-tab.on::after{bottom:auto;top:5px}
  .fg-close{display:none}
  body.fg.fg-in .verify-bar{top:calc(.6rem + env(safe-area-inset-top))}
}
/* Phones sideways: the circle, small */
@media (orientation: landscape) and (max-height: 520px){
  .fg-orbs{flex-wrap:nowrap;overflow-x:auto;justify-content:flex-start;scrollbar-width:none}
  .fg-orb span{display:none}
  body{--fg-bar:50px}
}
@media (prefers-reduced-motion: reduce){
  .fg-anim .fg-dia,.fg-anim .fg-gem,.fg-anim .fg-lbl,.fg-anim .fg-orb,.fg-anim .fg-level,.fg-anim .fg-center .neuron-core,.fg-anim .fg-orbit,.fg-gem-in,.fg-orbit,.fg-rays,body.fg .neuron-node.fg-page.fg-enter{animation:none !important}
}
.fg-dia.fg-free .fg-gem{border-style:dashed;background:transparent;box-shadow:none;font-size:1.8rem;font-weight:300}
.fg-dia.fg-free .fg-lbl b{color:var(--muted)}
.fg-dia.fg-free .fg-gem::before{display:none}

/* ---------- Pixel art (tools/34-pixelart.js): crisp pixels, smooth light around them (HD-2D) ---------- */
.px-ic,.px-medal{image-rendering:pixelated;image-rendering:crisp-edges;display:block}
.fg-gem.px{border:none;background:none;box-shadow:none}
.fg-gem.px::before{display:none}
.fg-gem.px .px-medal{width:100%;height:100%;filter:drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 45%, transparent)) drop-shadow(0 8px 14px rgba(0,0,0,.35))}
.fg-gem.px:hover,.fg-gem.px:focus-visible{box-shadow:none}
.fg-gem.px:hover .px-medal{filter:drop-shadow(0 0 16px var(--accent)) drop-shadow(0 8px 14px rgba(0,0,0,.35)) brightness(1.12)}
.fg-dia.locked .fg-gem.px{opacity:.55;filter:grayscale(1)}
.fg-tab .px-ic{width:22px;height:22px}
.fg-tab:not(.on) .px-ic{filter:grayscale(.85) brightness(.85);opacity:.75}
.fg-tab:hover .px-ic{filter:none;opacity:1}
.fg-orb .px-ic{width:22px;height:22px}
.fg-gear .px-ic{width:20px;height:20px}
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){ .fg-gem.px{width:80px;height:80px} }

/* HP: a game life badge with a little bar */
.fg-hp{display:inline-block;font-style:normal;font-weight:700;font-size:.62rem;line-height:1;padding:.14rem .3rem .1rem;border-radius:3px;
  color:#fff;background:#e0464f;box-shadow:inset 0 -2px 0 rgba(0,0,0,.25), 0 0 0 1px rgba(0,0,0,.35);letter-spacing:.06em;vertical-align:1px;image-rendering:pixelated}
.fg-hpbar{display:inline-block;width:38px;height:6px;border-radius:1px;background:color-mix(in srgb, #e0464f 22%, var(--card));box-shadow:0 0 0 1px rgba(0,0,0,.35);vertical-align:1px;overflow:hidden}
.fg-hpbar i{display:block;height:100%;background:linear-gradient(#ff7a82, #e0464f 60%, #b72f38)}

/* The orb: a pixel sphere, its neon glow smooth around it */
.neuron-core.px-orb{background-size:100% 100% !important;background-repeat:no-repeat !important;background-position:center !important;background-color:transparent !important;image-rendering:pixelated;
  box-shadow:0 0 16px 4px color-mix(in srgb, var(--accent) 70%, transparent), 0 0 46px 14px color-mix(in srgb, var(--accent) 40%, transparent), 0 0 110px 36px color-mix(in srgb, var(--accent) 18%, transparent) !important}

/* ---------- Electricity: nerves from the orb to each neuron, slow pulses, a spark on arrival ---------- */
.fg-nerves{position:absolute;left:0;top:0;pointer-events:none;overflow:visible;z-index:1;opacity:0;transition:opacity .8s ease}
.fg-nerves.on{opacity:1}
.fn-glow{fill:none;stroke:var(--accent);stroke-width:6;opacity:.06;stroke-linecap:round}
.fn-nerve{fill:none;stroke:var(--accent);stroke-width:1.3;opacity:.32;stroke-linecap:round}
.fn-twig{fill:none;stroke:var(--accent);stroke-width:1;opacity:.2;stroke-linecap:square}
.fn-pulse{fill:none;stroke:color-mix(in srgb, var(--accent) 60%, #fff);stroke-width:2.2;stroke-linecap:round;stroke-dasharray:7 93;stroke-dashoffset:100;
  filter:drop-shadow(0 0 4px var(--accent));animation:fnPulse var(--dur, 6s) linear var(--del, 0s) infinite}
@keyframes fnPulse{0%{stroke-dashoffset:100;opacity:0}8%{opacity:.95}70%{opacity:.9}88%{stroke-dashoffset:7;opacity:0}100%{stroke-dashoffset:7;opacity:0}}
.fn-syn{fill:color-mix(in srgb, var(--accent) 55%, #fff);opacity:0;filter:drop-shadow(0 0 6px var(--accent));animation:fnSyn var(--dur, 6s) ease-out var(--del, 0s) infinite}
@keyframes fnSyn{0%,78%{opacity:0;r:2}84%{opacity:.95;r:4.5}100%{opacity:0;r:2}}
/* the tab bar carries a faint current too */
.fg-bar::before{content:'';position:absolute;left:0;right:0;bottom:-1px;height:1px;pointer-events:none;
  background:linear-gradient(90deg, transparent 0 40%, color-mix(in srgb, var(--accent) 80%, #fff) 50%, transparent 60% 100%) 0 0 / 300% 100%;
  opacity:.55;animation:fgCurrent 7s linear infinite}
@keyframes fgCurrent{from{background-position:150% 0}to{background-position:-150% 0}}
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){ .fg-bar::before{bottom:auto;top:-1px} }
@media (prefers-reduced-motion: reduce){ .fn-pulse,.fn-syn,.fg-bar::before{animation:none;opacity:0} }

/* The orb can be grabbed and thrown: it bounces on its spring and floats back to the center */
.fg-center{will-change:transform}
.fg-center .neuron-core{cursor:grab;touch-action:none}
body.fg-orb-drag .fg-center .neuron-core{cursor:grabbing}
/* while the orb is being thrown, its big bloom stays hidden (it would cover the neurons) */
body.fg-orb-drag .fg-center .core-frac{opacity:0 !important;transition:opacity .15s}

/* ---------- The flower opens and closes (hover / click / tap / Q) ---------- */
@supports (transform: translateX(calc(cos(0deg) * 1px))){
  .fg-anim .fg-dia{animation:none}
  .fg-dia{transition:--fgr .75s cubic-bezier(.22,.9,.24,1), --fga .75s cubic-bezier(.22,.9,.24,1), opacity .3s ease;transition-delay:calc(var(--i) * 45ms)}
  .fg-closed .fg-dia{--fgr:0px;--fga:calc(var(--a) - 160deg);opacity:0;pointer-events:none;transition-delay:calc((8 - var(--i)) * 25ms)}
}
.fg-anim .fg-gem,.fg-anim .fg-lbl{animation:none}
.fg-gem{transition:transform .2s ease, rotate .75s cubic-bezier(.22,.9,.24,1), scale .75s cubic-bezier(.22,.9,.24,1), filter .2s}
.fg-closed .fg-gem{rotate:-200deg;scale:.25}
.fg-lbl{transition:opacity .35s ease .45s}
.fg-closed .fg-lbl{opacity:0;transition-delay:0s}
.fg-nerves{transition:opacity .5s ease}
.fg-closed .fg-nerves{opacity:0 !important}
.fg-orbit{transition:scale .7s ease, opacity .5s ease}
.fg-closed .fg-orbit{scale:.35;opacity:.25}
.fg-closed .fg-center .neuron-core{cursor:pointer}
/* phones: they spin out of the orb into the grid */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){
  .fg-dia{transition:translate .6s cubic-bezier(.22,.9,.24,1), scale .6s cubic-bezier(.22,.9,.24,1), opacity .3s ease;transition-delay:calc(var(--i) * 40ms)}
  .fg-closed .fg-dia{translate:0 -110px;scale:.3;opacity:0;pointer-events:none}
  .fg-anim .fg-dia{animation:none !important}
}
@media (prefers-reduced-motion: reduce){ .fg-dia,.fg-gem,.fg-lbl{transition:opacity .2s !important} .fg-closed .fg-gem{rotate:0deg;scale:1} }

/* HP in the app's own color */
.fg-hp{background:var(--accent);color:var(--bg)}
.fg-hpbar{background:color-mix(in srgb, var(--accent) 18%, var(--card))}
.fg-hpbar i{background:linear-gradient(color-mix(in srgb, var(--accent) 55%, #fff), var(--accent) 60%, color-mix(in srgb, var(--accent) 70%, #000))}

/* ---------- Lighter flower, readable neurons ---------- */
/* the flower behind the orb is see-through and smaller (it no longer runs under the neurons), with a soft glow only */
body.fg .fg-center .core-frac,body.fg .fg-center .neuron-core.bloom-big .core-frac{width:160px;height:160px;margin:-80px 0 0 -80px;opacity:.45}
body.fg .fg-center .core-frac canvas.fl-px{filter:drop-shadow(0 0 3px color-mix(in srgb, var(--accent) 35%, transparent))}
body.fg .fg-center .neuron-core.placed{animation-name:coreBreath, coreIn;animation-duration:4s, .35s}
/* the neurons sit above everything, their glow is calmer, and the names have a plate behind them */
.fg-dia{z-index:3}
.fg-gem.px{filter:drop-shadow(0 0 5px color-mix(in srgb, var(--accent) 40%, transparent))}
.fg-lbl{top:50px;padding:.18rem .55rem .22rem;border-radius:8px;background:color-mix(in srgb, var(--bg) 82%, transparent);
  box-shadow:0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent);backdrop-filter:blur(3px)}
.fg-lbl b{color:var(--text);text-shadow:0 1px 0 var(--bg)}
.fg-lbl small{color:color-mix(in srgb, var(--text) 70%, var(--muted))}
@media (max-width:700px), (orientation:portrait) and (max-width:900px), (orientation: landscape) and (max-height: 520px){ .fg-lbl{background:none;box-shadow:none;backdrop-filter:none;padding:0} }

/* ---------- Floating, throwable neurons + nerves plugged into them ---------- */
.fg-float .fg-dia{transition:opacity .3s ease !important}
.fg-float .fg-gem{cursor:grab;touch-action:none}
body.fg-gem-drag,body.fg-gem-drag .fg-gem{cursor:grabbing !important}
body.fg-gem-drag .fg-gem:hover{transform:scale(1.1)}
body.fg-gem-drag .fg-lbl{opacity:.35;transition:opacity .2s}
.fg-nerves{opacity:.8}
.fg-nerves.on{opacity:.8}
.fn-nerve{opacity:.42}
.fn-plug{fill:var(--bg);stroke:var(--accent);stroke-width:1.4;opacity:.85}
.fn-plug.a{opacity:.7}
.fn-plug.b{fill:var(--accent);stroke:color-mix(in srgb, var(--accent) 50%, #fff);filter:drop-shadow(0 0 3px var(--accent))}

/* the round buttons: always one horizontal row (Edit next to the Shop) */
.fg-orbs{flex-wrap:nowrap;max-width:calc(100vw - 32px);overflow-x:auto;scrollbar-width:none}
.fg-orbs::-webkit-scrollbar{display:none}
.fg-orbs > *{flex:0 0 auto}

/* No phantom scroll: the floating / thrown orb and neurons must never make the home screen taller or wider */
.fg-home-screen{overflow:hidden !important}
.fg-book{overflow:clip;overflow-clip-margin:24px}

/* ---------- Phones: the classic tab bar always at the bottom, everything visible without sideways scrolling ---------- */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){
  .fg-home-screen{justify-content:center;padding-bottom:calc(var(--fg-bar, 60px) + 1rem + env(safe-area-inset-bottom))}
  .fg-brand{display:none}
  .fg-home.on{border-color:var(--accent);box-shadow:0 0 10px var(--fg-glow)}
  /* the round buttons: two tidy rows instead of a strip that hides half of them */
  .fg-orbs{flex-wrap:wrap !important;justify-content:center !important;overflow:visible !important;max-width:100% !important;gap:.4rem;padding:0}
  .fg-orb{min-width:42px;height:42px;padding:0 .6rem}
  .fg-orb-sep{display:none}
  .fg-orb.shop span,.fg-orb.gems span{display:inline;font-size:.72rem}
  .fg-orb.edit span{display:none}
  /* the tab bar: every neuron fits, spread evenly */
  .fg-bar{gap:.25rem}
  .fg-tabs{justify-content:space-between !important;gap:0}
  .fg-tab{flex:1 1 0;justify-content:center;padding:0 .1rem;min-width:0}
  .fg-tab .px-ic{width:24px;height:24px}
  .fg-edit{width:34px;height:34px;padding:0;justify-content:center}
  .fg-edit span{display:none}
  .fg-home,.fg-gear{width:38px;height:38px}
  /* the flower behind the neurons stays small and faint so the names read clearly */
  body.fg .fg-center .core-frac{opacity:.35}
}
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){
  .fg-home-screen{justify-content:safe center}
  /* Edit and Settings already live in the tab bar below */
  .fg-orb.edit,.fg-orb.gear{display:none}
}
/* short phones: everything a bit smaller so the whole flower fits above the bar */
@media (max-width: 760px) and (max-height: 760px){
  .fg-book{gap:.7rem .4rem}
  .fg-center{height:104px}
  .fg-center .neuron-core{transform:scale(1.25)}
  .fg-gem{width:64px;height:64px}
  .fg-gem .px-medal{width:64px;height:64px}
  .fg-orb{height:38px;min-width:38px}
}

/* ---------- Tab bar v2: Q | orb + tabs + Edit (centered) | Settings, ✕ Esc | E ---------- */
.fg-side{display:contents}
.fg-bar{gap:.15rem;padding:0 .5rem}
.fg-bar .fg-home{margin-left:auto;margin-right:.35rem}
.fg-bar .fg-edit{margin-left:.35rem}
.fg-bar .fg-gear{margin-left:auto}
.fg-bar .fg-step.q{margin-right:.2rem}
.fg-bar .fg-step.e{margin-left:.2rem}
/* (03/11) the ⚙ Settings button left the bar (it lives at the bottom now): its margin balanced the orb's, and without it
   the whole bar slid to the right. The last button balances it again, so the bar stays centered */
#fgBar .fg-step.e{margin-right:auto !important}
.fg-close{width:auto;min-width:40px;padding:0 .6rem;border-radius:999px;gap:.35rem;display:inline-flex;align-items:center;justify-content:center}
.fg-close kbd{font-size:.62rem;padding:.05rem .3rem;border-radius:5px;color:var(--muted);background:var(--bg);border:1px solid var(--border)}
.fg-close:hover kbd{color:var(--accent);border-color:var(--fg-acc-line)}
@media (hover:none){ .fg-close kbd{display:none} .fg-close{padding:0;width:40px} }
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){
  .fg-bar{gap:0}
  .fg-bar .fg-home{margin:0 .2rem 0 0}
  .fg-bar .fg-gear{margin-left:0}
  .fg-bar .fg-edit{margin:0 .15rem}
  .fg-bar .fg-tab{flex:1 1 0;justify-content:center;padding:0 .1rem;min-width:0}
}

/* ---------- Phones held sideways: a mini version of the computer — the same bar on top, icons only ---------- */
@media (orientation: landscape) and (max-height: 520px){
  body{--fg-bar:46px}
  .fg-bar{height:var(--fg-bar);padding:0 .4rem;gap:.15rem}
  .fg-bar .fg-step{display:none}
  .fg-bar .fg-tab{padding:0 .45rem;min-width:0}
  .fg-bar .fg-tab span{display:none !important}
  .fg-bar .fg-tab .px-ic,.fg-bar .fg-tab .nav-ic{width:22px;height:22px}
  .fg-bar .fg-edit span{display:none}
  .fg-bar .fg-close kbd{display:none}
}

/* The Edit place on the circle: a real button, not an empty slot */
.fg-dia.fg-free .fg-gem{border:2px solid var(--fg-acc-line);border-style:solid;background:var(--card);color:var(--accent);font-size:1.9rem;font-weight:700}
.fg-dia.fg-free .fg-gem:hover{border-color:var(--accent)}
.fg-dia.fg-free .fg-lbl b{color:var(--accent)}

/* The open tab: just lit in your color (no line through or under the name) */
.fg-tab.on::after,.fg-bar .fg-tab.on::after{display:none !important}
.fg-tab.on{color:var(--accent);text-shadow:0 0 12px var(--fg-glow)}
.fg-tab.on .px-ic{filter:none;opacity:1}
.fg-bar .fg-tab{align-self:stretch}
@media (orientation: landscape) and (max-height: 520px){
  .fg-home-screen{gap:.4rem;padding:.4rem .6rem calc(.4rem + env(safe-area-inset-bottom))}
  .fg-brand,.fg-level{display:none}
  .fg-orb{height:36px;min-width:36px;padding:0 .5rem}
}
/* Settings right after Edit; only ✕ (Esc) and E stay on the right edge */
.fg-bar .fg-gear{margin-left:.35rem}
.fg-bar .fg-close{margin-left:auto}
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){ .fg-bar .fg-gear{margin-left:0} .fg-bar .fg-close{margin-left:0} }
@media (orientation: landscape) and (max-height: 520px){ .fg-bar .fg-gear,.fg-bar .fg-close{margin:0} }

/* The orb's wide glow is a soft round gradient behind it (the old 110 px shadow showed up as a dark square) */
body.fg .fg-center .neuron-core{box-shadow:0 0 4px 1px color-mix(in srgb, var(--accent) 90%, #fff), 0 0 16px 4px color-mix(in srgb, var(--accent) 70%, transparent), 0 0 34px 8px color-mix(in srgb, var(--accent) 30%, transparent) !important}
.fg-center::before{content:'';position:absolute;left:-220px;top:-220px;width:440px;height:440px;border-radius:50%;pointer-events:none;
  background:radial-gradient(circle, color-mix(in srgb, var(--accent) 20%, transparent) 0%, color-mix(in srgb, var(--accent) 8%, transparent) 35%, transparent 70%)}
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){ .fg-center::before{left:calc(50% - 160px);top:calc(50% - 160px);width:320px;height:320px} }
/* Q and E right next to the first and last tab */
.fg-bar .fg-step.q,.fg-bar .fg-step.e{margin:0 .1rem}
.fg-bar .fg-home{margin-right:.2rem}
/* No hard edge cutting the orb or its glow: only the screen itself clips (the home screen is overflow:hidden) */
.fg-book{overflow:visible !important}

/* A light hint above the orb while the menu is closed */
.fg-tip{position:absolute;left:0;top:-112px;transform:translateX(-50%);white-space:nowrap;pointer-events:none;z-index:2;
  font-size:.78rem;font-weight:700;letter-spacing:.02em;color:color-mix(in srgb, var(--accent) 75%, var(--text));
  padding:.3rem .75rem;border-radius:999px;background:color-mix(in srgb, var(--bg) 70%, transparent);border:1px solid var(--fg-acc-line);
  opacity:.85;transition:opacity .35s ease, translate .35s ease;animation:fgTipBob 3.2s ease-in-out infinite}
.fg-tip::after{content:'';position:absolute;left:50%;bottom:-5px;width:8px;height:8px;margin-left:-4px;rotate:45deg;
  background:inherit;border-right:1px solid var(--fg-acc-line);border-bottom:1px solid var(--fg-acc-line)}
@keyframes fgTipBob{50%{translate:0 -4px}}
#fgHome:not(.fg-closed) .fg-tip,body.fg-orb-drag .fg-tip{opacity:0;translate:0 6px;animation:none}
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){ .fg-tip{left:50%;top:-14px;font-size:.72rem} }
@media (prefers-reduced-motion: reduce){ .fg-tip{animation:none} }
/* phones: there is no room above (the level sits there), so the hint goes just under the orb, pointing up */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){
  .fg-tip{top:auto;bottom:-30px}
  .fg-tip::after{bottom:auto;top:-5px;rotate:225deg}
}
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){ .fg-bar .fg-close{display:none} }

/* More than 8 neurons: the extra ones float as smaller bubbles on an outer ring */
@media (min-width: 761px) and (orientation: landscape) and (min-height: 521px), (min-width: 1025px) and (min-height: 521px){
  .fg-dia.fg-out .fg-gem{scale:.74}
  .fg-dia.fg-out .fg-lbl{top:38px}
  .fg-dia.fg-out .fg-lbl b{font-size:.8rem}
  .fg-dia.fg-out .fg-lbl small{display:none}
  .fg-dia.fg-out .fg-gem kbd{display:none}
}
.fg-closed .fg-dia.fg-out .fg-gem{scale:.2}
/* phones: the grid simply grows; the flower screen scrolls up and down if it has to (never sideways) */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){
  .fg-home-screen{overflow:hidden auto !important}
}
/* many tabs: only the open one keeps its name */
.fg-bar.many .fg-tab span{display:none}
.fg-bar.many .fg-tab.on span{display:inline}
.fg-bar.many .fg-tab{padding:0 .55rem}

/* Tutorial paused: a small pill at the corner (above the tab bar on phones) */
.mt-pause-pill{position:fixed;right:16px;bottom:calc(16px + env(safe-area-inset-bottom));z-index:9600;display:flex;align-items:center;gap:.55rem;
  padding:.45rem .55rem .45rem .5rem;border-radius:999px;background:var(--card);border:1px solid var(--accent);
  box-shadow:0 10px 30px rgba(0,0,0,.35), 0 0 16px var(--fg-glow);animation:tourPop .3s ease-out}
.mt-pp-mage{display:grid;place-items:center;width:30px;height:30px}
.mt-pp-txt{display:flex;flex-direction:column;line-height:1.1}
.mt-pp-txt b{font-size:.8rem}
.mt-pp-txt small{font-size:.68rem;color:var(--muted)}
.mt-pause-pill .tour-next{padding:.4rem .8rem}
.mt-pause-pill .tour-skip{padding:.3rem .5rem}
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){ .mt-pause-pill{bottom:calc(var(--fg-bar, 60px) + 12px + env(safe-area-inset-bottom));right:10px;left:10px;justify-content:space-between} }
.tour-card .tour-foot{flex-wrap:wrap;row-gap:.35rem}
.tour-card .mt-sound{margin:.1rem 0 .45rem;padding:.35rem .8rem;font-size:.78rem}

/* Entrance of the round buttons: the divider first, then the buttons slide out of it to both sides */
.fg-anim .fg-orb-sep{animation:fgSepIn .35s cubic-bezier(.2,1.3,.4,1) .1s both}
@keyframes fgSepIn{from{transform:scaleY(0);opacity:0}to{transform:scaleY(1);opacity:1}}
/* the bottom bar is the first thing on screen: no waiting for the flower (it used to start after 1.15 s) */
.fg-anim .fg-orb{animation:fgOrbSlide .45s cubic-bezier(.2,.9,.25,1) both !important;animation-delay:calc(var(--d, 0) * 25ms) !important}
@keyframes fgOrbSlide{
  0%{transform:translateX(var(--from, 0)) scale(.4);opacity:0}
  25%{opacity:1}
  100%{transform:none;opacity:1}
}
@media (prefers-reduced-motion: reduce){ .fg-anim .fg-orb,.fg-anim .fg-orb-sep{animation:none !important} }

/* ---------- After the tutorial: explore or add a neuron ---------- */
.modal.ob-choice-modal{width:min(440px,94vw)}
.modal.ob-choice-modal.wide{width:min(640px,96vw)}
.ob-choice{text-align:center}
.ob-choice h3{margin:.4rem 0 .5rem}
.ob-choice-mage{display:flex;justify-content:center;margin-top:-.2rem}
.ob-choice-left{font-size:.8rem;color:var(--muted);margin:.2rem 0 0}
.ob-choice-btns{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:.6rem;margin-top:1.1rem}
.ob-choice-btn{display:flex;flex-direction:column;align-items:center;gap:.35rem;padding:.9rem .7rem;border-radius:12px;border:1px solid var(--border);background:var(--bg);color:var(--text);cursor:pointer;font:inherit;font-weight:700;transition:transform .15s,border-color .15s}
.ob-choice-btn b{font-size:1.6rem;line-height:1}
.ob-choice-btn:hover{transform:translateY(-2px);border-color:var(--accent)}
.ob-choice-btn.main{background:var(--accent);color:#0b1020;border-color:var(--accent)}
.ob-pick{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:.55rem;margin-top:.8rem;max-height:min(58vh,520px);overflow-y:auto;padding:.15rem}
.ob-pick-n{display:flex;flex-direction:column;align-items:center;gap:.3rem;padding:.75rem .55rem;border-radius:12px;border:1px solid var(--border);background:var(--bg);color:var(--text);cursor:pointer;font:inherit;text-align:center;transition:transform .15s,border-color .15s}
.ob-pick-n:hover{transform:translateY(-2px);border-color:var(--accent)}
.ob-pick-n b{font-size:.92rem}
.ob-pick-n small{font-size:.74rem;color:var(--muted);line-height:1.3}
.ob-pick-ic{display:flex;align-items:center;justify-content:center;min-height:48px;font-size:1.8rem}
.ob-pick-ic.big{min-height:64px;font-size:2.4rem}
.ob-pick-ic svg,.ob-pick-ic img{max-width:56px;max-height:56px}
.mt-later{margin-left:auto}
/* while a form of the neuron is open (create a habit…), the mage steps aside */
body.mt-running:not(.ft-in-modal):has(#modalOverlay) #obCard.mt-card{opacity:0 !important;pointer-events:none}
.mt-card .tour-foot{flex-wrap:wrap}
.mt-wait-line{margin:.15rem 0 .45rem}
.mt-card .tour-foot .mt-later{margin-left:.2rem}
.mt-card .tour-foot{flex-wrap:nowrap;justify-content:flex-end}
.fg-dia.tip-spot .fg-gem{box-shadow:0 0 0 3px var(--accent),0 0 22px color-mix(in srgb,var(--accent) 60%,transparent)}
/* Tutorial: the look step */
.mt-look{display:flex;flex-direction:column;gap:.5rem;margin:.2rem 0 .55rem}
.mt-look-row{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center}
.mt-theme{flex:1;padding:.45rem .6rem;border-radius:10px;border:1px solid var(--border);background:var(--bg);color:var(--text);font:inherit;font-weight:700;font-size:.8rem;cursor:pointer}
.mt-theme.on{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 35%,transparent)}
.mt-color{width:24px;height:24px;border-radius:50%;border:2px solid transparent;background:var(--c);cursor:pointer;padding:0}
.mt-color.on{border-color:var(--text);box-shadow:0 0 0 2px var(--bg) inset}
.mt-colors input[type=color]{width:28px;height:26px;border:none;background:none;padding:0;cursor:pointer}
.mt-look-row.mt-colors{flex-wrap:nowrap;gap:.3rem}.mt-color{width:22px;height:22px;flex:none}.mt-colors input[type=color]{flex:none;width:26px;height:24px}
/* a number on the neuron: something waits there */
.fg-alert.n{background:#ef4444;color:#fff;font-size:.72rem;min-width:24px;width:auto;padding:0 5px;border-radius:999px;top:-4px;left:-4px;right:auto;bottom:auto}
.mt-card .tour-foot button{white-space:nowrap}
.mt-lang{width:100%;padding:.4rem .5rem;font-size:.82rem;margin:0}
.set-row.set-lang select{max-width:60%}
/* How to use: essentials, locked neurons, the button after the tutorial */
.hv-ess span{flex-basis:100%}
.hv-neuron.locked{opacity:.65;border-style:dashed}
.hv-neuron.locked .me-ic{filter:grayscale(1)}
.hv-after{display:flex;justify-content:flex-end;margin:1.1rem 0 .3rem}
.hv-ess span{border-radius:12px;line-height:1.4}
/* Tutorial not finished: the mage waits beside the flower */
.tut-home-mage{position:fixed;left:24px;bottom:96px;z-index:140;display:flex;align-items:flex-end;gap:.5rem;animation:thmIn .5s ease both}
.thm-mage{filter:drop-shadow(0 6px 14px rgba(0,0,0,.45));animation:thmBob 2.4s ease-in-out infinite}
.thm-say{position:relative;display:flex;flex-direction:column;gap:.45rem;padding:.65rem .8rem;border-radius:14px;background:var(--card);border:1px solid var(--accent);box-shadow:0 10px 28px rgba(0,0,0,.45);margin-bottom:1.6rem}
.thm-say::before{content:'';position:absolute;left:-7px;bottom:14px;width:12px;height:12px;background:var(--card);border-left:1px solid var(--accent);border-bottom:1px solid var(--accent);transform:rotate(45deg)}
.thm-say b{font-size:.86rem}
.thm-say .tour-next{align-self:flex-start}
body.tut-home #mtPausePill{display:none}
@keyframes thmIn{from{opacity:0;transform:translateX(-20px)}to{opacity:1;transform:none}}
@keyframes thmBob{0%,100%{transform:translateY(0)}50%{transform:translateY(-5px)}}
@media (max-width:760px){.tut-home-mage{left:12px;bottom:84px}}
.hv-art.hv-emo{display:grid;place-items:center;font-size:2.4rem;line-height:1;height:64px;filter:drop-shadow(0 4px 10px rgba(0,0,0,.35))}
.help-hk{margin:.4rem 0 .6rem}
/* first time: no flower until the tutorial and its summary are over */
html.ob-pre #fgHome, html.ob-pre #neuronCore, html.ob-pre .fg-tip, html.ob-pre .core-hint{visibility:hidden !important}
/* Phones / narrow bars: the number sits on the corner of the icon, readable (no glow blob) */
@media (max-width:1100px){
  .fg-bar .fg-tab .nb-badge{position:absolute;top:3px;left:50%;right:auto;margin:0 0 0 6px;min-width:17px;height:17px;line-height:17px;padding:0 4px;
    font-size:.62rem;box-shadow:0 0 0 2px var(--card);animation:none;z-index:2}
}
.fg-bar .fg-tab{overflow:visible}
.tour-next:disabled{opacity:.45;cursor:not-allowed;filter:grayscale(.6)}
/* Challenges (tools/37-challenges.js) */
.fg-orb.ch-orb{position:relative}
.fg-orb.ch-orb .fg-alert{position:absolute;top:-4px;right:-4px}
.ch-head{display:flex;align-items:center;gap:.7rem}
.ch-head h3{margin:0}
.ch-head .modal-text{margin:.15rem 0 0}
.ch-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:.3rem;margin:.7rem 0 .3rem}
.ch-tabs button{background:var(--bg);border:1px solid var(--border);border-radius:10px;padding:.4rem;color:var(--muted);font:inherit;font-weight:700;font-size:.82rem;cursor:pointer}
.ch-tabs button.on{border-color:var(--accent);color:var(--text);background:color-mix(in srgb,var(--accent) 12%,var(--bg))}
.ch-tabs small{opacity:.7;font-weight:600}
.ch-left{font-size:.72rem;color:var(--muted);margin:.2rem 0 .5rem}
.ch-list{display:flex;flex-direction:column;gap:.45rem;max-height:52vh;overflow:auto}
.ch-item{display:flex;align-items:center;gap:.6rem;padding:.55rem .6rem;border-radius:12px;background:var(--bg);border:1px solid var(--border)}
.ch-item.done{border-color:color-mix(in srgb,var(--accent) 50%,var(--border));opacity:.8}
.ch-ic{flex:none;display:flex}
.ch-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:.2rem}
.ch-body b{font-size:.84rem;line-height:1.3}
.ch-body small{font-size:.68rem;color:var(--muted)}
.ch-bar{height:6px;border-radius:999px;background:color-mix(in srgb,var(--text) 10%,transparent);overflow:hidden}
.ch-bar i{display:block;height:100%;background:var(--accent);border-radius:999px;transition:width .4s}
.ch-coins{font-weight:800;font-size:.78rem;white-space:nowrap;color:var(--accent)}
.ch-go{background:none;border:1px solid var(--border);color:var(--text);border-radius:8px;width:28px;height:28px;cursor:pointer}
.ch-strip{display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:auto auto;gap:.1rem .6rem;align-items:center;width:100%;margin:0 0 .6rem;padding:.55rem .75rem;border-radius:12px;border:1px solid color-mix(in srgb,var(--accent) 45%,var(--border));background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 10%,var(--card)),var(--card));color:var(--text);font:inherit;text-align:left;cursor:pointer}
.ch-strip span{font-size:.72rem;font-weight:800;color:var(--accent)}
.ch-strip b{font-size:.84rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ch-strip em{font-style:normal;font-size:.78rem;font-weight:800;color:var(--accent)}
.ch-strip small{grid-column:1 / -1;font-size:.66rem;color:var(--muted)}
.ch-strip.done{border-color:var(--border)}
.ch-toast{cursor:pointer}
.ch-toast span:not(.cre-toast-mage){display:flex;flex-direction:column}
.ch-toast small{font-size:.68rem;color:var(--accent)}
.ch-toast em{font-style:normal;color:var(--accent);font-weight:800;margin-left:.3rem}
.ch-orb .ch-n{position:absolute;top:-6px;right:-4px;min-width:18px;height:18px;padding:0 4px;border-radius:999px;background:#ef4444;color:#fff;font-style:normal;font-size:.62rem;font-weight:800;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 2px var(--bg)}
/* The challenges counter sits inside the button (the row of buttons clips anything above it) */
.ch-orb .ch-n{position:static;margin-left:.15rem;box-shadow:none;transform:none}
/* Quick create: little neurons floating on a circle inside the flower (computers / tablets sideways) */
.fg-minis{position:absolute;inset:0;pointer-events:none;z-index:4}
.fg-mini{position:absolute;left:var(--x);top:var(--y);width:46px;height:46px;margin:-23px 0 0 -23px;border-radius:50%;pointer-events:auto;cursor:pointer;
  display:flex;align-items:center;justify-content:center;border:1px solid var(--fg-acc-line, var(--border));
  background:radial-gradient(circle at 35% 30%, color-mix(in srgb,var(--accent) 30%,var(--card)), var(--card) 70%);color:var(--accent);
  box-shadow:0 0 14px -2px var(--fg-glow, var(--accent)),0 4px 12px rgba(0,0,0,.35);
  animation:fgMiniFloat 4.5s ease-in-out infinite;animation-delay:calc(var(--k) * -.75s);transition:scale .15s, opacity .4s}
.fg-mini:hover{scale:1.15;border-color:var(--accent)}
.fg-mini .px-ic{width:20px;height:20px}
.fg-mini .nav-plus{position:absolute;right:-3px;bottom:-3px;width:16px;height:16px;border-radius:50%;background:var(--accent);color:#0b1020;font-size:.7rem;display:flex;align-items:center;justify-content:center;font-weight:900}
@keyframes fgMiniFloat{0%,100%{translate:0 0}25%{translate:3px -5px}50%{translate:0 -8px}75%{translate:-3px -4px}}
/* hidden until the Cognose orb is opened (also on reload: no flash), then they pop out one by one */
.fg-mini{transition:opacity .35s ease, scale .45s cubic-bezier(.22,1.4,.4,1), visibility 0s;transition-delay:calc(var(--k) * 60ms + 150ms)}
.fg-closed .fg-mini,.fg-home-screen:not(.fg-ready) .fg-mini{opacity:0;scale:.3;visibility:hidden;pointer-events:none;transition-delay:0s, 0s, .35s}
/* with the little neurons inside the flower, the row below keeps only the other buttons */
.fg-orbs .fg-orb.create{display:none}
.fg-orbs .fg-orb.create + .fg-orb-sep, .fg-orbs > .fg-orb-sep:first-child{display:none}
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){
  .fg-minis{display:none}
  .fg-orbs .fg-orb.create{display:inline-flex}
}
@media (orientation: landscape) and (max-height: 520px){ .fg-minis{display:none} .fg-orbs .fg-orb.create{display:inline-flex} }
@media (prefers-reduced-motion: reduce){ .fg-mini{animation:none} }
.fg-mini-tip{position:absolute;left:50%;top:calc(100% + 10px);transform:translateX(-50%) translateY(-4px);min-width:170px;max-width:220px;padding:.5rem .65rem;border-radius:12px;
  background:var(--card);border:1px solid var(--fg-acc-line, var(--border));box-shadow:0 10px 26px rgba(0,0,0,.45),0 0 14px -6px var(--accent);
  display:flex;flex-direction:column;gap:.15rem;text-align:left;color:var(--text);opacity:0;pointer-events:none;transition:opacity .15s, transform .15s;z-index:6}
.fg-mini-tip.up{top:auto;bottom:calc(100% + 10px);transform:translateX(-50%) translateY(4px)}
.fg-mini-tip b{font-size:.78rem}
.fg-mini-tip small{font-size:.68rem;color:var(--muted);font-weight:500;line-height:1.35}
.fg-mini-tip em{font-style:normal;font-size:.7rem;font-weight:700;color:var(--accent)}
.fg-mini:hover .fg-mini-tip,.fg-mini:focus-visible .fg-mini-tip{opacity:1;transform:translateX(-50%) translateY(0)}
.fg-mini:hover{z-index:7}
.fg-mini:hover{animation-play-state:paused}
.fg-mini:hover{transition-delay:0s}
.fg-still,.fg-still *{transition:none !important;animation-duration:0s !important;animation-delay:0s !important}
/* The round buttons under the flower: they rise in one by one, lift and glow on hover, press in on click */
.fg-orbs .fg-orb{animation:fgOrbIn .55s cubic-bezier(.22,1.35,.4,1) backwards;animation-delay:calc(var(--o, 0) * 55ms + 120ms + var(--orbT, 0ms));
  transition:transform .22s cubic-bezier(.22,1.5,.4,1), box-shadow .22s, border-color .2s, color .2s, background .2s}
/* a redraw while they rise in (data arriving, the gems, the challenges badge) must not finish them at once and then
   start them over (they flashed in twice): "still" leaves this one entrance alone, it continues where it was */
.fg-still .fg-orbs .fg-orb{animation-duration:.55s !important;animation-delay:calc(var(--o, 0) * 55ms + 120ms + var(--orbT, 0ms)) !important}
@keyframes fgOrbIn{from{opacity:0;transform:translateY(16px) scale(.85);filter:blur(2px)}to{opacity:1;transform:none;filter:none}}
.fg-orbs .fg-orb:hover{transform:translateY(-4px) scale(1.05);border-color:var(--accent);color:var(--accent);
  box-shadow:0 10px 22px -6px rgba(0,0,0,.45),0 0 18px -4px var(--fg-glow, var(--accent));background:color-mix(in srgb,var(--accent) 8%,var(--card))}
.fg-orbs .fg-orb:active{transform:translateY(-1px) scale(.95);transition-duration:.08s}
.fg-orbs .fg-orb .px-ic,.fg-orbs .fg-orb .nav-ic{transition:transform .35s cubic-bezier(.22,1.6,.4,1)}
.fg-orbs .fg-orb:hover .px-ic,.fg-orbs .fg-orb:hover .nav-ic{transform:rotate(-12deg) scale(1.15)}
.fg-orbs .fg-orb.gear:hover .px-ic,.fg-orbs .fg-orb.gear:hover .nav-ic{transform:rotate(90deg) scale(1.1)}
/* a soft light sweeps across the shop and the challenges every few seconds */
.fg-orbs .fg-orb.shop,.fg-orbs .fg-orb.ch-orb{overflow:hidden}
.fg-orbs .fg-orb.shop::after,.fg-orbs .fg-orb.ch-orb::after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:linear-gradient(105deg,transparent 35%,color-mix(in srgb,var(--accent) 35%,transparent) 50%,transparent 65%);transform:translateX(-120%);animation:fgSweep 5s ease-in-out infinite 1.5s}
.fg-orbs .fg-orb.ch-orb::after{animation-delay:3.5s}
@keyframes fgSweep{0%,70%{transform:translateX(-120%)}100%{transform:translateX(120%)}}
/* pending challenges: the counter beats gently */
.ch-orb .ch-n{animation:fgBeat 2.4s ease-in-out infinite}
@keyframes fgBeat{0%,80%,100%{transform:scale(1)}88%{transform:scale(1.22)}94%{transform:scale(.95)}}
@media (prefers-reduced-motion: reduce){ .fg-orbs .fg-orb,.fg-orbs .fg-orb::after,.ch-orb .ch-n{animation:none !important} }
.fg-orbs{padding-top:.55rem;padding-bottom:.45rem;margin-top:-.55rem;margin-bottom:-.45rem}
/* Phones: the create buttons on the first row, Retos opens the second row (next to the shop) */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){
  .fg-orbs .fg-orb-sep{display:block !important;flex-basis:100%;width:0;height:0;margin:0;padding:0;background:none}
}
/* Phones: the button rows sit a little lower, and step aside while the Cognose orb is open (the neurons get the space) */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){
  .fg-orbs{margin-top:1.1rem;transition:opacity .3s ease, translate .35s cubic-bezier(.22,1,.36,1), visibility 0s}
}
/* a redraw that is not an entrance keeps the flower as it was (no pop-in, no dimming) */
body.fg .fg-center .neuron-core.placed.kept{animation-name:coreBreath;animation-duration:4s}
.tour-gold{color:#facc15;font-weight:800;white-space:nowrap;text-shadow:0 0 10px rgba(250,204,21,.35)}
@media (orientation: landscape) and (max-height: 520px){ body.fg-in .fs-hint{top:calc(var(--fg-bar) + 8px)} }

/* ===== Welcome (tools/38-welcome.js): three friendly screens with the mage ===== */
.wl-screen{position:fixed;inset:0;z-index:9900;display:flex;align-items:center;justify-content:center;padding:max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background:color-mix(in srgb, var(--bg) 82%, transparent);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);overflow-y:auto}
.wl-box{width:min(560px,100%);max-height:100%;overflow-y:auto;display:flex;flex-direction:column;gap:1rem;padding:1.2rem 1.2rem 1rem;border-radius:22px;background:var(--card);border:1px solid color-mix(in srgb,var(--accent) 45%,var(--border));box-shadow:0 24px 60px rgba(0,0,0,.5),0 0 30px -12px var(--accent)}
.wl-screen.pop .wl-box{animation:tourPop .3s ease-out}
.wl-dots{display:flex;align-items:center;gap:.35rem;font-size:.72rem;color:var(--muted);font-weight:700}
.wl-dots i{width:22px;height:5px;border-radius:999px;background:var(--border)}
.wl-dots i.on{background:var(--accent)}
.wl-dots i.past{background:color-mix(in srgb,var(--accent) 45%,var(--border))}
.wl-dots span{margin-left:auto}
.wl-mage{display:flex;align-items:flex-start;gap:.8rem}
.wl-mage-art{flex:none;animation:gdBob 2.4s ease-in-out infinite}
.wl-say{position:relative;flex:1;display:flex;flex-direction:column;gap:.3rem;padding:.75rem .9rem;border-radius:16px;background:color-mix(in srgb,var(--accent) 10%,var(--bg));border:1px solid color-mix(in srgb,var(--accent) 35%,var(--border))}
.wl-say b{font-size:1.02rem}
.wl-say small{color:var(--muted);font-size:.84rem;line-height:1.45}
.wl-field{display:flex;flex-direction:column;gap:.4rem}
.wl-field label{font-size:.78rem;font-weight:800;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.wl-row{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center}
.wl-opt{flex:1;padding:.7rem;border-radius:12px;border:1px solid var(--border);background:var(--bg);color:var(--text);font:inherit;font-weight:700;cursor:pointer}
.wl-opt.on{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 14%,var(--bg))}
.wl-color{width:34px;height:34px;border-radius:50%;border:3px solid transparent;background:var(--c);cursor:pointer;outline:2px solid transparent}
.wl-color.on{border-color:var(--card);outline-color:var(--c)}
.wl-colors input[type=color]{width:38px;height:34px;border:none;background:none;padding:0;cursor:pointer}
.wl-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.55rem}
.wl-pick{position:relative;display:flex;flex-direction:column;align-items:center;gap:.25rem;text-align:center;padding:.8rem .5rem;border-radius:14px;border:1.5px solid var(--border);background:var(--bg);color:var(--text);font:inherit;cursor:pointer;transition:transform .12s, border-color .15s, background .15s}
.wl-pick:hover:not(:disabled){transform:translateY(-2px);border-color:var(--accent)}
.wl-pick.on{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 14%,var(--bg));box-shadow:0 0 0 1px var(--accent)}
.wl-pick:disabled{opacity:.4;cursor:default}
.wl-pick b{font-size:.86rem}
.wl-pick small{font-size:.68rem;color:var(--muted);line-height:1.3;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.wl-check{position:absolute;top:6px;right:8px;font-style:normal;width:20px;height:20px;border-radius:50%;background:var(--accent);color:#0b1020;font-size:.72rem;font-weight:900;display:flex;align-items:center;justify-content:center}
.wl-space{display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem}
.wl-chip{display:flex;flex-direction:column;align-items:center;gap:.2rem;padding:.7rem .4rem;border-radius:14px;background:color-mix(in srgb,var(--accent) 12%,var(--bg));border:1px solid var(--accent);animation:tourPop .35s ease-out backwards}
.wl-chip.base{background:var(--bg);border-color:var(--border)}
.wl-chip b{font-size:.85rem}
.wl-chip small{font-size:.66rem;color:var(--muted)}
.wl-chip:nth-child(2){animation-delay:.05s}.wl-chip:nth-child(3){animation-delay:.1s}.wl-chip:nth-child(4){animation-delay:.18s}.wl-chip:nth-child(5){animation-delay:.26s}.wl-chip:nth-child(6){animation-delay:.34s}
.wl-foot{display:flex;align-items:center;gap:.6rem;justify-content:flex-end;flex-wrap:wrap}
.wl-count{margin-right:auto;font-size:.82rem;font-weight:800;color:var(--accent)}
.wl-main{padding:.8rem 1.3rem;border-radius:999px;border:none;background:var(--accent);color:#0b1020;font:inherit;font-weight:800;cursor:pointer;box-shadow:0 10px 24px -10px var(--accent)}
.wl-main:disabled{opacity:.4;cursor:default;box-shadow:none}
.wl-back{padding:.7rem 1rem;border-radius:999px;border:1px solid var(--border);background:transparent;color:var(--muted);font:inherit;font-weight:700;cursor:pointer}
.wl-back:first-child{margin-right:auto}
@media (max-width: 520px){
  .wl-box{padding:1rem .9rem .9rem;gap:.8rem}
  .wl-grid{grid-template-columns:repeat(2,1fr)}
  .wl-space{grid-template-columns:repeat(3,1fr)}
  .wl-mage-art svg{width:48px;height:auto}
  .wl-foot{justify-content:stretch}
  .wl-foot .wl-main{flex:1}
}

/* The mage is ALWAYS on screen during the tutorial: with a form open it waits docked at the top (smaller),
   instead of disappearing */
body.mt-running:not(.ft-in-modal):has(#modalOverlay) #obCard.mt-card{opacity:1 !important;pointer-events:none;left:8px !important;right:8px !important;top:calc(8px + env(safe-area-inset-top)) !important;
  bottom:auto !important;width:auto !important;max-width:none !important;z-index:10050;transform:none;padding:.5rem .7rem}
body.mt-running:not(.ft-in-modal):has(#modalOverlay) #obCard.mt-card .tour-foot,body.mt-running:not(.ft-in-modal):has(#modalOverlay) #obCard.mt-card .mt-look,body.mt-running:not(.ft-in-modal):has(#modalOverlay) #obCard.mt-card .tour-kicker{display:none}
body.mt-running:not(.ft-in-modal):has(#modalOverlay) #obCard.mt-card p{font-size:.8rem;margin:0}
body.mt-running:not(.ft-in-modal):has(#modalOverlay) #obCard.mt-card .tour-mage svg{width:32px;height:auto}
body.mt-running:not(.ft-in-modal):has(#modalOverlay) .modal{margin-top:72px}
.wl-nomore{color:var(--muted)}

.wl-foot{position:sticky;bottom:-1rem;background:var(--card);padding:.6rem 0 .2rem;margin-bottom:-.2rem}
@media (max-width: 520px){
  .wl-grid{grid-template-columns:repeat(3,1fr);gap:.4rem}
  .wl-pick{padding:.6rem .3rem}
  .wl-pick small{display:none}
  .wl-pick b{font-size:.78rem}
}
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){ .fg-bar .fg-tab span,.fg-bar .fg-tab.on span{display:none !important} }

/* The mage's card always fits its text (any language): it grows up to 460px wide, and the buttons go to a second
   row instead of spilling out ("No more tutorials" · Skip · Pause on the left, Next on the right) */
.tour-card.mt-card,body.mt-running .tour-card.mt-card{width:fit-content;min-width:min(320px, calc(100vw - 24px));max-width:min(460px, calc(100vw - 24px))}
.tour-card .tour-foot,.mt-card .tour-foot{flex-wrap:wrap;justify-content:flex-end;row-gap:.45rem;column-gap:.5rem}
.mt-card .tour-foot .tour-dots:empty{display:none}
.mt-card .tour-foot .wl-nomore{margin-right:auto}
.mt-card .tour-foot .tour-next{margin-left:auto}
.tour-card .tour-body{overflow-wrap:anywhere}

/* petals at the top of the flower: their name goes above them, so it never touches the inner neurons */
.fg-dia.fg-out.lbl-up .fg-lbl{top:auto;bottom:38px}
@media (max-width:760px){.fg-dia.fg-out.lbl-up .fg-lbl{bottom:auto}}

/* Phones: with the orb closed the hidden neurons take no room, so the round buttons sit right under the flower.
   Opening the orb lets the neurons grow out and push the buttons down. */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){
  .fg-book{transition:row-gap .5s cubic-bezier(.22,.9,.24,1)}
  .fg-dia{max-height:220px;transition:translate .6s cubic-bezier(.22,.9,.24,1), scale .6s cubic-bezier(.22,.9,.24,1), opacity .3s ease, max-height .5s cubic-bezier(.22,.9,.24,1)}
  .fg-closed .fg-book{row-gap:0}
  .fg-closed .fg-dia{max-height:0;overflow:visible}
}

/* Phones & tablets: only vertical scrolling. Leftovers of the old window layout (windows placed off to the side,
   wide content) can no longer drag the screen sideways; real side-scrollers inside a neuron (the music roll) keep working. */
@media (max-width: 1024px), (hover: none) and (pointer: coarse){
  html,body{overflow-x:clip;overscroll-behavior-x:none;max-width:100%}
  body.fg main.neuron-canvas,body.fg #main{overflow-x:clip;max-width:100vw}
  .fg-home-screen{overflow-x:hidden !important}
  body.fg .neuron-node.fg-page{overflow-x:clip}
  body.fg .neuron-node.fg-page .neuron-body{overflow-x:hidden !important;overflow-y:auto !important;overscroll-behavior-x:none}
}

/* Download app (tools/40-install.js) */
.inst-orb{font-weight:800}
.inst-box{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.6rem}
.inst-box img{border-radius:18px;box-shadow:0 0 24px -6px var(--accent)}
.inst-box h3{margin:0}
.inst-box p{margin:0;color:var(--muted);line-height:1.45}
.inst-box .inst-how{color:var(--text);padding:.6rem .8rem;border-radius:12px;background:color-mix(in srgb,var(--accent) 10%,transparent)}
/* the download button keeps its words on phones too (an arrow alone says little) */
.fg-orbs .fg-orb.inst-orb span{display:inline !important;font-size:.72rem}
/* Hover a neuron on the flower: what it is for (same card as the quick-create buttons inside the flower) */
.fg-dia-tip{position:absolute;left:58px;top:0;transform:translate(-4px,-50%);min-width:180px;max-width:230px;padding:.55rem .7rem;border-radius:12px;
  background:var(--card);border:1px solid var(--fg-acc-line, var(--border));box-shadow:0 10px 26px rgba(0,0,0,.45),0 0 14px -6px var(--accent);
  display:flex;flex-direction:column;gap:.18rem;text-align:left;color:var(--text);white-space:normal;opacity:0;pointer-events:none;transition:opacity .15s, transform .15s;z-index:8}
.fg-dia-tip.left{left:auto;right:58px;transform:translate(4px,-50%)}
.fg-dia-tip b{font-size:.8rem}
.fg-dia-tip small{font-size:.7rem;color:var(--muted);font-weight:500;line-height:1.38}
.fg-dia-tip em{font-style:normal;font-size:.7rem;font-weight:700;color:var(--accent)}
.fg-dia-key{font-size:.66rem;color:var(--muted)}
.fg-dia-key kbd{font-size:.64rem;padding:0 .3rem}
.fg-dia.fg-out .fg-dia-tip{left:44px}
.fg-dia.fg-out .fg-dia-tip.left{left:auto;right:44px}
.fg-gem:hover ~ .fg-dia-tip,.fg-gem:focus-visible ~ .fg-dia-tip{opacity:1;transform:translate(0,-50%)}
.fg-dia:has(.fg-gem:hover),.fg-dia:has(.fg-gem:focus-visible){z-index:9}
@media (hover: none){ .fg-dia-tip{display:none} }
@media (max-width:760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){ .fg-dia-tip{display:none} }
/* The part the tutorial is showing glows on and off (neon), slowly enough to stay calm, fast enough to catch the eye */
.mt-spot{animation:mtGlow 1.8s ease-in-out infinite}
@keyframes mtGlow{
  0%,100%{outline-color:color-mix(in srgb, var(--accent) 55%, transparent);box-shadow:0 0 0 9999px rgba(0,0,0,.55), 0 0 8px 0 color-mix(in srgb, var(--accent) 35%, transparent)}
  50%{outline-color:var(--accent);box-shadow:0 0 0 9999px rgba(0,0,0,.55), 0 0 30px 6px color-mix(in srgb, var(--accent) 75%, transparent), 0 0 60px 10px color-mix(in srgb, var(--accent) 30%, transparent)}
}
body.theme-light .mt-spot{animation-name:mtGlowLight}
@keyframes mtGlowLight{
  0%,100%{outline-color:color-mix(in srgb, var(--accent) 55%, transparent);box-shadow:0 0 0 9999px rgba(0,0,0,.35), 0 0 8px 0 color-mix(in srgb, var(--accent) 35%, transparent)}
  50%{outline-color:var(--accent);box-shadow:0 0 0 9999px rgba(0,0,0,.35), 0 0 30px 6px color-mix(in srgb, var(--accent) 75%, transparent), 0 0 60px 10px color-mix(in srgb, var(--accent) 30%, transparent)}
}
.tour-spot{animation:tourGlow 1.8s ease-in-out infinite !important}
@keyframes tourGlow{
  0%,100%{box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 60%, transparent), 0 0 8px 2px color-mix(in srgb, var(--accent) 25%, transparent)}
  50%{box-shadow:0 0 0 3px var(--accent), 0 0 26px 7px color-mix(in srgb, var(--accent) 70%, transparent)}
}
@media (prefers-reduced-motion: reduce){ .mt-spot,.tour-spot{animation:none !important} }
/* "Watch tutorial": the tab at the corner after "Watch later", and its card first in "How to use" */
.tl-pill{animation:tlIn .45s cubic-bezier(.2,1.2,.4,1) both}
@keyframes tlIn{from{opacity:0;transform:translateY(16px) scale(.96)}to{opacity:1;transform:none}}
.help-tab.tl-watch{background:color-mix(in srgb, var(--accent) 16%, transparent);border-color:var(--accent);color:var(--accent);font-weight:800}
.tl-help-card{display:flex;align-items:center;gap:.8rem;width:100%;margin:0 0 1rem;padding:.75rem .9rem;border-radius:16px;cursor:pointer;text-align:left;font:inherit;color:var(--text);
  background:linear-gradient(120deg, color-mix(in srgb, var(--accent) 16%, var(--card)), var(--card) 70%);border:1px solid color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow:0 0 18px -8px var(--accent);transition:transform .15s, box-shadow .15s}
.tl-help-card:hover{transform:translateY(-1px);box-shadow:0 0 24px -6px var(--accent)}
.tl-help-ic{flex:0 0 auto;display:grid;place-items:center;width:44px;height:44px}
.tl-help-tx{display:flex;flex-direction:column;gap:.15rem;flex:1;min-width:0}
.tl-help-tx b{font-size:.95rem}
.tl-help-tx small{font-size:.78rem;color:var(--muted);line-height:1.35}
.tl-help-go{flex:0 0 auto;display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:var(--accent);color:#06080c;font-size:.9rem}
@media (prefers-reduced-motion: reduce){ .tl-pill{animation:none} }
/* Free mode: the PayPal donation button takes the place of the gems one */
.fg-orb.paypal{background:#ffc439 !important;color:#142c8e !important;border-color:#ffc439 !important;font-weight:800;text-decoration:none}
.fg-orb.paypal span{display:inline !important;color:#142c8e}
.fg-orb.paypal:hover{filter:brightness(1.06)}
.fg-pp{margin:.8rem 0 .4rem}
/* phones held upright: the PayPal button is just a heart, so the menu keeps its shape */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){
  .fg-orb.paypal{width:44px;padding:0 !important;font-size:1.15rem}
  .fg-orb.paypal span{display:none !important}
}

/* ---------- Phones: the tab bar at the TOP of the screen (it used to sit at the bottom) ---------- */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){
  .fg-bar{top:0 !important;bottom:auto !important;height:calc(var(--fg-bar, 60px) + env(safe-area-inset-top)) !important;padding:env(safe-area-inset-top) .4rem 0 !important;border-top:none !important;border-bottom:1px solid var(--border) !important}
  .fg-bar::before{top:auto !important;bottom:-1px !important}
  .fg-tab.on::after{top:auto !important;bottom:5px !important}
  body.fg .neuron-node.fg-page{top:calc(var(--fg-bar, 60px) + env(safe-area-inset-top)) !important;bottom:0 !important}
  body.fg .neuron-node.fg-page .neuron-body{padding-bottom:calc(1.6rem + env(safe-area-inset-bottom))}
  .fg-home-screen{padding-bottom:calc(1rem + env(safe-area-inset-bottom)) !important;padding-top:calc(var(--fg-bar, 60px) + env(safe-area-inset-top)) !important}
  body.fg.fg-in .verify-bar{top:calc(var(--fg-bar, 60px) + .6rem + env(safe-area-inset-top))}
  .mt-pause-pill{bottom:calc(12px + env(safe-area-inset-bottom)) !important}
  body.fg-phone .fz-arm{bottom:calc(16px + env(safe-area-inset-bottom))}
  body.fg-phone .fx-warm{bottom:calc(16px + env(safe-area-inset-bottom))}
}

/* on phones the tab bar sits at the top (upright and sideways): the reminders question goes just under it */
body.fg-phone .notif-ask{top:calc(var(--fg-bar, 60px) + 8px + env(safe-area-inset-top))}

/* ===== tools/63-tutorials.js ===== */
/* Hover a neuron (its medal OR its name) and its card says what it is — on any screen with a mouse, at any width */
.fg-dia .fg-lbl{pointer-events:auto;cursor:pointer}
.fg-dia:hover,.fg-dia:focus-within{z-index:60 !important}
@media (max-width:760px), (orientation: portrait) and (max-width: 1024px){ .fg-dia:hover,.fg-dia:focus-within{position:relative} }
.fg-lbl:hover ~ .fg-dia-tip{opacity:1;transform:translate(0,-50%)}
@media (hover: hover) and (pointer: fine){
  .fg-dia-tip{display:flex !important}
}
/* on the phone layout (a grid) the card opens below the medal instead of beside it */
@media (hover: hover) and (pointer: fine) and ((max-width:760px) or ((orientation: portrait) and (max-width: 1024px)) or ((orientation: landscape) and (max-height: 520px))){
  .fg-dia-tip,.fg-dia-tip.left{left:50% !important;right:auto !important;top:100%;transform:translate(-50%,4px) !important;z-index:40}
  .fg-gem:hover ~ .fg-dia-tip,.fg-lbl:hover ~ .fg-dia-tip{transform:translate(-50%,8px) !important}
  .fg-dia[data-tside="l"] .fg-dia-tip{left:0 !important;transform:translate(0,4px) !important}
  .fg-dia[data-tside="l"] .fg-gem:hover ~ .fg-dia-tip,.fg-dia[data-tside="l"] .fg-lbl:hover ~ .fg-dia-tip{transform:translate(0,8px) !important}
  .fg-dia[data-tside="r"] .fg-dia-tip{left:auto !important;right:0 !important;transform:translate(0,4px) !important}
  .fg-dia[data-tside="r"] .fg-gem:hover ~ .fg-dia-tip,.fg-dia[data-tside="r"] .fg-lbl:hover ~ .fg-dia-tip{transform:translate(0,8px) !important}
}
/* The tutorial lighting the WHOLE bar (or a part of it): the bar glows, the page below stays visible (it used to go dark) */
.fg-bar.mt-spot,.fg-bar .mt-spot{box-shadow:0 0 26px var(--fg-glow);animation-name:mtGlowBar}
@keyframes mtGlowBar{
  0%,100%{outline-color:color-mix(in srgb, var(--accent) 55%, transparent);box-shadow:0 0 8px 0 color-mix(in srgb, var(--accent) 35%, transparent)}
  50%{outline-color:var(--accent);box-shadow:0 0 30px 6px color-mix(in srgb, var(--accent) 75%, transparent)}
}
/* The Tutorial button: a little mage with a "?" beside Quick add */
.cg-tut-btn{position:fixed;right:150px;bottom:20px;z-index:195;display:flex;align-items:center;gap:.35rem;padding:.35rem .8rem .35rem .4rem;border-radius:999px;
  border:1px solid color-mix(in srgb, var(--accent) 45%, var(--border, #2a313c));background:color-mix(in srgb, var(--accent) 10%, var(--card, #1b1f27));color:var(--text);
  font:700 .85rem var(--font, system-ui);cursor:pointer;box-shadow:0 6px 18px rgba(0,0,0,.3);transition:transform .15s ease, background .15s ease}
.cg-tut-btn:hover{transform:translateY(-2px);background:color-mix(in srgb, var(--accent) 18%, var(--card, #1b1f27))}
.cg-tut-btn[hidden]{display:none}
.cg-tut-mage{position:relative;display:inline-flex;width:30px;height:30px;align-items:center;justify-content:center}
.cg-tut-mage svg{width:26px;height:auto}
.cg-tut-mage i{position:absolute;right:-5px;top:-5px;min-width:16px;height:16px;border-radius:50%;background:var(--accent);color:#0b0f14;font:800 .68rem/16px system-ui;font-style:normal;text-align:center;box-shadow:0 0 0 2px var(--bg, #111)}
.cg-tut-btn.mt-spot{position:fixed;border-radius:999px}
body.qa-on .cg-tut-btn,body.ez-dragging .cg-tut-btn{display:none}
@media (max-width:760px){ .cg-tut-btn{padding:.35rem} .cg-tut-btn b{display:none} }
#neuronCore.mt-spot,.neuron-core.mt-spot{border-radius:50%}
/* the 1-minute tutorial's summary: habits · dailies · to-dos */
.mt-card:has(.cg-info){max-width:min(640px, calc(100vw - 24px)) !important}
.cg-info{display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem;margin:.6rem 0 .5rem}
.cg-info-c{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.25rem;padding:.6rem .5rem;border-radius:12px;background:color-mix(in srgb, var(--accent) 8%, transparent);border:1px solid color-mix(in srgb, var(--accent) 30%, transparent)}
.cg-info-ic{display:inline-flex;width:40px;height:40px;align-items:center;justify-content:center;font-size:1.6rem;border-radius:50%;background:color-mix(in srgb, var(--accent) 16%, transparent)}
.cg-info-c b{font-size:.88rem}
.cg-info-c small{font-size:.74rem;color:var(--muted);line-height:1.35}
.cg-info-rule{display:flex;flex-direction:column;gap:.25rem;font-size:.76rem;line-height:1.35;margin-bottom:.3rem}
.cg-info-rule .win b{color:var(--accent)} .cg-info-rule .lose b{color:#f87171}
@media (max-width:520px){ .cg-info{grid-template-columns:1fr} .cg-info-c{flex-direction:row;text-align:left;align-items:center} .cg-info-c b{min-width:5.5em} }
/* "Tutorial paused · Continue" no longer sits on top of the Tutorial button: bottom left on computers;
   on phones the Tutorial button steps aside while the pill is there (the pill has its own Continue) */
.mt-pause-pill{right:auto !important;left:16px}
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){
  .mt-pause-pill{left:10px;right:10px !important}
  body:has(#mtPausePill) .cg-tut-btn{display:none !important}
}
/* the faint rotating lines over the orb (tools/42-orbsymbol.js .orb-turn): removed */
.neuron-core .orb-turn{display:none !important}
/* Phones: the orb's open / close animation is played by tools/32-fieldguide.js (body.fg-orbfx), so the grid itself
   switches state at once instead of sliding with its own transitions */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){
  body.fg-orbfx .fg-book,body.fg-orbfx .fg-dia{transition:none !important}
}
.fg-shock{position:fixed;border-radius:50%;pointer-events:none;z-index:60;border:2px solid var(--accent);
  box-shadow:0 0 18px color-mix(in srgb, var(--accent) 70%, transparent), inset 0 0 14px color-mix(in srgb, var(--accent) 50%, transparent)}

/* ===== the flower's nerves as lightning (tools/32-fieldguide.js fgJag) ===== */
.fn-glow,.fn-nerve,.fn-twig,.fn-pulse,.fn-bolt{stroke-linejoin:miter;stroke-miterlimit:3}
.fn-nerve{stroke:color-mix(in srgb,var(--accent) 80%,#fff);opacity:.5}
.fn-glow{stroke-width:8;opacity:.09}
.fn-twig{opacity:.35}
.fn-bolt{fill:none;stroke:#fff;stroke-width:1.5;stroke-linecap:round;pointer-events:none;opacity:0;
  filter:none;animation:fnStrike var(--dur,6s) linear var(--del,0s) infinite}
@keyframes fnStrike{0%,100%{opacity:0}2%{opacity:1}5%{opacity:.3}8%{opacity:.95}12%{opacity:.15}15%{opacity:.8}20%{opacity:0}}
@media (prefers-reduced-motion: reduce){ .fn-bolt{animation:none;opacity:0} }

/* (27/10) the lightning is the connection: bright, above the flower's art, plugged into the rim of the orb and of each neuron */
.fg-nerves{z-index:2 !important}
.fg-nerves.on{opacity:1 !important}
.fg-closed .fg-nerves,.fg-closed .fg-nerves.on{opacity:0 !important}   /* flower closed: no neurons, no lightning */
.fn-nerve{stroke:color-mix(in srgb,var(--accent) 70%,#fff) !important;stroke-width:2 !important;opacity:.92 !important;filter:none !important}
.fn-glow{stroke-width:9 !important;opacity:.22 !important;filter:none !important}
.fn-twig{stroke:color-mix(in srgb,var(--accent) 80%,#fff) !important;stroke-width:1.3 !important;opacity:.6 !important}
.fn-bolt{stroke-width:2.4;animation-duration:calc(var(--dur,6s) * .55)}
.fn-nerve,.fn-bolt,.fn-glow,.fn-twig,.fn-plug{will-change:auto}
.fn-syn{filter:none !important}
.fn-plug{fill:color-mix(in srgb,var(--accent) 60%,#fff) !important;stroke:color-mix(in srgb,var(--accent) 45%,transparent) !important;stroke-width:5 !important;paint-order:stroke;opacity:1 !important;filter:none !important}

/* (27/10) the bolt flashes from fgNervesDraw (in step with its shape), not from a CSS animation */
.fn-bolt{animation:none !important}
/* the old travelling pulse and the synapse blink were CSS animations too (and the pulse had a glow filter): the
   lightning's flashes carry the energy now, so they rest — the orb opens and closes without lag */
.fn-pulse,.fn-syn{display:none !important;animation:none !important}
/* the nerves fade in and out together with the spiralling neurons */
.fg-nerves{transition:opacity .35s ease !important}

/* (28/10) Con las neuronas abiertas, el símbolo del orbe (hojas, árbol, flor, copo… el que esté elegido) crece por
   detrás de todas las neuronas juntas, transparente, como un sello de fondo; al cerrar el orbe vuelve a su tamaño */
.fg-center .core-frac,.fg-center .orb-turn{transition:scale .7s cubic-bezier(.2,.8,.2,1),opacity .5s ease}
#fgHome:not(.fg-closed) .fg-center .core-frac{scale:2.2;opacity:.16 !important;pointer-events:none;z-index:-1}
#fgHome:not(.fg-closed) .fg-center .orb-turn{scale:2.2;opacity:.12 !important;pointer-events:none}

/* (30/10) PHONE TAB BAR: the icons disappeared (only the red badges showed) — with every neuron squeezed into the width
   each tab shrank to almost nothing. Now each tab keeps a real size (44 px) and the bar scrolls sideways if needed; the
   icon is always drawn, full size and full colour. */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){
  .fg-tabs{justify-content:flex-start !important;overflow-x:auto !important;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity}
  .fg-tab{flex:0 0 44px !important;min-width:44px !important;padding:0 !important;justify-content:center;overflow:visible;scroll-snap-align:center}
  .fg-tab .px-ic,.fg-tab .nav-ic,.fg-tab .px-wait,.fg-tab img,.fg-tab svg{display:block !important;width:24px !important;height:24px !important;min-width:24px;flex:0 0 24px;opacity:1 !important;visibility:visible !important}
  .fg-tab:not(.on) .px-ic{filter:grayscale(.55) brightness(.95) !important;opacity:.85 !important}
  .fg-tab .nb-badge{position:absolute !important;top:4px;right:2px;margin:0}
}

/* (30/10) computers: the same top tab bar as on phones, also on the home screen — icons only, names on hover */
body.fg:not(.fg-phone) .fg-home-screen{padding-top:var(--fg-bar, 60px) !important}
body.fg:not(.fg-phone) .fg-bar .fg-tab span,body.fg:not(.fg-phone) .fg-bar .fg-tab.on span,body.fg:not(.fg-phone) .fg-bar .fg-edit span{display:none !important}
body.fg:not(.fg-phone) .fg-bar .fg-tab{padding:0 .7rem;justify-content:center}
body.fg:not(.fg-phone) .fg-bar .fg-tab .px-ic,body.fg:not(.fg-phone) .fg-bar .fg-tab .nav-ic{width:24px;height:24px}
body.fg:not(.fg-phone) .fg-bar .fg-edit{width:38px;padding:0;justify-content:center}

/* (30/10) settings live in the button next to Undo now: not in the home row */
.fg-orbs .fg-orb.gear{display:none !important}

/* (30/10) phones: the top bar SCROLLS sideways between all the neurons (it used to squeeze them and cut the last ones) */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){
  .fg-bar{overflow-x:auto !important;overflow-y:hidden !important;justify-content:flex-start !important;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;scrollbar-width:none;touch-action:pan-x}
  .fg-bar::-webkit-scrollbar{display:none}
  .fg-bar .fg-side{display:flex !important;flex:0 0 auto !important;flex-wrap:nowrap !important;width:auto !important;overflow:visible !important}
  .fg-bar .fg-tab{flex:0 0 52px !important;min-width:52px !important;scroll-snap-align:start}
  .fg-bar .fg-home{flex:0 0 auto !important}
}

/* (30/10) Settings live in the button next to Undo: not in the top bar */
.fg-bar .fg-gear{display:none !important}

/* (30/10) the orb in the top bar, a little bigger than the neuron icons */
.fg-bar .fg-home svg,.fg-bar .fg-home img,.fg-bar .fg-home canvas{width:32px !important;height:32px !important}
.fg-bar .fg-home{min-width:44px}

/* (31/10) phones: the orb at the left of the top bar was half cut and could not be reached — the bar snapped to the
   first tab (the orb had no snap point). No snapping now: the bar scrolls freely from the orb to the last icon. */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px), (orientation: landscape) and (max-height: 520px){
  .fg-bar{scroll-snap-type:none !important;scroll-padding-left:0}
  .fg-bar .fg-home{scroll-snap-align:start}
}

/* (31/10) Tablets held upright (and any wide screen with the phone layout): the top bar and the rows of tabs are
   CENTERED. Auto margins on the ends center the row while it fits; when it is wider than the screen they become 0,
   so it starts at the orb and scrolls (nothing is cut). */
@media (min-width: 600px) and (max-width: 1024px) and (orientation: portrait){
  .fg-bar > :first-child{margin-left:auto !important}
  .fg-bar > :last-child{margin-right:auto !important}
  .st-tabs,.ftb-tabs,.cr-tabs,.ln-tabs,.my-tabs,.pf-tabs,.bt-tabs,.bs-seg,[role="tablist"]{justify-content:safe center !important}
  .st-tabs > :first-child,.ftb-tabs > :first-child,.ln-tabs > :first-child,.my-tabs > :first-child,.pf-tabs > :first-child{margin-left:auto}
  .st-tabs > :last-child,.ftb-tabs > :last-child,.ln-tabs > :last-child,.my-tabs > :last-child,.pf-tabs > :last-child{margin-right:auto}
}

/* ===== (02/11) FLUIDEZ EN TELÉFONOS VIEJOS =====
   html[data-perf] lo pone tools/75-perf.js (alto · medio · bajo, medido en el equipo). Las animaciones que repintan en
   cada cuadro (sombras que respiran, el brillo que recorre la barra) eran lo que más trabajo daba en la pantalla de
   inicio aunque no tocaras nada. En «medio» se quitan ésas; en «bajo» también las que sólo se mueven, el desenfoque de
   fondo y los resplandores. Nada de esto cambia qué se ve: sólo deja de moverse o de brillar. */
html[data-perf=medium] .neuron-core.placed,html[data-perf=low] .neuron-core.placed,
html[data-perf=medium] body.fg .fg-center .neuron-core.placed,html[data-perf=low] body.fg .fg-center .neuron-core.placed{animation:none !important}
html[data-perf=medium] .fg-bar::before,html[data-perf=low] .fg-bar::before{animation:none !important;background-position:50% 0 !important}
html[data-perf=medium] .fg-orbs .fg-orb.shop::after,html[data-perf=medium] .fg-orbs .fg-orb.ch-orb::after,
html[data-perf=low] .fg-orbs .fg-orb.shop::after,html[data-perf=low] .fg-orbs .fg-orb.ch-orb::after{animation:none !important;opacity:0 !important}
html[data-perf=medium] .neuron-core::after{animation-duration:7s !important}
html[data-perf=low] .neuron-core::after,html[data-perf=low] .core-orbit,html[data-perf=low] .fg-gem-in,html[data-perf=low] .ch-orb .ch-n,
html[data-perf=low] .px-octo,html[data-perf=low] .fn-syn,html[data-perf=low] .fn-pulse{animation:none !important}
html[data-perf=low] *,html[data-perf=low] *::before,html[data-perf=low] *::after{backdrop-filter:none !important;-webkit-backdrop-filter:none !important}
html[data-perf=low] .fn-plug.b,html[data-perf=low] .fn-syn,html[data-perf=low] body.fg .fg-center .core-frac canvas.fl-px{filter:none !important}
html[data-perf=low] body.fg .fg-center .neuron-core{box-shadow:0 0 4px 1px var(--accent),0 0 14px 3px color-mix(in srgb,var(--accent) 50%,transparent) !important}
/* (03/11) with a neuron open the bar was off-centre: «full screen» and ✕ Esc sat on the right and pushed the neurons
   to the left. Now «full screen» goes to the far LEFT and ✕ to the far right, out of the row: the neurons stay centred. */
@media (min-width: 900px){
  #fgBar .fg-imm{position:absolute;left:14px;top:50%;transform:translateY(-50%);margin:0 !important}
  #fgBar .fg-close{position:absolute;right:10px;top:50%;transform:translateY(-50%);margin:0 !important}
}

/* ---------- (09/11 f) Celular acostado (poca altura): la flor a la izquierda y las neuronas en 2 filas a la derecha,
   todo cabe sin hacer scroll; la barra deja libre la esquina del Portal ---------- */
@media (orientation: landscape) and (max-height: 520px){
  .fg-home-screen{justify-content:center !important;padding:calc(var(--fg-bar, 46px) + .3rem) .8rem calc(3.2rem + env(safe-area-inset-bottom)) !important}
  .fg-book{max-width:min(1100px, 100%) !important;width:auto !important;grid-template-columns:minmax(130px, 180px) repeat(var(--fgcols, 5), minmax(84px, 120px)) !important;gap:.15rem .4rem !important;padding-top:0 !important;align-items:center;align-content:center;justify-content:center;margin:0 auto}
  .fg-level{grid-column:1 !important;grid-row:1}
  .fg-center{grid-column:1 !important;grid-row:1 / span 3;height:100% !important;min-height:140px}
  .fg-dia{grid-column:auto}
  .fg-lbl b{white-space:nowrap;font-size:calc(1.08rem - var(--fgcols, 5) * 0.058rem) !important}
  .fg-center .neuron-core{transform:scale(1.15) !important}
  .fg-gem,.fg-gem .px-medal{width:50px !important;height:50px !important}
  .fg-gem .nav-ic{width:22px;height:22px}
  .fg-lbl b{font-size:.66rem}
  .fg-lbl small{font-size:.56rem}
  .fg-dia{gap:.25rem !important}
  .fg-orbs{position:fixed;left:50%;bottom:calc(.55rem + env(safe-area-inset-bottom));transform:translateX(-50%);max-width:calc(100vw - 340px) !important;flex-wrap:nowrap !important;gap:.3rem !important;overflow-x:auto !important;justify-content:flex-start !important;scrollbar-width:none}
  .fg-orb{height:34px !important;min-width:34px !important;padding:0 .5rem !important}
  .fg-bar{padding-left:70px !important}
  .fg-bar .fg-tabs{justify-content:center !important}
  /* (10/11) nombres largos en dos líneas (no se enciman) y la fila de botones rápidos arriba de la barra de abajo */
  .fg-lbl b{white-space:nowrap !important;max-width:104px;overflow:hidden;text-overflow:ellipsis;font-size:.6rem !important;line-height:1.1;text-align:center;display:block}
  .fg-lbl small,.fg-dia .fg-hp,.fg-dia .fg-st{display:none !important}
  .fg-book > .fg-dia{translate:none !important}   /* (el vaivén de las neuronas las encimaba en el bloque de 3 filas) */
  html.cg-has-footer .fg-orbs{bottom:calc(68px + env(safe-area-inset-bottom)) !important}
  html.cg-has-footer .fg-home-screen{padding-bottom:calc(62px + 52px + env(safe-area-inset-bottom)) !important}
  html.cg-has-footer .fg-gem,html.cg-has-footer .fg-gem .px-medal{width:44px !important;height:44px !important}
}
/* (09/11 f) Celular de pie: la flor un poco más compacta y la fila de botones rápidos por encima de los botones flotantes */
@media (orientation: portrait) and (max-width: 600px){
  .fg-home-screen{padding-bottom:calc(4.6rem + env(safe-area-inset-bottom)) !important}
  .fg-book{gap:.55rem .4rem !important}
  .fg-center{height:112px !important}
  .fg-center .neuron-core{transform:scale(1.3) !important}
  .fg-gem,.fg-gem .px-medal{width:64px !important;height:64px !important}
  .fg-level{margin-bottom:-.3rem}
}

/* (10/11) girasol: las neuronas de arriba (también las grandes) llevan el nombre encima, para no tapar los botones rápidos del orbe */
.fg-dia.lbl-up:not(.fg-out) .fg-lbl{top:auto;bottom:50px}
@media (max-width:760px){.fg-dia.lbl-up:not(.fg-out) .fg-lbl{bottom:auto}}

/* (11/11) celular acostado: el orbe ocupa toda la altura del bloque (ninguna neurona queda debajo de él), 3 filas como
   máximo y columnas que se encogen para que todo quepa en la pantalla */
@media (orientation: landscape) and (max-height: 520px){
  .fg-book{grid-template-columns:minmax(110px, 160px) repeat(var(--fgcols, 5), minmax(64px, 1fr)) !important;max-width:100% !important;width:100% !important;column-gap:.2rem !important;row-gap:.35rem !important}
  .fg-center{grid-row:1 / span var(--fgrows, 3) !important}
  .fg-lbl b{max-width:88px}
}

/* (17/11) «al abrir las neuronas quedan enfrente del orbe y las toco por accidente»: el orbe va por encima de las neuronas,
   de las burbujas de crear y de los rayos, así que tocar el orbe siempre toca el orbe; las burbujas quedan un poco más lejos y más chicas */
.fg-center{z-index:8}
.fg-mini{width:40px;height:40px;margin:-20px 0 0 -20px}
.fg-mini .px-ic{width:18px;height:18px}

/* (18/11) «delete little buttons around orb»: fuera los botoncitos de crear alrededor de la esfera */
#fgHome .fg-minis,.fg-minis{display:none!important}

/* (18/11) «remove animation orbs around orb»: fuera los puntitos que giran alrededor del orbe (.core-orbit, tools/11-neurons.js) */
.core-orbit{display:none!important}
