:root {
  --bg: #f2f1ed;
  --card: #ffffff;
  --ink: #17181b;
  --soft: rgba(23, 24, 27, 0.5);
  --line: rgba(23, 24, 27, 0.08);
  --c0: #ff6a3d; /* the three branches */
  --c1: #3d7bff;
  --c2: #12a56b;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 16px;
}

.mm {
  width: min(350px, 100%);
  padding: 13px 10px 8px;
  border-radius: 28px;
  background: var(--card);
  box-shadow:
    0 0 0 1px rgba(23, 24, 27, 0.05),
    0 1px 1px rgba(23, 24, 27, 0.04),
    0 12px 24px -10px rgba(60, 50, 30, 0.12),
    0 40px 70px -30px rgba(60, 50, 30, 0.22);
}
.mm__head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; height: 24px; }
.mm__title { font-size: 15px; font-weight: 680; font-stretch: 108%; letter-spacing: -0.008em; }
.mm__chip { height: 22px; padding: 0 9px; border-radius: 999px; overflow: hidden; background: rgba(23, 24, 27, 0.055); font-size: 11.500px; line-height: 22px; font-weight: 600; }
.mm__chip span { display: block; white-space: nowrap; }

.mm__map { display: block; width: 100%; height: auto; max-height: 66vh; margin-top: 2px; overflow: visible; font-family: inherit; }
.link { fill: none; stroke-linecap: round; }
.link--main { stroke-width: 1.600; opacity: 0.55; transition: opacity 0.3s ease, stroke-width 0.3s ease; }
.link--main.is-on { stroke-width: 2.400; opacity: 1; }
.link--kid { stroke-width: 1.300; }
.b0 { --c: var(--c0); }
.b1 { --c: var(--c1); }
.b2 { --c: var(--c2); }
.link { stroke: var(--c); }

.node { cursor: pointer; outline: none; }
.node rect { transition: fill 0.3s ease, stroke 0.3s ease; }
.node text { font-weight: 640; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.node--root { cursor: default; }
.node--root rect { fill: var(--ink); }
.node--root text { fill: #ffffff; font-size: 13px; font-weight: 700; }
.node--branch rect { fill: #ffffff; stroke: var(--c); stroke-width: 1.600; filter: drop-shadow(0 3px 5px rgba(60, 50, 30, 0.14)); }
.node--branch text { fill: var(--ink); font-size: 12px; }
.node--branch .node__count { fill: var(--c); font-size: 10.500px; font-weight: 700; text-anchor: middle; }
.node--branch.is-on rect { fill: var(--c); }
.node--branch.is-on text, .node--branch.is-on .node__count { fill: #ffffff; }
.node--branch.is-dim { opacity: 0.62; }
.node--branch { transition: opacity 0.3s ease; }
.node--branch:focus-visible rect { stroke: var(--ink); stroke-width: 2.400; }
.node--kid { cursor: default; }
.node--kid rect { fill: color-mix(in srgb, var(--c) 13%, #ffffff); stroke: color-mix(in srgb, var(--c) 34%, transparent); stroke-width: 1; }
.node--kid text { fill: var(--ink); font-size: 11px; font-weight: 580; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #17181b;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

/* larger on a desktop-sized window, so the piece fills the frame; the phone box and the narrow Playground stay as they are */
@media (min-width: 700px) and (min-height: 500px) { .mm { zoom: 1.25; } }
@media (min-width: 1100px) and (min-height: 760px) { .mm { zoom: 1.6; } }
