:root {
  --bg: #0c0c0f;
  --card: #15151a;
  --tile: #24242c;
  --ink: #f4f2f6;
  --soft: rgba(244, 242, 246, 0.6);
  --faint: rgba(244, 242, 246, 0.22);
  --line: rgba(244, 242, 246, 0.1);
  --accent: #ff7d6b;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(120% 80% at 50% 0%, #16161c 0%, var(--bg) 60%);
  background-color: 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 12px;
}

.ft { position: relative; width: min(324px, 100%); padding: 14px; border-radius: 26px; background: linear-gradient(180deg, #1b1b21, var(--card)); box-shadow: 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 30px 50px -30px rgba(0, 0, 0, 0.9); }

.ft__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 2px; }
.ft__name { min-width: 0; display: grid; }
.ft__name b { font-size: 16px; line-height: 21px; font-weight: 740; font-stretch: 108%; letter-spacing: -0.012em; }
.ft__name span { font-size: 11.500px; line-height: 15px; font-weight: 540; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft__steps { flex: none; display: block; height: 26px; padding: 0 11px; border-radius: 13px; overflow: hidden; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 12px; line-height: 26px; font-weight: 700; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.ft__steps span { display: block; white-space: nowrap; }

.ft__tree { position: relative; height: 190px; margin-top: 10px; }
.ft__tree svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
.ft__line, .ft__hot { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; }
.ft__line { stroke: var(--faint); stroke-width: 1.500; }
/* the same branches again, in colour: drawn only along the way from the person picked to you */
.ft__hot { stroke: var(--accent); stroke-width: 2.200; stroke-dashoffset: 1; }

.ft__p { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 0; border-radius: 50%; background: var(--tile); color: var(--soft); font: inherit; font-size: 12px; font-weight: 720; cursor: pointer; outline: none; box-shadow: inset 0 0 0 1px rgba(244, 242, 246, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 8px -4px rgba(0, 0, 0, 0.8); transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ft__p span { display: block; line-height: 30px; }
.ft__p::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; }
.ft__p.is-you { color: var(--ink); box-shadow: inset 0 0 0 1.500px var(--ink), 0 4px 8px -4px rgba(0, 0, 0, 0.8); }
.ft.has-pick .ft__p:not(.is-way):not(.is-pick) { opacity: 0.42; }
.ft__p.is-way { color: var(--ink); box-shadow: inset 0 0 0 1.500px var(--accent), 0 4px 8px -4px rgba(0, 0, 0, 0.8); }
.ft__p.is-pick { background: var(--accent); color: #2a0d08; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), 0 8px 14px -6px color-mix(in srgb, var(--accent) 70%, #000000); }
.ft__p:focus-visible, .ft__back:focus-visible { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
@media (hover: hover) { .ft__p:not(.is-pick):hover { background: #30303a; color: var(--ink); opacity: 1; } }

.ft__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 10px 6px 0 2px; border-top: 1px solid var(--line); }
.ft__who { min-width: 0; display: grid; }
.ft__roll { display: block; height: 19px; overflow: hidden; font-size: 14.500px; line-height: 19px; font-weight: 720; white-space: nowrap; }
.ft__roll span { display: block; }
.ft__roll--sub { height: 15px; font-size: 11.500px; line-height: 15px; font-weight: 540; color: var(--soft); }
.ft__back { flex: none; height: 34px; padding: 0 13px; border: 0; border-radius: 11px; background: rgba(244, 242, 246, 0.09); color: var(--ink); font: inherit; font-size: 12.500px; font-weight: 680; cursor: pointer; outline: none; box-shadow: inset 0 0 0 1px var(--line); transition: opacity 0.3s ease, background-color 0.2s ease; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ft__back:disabled { opacity: 0.35; cursor: default; }
@media (hover: hover) { .ft__back:not(:disabled):hover { background: rgba(244, 242, 246, 0.16); } }

.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; transform-origin: 20% 15%; pointer-events: none; opacity: 0; fill: #f4f2f6; stroke: #000000; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); z-index: 6; }
