/* The Mycelium as a full-screen web of roots (main.js «web-page», mycelium.rs): dark earth, roots of ink that
   light up lime as they grow, sap flowing along them, nodes that bloom into spores. */

:root #overlay.menu.web-page { display: block; padding: 0; overflow: hidden; background: none; }
:root #overlay.menu > .web-screen {
  position: fixed; inset: 0; width: 100vw; max-width: none; height: 100vh; overflow: hidden; color: #e9dcc0; font-family: var(--hud-font);
  background:
    radial-gradient(ellipse at 50% 50%, #233019 0, #141c10 40%, #0a0e08 75%),
    #0a0e08;
}
.web-screen::before {
  /* Drifting dust over the earth. */
  content: ''; position: absolute; inset: -20%; pointer-events: none; opacity: .5;
  background-image: radial-gradient(#b9f34f 1px, transparent 1.5px), radial-gradient(#8fd12a 1px, transparent 1.5px);
  background-size: 140px 140px, 90px 90px; background-position: 0 0, 40px 60px;
  animation: dust-drift 40s linear infinite;
}
@keyframes dust-drift { to { transform: translate(140px, -90px); } }
.web-screen::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, #000a 100%);
}

/* The bar on top: name, seeds, burn and back. */
.web-head {
  position: absolute; left: 0; right: 0; top: 0; z-index: 4; display: flex; align-items: center; gap: 18px; padding: 12px 22px;
  background: linear-gradient(#0a0e08f0, #0a0e0800);
}
:root #overlay .web-head h1 { margin: 0; font: 700 clamp(26px, 2.4vw, 44px)/1 var(--title-font); letter-spacing: .04em; color: #c9f550; text-shadow: 0 0 18px #b9f34f88, 0 3px 0 #1c2a08; }
.web-seeds { display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 20px; border: 2px solid #5a6a2a; background: #141c10cc; }
.web-seeds .icon { --size: 26px; }
.web-seeds b { font: 700 22px/1 var(--title-font); color: #d8ff7a; }
.web-seeds small { font-size: 13px; opacity: .7; text-transform: uppercase; }
.web-head button {
  padding: 9px 18px; border-radius: 6px; border: 2px solid #3a2716; cursor: pointer; font: 600 15px/1 var(--hud-font); text-transform: uppercase;
  background: linear-gradient(#83593a, #4b301d); color: #f6e6bd; box-shadow: inset 0 2px 0 #a8794d, 2px 3px 0 #0009;
}
.web-head .web-burn { margin-left: auto; background: linear-gradient(#7a2a18, #3e140a); }
.web-head .web-burn:disabled { opacity: .4; cursor: default; }
.web-head button:hover:enabled { filter: brightness(1.15); }

.web-tools { position: absolute; right: 18px; bottom: 18px; z-index: 4; display: flex; flex-direction: column; gap: 8px; }
.web-tools button { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #5a6a2a; background: #141c10e6; color: #d8ff7a; font: 700 20px/1 Georgia, serif; cursor: pointer; }

.web-field { position: absolute; inset: 0; cursor: grab; touch-action: none; }
.web-field:active { cursor: grabbing; }
.web-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.web-world svg { position: absolute; left: 0; top: 0; overflow: visible; }

/* Roots: ink lines, a warm reach toward what can grow next, lime with flowing sap where grown. */
.web-world .root { fill: none; stroke: #3b2f1d; stroke-width: 5; stroke-linecap: round; }
.web-world .root.reach { stroke: #8a6a2a; stroke-width: 5; stroke-dasharray: 2 10; animation: reach 1.2s linear infinite; }
@keyframes reach { to { stroke-dashoffset: -24; } }
.web-world .root.under { stroke: #3e5c0c; stroke-width: 9; }
.web-world .root.lit { stroke: #c9f550; stroke-width: 4; stroke-dasharray: 14 18; filter: drop-shadow(0 0 5px #b9f34f); animation: sapflow 1.6s linear infinite; }
@keyframes sapflow { to { stroke-dashoffset: -64; } }
.web-world .sap { fill: none; stroke: #f2ffb0; stroke-width: 8; stroke-linecap: round; filter: drop-shadow(0 0 6px #b9f34f) drop-shadow(0 0 12px #b9f34f); }

/* Nodes. */
.web-node {
  position: absolute; translate: -50% -50%; display: grid; place-items: center; padding: 0; border-radius: 50%; cursor: default;
  border: 3px solid #2a1d10; background: radial-gradient(#3a3424, #1a160e 75%); color: #8a7a5a;
  box-shadow: 0 3px 8px #000c; transition: scale .15s ease-out, filter .15s ease-out;
}
.web-node.minor { width: 30px; height: 30px; font: 700 15px/1 Georgia, serif; }
.web-node.habit { width: 58px; height: 58px; }
.web-node.habit .icon { --size: 100%; width: 100%; height: 100%; filter: grayscale(.9) brightness(.45); }
.web-node.key { width: 84px; height: 84px; border-radius: 22%; rotate: 45deg; border-width: 4px; background: radial-gradient(#4a2418, #1a0c08 75%); }
.web-node.key .icon { --size: 76%; width: 76%; height: 76%; rotate: -45deg; filter: grayscale(.8) brightness(.45); }
.web-node.heart { width: 74px; height: 74px; border: 4px solid #b9f34f; color: #f2ffb0; font: 700 34px/1 Georgia, serif;
  background: radial-gradient(#8fd12a, #2e4410 70%); box-shadow: 0 0 30px #b9f34f, 0 0 60px #6f9a1288; animation: heart-beat 2.4s ease-in-out infinite; }
@keyframes heart-beat { 50% { scale: 1.07; box-shadow: 0 0 44px #d8ff7a, 0 0 90px #6f9a12aa; } }

.web-node.open { cursor: pointer; border-color: #8a6a2a; }
.web-node.open.affordable { border-color: #e8d27a; animation: can-grow 1.5s ease-in-out infinite; }
@keyframes can-grow { 50% { box-shadow: 0 0 18px #e8d27a, 0 3px 8px #000c; } }
.web-node.open .icon { filter: grayscale(.4) brightness(.75); }
.web-node.grown { border-color: #b9f34f; color: #e2ff9a; background: radial-gradient(#4f6a1c, #1f2a0c 75%); box-shadow: 0 0 14px #b9f34f99, 0 3px 8px #000c; }
.web-node.grown .icon { filter: none; }
.web-node.key.grown { border-color: #ff8a4a; box-shadow: 0 0 24px #ff6a2a, 0 0 50px #b9f34f66; }
.web-node:hover { scale: 1.18; z-index: 3; filter: brightness(1.2); }
.web-node.key:hover { scale: 1.12; }
.web-node.refuse { animation: refuse .35s ease-in-out; }
@keyframes refuse { 25% { translate: calc(-50% - 5px) -50%; } 75% { translate: calc(-50% + 5px) -50%; } }
.web-node.bloom { animation: web-bloom .7s ease-out forwards; z-index: 4; }
@keyframes web-bloom { 30% { scale: 1.9; filter: brightness(2.4) drop-shadow(0 0 20px #e2ff9a); } 100% { scale: 1.2; filter: brightness(1.4); } }
.web-node.just { animation: web-settle .7s ease-out; }
@keyframes web-settle { 0% { scale: 1.35; filter: brightness(1.9) drop-shadow(0 0 16px #e2ff9a); } }
.web-spore { position: absolute; width: 9px; height: 9px; border-radius: 50%; translate: -50% -50%; pointer-events: none; z-index: 5;
  background: radial-gradient(#f2ffb0, #8fd12a 60%, transparent 70%); animation: web-spore 1s ease-out forwards; }
@keyframes web-spore { from { opacity: 1; transform: translate(0, 0) scale(1.5); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.4); } }
.web-ring { position: absolute; width: 20px; height: 20px; translate: -50% -50%; border-radius: 50%; border: 3px solid #e2ff9a; pointer-events: none; z-index: 5; animation: web-ring .7s ease-out forwards; }
@keyframes web-ring { to { width: 180px; height: 180px; opacity: 0; } }

/* The names of the roots past their tips. */
.web-root-name { position: absolute; translate: -50% -50%; pointer-events: none; font: 700 30px/1 var(--title-font); letter-spacing: .06em; text-transform: uppercase; opacity: .55; text-shadow: 0 2px 0 #000; }
.web-root-name.root0 { color: #ff8a5a; } .web-root-name.root1 { color: #d8b07a; } .web-root-name.root2 { color: #7fe0c4; } .web-root-name.root3 { color: #c9f550; }

/* The card that follows the pointer. */
.web-tip {
  position: absolute; z-index: 6; width: 280px; padding: 12px 14px; pointer-events: none; border-radius: 6px;
  background: #efdfb8; color: #3a2716; border: 3px solid #3a2716; box-shadow: 4px 6px 0 #000a;
}
.web-tip b { display: block; font: 700 18px/1.15 var(--title-font); }
.web-tip p { margin: 6px 0 0; font: 400 14px/1.35 var(--hud-font); }
.web-tip em { display: block; margin-top: 6px; font: italic 400 13px/1.3 var(--hud-font); color: #7a5a36; }
.web-tip small { display: block; margin-top: 8px; padding-top: 6px; border-top: 1px dashed #3a271666; font: 600 13px/1 var(--hud-font); text-transform: uppercase; }
.web-tip small.ready { color: #3c6a10; } .web-tip small.far { color: #8a5a36; } .web-tip small.done { color: #2f6a4a; }
.web-tip.key { background: #f3d7c0; border-color: #6a1c0c; }
