html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  color: #f4f1ea;
  font-family: Sora, "Segoe UI", sans-serif;
}

.stage {
  box-sizing: border-box;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  padding: 20px 28px 18px;
}

.train, .goals { width: min(820px, 100%); }
.train { position: relative; }
.timer { align-self: flex-start; }

.label, .kicker {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #d9d3ea;
}

.kicker { display: block; margin-bottom: 2px; }

.rail {
  position: relative;
  height: 52px;
  margin-top: 6px;
}

.ties {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 8px;
  background:
    repeating-linear-gradient(90deg, #6b6258 0 10px, transparent 10px 22px),
    linear-gradient(#3a342e, #3a342e) center / 100% 3px no-repeat;
}

.cars {
  position: absolute;
  left: 0;
  bottom: 16px;
  height: 22px;
  width: 0;
  background:
    repeating-linear-gradient(90deg,
      #3a1868 0 4px,
      #9146ff 4px 26px,
      #1a1024 26px 30px,
      #ff0033 30px 52px,
      #140810 52px 56px,
      #1f6b12 56px 60px,
      #53fc18 60px 82px,
      #10200c 82px 86px);
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.28), inset 0 -5px 0 rgba(0, 0, 0, 0.35);
  transition: width 0.35s ease;
}

.solo.twitch .cars {
  background: repeating-linear-gradient(90deg, #3a1868 0 4px, #9146ff 4px 28px, #1a1024 28px 34px);
}
.solo.youtube .cars {
  background: repeating-linear-gradient(90deg, #5c0014 0 4px, #ff0033 4px 28px, #1a0810 28px 34px);
}
.solo.kick .cars {
  background: repeating-linear-gradient(90deg, #14520c 0 4px, #53fc18 4px 28px, #0c1c0a 28px 34px);
}

.loco {
  position: absolute;
  bottom: 8px;
  width: 78px;
  height: 44px;
  margin-left: -70px;
  transition: left 0.35s ease;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.45));
}

.loco svg { width: 78px; height: 44px; display: block; }

.solo.twitch .loco rect:first-child,
.solo.twitch .loco path { fill: #9146ff; }
.solo.youtube .loco rect:first-child,
.solo.youtube .loco path { fill: #ff0033; }
.solo.kick .loco rect:first-child,
.solo.kick .loco path { fill: #126b12; }

#burst {
  position: absolute;
  left: 8px;
  top: 22px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  pointer-events: none;
}

#burst.burst { animation: rise 0.9s ease forwards; }

.timer {
  min-width: 280px;
  padding: 8px 16px 10px;
  background: #121014;
  box-shadow: inset 0 0 0 2px #2c2633, 0 7px 0 #050308;
  border-left: 7px solid #9146ff;
}

.stage.mix .timer {
  border-left-width: 7px;
  border-image: linear-gradient(#9146ff, #ff0033, #53fc18) 1;
}

.stage.solo.youtube .timer { border-left-color: #ff0033; border-image: none; }
.stage.solo.kick .timer { border-left-color: #53fc18; border-image: none; }
.stage.solo.twitch .timer { border-left-color: #9146ff; border-image: none; }

.clock {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 58px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.06em;
  color: #f7f3ea;
}

.stage.mix .clock { text-shadow: 0 0 16px rgba(145, 70, 255, 0.55); }
.stage.solo.twitch .clock { color: #f3e9ff; text-shadow: 0 0 14px #9146ff; }
.stage.solo.youtube .clock { color: #ffe4ea; text-shadow: 0 0 14px #ff0033; }
.stage.solo.kick .clock { color: #e9ffe4; text-shadow: 0 0 14px #53fc18; }

.goal { margin-top: 8px; }
.goal:first-child { margin-top: 0; }

.meter {
  height: 10px;
  margin-top: 5px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 12.5%),
    #1a1620;
  box-shadow: inset 0 2px 0 #050308;
}

.meter .fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #9146ff, #ff0033 55%, #53fc18);
}

.stage.solo.twitch .meter .fill { background: #9146ff; }
.stage.solo.youtube .meter .fill { background: #ff0033; }
.stage.solo.kick .meter .fill { background: #53fc18; }

.goal-follow .meter .fill { background: #9146ff; }
.goal-tip .meter .fill { background: #53fc18; }
.goal-sub .meter .fill,
.goal-gift .meter .fill,
.goal-member .meter .fill { background: #ff0033; }

.stage.solo.twitch .goal-follow .meter .fill,
.stage.solo.twitch .goal-tip .meter .fill,
.stage.solo.twitch .goal-sub .meter .fill { background: #9146ff; }
.stage.solo.youtube .goal-follow .meter .fill,
.stage.solo.youtube .goal-tip .meter .fill,
.stage.solo.youtube .goal-sub .meter .fill { background: #ff0033; }
.stage.solo.kick .goal-follow .meter .fill,
.stage.solo.kick .goal-tip .meter .fill,
.stage.solo.kick .goal-sub .meter .fill { background: #53fc18; }

.sb-note {
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
}

.sb-note.show { opacity: 1; }

@keyframes rise {
  0% { opacity: 0; transform: translateY(6px); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-8px); }
}

/* ------------------------------------------------------------------
   RPG skill tree
   ------------------------------------------------------------------ */
.stage.tree-mode {
  display: block;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.tree {
  --bone: #efe6cf;
  --gold: #f5c04a;
  --gold-hi: #ffe9a8;
  --gold-lo: #8a5f16;
  --ghost: #63f5d0;
  --ghost-lo: #17806c;
  --blood: #c8334d;
  --violet: #9d7bff;
  --edge: #3b2c58;
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  font-family: Cinzel, "Sora", serif;
  color: var(--bone);
}

.tree[hidden] { display: none; }
/* Only the widgets the layout asks for, from the first paint (events.html sets data-mode early). */
html[data-mode]:not([data-mode="all"]):not([data-mode="train"]) #train-widget,
html[data-mode]:not([data-mode="all"]):not([data-mode="timer"]) #timer-widget,
html[data-mode]:not([data-mode="all"]):not([data-mode="goals"]) #goals-widget { display: none; }
.tree { transition: opacity 0.6s ease, visibility 0s linear 0s; }
.tree.away { opacity: 0; visibility: hidden; transition: opacity 0.6s ease, visibility 0s linear 0.6s; }

.tree-frame {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(96, 52, 160, 0.42), transparent 70%),
    radial-gradient(60% 50% at 50% 110%, rgba(255, 122, 28, 0.10), transparent 70%),
    linear-gradient(rgba(10, 7, 17, var(--tree-alpha, 1)), rgba(8, 5, 14, var(--tree-alpha, 1)));
  box-shadow:
    0 0 0 1px rgba(245, 192, 74, 0.55),
    0 0 0 5px rgba(10, 7, 17, var(--tree-alpha, 1)),
    0 0 0 6px rgba(245, 192, 74, 0.22),
    0 24px 60px rgba(0, 0, 0, 0.65);
}

.tree-frame::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 10px;
  border: 1px solid rgba(245, 192, 74, 0.16);
}

.corner {
  position: absolute;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold-lo));
  transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(245, 192, 74, 0.6);
}
.corner.tl { left: -7px; top: -7px; }
.corner.tr { right: -7px; top: -7px; }
.corner.bl { left: -7px; bottom: -7px; }
.corner.br { right: -7px; bottom: -7px; }

.ico { display: block; fill: currentColor; }

/* ---------- HUD ---------- */
/* The header holds stacked slides; only the "on" one shows, and they cross-fade. */
.hud {
  position: absolute;
  left: 44px;
  right: 44px;
  top: 24px;
  height: 88px;
}

.hud-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease, visibility 0s linear 0.5s;
}

.hud-slide.on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease, visibility 0s;
}

.hud-row {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  align-items: center;
}

.hud-pts { display: flex; align-items: center; gap: 16px; }

.gem {
  position: relative;
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  flex: none;
}

.gem::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #8a55e8, #2c1556 68%, #170b30);
  box-shadow: inset 0 0 0 3px #d9a93d, inset 0 0 0 5px rgba(0, 0, 0, 0.5), 0 0 22px rgba(140, 90, 255, 0.5);
}

.gem .ico {
  position: relative;
  width: 40px;
  height: 40px;
  color: var(--gold-hi);
  filter: drop-shadow(0 0 7px rgba(245, 192, 74, 0.85));
}

.hud-pts.ready .gem::before { animation: gemPulse 1.7s ease-in-out infinite; }

.pts-text { display: flex; flex-direction: column; gap: 5px; }

.pts-text b {
  font-size: 46px;
  font-weight: 700;
  line-height: 0.9;
  color: var(--gold-hi);
  text-shadow: 0 0 16px rgba(245, 192, 74, 0.6), 0 2px 0 #000;
}

.pts-text em {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8f83aa;
  white-space: nowrap;
}

.pts-text span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #c9b8ee;
}

.hud-xp { position: relative; min-width: 0; }

.xp-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #d9cff2;
}

.xp-top span:last-child {
  font-family: "IBM Plex Mono", monospace;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--gold-hi);
}

.xp-bar {
  position: relative;
  height: 18px;
  border-radius: 10px;
  background: #110b1d;
  box-shadow: inset 0 0 0 2px #4b3a6c, inset 0 4px 8px #000, 0 0 0 1px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.xp-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 10px;
  background: linear-gradient(90deg, #6a2fe0, #b866ff 62%, #ffd76a);
  box-shadow: 0 0 16px rgba(184, 102, 255, 0.75), inset 0 3px 0 rgba(255, 255, 255, 0.28);
  transition: width 0.45s ease;
}

.xp-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), rgba(0, 0, 0, 0.6) calc(25% - 1px) 25%);
}

.earn {
  display: flex;
  gap: 16px;
  margin-top: 9px;
  white-space: nowrap;
}

.earn:empty { display: none; }

.xp-foot {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 9px;
}

.raised {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8f83aa;
  white-space: nowrap;
}

.status {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ghost);
  white-space: nowrap;
}

.xp-foot + .earn { margin-top: 6px; }

/* overall goal slide */
.gem.gold::before {
  background: radial-gradient(circle at 34% 28%, #ffd76a, #8a5f16 68%, #3a2608);
  box-shadow: inset 0 0 0 3px #ffe9a8, inset 0 0 0 5px rgba(0, 0, 0, 0.5), 0 0 22px rgba(245, 192, 74, 0.5);
}
.gem.gold .ico { color: #fff6da; }
.xp-bar.goal i {
  background: linear-gradient(90deg, #b5661a, #f5c04a 62%, #fff0b8);
  box-shadow: 0 0 16px rgba(245, 192, 74, 0.7), inset 0 3px 0 rgba(255, 255, 255, 0.3);
}

/* donate slide */
.hud-donate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-hi);
  text-shadow: 0 0 16px rgba(245, 192, 74, 0.55), 0 2px 0 #000;
  white-space: nowrap;
}
.hud-donate::before, .hud-donate::after {
  content: "";
  flex: 0 1 220px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 192, 74, 0.7));
}
.hud-donate::after { background: linear-gradient(90deg, rgba(245, 192, 74, 0.7), transparent); }

.earn .e {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8f83aa;
}

.earn .e b { color: #d9cff2; font-weight: 700; }

.earn .e em {
  font-style: normal;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gold-hi);
}

.pips { display: flex; gap: 3px; }
.pip { width: 8px; height: 8px; border-radius: 50%; display: block; }
.pip.twitch { background: #9146ff; box-shadow: 0 0 6px rgba(145, 70, 255, 0.9); }
.pip.youtube { background: #ff0033; box-shadow: 0 0 6px rgba(255, 0, 51, 0.9); }
.pip.kick { background: #53fc18; box-shadow: 0 0 6px rgba(83, 252, 24, 0.9); }

.hud-vote {
  box-sizing: border-box;
  padding: 0 26px;
  border-radius: 14px;
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr) 220px;
  gap: 28px;
  align-items: center;
  background: linear-gradient(rgba(14, 40, 40, 0.85), rgba(22, 15, 38, 0.96));
  box-shadow: inset 0 0 0 1.5px var(--ghost), 0 0 30px rgba(99, 245, 208, 0.25);
}

.vote-head { display: flex; flex-direction: column; gap: 7px; min-width: 0; }

#vote-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ghost);
  text-shadow: 0 0 14px rgba(99, 245, 208, 0.5), 0 2px 0 #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#vote-count {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--bone);
}

.vote-cmds { display: flex; gap: 8px; min-height: 24px; align-items: center; overflow: hidden; }
.vote-cmds.ticker {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
}
.ticker-track { display: flex; flex: none; animation: ticker var(--ticker-time, 12s) linear infinite; }
.ticker-set { display: flex; flex: none; gap: 8px; align-items: center; padding-right: 32px; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.cmd {
  padding: 3px 10px 3px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 0 0 1px rgba(99, 245, 208, 0.35);
  font-family: "IBM Plex Mono", monospace;
  font-size: 15px;
  font-weight: 600;
  color: var(--bone);
  white-space: nowrap;
}

.hud-vote .cmd { padding: 5px 12px; }

.cmd b { color: var(--ghost); font-weight: 600; }
.cmd.more, .cmd.quiet { box-shadow: none; background: none; padding-left: 0; color: #8f83aa; font-family: Cinzel, serif; letter-spacing: 0.14em; text-transform: uppercase; font-size: 12px; }

.vote-clock { display: flex; flex-direction: column; gap: 8px; }

.vote-bar {
  height: 8px;
  border-radius: 4px;
  background: #0d0817;
  box-shadow: inset 0 0 0 1px #3b2c58;
  overflow: hidden;
}

.vote-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ff7b1c, #f5c04a);
  box-shadow: 0 0 10px rgba(255, 123, 28, 0.7);
  transition: width 0.25s linear;
}

#vote-left {
  text-align: right;
  font-family: "IBM Plex Mono", monospace;
  font-size: 28px;
  line-height: 1;
  color: var(--gold-hi);
  text-shadow: 0 0 14px rgba(245, 192, 74, 0.5);
}

/* ---------- board ---------- */
.board { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }

.links { position: absolute; left: 0; top: 0; overflow: visible; }

.link .glow, .link .core { fill: none; stroke-linecap: round; }
.link .glow { stroke-width: 10; opacity: 0; }
.link .core { stroke-width: 3; }
.link .knot { fill: #5a4a80; }
.link .cut { fill: none; stroke: var(--blood); stroke-width: 3; stroke-linecap: round; }

.link.wait .core { stroke: #54447a; stroke-width: 2.5; stroke-dasharray: 2 9; }

.link.lit .glow { stroke: var(--gold); opacity: 0.28; filter: blur(3px); }
.link.lit .core { stroke: var(--gold); }
.link.lit .knot { fill: var(--gold); filter: drop-shadow(0 0 5px var(--gold)); }
.link.live .core { stroke: var(--gold-hi); stroke-dasharray: 9 8; animation: flow 0.8s linear infinite; }

.link.sealed .core { stroke: #6f2033; stroke-width: 2; stroke-dasharray: 1 9; }
.link.sealed .knot { fill: #4a1626; }

.fork {
  position: absolute;
  width: 284px;
  height: 146px;
  transition: opacity 0.4s ease, filter 0.4s ease;
}

/* plaque */
.plaque {
  position: absolute;
  left: 37px;
  top: 0;
  width: 210px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 2;
  --cut: polygon(11px 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 11px 100%, 0 50%);
}

.plaque::before, .plaque::after {
  content: "";
  position: absolute;
  clip-path: var(--cut);
}
.plaque::before { inset: 0; background: linear-gradient(#f6d27a, #8a5f16); }
.plaque::after { inset: 2px; background: linear-gradient(#33244f, #1b1230); }

.pl-text, .pl-ico { position: relative; z-index: 1; }

.pl-text {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--bone);
  text-shadow: 0 1px 0 #000;
  white-space: nowrap;
}

.pl-ico { display: flex; }
.pl-ico:empty { display: none; }
.pl-ico .ico { width: 14px; height: 14px; color: #a99bcf; }

.fork.chosen .plaque::before { background: linear-gradient(#fff0b8, #d9a02c); }
.fork.chosen .plaque::after { background: linear-gradient(#5a3a10, #2e1c08); }
.fork.chosen .pl-text { color: var(--gold-hi); }
.fork.chosen .pl-ico .ico { color: var(--gold-hi); }

.fork.open .plaque::before { background: linear-gradient(#b9fff0, #17806c); }
.fork.open .plaque::after { background: linear-gradient(#153a3b, #0c2224); }
.fork.open .pl-text { color: #d9fff5; }

.fork.hot .plaque::before { background: linear-gradient(#e6fff9, var(--ghost)); }
.fork.hot .plaque { animation: plaqueGlow 1.5s ease-in-out infinite; }
.fork.finale .plaque::before { background: linear-gradient(#fff6d0, #f5c04a, #a26f1a); }
.fork.finale .pl-text { color: var(--gold-hi); letter-spacing: 0.18em; }
.fork.finale .orb { transform: scale(1.12); }
.fork-need {
  position: absolute;
  left: -40px;
  right: -40px;
  top: calc(100% + 6px);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-hi);
  text-shadow: 0 0 10px rgba(245, 192, 74, 0.45), 0 2px 0 #000;
  white-space: nowrap;
}

/* strand heading over a group of nodes */
.strand {
  position: absolute;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-hi);
  text-shadow: 0 0 12px rgba(245, 192, 74, 0.5), 0 2px 0 #000;
  white-space: nowrap;
}
.strand::before, .strand::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 192, 74, 0.55));
}
.strand::after { background: linear-gradient(90deg, rgba(245, 192, 74, 0.55), transparent); }

/* options */
.opt {
  position: absolute;
  top: 36px;
  width: 140px;
  text-align: center;
}

.orb {
  position: relative;
  width: 68px;
  height: 68px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 34% 28%, #52397e 0%, #241840 56%, #120b24 100%);
  box-shadow: inset 0 0 0 2px #6a5896, inset 0 -8px 14px rgba(0, 0, 0, 0.55), 0 5px 12px rgba(0, 0, 0, 0.6);
}

.orb::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, #8f6a26, #f6d883, #7b5416, #d9b45e, #8f6a26, #f6d883, #7b5416, #8f6a26);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
}

.orb::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1.5px dotted rgba(245, 192, 74, 0.35);
}

.orb .ico {
  position: relative;
  width: 40px;
  height: 40px;
  color: #d7c9fb;
  filter: drop-shadow(0 0 5px rgba(157, 123, 255, 0.55));
}

.numeral { position: relative; font-size: 26px; font-weight: 700; color: #d7c9fb; text-shadow: 0 0 8px rgba(157, 123, 255, 0.6); }

.opt-label {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-top: 9px;
  min-height: 30px;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: 0.05em;
  color: var(--bone);
  text-shadow: 0 1px 2px #000, 0 0 8px #000;
}

.or {
  position: absolute;
  left: 131px;
  top: 58px;
  width: 22px;
  height: 22px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #2a1d45, #150e26);
  box-shadow: inset 0 0 0 1.5px #7b5f28;
  display: grid;
  place-items: center;
}

.or span {
  transform: rotate(-45deg);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b9a76d;
}

/* available */
.fork.open .orb { box-shadow: inset 0 0 0 2px #2fbfa5, inset 0 -8px 14px rgba(0, 0, 0, 0.55), 0 0 22px rgba(99, 245, 208, 0.38), 0 5px 12px rgba(0, 0, 0, 0.6); }
.fork.open .orb::before { background: conic-gradient(from 200deg, #17806c, #b9fff0, #0f5c4d, #63f5d0, #17806c, #b9fff0, #0f5c4d, #17806c); }
.fork.open .orb::after { border-color: rgba(99, 245, 208, 0.45); }
.fork.open .orb .ico { color: #dffff7; filter: drop-shadow(0 0 6px rgba(99, 245, 208, 0.8)); }
.fork.open .numeral { color: #dffff7; }
.fork.hot .orb { animation: orbPulse 1.5s ease-in-out infinite; }

/* chosen */
.opt.won .orb {
  background: radial-gradient(circle at 34% 28%, #ffcf6a 0%, #b5661a 52%, #4a2308 100%);
  box-shadow: inset 0 0 0 2px #ffe9a8, inset 0 -8px 14px rgba(0, 0, 0, 0.35), 0 0 34px rgba(255, 150, 40, 0.65), 0 0 70px rgba(255, 123, 28, 0.28);
  animation: none;
}
.opt.won .orb::before { background: conic-gradient(from 200deg, #ffe9a8, #ffb238, #fff2c4, #d9822a, #ffe9a8, #ffb238, #fff2c4, #ffe9a8); }
.opt.won .orb::after { border-color: rgba(255, 233, 168, 0.7); }
.opt.won .orb .ico { color: #fff6da; filter: drop-shadow(0 0 8px rgba(255, 190, 60, 0.95)); }
.opt.won .numeral { color: #fff6da; }
.opt.won .opt-label { color: var(--gold-hi); }

.star {
  position: absolute;
  right: -8px;
  bottom: -6px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #2e1c08;
  box-shadow: 0 0 0 2px var(--gold), 0 0 10px rgba(245, 192, 74, 0.8);
}
.star .ico { width: 15px; height: 15px; color: var(--gold-hi); filter: none; }

/* sealed (lost) */
.opt.lost .orb {
  background: radial-gradient(circle at 34% 28%, #3a343f, #1a161d 70%);
  box-shadow: inset 0 0 0 2px #4a4250, 0 5px 10px rgba(0, 0, 0, 0.6);
}
.opt.lost .orb::before { background: conic-gradient(#4b4552, #2b2630, #4b4552, #2b2630, #4b4552); }
.opt.lost .orb::after { border-color: rgba(120, 100, 130, 0.3); }
.opt.lost .orb > .ico:not(.seal), .opt.lost .numeral { color: #5d5566; filter: grayscale(1); opacity: 0.6; }
.opt.lost .opt-label { color: #7d7387; text-decoration: line-through; text-decoration-color: rgba(200, 51, 77, 0.85); text-decoration-thickness: 1px; }

.orb > .seal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  color: var(--blood);
  filter: drop-shadow(0 0 6px rgba(200, 51, 77, 0.8)) drop-shadow(0 2px 0 #000);
}

/* locked / closed forks */
.fork.locked { opacity: 0.6; }
.fork.locked .orb { box-shadow: inset 0 0 0 2px #4b4068, 0 5px 10px rgba(0, 0, 0, 0.5); }
.fork.locked .orb::before { background: conic-gradient(#5a4a75, #3a2f52, #5a4a75, #3a2f52, #5a4a75); }
.fork.locked .orb::after { display: none; }
.fork.locked .orb .ico:not(.lockdot .ico) { color: #7d6fa3; filter: none; }
.fork.locked .plaque::before { background: #54447a; }
.fork.locked .pl-text { color: #a99bcf; }
.fork.locked .opt-label { color: #a397c2; }
.fork.locked .or { box-shadow: inset 0 0 0 1.5px #54447a; }

.lockdot {
  position: absolute;
  right: -7px;
  bottom: -5px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #1a1230;
  box-shadow: 0 0 0 2px #6a5896;
}
.lockdot .ico { width: 14px; height: 14px; color: #d7c9fb; filter: none; }

.fork.closed { opacity: 0.42; filter: grayscale(0.85); }
.fork.closed .plaque::before { background: #5a2434; }
.fork.closed .pl-text { text-decoration: line-through; text-decoration-color: rgba(200, 51, 77, 0.9); color: #8b7f9c; }
.fork.closed .pl-ico .ico { color: var(--blood); }
.fork.closed .orb::before { background: conic-gradient(#3f3846, #262029, #3f3846, #262029, #3f3846); }
.fork.closed .orb::after { display: none; }

/* votes */
.chip {
  position: absolute;
  top: -12px;
  right: -14px;
  z-index: 3;
  min-width: 26px;
  height: 26px;
  box-sizing: border-box;
  padding: 0 7px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: #0b2a27;
  box-shadow: 0 0 0 1.5px var(--ghost), 0 0 12px rgba(99, 245, 208, 0.55);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--ghost);
}

/* Beside the title plaque (it ends at 247px), so a long title is never covered. */
.fork > .node-chip { left: 253px; top: 0; right: auto; z-index: 3; }

.opt.lead .chip { background: #34210a; color: var(--gold-hi); box-shadow: 0 0 0 1.5px var(--gold), 0 0 12px rgba(245, 192, 74, 0.6); }

.opt-bar {
  height: 6px;
  margin: 5px 26px 0;
  border-radius: 3px;
  background: #0d0817;
  box-shadow: inset 0 0 0 1px #3b2c58;
  overflow: hidden;
}
.opt-bar i { display: block; height: 100%; background: linear-gradient(90deg, #1c9e86, var(--ghost)); }
.opt.lead .opt-bar i { background: linear-gradient(90deg, #d9822a, var(--gold-hi)); box-shadow: 0 0 8px rgba(245, 192, 74, 0.7); }

/* title ribbon */
.tree-title {
  position: absolute;
  left: 50%;
  top: -15px;
  height: 30px;
  min-width: 300px;
  padding: 0 44px;
  box-sizing: border-box;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  --cut: polygon(16px 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 16px 100%, 0 50%);
}
.tree-title::before, .tree-title::after { content: ""; position: absolute; clip-path: var(--cut); }
.tree-title::before { inset: 0; background: linear-gradient(#fff0b8, #a26f1a); }
.tree-title::after { inset: 2px; background: linear-gradient(#3a2560, #1a1030); }
.tree-title span {
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold-hi);
  text-shadow: 0 0 12px rgba(245, 192, 74, 0.6), 0 2px 0 #000;
  white-space: nowrap;
}
.tree.no-title .tree-title { display: none; }

/* legend */
.legend {
  position: absolute;
  left: 46px;
  right: 46px;
  bottom: 22px;
  display: flex;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-hi);
  text-shadow: 0 0 12px rgba(245, 192, 74, 0.45), 0 2px 0 #000;
}
.tree-help { white-space: nowrap; }
.tree.no-legend .legend { display: none; }
.legend .k { display: flex; align-items: center; gap: 9px; }
.legend .k::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-sizing: border-box;
}
.legend .open::before { background: #153a3b; box-shadow: 0 0 0 2px var(--ghost), 0 0 8px rgba(99, 245, 208, 0.6); }
.legend .chosen::before { background: #b5661a; box-shadow: 0 0 0 2px var(--gold-hi), 0 0 8px rgba(255, 150, 40, 0.7); }
.legend .sealed::before { background: #241f28; box-shadow: 0 0 0 2px var(--blood); }
.legend .locked::before { background: #1a1230; box-shadow: 0 0 0 2px #54447a; }

/* skill point toast */
#tree-burst {
  position: absolute;
  inset: 0;
  margin: auto;
  width: max-content;
  max-width: 80%;
  height: max-content;
  padding: 26px 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-radius: 14px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--gold-hi);
  text-shadow: 0 0 20px rgba(255, 150, 40, 0.95), 0 3px 0 #000;
  background: rgba(16, 9, 30, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1.5px rgba(245, 192, 74, 0.7), 0 0 40px rgba(255, 150, 40, 0.3);
  opacity: 0;
  pointer-events: none;
  z-index: 6;
}
#tree-burst[data-plat="twitch"] { --plat: #9146ff; }
#tree-burst[data-plat="youtube"] { --plat: #ff0033; }
#tree-burst[data-plat="kick"] { --plat: #53fc18; }
#tree-burst[data-plat]:not([data-plat=""])::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--plat);
  box-shadow: 0 0 14px var(--plat);
}
#tree-burst.burst { animation: toast 2.4s ease forwards; }

@keyframes flow { to { stroke-dashoffset: -17; } }
@keyframes gemPulse {
  0%, 100% { box-shadow: inset 0 0 0 3px #d9a93d, inset 0 0 0 5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(140, 90, 255, 0.5); }
  50% { box-shadow: inset 0 0 0 3px #ffe9a8, inset 0 0 0 5px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 190, 60, 0.85); }
}
@keyframes orbPulse {
  0%, 100% { box-shadow: inset 0 0 0 2px #2fbfa5, inset 0 -8px 14px rgba(0, 0, 0, 0.55), 0 0 18px rgba(99, 245, 208, 0.3), 0 5px 12px rgba(0, 0, 0, 0.6); }
  50% { box-shadow: inset 0 0 0 2px #7dffe4, inset 0 -8px 14px rgba(0, 0, 0, 0.55), 0 0 34px rgba(99, 245, 208, 0.65), 0 5px 12px rgba(0, 0, 0, 0.6); }
}
@keyframes plaqueGlow {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(99, 245, 208, 0.35)); }
  50% { filter: drop-shadow(0 0 9px rgba(99, 245, 208, 0.9)); }
}
@keyframes toast {
  0% { opacity: 0; transform: translateY(10px) scale(0.94); }
  12% { opacity: 1; transform: translateY(0) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-14px); }
}
