* {
  box-sizing: border-box;
}
:root {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #233c35;
  background: #f7f6f2;
  font-synthesis: none;
}
body {
  margin: 0;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
}
button:focus-visible,
a:focus-visible,
#viewport:focus-visible {
  outline: 3px solid #b39358;
  outline-offset: 3px;
}
header {
  height: 100px;
  border-bottom: 1px solid #dedfd7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  background: #faf9f6;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
  font-weight: 650;
  font-size: 17px;
}
.mark {
  font-size: 44px;
  color: #3b6551;
}
.brand small {
  display: block;
  font-size: 9px;
  letter-spacing: 3px;
  color: #899188;
  margin-top: 7px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 12px;
  color: #7c877d;
}
button {
  background: #fffefa;
  border: 1px solid #d7dcd2;
  border-radius: 8px;
  padding: 10px 16px;
}
button:hover {
  background: #edf1e9;
}
main {
  position: relative;
  height: calc(100dvh - 147px);
  min-height: 500px;
  overflow: hidden;
  background-image: radial-gradient(#c8cfc3 0.75px, transparent 0.75px);
  background-size: 22px 22px;
}
.intro {
  position: absolute;
  top: 42px;
  left: 48px;
  pointer-events: none;
  z-index: 2;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 2.1px;
  font-weight: 650;
  color: #78816e;
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 39px;
  line-height: 1.17;
  letter-spacing: -1px;
  margin: 16px 0;
}
.intro p {
  font-size: 12px;
  line-height: 1.8;
  color: #818779;
}
#viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
#viewport.dragging {
  cursor: grabbing;
}
#world {
  position: absolute;
  transform-origin: 0 0;
}
#lines {
  position: absolute;
  overflow: visible;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
#lines path {
  fill: none;
  stroke: #aebcac;
  stroke-width: 1.5;
}
#lines path.sibling {
  stroke-dasharray: 5 5;
}
#cards {
  position: absolute;
}
.card {
  position: absolute;
  width: 258px;
  min-height: 190px;
  background: #fffefa;
  border: 1px solid #d8ded2;
  border-radius: 12px;
  box-shadow: 0 7px 24px #273c3010;
  padding: 20px;
  cursor: inherit;
  user-select: none;
}
.card.root {
  border: 1.5px solid #486c54;
  box-shadow: 0 8px 30px #273c301a;
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}
.avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eaf0e5;
  color: #59734e;
  font-size: 12px;
}
.card[data-sex="F"] .avatar {
  background: #f3eae0;
  color: #9c7958;
}
.badge {
  font-size: 8px;
  letter-spacing: 1.4px;
  color: #5f7b55;
}
.card h2 {
  font-size: 16px;
  line-height: 1.35;
  font-weight: 600;
  margin: 0 0 7px;
  overflow-wrap: anywhere;
}
.dates {
  font-size: 11px;
  color: #92968a;
  min-height: 16px;
  margin-bottom: 16px;
}
.branches {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 12px;
  border-top: 1px solid #eceee6;
}
.branches button {
  padding: 6px 8px;
  border: 0;
  background: #f0f3ec;
  font-size: 10px;
  border-radius: 5px;
}
.branches button[aria-expanded="true"] {
  background: #3e604b;
  color: #fff;
}
.empty {
  font-size: 11px;
  color: #8b9385;
}
.legend {
  position: absolute;
  bottom: 28px;
  left: 48px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 10px;
  color: #7b8576;
  pointer-events: none;
}
.legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #57744d;
}
.controls {
  position: absolute;
  right: 35px;
  bottom: 25px;
  display: flex;
  align-items: center;
  background: #fffefa;
  border: 1px solid #dce0d6;
  border-radius: 10px;
  box-shadow: 0 3px 12px #253b3010;
}
.controls button {
  border: 0;
  background: none;
  font-size: 21px;
  padding: 9px 14px;
}
.controls span {
  font-size: 10px;
  min-width: 38px;
  text-align: center;
}
.hint {
  position: absolute;
  bottom: 76px;
  right: 35px;
  color: #89917f;
  font-size: 10px;
  pointer-events: none;
}
footer {
  height: 47px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 48px;
  font-size: 10px;
  color: #929788;
  border-top: 1px solid #e0e3d9;
}
#status {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  color: #637554;
  max-width: 80%;
}
#status:empty {
  display: none;
}
@media (max-width: 700px) {
  header {
    height: 78px;
    padding: 0 20px;
  }
  .brand {
    font-size: 14px;
  }
  .mark {
    font-size: 34px;
  }
  .header-right {
    gap: 8px;
  }
  #total {
    display: none;
  }
  #reset {
    font-size: 11px;
    padding: 9px;
  }
  .intro {
    top: 26px;
    left: 23px;
  }
  h1 {
    font-size: 29px;
    margin: 12px 0;
  }
  .intro p {
    font-size: 11px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 1.5px;
  }
  main {
    height: calc(100dvh - 117px);
    min-height: 550px;
  }
  .legend {
    bottom: 76px;
    left: 23px;
    font-size: 9px;
  }
  .controls {
    right: 20px;
    bottom: 20px;
  }
  .hint {
    display: none;
  }
  footer {
    height: 39px;
    padding: 0 20px;
    font-size: 9px;
  }
  footer span:last-child {
    display: none;
  }
}
