.beast-sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

.beast-image-container {
  grid-column: 1;
  grid-row: 1;
}

.beast-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border: 3px solid #8b7355;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #e8dcc8 0%, #d4c4a8 100%);
}

.beast-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: #8b7355;
  opacity: 0.5;
  user-select: none;
}

.beast-info-container {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
}

.beast-name {
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
  font-size: 1.8rem;
  color: #3a1e0e;
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #8b7355;
  letter-spacing: 0.05em;
}

.beast-trivia {
  font-size: 1rem;
  line-height: 1.7;
  color: #4a3827;
  white-space: pre-line;
  text-align: justify;
  hyphens: auto;
}

.beast-stats {
  grid-column: 1 / -1;
  grid-row: 2;
  background: rgba(139, 115, 85, 0.1);
  border: 2px solid #8b7355;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 2rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  position: relative;
  cursor: help;
  padding: 0 1rem;
}

.stat-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  position: relative;
  cursor: help;
  padding: 0 0;
  border-right: 2px solid #8b7355;
  height: 3em;
  width: 3px;
}

.stat-symbol {
  font-size: 2rem;
  line-height: 1;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: bold;
  color: #3a1e0e;
}

.beast-traits {
  grid-column: 1 / -1;
  grid-row: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.trait-box {
  background: #1e3a5f;
  border: 3px solid #d4af37;
  box-shadow: 0 0 0 2px #1e3a5f;
  padding: 0.5rem 1rem;
  color: #f9f4e8;
  font-weight: bold;
  font-size: 0.95rem;
}

.beast-properties {
  grid-column: 1 / -1;
  grid-row: 4;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.property-box {
  background: linear-gradient(to bottom, #faf5e8 0%, #f3ead8 100%);
  border: 2px solid #8b7355;
  border-radius: 8px;
  padding: 1rem;
}

.property-title {
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
  font-size: 1.1rem;
  color: #3a1e0e;
  margin: 0 0 0.8rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #8b7355;
}

.property-content {
  font-size: 0.95rem;
  color: #4a3827;
  line-height: 1.6;
}

.property-item {
  margin-bottom: 0.5rem;
}

.property-item:last-child {
  margin-bottom: 0;
}

.property-key {
  font-weight: bold;
  color: #3a1e0e;
}

.property-none {
  font-style: italic;
  color: #7a6a55;
  text-align: center;
}

.beast-abilities {
  grid-column: 1 / -1;
  grid-row: 5;
}

.abilities-title {
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
  font-size: 1.3rem;
  color: #3a1e0e;
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #8b7355;
}

.abilities-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.ability-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
  background: rgba(139, 115, 85, 0.08);
  border: 1px solid rgba(139, 115, 85, 0.3);
  border-radius: 6px;
  cursor: help;
}

.ability-name {
  flex: 1;
  font-weight: bold;
  color: #3a1e0e;
  border-bottom: 2px dashed #3a1e0e;
  padding-bottom: 2px;
}

.ability-cost-icon {
  height: 1.5rem;
  width: auto;
}

/* Ability tooltip */
.ability-tooltip {
  position: fixed;
  background: linear-gradient(to bottom, #f9f4e8 0%, #f0e6d8 100%);
  border: 2px solid #8b7355;
  border-radius: 4px;
  padding: 1rem;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  display: none;
  max-width: 400px;
}

.ability-tooltip.visible {
  display: block;
}

.ability-tooltip-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #b89655;
}

.ability-tooltip-name {
  flex: 1;
  font-size: 1.1rem;
  font-weight: bold;
  color: #3a1e0e;
}

.ability-tooltip-cost-icon {
  height: 1.5rem;
  width: auto;
}

.ability-tooltip-meta {
  font-size: 0.9rem;
  color: #5d4a33;
  margin-bottom: 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #d4c4a8;
}

.ability-tooltip-meta-item {
  margin-bottom: 0.3rem;
}

.ability-tooltip-meta-item:last-child {
  margin-bottom: 0;
}

.ability-tooltip-meta-label {
  font-weight: bold;
}

.ability-tooltip-description {
  font-size: 0.95rem;
  color: #4a3827;
  line-height: 1.6;
  white-space: pre-line;
}

.ability-tooltip-description [data-effect] {
  border: 1px solid #8b7355;
  padding: 0.1rem 0.3rem;
  margin: 0 0.1rem;
  background: rgba(139, 115, 85, 0.1);
  white-space: nowrap;
}

/* Sidebar tree structure */
.sidebar-tree {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-tree-item {
  margin-bottom: 0.3rem;
}

.sidebar-tree-folder {
  cursor: pointer;
  padding: 0.5rem 0.8rem;
  color: #d4c4a8;
  background: rgba(139, 104, 85, 0.15);
  border: 1px solid rgba(139, 115, 85, 0.4);
  border-radius: 4px;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  width: fit-content;
  padding-right: 1rem;
}

.sidebar-tree-folder:hover {
  background: rgba(139, 115, 85, 0.25);
  border-color: #8b7355;
}

.sidebar-tree-folder-icon {
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.sidebar-tree-folder.expanded .sidebar-tree-folder-icon {
  transform: rotate(90deg);
}

.sidebar-tree-children {
  list-style: none;
  padding-left: 1.5rem;
  margin-top: 0.3rem;
  margin-bottom: 0.3rem;
  display: none;
}

.sidebar-tree-children.expanded {
  display: block;
}

.sidebar-tree-link {
  display: block;
  padding: 0.5rem 0.8rem;
  color: #d4c4a8;
  text-decoration: none;
  background: rgba(139, 115, 85, 0.1);
  border: 1px solid rgba(139, 115, 85, 0.3);
  border-radius: 4px;
  transition: all 0.2s ease;
  width: calc(100% - 4px);
}

.sidebar-tree-link:hover {
  background: rgba(139, 115, 85, 0.2);
  border-color: #8b7355;
  transform: translateX(4px);
}

.sidebar-tree-link.active {
  background: rgba(139, 0, 0, 0.2);
  border-color: #8b0000;
  color: #f9f4e8;
}

@media (max-width: 768px) {
  .beast-sheet {
    grid-template-columns: 1fr;
  }

  .beast-image-container {
    grid-column: 1;
    grid-row: 1;
  }

  .beast-info-container {
    grid-column: 1;
    grid-row: 2;
  }

  .beast-stats {
    grid-row: 3;
  }

  .beast-traits {
    grid-row: 4;
  }

  .beast-properties {
    grid-row: 5;
    grid-template-columns: 1fr;
  }

  .beast-abilities {
    grid-row: 6;
  }

  .beast-name {
    font-size: 1.5rem;
  }
}