@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Libre+Baskerville:wght@400;700&display=swap");

body {
  padding: 0;
  margin: 0;
}

@font-face {
  font-family: "Ringbearer";
  src: url("./assets/ringbearer.TTF") format("truetype");
}

html, body, #map {
  height: 100%;
  font: 10pt "Libre Baskerville", Georgia, serif;
}

body,
button,
input,
label,
table,
td,
th,
p {
  font-family: "Libre Baskerville", Georgia, serif;
}

h1,
h2,
h3,
.sidebar-header,
.polygon-label {
  font-family: "Cormorant Garamond", Georgia, serif;
  letter-spacing: 0.02em;
}

.sidebar-tabs a,
.atlas-map-nav__link {
  font-family: "Ringbearer", Georgia, serif;
}

.map-title,
.brand-mark,
.ringbearer-accent {
  font-family: "Ringbearer", "Cormorant Garamond", Georgia, serif;
}

.lorem {
  font-style: italic;
  color: #AAA;
}

#settlementsSection, #pathsSection, #roadsSection, #geographySection, #battlesSection, #itemsSection, #campsSection, #regionsSection {
  display: flex;
  flex-direction: column; /* Stack the labels vertically */
  gap: 8px; /* Optional: Add spacing between items */
  padding-top: 16px; /* Optional: Add padding for indentation */
}

#regionsSection h1,
#campsSection h1,
#itemsSection h1, 
#settlementsSection h1, 
#pathsSection h1, 
#geographySection h1,
#battlesSection h1 {
  font-size: 18px; /* Adjust the size as needed */
  font-weight: 600; /* Bold text */
  margin: 2px 0; /* Adjust top and bottom spacing */
  padding-top: 2px; /* Optional: Add spacing above the header */
  color: #444; /* Set a consistent text color */
  text-align: left; /* Align text to the left */
}

#settlementsSection label, #pathsSection label, #roadsSection label, #geographySection label, #battlesSection label, #itemsSection label #pathsSection label, #itemsSection label, #campsSection label, #regionsSection label {
  display: flex;
  align-items: center; /* Align the checkbox and label text */
  cursor: pointer; /* Change the cursor to indicate clickability */
  font-size: 15px;
  line-height: 1.45;
}

#regionsSection input[type="checkbox"],
/* #campsSection input[type="checkbox"], */
#itemsSection input[type="checkbox"],
/* #pathsSection input[type="checkbox"], */
#roadsSection input[type="checkbox"],
#itemsSection input[type="checkbox"],
#battlesSection input[type="checkbox"],
#settlementsSection input[type="checkbox"],
#geographySection input[type="checkbox"] {
  margin-right: 8px; /* Add spacing between the checkbox and label text */
}

.sidebar-tabs .material-icons {
  position: relative;
  top: 10px; /* Shifts the icons down */
}
.sidebar-tabs .material-symbols-outlined {
  position: relative;
  top: 10px; /* Shifts the icons down */
}

.polygon-label {
  /*background-color: rgba(255, 255, 255, 1); /* Fully opaque for visibility */
  border: 2px solid black;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 18px;
  color: black;
  font-weight: 600;
  text-align: center;
  pointer-events: none; /* Prevent the label from being interactive */
}

#campsSection, #pathsSection, #roadsSection {
  padding-top: 0; /* Remove extra padding from the top */
}

#campsSection h3,
#pathsSection h3,
#roadsSection h3 {
  margin-top: 0; /* Remove any extra margin on the h3 headers */
}

#campsSection label, #pathsSection label, #roadsSection label {
  margin-top: 0; /* Remove top margin from the labels */
}

.campsite-popup {
  min-width: 260px;
  max-width: 320px;
  color: #38291a;
}

.campsite-popup-shell .leaflet-popup-content-wrapper {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.campsite-popup-shell .leaflet-popup-content {
  margin: 0;
}

.campsite-popup-shell .leaflet-popup-tip {
  background: #fefaf0;
  box-shadow: none;
}

.lore-popup-shell .leaflet-popup-content-wrapper {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.lore-popup-shell .leaflet-popup-content {
  margin: 0;
}

.lore-popup-shell .leaflet-popup-tip {
  background: #fefaf0;
  box-shadow: none;
}

.campsite-popup__frame {
  padding: 16px;
  border: 1px solid #8f7650;
  border-radius: 10px;
  background: #fefaf0;
  box-shadow: inset 0 0 0 1px rgba(255, 248, 224, 0.45);
}

.campsite-popup__kicker {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7b5e32;
}

.campsite-popup__title {
  margin: 0;
  font-size: 28px;
  line-height: 1;
  color: #2d2013;
}

.campsite-popup__subtitle {
  margin: 6px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(111, 83, 40, 0.35);
  font-size: 15px;
  font-style: italic;
  color: #5e4727;
}

.campsite-popup__details {
  display: grid;
  gap: 8px;
}

.campsite-popup__row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(111, 83, 40, 0.2);
}

.campsite-popup__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #755a32;
}

.campsite-popup__value {
  font-size: 14px;
  text-align: right;
  color: #2c2218;
}

.campsite-popup__notes {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(111, 83, 40, 0.35);
}

.campsite-popup__notes-label {
  margin: 0 0 6px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 18px;
  color: #41301c;
}

.campsite-popup__notes-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #38291a;
}

.lore-popup {
  min-width: 260px;
  max-width: 440px;
  color: #38291a;
}

.lore-popup__frame {
  padding: 16px;
  border: 1px solid #8f7650;
  border-radius: 10px;
  background: #fefaf0;
  box-shadow: inset 0 0 0 1px rgba(255, 248, 224, 0.45);
}

.lore-popup__kicker {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7b5e32;
}

.lore-popup__title {
  margin: 0;
  font-size: 28px;
  line-height: 1;
  color: #2d2013;
}

.lore-popup__details {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.lore-popup__sections {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.lore-popup__section {
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(111, 83, 40, 0.2);
}

.lore-popup__section-title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px;
  line-height: 1.05;
  color: #41301c;
}

.lore-popup__section-text {
  margin: 1px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: #38291a;
}

.lore-popup__row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(111, 83, 40, 0.2);
}

.lore-popup__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #755a32;
}

.lore-popup__value {
  font-size: 14px;
  text-align: right;
  color: #2c2218;
}

.lore-popup__notes {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(111, 83, 40, 0.35);
}

.lore-popup__notes-label {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 18px;
  line-height: 1.05;
  color: #41301c;
}

.lore-popup__notes-text {
  margin: 1px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: #38291a;
}

.lore-popup__link {
  display: table;
  margin-top: 14px;
  margin-left: auto;
  margin-right: auto;
  padding: 8px 12px;
  border: 1px solid #8f7650;
  border-radius: 999px;
  background: rgba(126, 102, 59, 0.12);
  color: #4d371a;
  text-decoration: none;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 18px;
}

.lore-popup__link:hover,
.lore-popup__link:focus-visible {
  background: rgba(126, 102, 59, 0.2);
}

.atlas-map-nav {
  position: absolute;
  top: 18px;
  right: 18px;
  left: auto;
  transform: none;
  z-index: 900;
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  max-width: calc(100vw - 24px);
  pointer-events: auto;
}

.atlas-map-nav__menu {
  position: relative;
}

.atlas-map-nav__toggle {
  list-style: none;
  cursor: pointer;
}

.atlas-map-nav__toggle::-webkit-details-marker {
  display: none;
}

.atlas-map-nav__link {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  padding: 10px 14px;
  border: 1px solid rgba(218, 184, 112, 0.55);
  border-radius: 999px;
  background: rgba(31, 22, 13, 0.88);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  color: #f5e6c8;
  text-decoration: none;
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1;
}

.atlas-map-nav__dropdown {
  display: grid;
  gap: 8px;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  transform: none;
  width: max-content;
  min-width: max-content;
  max-width: calc(100vw - 24px);
  z-index: 901;
}

.atlas-map-nav__toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(218, 184, 112, 0.55);
  border-radius: 999px;
  background: rgba(31, 22, 13, 0.88);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  color: #f5e6c8;
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1;
}

.atlas-map-nav__toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.atlas-map-nav__link > span,
.atlas-map-nav__toggle-label > span {
  font-family: inherit;
  flex: initial;
}

.atlas-map-nav__link .material-icons,
.atlas-map-nav__toggle .material-icons {
  font-size: 20px;
}

.atlas-map-nav__link--home {
  background: rgba(31, 22, 13, 0.88);
}

.atlas-map-nav__link--current {
  background: rgba(111, 72, 32, 0.92);
}

.atlas-map-nav__menu[open] .atlas-map-nav__chevron {
  transform: rotate(180deg);
}

.atlas-map-nav__link:hover,
.atlas-map-nav__link:focus-visible,
.atlas-map-nav__toggle:hover,
.atlas-map-nav__toggle:focus-visible {
  transform: none;
  background: rgba(47, 33, 18, 0.95);
}

.stories-section {
  padding-top: 4px;
}

.story-launch-card {
  padding: 16px;
  border: 1px solid rgba(143, 118, 80, 0.85);
  border-radius: 14px;
  background: linear-gradient(rgba(255, 250, 240, 0.98), rgba(242, 232, 210, 0.98));
  box-shadow: inset 0 0 0 1px rgba(255, 248, 224, 0.45);
}

.story-launch-card__eyebrow {
  margin: 0 0 6px;
  color: #7b5e32;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.story-launch-card__title {
  margin: 0;
  font-size: 28px;
  line-height: 1;
  color: #2d2013;
}

.story-launch-card__copy {
  margin: 10px 0 0;
  color: #4f3b26;
  font-size: 14px;
  line-height: 1.6;
}

.story-launch-card__meta {
  margin-top: 12px;
  color: #755a32;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-launch-card__button {
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(111, 83, 40, 0.65);
  border-radius: 999px;
  background: rgba(47, 29, 18, 0.92);
  color: #f3e1ba;
  cursor: pointer;
  font-family: "Ringbearer", Georgia, serif;
  font-size: 14px;
}

.story-launch-card__button:hover,
.story-launch-card__button:focus-visible {
  background: rgba(70, 45, 22, 0.96);
}

.leaflet-story-pane {
  z-index: 575;
  pointer-events: none;
}

.leaflet-story-pane canvas,
.leaflet-story-pane svg {
  pointer-events: none;
}

.story-panel {
  position: absolute;
  top: 84px;
  right: 18px;
  bottom: 104px;
  left: 18px;
  z-index: 850;
  pointer-events: none;
}

.story-panel--hidden {
  display: none;
}

.story-panel[hidden] {
  display: none !important;
}

.story-panel__inner {
  width: min(1240px, calc(100vw - 36px));
  min-height: min(72vh, 820px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 22px;
  padding: 22px;
  border: 1px solid rgba(143, 118, 80, 0.85);
  border-radius: 18px;
  background: rgba(254, 250, 240, 0.97);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 248, 224, 0.45);
  pointer-events: auto;
}

.story-panel__kicker {
  margin: 0 0 6px;
  color: #7b5e32;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.story-panel__title {
  margin: 0;
  color: #2d2013;
  font-size: 34px;
  line-height: 0.98;
}

.story-panel__meta {
  margin: 8px 0 0;
  color: #5e4727;
  font-size: 14px;
  font-style: italic;
}

.story-panel__narrative {
  margin: 14px 0 0;
  color: #38291a;
  font-size: 15px;
  line-height: 1.7;
}

.story-panel__details {
  display: grid;
  gap: 9px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(111, 83, 40, 0.35);
}

.story-panel__detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(111, 83, 40, 0.2);
}

.story-panel__detail-label {
  color: #755a32;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-panel__detail-value {
  color: #2c2218;
  font-size: 14px;
  line-height: 1.45;
  text-align: right;
}

.story-panel__detail-value--notes {
  max-width: 28ch;
}

.story-panel__counter {
  margin: 14px 0 0;
  color: #755a32;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-panel__media {
  display: grid;
  align-items: stretch;
}

.story-panel__image,
.story-panel__placeholder {
  grid-area: 1 / 1;
  width: 100%;
  min-height: 100%;
  border: 1px solid rgba(143, 118, 80, 0.75);
  border-radius: 14px;
  background: #efe3c5;
}

.story-panel__image {
  display: block;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.story-panel__placeholder {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  color: #4f3b26;
  background:
    linear-gradient(rgba(254, 250, 240, 0.94), rgba(239, 227, 197, 0.98)),
    url("./assets/book.png") center 24px / 48px 48px no-repeat;
}

.story-panel__image--hidden,
.story-panel__placeholder--hidden {
  display: none;
}

.story-panel__placeholder-title {
  margin: 40px 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 28px;
  line-height: 1;
  color: #2d2013;
}

.story-panel__placeholder-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.story-controls {
  position: absolute;
  bottom: 22px;
  left: 50%;
  z-index: 860;
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(218, 184, 112, 0.55);
  border-radius: 999px;
  background: rgba(31, 22, 13, 0.92);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
  transform: translateX(-50%);
}

.story-controls--hidden {
  display: none;
}

.story-controls[hidden] {
  display: none !important;
}

.story-controls__button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  border: 1px solid rgba(218, 184, 112, 0.45);
  border-radius: 999px;
  background: rgba(63, 43, 20, 0.96);
  color: #f5e6c8;
  cursor: pointer;
  font-family: "Ringbearer", Georgia, serif;
  font-size: 13px;
  line-height: 1;
}

.story-controls__button--primary {
  background: rgba(111, 72, 32, 0.98);
}

.story-controls__button:hover,
.story-controls__button:focus-visible {
  background: rgba(85, 56, 26, 0.98);
}

.story-controls__button .material-icons {
  font-size: 18px;
}

@media (max-width: 860px) {
  .story-panel {
    top: 72px;
    right: 12px;
    bottom: 86px;
    left: 12px;
  }

  .story-panel__inner {
    width: auto;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }

  .story-panel__title {
    font-size: 28px;
  }

  .story-panel__detail-row {
    flex-direction: column;
    gap: 4px;
  }

  .story-panel__detail-value {
    text-align: left;
  }

  .story-panel__detail-value--notes {
    max-width: none;
  }

  .story-panel__image,
  .story-panel__placeholder {
    min-height: 220px;
  }

  .story-controls {
    right: 12px;
    bottom: 14px;
    left: 12px;
    justify-content: center;
    flex-wrap: wrap;
    transform: none;
  }
}

@media (max-width: 720px) {
  .atlas-map-nav {
    top: 12px;
    right: 12px;
    left: auto;
    bottom: auto;
    transform: none;
    width: auto;
  }

  .atlas-map-nav__link,
  .atlas-map-nav__toggle {
    justify-content: flex-start;
    font-size: 18px;
  }
}

.family-tree-page,
.family-tree-page * {
  box-sizing: border-box;
}

body.family-tree-page {
  margin: 0;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  background: #17110b;
  color: #f5f0e6;
}

.family-tree-page,
.family-tree-page button,
.family-tree-page p,
.family-tree-page strong {
  font-family: Georgia, "Times New Roman", serif;
}

.family-tree-page #tree {
  position: relative;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(circle at top, rgba(183, 137, 68, 0.18), transparent 45%),
    linear-gradient(135deg, #1d150d, #0f0a06 70%);
  overflow: hidden;
}

.family-tree-page svg {
  display: block;
  cursor: grab;
}

.family-tree-page svg:active {
  cursor: grabbing;
}

.family-tree-page .atlas-map-nav {
  position: absolute;
  top: 18px;
  right: 18px;
  left: auto;
  bottom: auto;
  transform: none;
  z-index: 10;
  display: flex;
  flex-direction: row;
  gap: 10px;
  width: auto;
  max-width: calc(100vw - 24px);
  justify-content: center;
  flex-wrap: wrap;
  align-items: flex-start;
  font-family: Arial, sans-serif;
}

.family-tree-page .atlas-map-nav__menu {
  position: relative;
}

.family-tree-page .atlas-map-nav__menu summary {
  list-style: none;
  cursor: pointer;
}

.family-tree-page .atlas-map-nav__menu summary::-webkit-details-marker {
  display: none;
}

.family-tree-page .atlas-map-nav__link,
.family-tree-page .atlas-map-nav__toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(218, 184, 112, 0.55);
  border-radius: 999px;
  background: rgba(31, 22, 13, 0.88);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  color: #f5e6c8;
  text-decoration: none;
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1;
  backdrop-filter: none;
}

.family-tree-page .atlas-map-nav__toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.family-tree-page .atlas-map-nav__dropdown {
  display: grid;
  gap: 8px;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  transform: none;
  width: max-content;
  min-width: max-content;
  max-width: calc(100vw - 24px);
  z-index: 11;
}

.family-tree-page .atlas-map-nav__link > span,
.family-tree-page .atlas-map-nav__toggle-label > span {
  font-family: inherit;
  flex: initial;
}

.family-tree-page .atlas-map-nav__link .material-icons,
.family-tree-page .atlas-map-nav__toggle .material-icons {
  font-size: 20px;
}

.family-tree-page .atlas-map-nav__link--home,
.family-tree-page .atlas-map-nav__link--current {
  background: rgba(31, 22, 13, 0.88);
}

.family-tree-page .atlas-map-nav__link--current {
  background: rgba(111, 72, 32, 0.92);
}

.family-tree-page .atlas-map-nav__menu[open] .atlas-map-nav__chevron {
  transform: rotate(180deg);
}

.family-tree-page .atlas-map-nav__link:hover,
.family-tree-page .atlas-map-nav__link:focus-visible,
.family-tree-page .atlas-map-nav__toggle:hover,
.family-tree-page .atlas-map-nav__toggle:focus-visible {
  transform: none;
  background: rgba(47, 33, 18, 0.95);
}

.family-tree-page #reset-view,
.family-tree-page .back-button {
  padding: 10px 16px;
  border: 1px solid rgba(218, 184, 112, 0.65);
  border-radius: 999px;
  background: rgba(31, 22, 13, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  color: #f5e6c8;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.family-tree-page .back-button {
  font-size: 15px;
  margin-bottom: 34px;
  background: rgba(31, 22, 13, 0.8);
}

.family-tree-page .hint {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 10;
  padding: 8px 14px;
  border: 1px solid rgba(218, 184, 112, 0.35);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #e8d3a6;
  font-family: Arial, sans-serif;
  font-size: 13px;
  pointer-events: none;
}

.family-tree-page .node {
  cursor: pointer;
}

.family-tree-page .node-card {
  fill: rgba(245, 240, 230, 0.94);
  stroke: #b78944;
  stroke-width: 2;
  rx: 16;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.38));
}

.family-tree-page .portrait-ring {
  fill: #efe1c4;
  stroke: #8c5f2a;
  stroke-width: 2;
}

.family-tree-page .node-name {
  fill: #2f2a1f;
  font-size: 16px;
  font-weight: bold;
  text-anchor: middle;
  dominant-baseline: middle;
}

.family-tree-page .node-title {
  fill: #66513a;
  font-size: 10px;
  text-anchor: middle;
  dominant-baseline: middle;
}

.family-tree-page .parent-link {
  fill: none;
  stroke: rgba(211, 176, 105, 0.85);
  stroke-width: 2.5;
}

.family-tree-page .spouse-line {
  stroke: rgba(224, 202, 150, 0.95);
  stroke-width: 2.5;
}

.family-tree-page .descent-line {
  stroke: rgba(211, 176, 105, 0.9);
  stroke-width: 2.5;
}

.family-tree-page .couple-node {
  display: none;
}

.family-tree-page .character-sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  background:
    radial-gradient(circle at top left, rgba(183, 137, 68, 0.22), transparent 35%),
    linear-gradient(135deg, #21170e, #090604 75%);
  color: #f5f0e6;
  overflow-y: auto;
}

.family-tree-page .character-sheet.hidden {
  display: none;
}

.family-tree-page .character-sheet__inner {
  width: min(1000px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 60px;
}

.family-tree-page .character-header {
  display: flex;
  gap: 30px;
  align-items: center;
  padding: 30px;
  border: 1px solid rgba(218, 184, 112, 0.45);
  border-radius: 26px;
  background: rgba(255, 244, 222, 0.08);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.family-tree-page .character-header img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid #b78944;
  background: #efe1c4;
}

.family-tree-page .character-header h1 {
  margin: 0 0 8px;
  color: #f7dfaa;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.95;
}

.family-tree-page .character-header h2 {
  margin: 0;
  color: #d7b36c;
  font-weight: normal;
  font-size: clamp(18px, 2.5vw, 28px);
}

.family-tree-page .character-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 24px 0;
}

.family-tree-page .meta-card {
  padding: 18px;
  border: 1px solid rgba(218, 184, 112, 0.35);
  border-radius: 18px;
  background: rgba(255, 244, 222, 0.07);
  color: #f0dfbd;
}

.family-tree-page .meta-card strong {
  display: block;
  margin-bottom: 8px;
  color: #d7b36c;
  font-family: Arial, sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.family-tree-page .character-section {
  padding: 26px 30px;
  border: 1px solid rgba(218, 184, 112, 0.3);
  border-radius: 22px;
  background: rgba(255, 244, 222, 0.07);
  color: #f5e9cf;
  font-size: 20px;
  line-height: 1.65;
}

.family-tree-page .tree-error-box {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 999;
  max-width: calc(100vw - 40px);
  padding: 16px;
  border: 1px solid #d7b36c;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.78);
  color: #f5e6c8;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .family-tree-page .atlas-map-nav {
    top: 12px;
    right: 12px;
    bottom: auto;
    left: auto;
    transform: none;
    width: auto;
  }

  .family-tree-page .character-header {
    flex-direction: column;
    text-align: center;
  }

  .family-tree-page .character-meta {
    grid-template-columns: 1fr;
  }
}
