:root {
  --bg: #ffffff;
  --card: #00f;
  --accent: #f0f;
  --muted: #ddd;
}

@font-face {
  font-family: "BigBlueTerm";
  src: url("/sable/fonts/BigBlue_TermPlus.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

html {
  font-family:
    "BigBlueTerm",
    system-ui,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
}

#stage {
  width: 100dvw;
  z-index: 15;
  height: 100dvh;
  overflow: hidden;
  /* background: #fff; */
  position: relative;
}
.mindmap {
  position: absolute;
  transform-origin: 0 0;
}
.node {
  position: absolute;
  background: var(--card);
  border: 2px solid #000;
  padding: 10px;
  box-sizing: border-box;
  width: fit-content;
  height: auto;
  cursor: grab;
  z-index: 500;
  user-select: none;
}
.node.hidden {
  display: none;
}
.link {
  position: absolute;
  height: 3px;
  background: rgba(99, 102, 241, 0.9);
  transform-origin: 0 50%;
}
.root-node {
  background: var(--accent);
  width: 220px;
}
.leaf-node {
  background: var(--muted);
}
.has-link {
  border: 2px solid #f0f;
}
.has-text {
  border: 2px solid #00a;
}
.node .head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.node .title {
  font-weight: 600;
  font-size: 14px;
}
.node .content {
  margin-top: 8px;
  color: #77f;
  font-size: 11px;
}

.node img {
  max-width: 320px;
  display: block;
  border-radius: 4px;
  margin-top: 6px;
}
.legend {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
a.node-link {
  color: var(--accent);
  text-decoration: underline;
}

body {
  overflow: hidden;
}

main {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  pointer-events: none;
}

[data-parent-id="root"] .content .text {
  font-weight: 600;
}

[data-parent-id="root"] {
  width: 200px;
  height: auto;
  min-width: unset;
  max-width: unset;
}

/* [data-parent-id="root"]:nth-of-type(3n + 3) {
   background: #f87171 !important;
   } */

.node:not(.leaf-node) .head {
  text-decoration: underline;
  color: white;
  text-decoration-style: double;
  text-underline-offset: 2px;
}

.node:not(.leaf-node) .content .text {
  color: white;
}

details.text summary:hover,
details.text[open]:hover summary {
  color: #000;
  text-decoration: underline;
}

summary {
  width: min-content;
}
.node:hover {
  z-index: 1000;
  box-shadow: 0 4px 8px #0000ff22;
  transform: scale(1.01);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.node .content .text summary,
.node .content a {
  cursor: pointer;
}

.node:active {
  cursor: grabbing;
}
main,
.p5Canvas {
  width: 100dvw;
  height: 100dvh;
}
