.compendium-home-list,
.compendium-list,
.rules-list,
.decks-list {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compendium-home-list {
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.compendium-home-list a,
.compendium-list a,
.rules-list a,
.decks-list a,
.class-card a,
.monster-entry a,
.item-card a,
.feat-card a,
.deity-card a {
  border-bottom: 0;
  color: #5c1f12;
  font-weight: 600;
  text-decoration: none;
}

.compendium-home-list a:hover,
.compendium-list a:hover,
.rules-list a:hover,
.decks-list a:hover,
.class-card a:hover,
.monster-entry a:hover,
.item-card a:hover,
.feat-card a:hover,
.deity-card a:hover {
  color: #111;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.compendium-home-list a,
.compendium-list li,
.rules-list li,
.decks-list li {
  display: block;
  padding: 0.42rem 0.55rem;
  border: 1px solid #dfceb2;
  border-radius: 4px;
  background: rgba(255, 253, 247, 0.72);
}

.compendium-kicker,
.compendium-count {
  margin: 0;
  color: #66513a;
  font-size: 0.92rem;
  text-align: center;
}

.compendium-search {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
  color: #4a2600;
  font-weight: 600;
}

.compendium-search input,
.search-bar {
  width: 100%;
  min-height: 2.1rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid #9b7548;
  border-radius: 4px;
  background: #fffdf7;
  color: #2d1d0f;
  font: inherit;
  font-size: 0.95rem;
  box-shadow: none;
}

.compendium-empty {
  padding: 0.75rem;
  text-align: center;
  border: 1px solid #d6bd92;
  border-radius: 4px;
  background: rgba(255, 253, 247, 0.82);
}

.rollable-table {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0.65rem 0 0.35rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid #dfceb2;
  border-radius: 4px;
  background: rgba(255, 253, 247, 0.82);
}

.roll-table-label {
  color: #66513a;
  font-size: 0.9rem;
}

.roll-table-result {
  display: block;
  max-width: 100%;
  margin: 0.35rem 0 0.85rem;
  padding: 0.45rem 0.6rem;
  border-left: 4px solid #7f623e;
  background: rgba(255, 253, 247, 0.86);
  color: #2d1d0f;
  font-weight: 600;
  line-height: 1.35;
}

.container button,
.container .btn,
.container .btn-runecast,
.letter-btn,
.items-reset {
  min-height: 2rem;
  margin-top: 0;
  padding: 0.38rem 0.7rem;
  border: 1px solid #7f623e;
  border-radius: 4px;
  background: #6c4a25;
  box-shadow: none;
  color: #fffdf7;
  font-size: 0.92rem;
  line-height: 1.2;
}

.container button:hover,
.container .btn:hover,
.container .btn-runecast:hover,
.letter-btn:hover,
.letter-btn.active,
.items-reset:hover {
  background: #4a2600;
  color: #fffdf7;
}

.alphabet-nav,
.items-alpha {
  gap: 0.25rem;
  padding: 0.45rem;
  border-radius: 4px;
}

.items-alpha a {
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0 0.35rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

.deities-filters,
.feats-filters,
.items-filters {
  gap: 0.55rem;
  padding: 0.75rem;
  border-radius: 4px;
}

.deities-filters input,
.deities-filters select,
.feats-filters input,
.feats-filters select,
.items-filters input,
.items-filters select {
  min-height: 2.1rem;
  padding: 0.38rem 0.55rem;
  border-radius: 4px;
  font-size: 0.95rem;
}

.deity-card,
.feat-card,
.item-card,
.items-empty,
.class-card {
  min-height: 0;
  padding: 0.55rem 0.65rem;
  border-radius: 4px;
  box-shadow: none;
}

.deities-list,
.feats-list,
.item-list {
  gap: 0.45rem;
}

.class-card {
  margin: 0 0 0.45rem;
  border-color: #dfceb2;
  background: rgba(255, 253, 247, 0.78);
}

.class-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  min-height: 2rem;
}

.class-toggle,
.class-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  color: #2d1d0f;
}

.class-toggle {
  flex: 1 1 auto;
  justify-content: flex-start;
  border: 0;
  background: transparent;
  color: #2d1d0f;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-align: left;
}

.class-toggle:hover {
  background: transparent;
  color: #111;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.class-view-link {
  flex: 0 0 auto;
  color: #6b4c2a;
  font-size: 0.86rem;
  font-weight: 500;
}

.class-source {
  color: #6b4c2a;
  font-size: 0.86rem;
  font-weight: 400;
}

.arrow {
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid #4a2600;
  border-bottom: 2px solid #4a2600;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.class-card[data-expanded="true"] .arrow {
  transform: rotate(45deg);
}

.subclasses {
  margin-top: 0.35rem;
}

.subclasses ul {
  margin: 0;
  padding-left: 1.2rem;
}

.monster-list-shell {
  display: grid;
  gap: 0.85rem;
}

.monster-list-shell .alphabet-nav {
  display: flex;
  flex-wrap: wrap;
}

.monster-list-shell h2 {
  margin: 0.8rem 0 0.35rem;
  font-size: 1rem;
  text-align: left;
}

#monsterList,
#monsterList ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.monster-entry {
  padding: 0.28rem 0;
}

@media (max-width: 700px) {
  .compendium-home-list {
    grid-template-columns: 1fr;
  }
}
