/* The tools (js/hood/ui/tools.js): Neighborhood in the site's warm off-white, the Map Editor in blueprint
   cyan, the Arcade in yellow to orange, Bug Mode in grass green to amber. The switcher at the top shows which one is in use; the curtain covers every
   move between them in the destination's colours. */

:root { --tl-hood: #eeece6; --tl-editor: #38d9ff; --tl-arcade: #ffc53a; --tl-arcade2: #ff7a3d; --tl-bug: #9be15d; --tl-bug2: #f2b630; }

/* ---- the switcher */
.tl-switch { position: fixed; z-index: 60; left: 50%; top: calc(var(--m) * .8 + env(safe-area-inset-top) - 6px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: rgb(6 6 11 / .78); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 8px 28px rgb(0 0 0 / .35); font-family: var(--mono); }
.tl-switch[hidden] { display: none; }
.tl-switch button { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 13px 0 11px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-3); font: 400 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; cursor: pointer;
  transition: color .3s var(--ease); }
.tl-switch button svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tl-switch button:hover:not(:disabled) { color: var(--ink); }
.tl-switch button:disabled { opacity: .38; cursor: default; }
.tl-switch button.on { color: #0b0b10; }
.tl-pill { position: absolute; z-index: 0; left: 0; top: 3px; height: 30px; width: 0; border-radius: 999px; background: var(--tl-hood);
  transition: transform .45s cubic-bezier(.3, 1.3, .5, 1), width .35s var(--ease), background .4s var(--ease); }
.tl-switch[data-tool="editor"] .tl-pill { background: var(--tl-editor); box-shadow: 0 0 18px rgb(56 217 255 / .35); }
.tl-switch[data-tool="arcade"] .tl-pill { background: linear-gradient(120deg, var(--tl-arcade), var(--tl-arcade2)); box-shadow: 0 0 18px rgb(255 160 60 / .35); }
.tl-switch[data-tool="bug"] .tl-pill { background: linear-gradient(120deg, var(--tl-bug), var(--tl-bug2)); box-shadow: 0 0 18px rgb(155 225 93 / .35); }
body[data-tool="bug"] .tl-switch:not(.tl-inline) { z-index: 120; }
/* over the Arcade's menus (it sits under them otherwise) */
body[data-tool="arcade"] .tl-switch:not(.tl-inline) { z-index: 120; }
/* inside the editor's top bar */
.tl-switch.tl-inline { position: relative; left: auto; top: auto; transform: none; box-shadow: none; background: rgb(255 255 255 / .04); }
.tl-switch.tl-inline button { height: 28px; padding: 0 11px 0 9px; font-size: 10px; }
.tl-switch.tl-inline .tl-pill { height: 28px; }
/* (in the editor's crowded bar only the tool in use is named; the others are icons with their names on hover) */
.tl-switch.tl-inline button:not(.on) span { display: none; }
.tl-switch.tl-inline button:not(.on) { padding: 0 9px; }
/* the map mode (choosing an area) keeps the top clear on narrow screens */
@media (max-width: 760px) { .tl-switch:not(.tl-inline) { top: auto; bottom: calc(14px + env(safe-area-inset-bottom)); } .tl-switch button span { display: none; } .tl-switch button { padding: 0 10px; } }
/* the page's title and line under it stay clear of the switcher (long names end in an ellipsis) */
@media (min-width: 761px) {
  .nb-head .ss-title { max-width: calc(50vw - 200px - var(--m)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nb-head .ss-sub { max-width: calc(50vw - 200px - var(--m)); }
}

/* the editor's own ways out are the switcher in its bar, Play (to the Arcade) and Library (its maps) */
.ed-root.has-switch:not(.has-library) .ed-play, .ed-root.has-switch:not(.has-library) .ed-done { display: none; }
/* the Arcade's menus sit on a darker, warmer veil than the pause menus, so it reads as its own place */
body[data-tool="arcade"] .pl-root.pl-theme-hub .pl-backdrop { background: radial-gradient(ellipse at 30% 0%, rgb(255 160 50 / .16), transparent 60%), rgb(8 6 4 / .72) !important; }

/* ---- the curtain */
.tl-curtain { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; opacity: 0; pointer-events: auto; transition: opacity .38s var(--ease); font-family: var(--mono); }
.tl-curtain.in { opacity: 1; }
.tl-curtain.out { opacity: 0; transition-duration: .55s; pointer-events: none; }
.tl-cbg { position: absolute; inset: 0; background: #050508; }
.tl-cbody { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 24px; transform: translateY(10px); transition: transform .7s var(--ease); }
.tl-curtain.in .tl-cbody { transform: none; }
.tl-cmark { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 22px; color: #0b0b10; background: var(--tl-hood); }
.tl-cmark svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tl-ckick { font-size: 10.5px; letter-spacing: .32em; text-transform: uppercase; color: var(--ink-3); }
.tl-ctitle { margin: 10px 0 0; font: 400 clamp(26px, 4.4vw, 46px)/1.05 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.tl-csub { margin: 12px 0 0; font-size: 12px; letter-spacing: .06em; color: var(--ink-2); }
.tl-cstatus { min-height: 1.4em; margin: 30px 0 0; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.tl-cbar { position: relative; display: block; width: 180px; height: 2px; margin-top: 12px; border-radius: 2px; overflow: hidden; background: rgb(255 255 255 / .08); }
.tl-cbar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; border-radius: 2px; background: currentColor; animation: tl-run 1.1s var(--ease) infinite; }
@keyframes tl-run { from { left: -40%; } to { left: 100%; } }
/* Neighborhood: the site's black and off-white */
.tl-c-hood { color: var(--tl-hood); }
.tl-c-hood .tl-cbg { background: radial-gradient(ellipse at 50% 120%, rgb(238 236 230 / .07), transparent 60%), #040407; }
/* the Map Editor: a blueprint */
.tl-c-editor { color: var(--tl-editor); }
.tl-c-editor .tl-cbg { background:
  linear-gradient(rgb(56 217 255 / .08) 1px, transparent 1px) 0 0 / 28px 28px,
  linear-gradient(90deg, rgb(56 217 255 / .08) 1px, transparent 1px) 0 0 / 28px 28px,
  linear-gradient(rgb(56 217 255 / .13) 1px, transparent 1px) 0 0 / 140px 140px,
  linear-gradient(90deg, rgb(56 217 255 / .13) 1px, transparent 1px) 0 0 / 140px 140px,
  radial-gradient(ellipse at 50% 50%, #0b2333, #04101a 70%); }
.tl-c-editor .tl-cmark { background: var(--tl-editor); box-shadow: 0 0 40px rgb(56 217 255 / .35); }
.tl-c-editor .tl-ckick, .tl-c-editor .tl-cstatus { color: rgb(56 217 255 / .7); }
/* the Arcade: warm, striped */
.tl-c-arcade { color: var(--tl-arcade); }
.tl-c-arcade .tl-cbg { background: repeating-linear-gradient(-55deg, rgb(255 200 60 / .05) 0 22px, transparent 22px 44px), radial-gradient(ellipse at 50% 30%, #3a1d08, #0d0704 70%); }
.tl-c-arcade .tl-cmark { background: linear-gradient(135deg, var(--tl-arcade), var(--tl-arcade2)); box-shadow: 0 0 44px rgb(255 140 50 / .4); }
.tl-c-arcade .tl-ckick, .tl-c-arcade .tl-cstatus { color: rgb(255 197 58 / .75); }
/* Bug Mode: grass at dusk, a glow of amber */
.tl-c-bug { color: var(--tl-bug); }
.tl-c-bug .tl-cbg { background: radial-gradient(ellipse at 50% 115%, rgb(242 182 48 / .18), transparent 55%),
  repeating-linear-gradient(97deg, rgb(155 225 93 / .05) 0 3px, transparent 3px 19px), radial-gradient(ellipse at 50% 30%, #13230c, #050803 72%); }
.tl-c-bug .tl-cmark { background: linear-gradient(135deg, var(--tl-bug), var(--tl-bug2)); box-shadow: 0 0 44px rgb(155 225 93 / .38); }
.tl-c-bug .tl-ckick, .tl-c-bug .tl-cstatus { color: rgb(155 225 93 / .75); }
@media (prefers-reduced-motion: reduce) { .tl-curtain, .tl-cbody, .tl-pill { transition: none; } .tl-cbar::after { animation: none; left: 30%; } }

/* ---- the Map Editor's own colours (it shared the Arcade's yellow before) */
.ed-root { --ed-acc: var(--tl-editor) !important; --ed-acc2: rgb(56 217 255 / .14) !important; --ed-blue: #b9a2ff !important; }
.ed-root .ed-logo { background: linear-gradient(140deg, #38d9ff, #2a7dff) !important; color: #04121a !important; }
.ed-root .ed-ib.on { border-color: rgb(56 217 255 / .4) !important; }
.ed-root .ed-rail button.on { border-color: rgb(56 217 255 / .35) !important; }
.ed-root .ed-tg.on { background: rgb(185 162 255 / .1) !important; border-color: rgb(185 162 255 / .45) !important; }
.ed-root .ed-btn.ed-primary, .ed-root .ed-play { color: #04121a !important; }
.ed-root .ed-btn.ed-primary:hover, .ed-root .ed-play:hover { background: #7de6ff !important; }
.ed-root .ed-brand .ed-kind { display: block; font-size: 9px; letter-spacing: .26em; text-transform: uppercase; color: var(--tl-editor); line-height: 1; margin: 0 0 3px 9px; }
.ed-root .ed-brand .ed-names { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ed-root .ed-name { padding-top: 2px !important; padding-bottom: 3px !important; }
.ed-root .ed-brand { flex: 0 1 auto; width: auto !important; min-width: 150px; max-width: calc(var(--ed-rail) + var(--ed-panel) - 26px); }
.ed-root .ed-names { min-width: 120px; }
/* narrower screens: the snap toggles keep their icons and lose their words */
@media (max-width: 1500px) { .ed-root .ed-snaps .ed-tg > span { display: none; } .ed-root .ed-top { gap: 10px; } }
@media (max-width: 1180px) { .ed-root .ed-saved { display: none; } }
/* a thin cyan rule under the editor's bar: the blueprint's edge */
.ed-root .ed-top { box-shadow: inset 0 -1px 0 rgb(56 217 255 / .35); }

/* ---- the Neighborhood's bar: the other two tools are in the switcher now */
body #editBtn, body #playBtn { display: none !important; }

/* room for the switcher between the title and the corner links on narrower screens */
@media (max-width: 1440px) { .ss-corner { gap: 14px !important; } .ss-corner > * { letter-spacing: .12em !important; } }
@media (max-width: 1240px) { .tl-switch:not(.tl-inline) button:not(.on) span { display: none; } .tl-switch:not(.tl-inline) button:not(.on) { padding: 0 10px; } }
