* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: url('/pic/wood-bg-optimized.jpg') center/cover fixed;
  color: #2c1810;
  font-family: Georgia, serif;
}
[hidden] {
  display: none !important;
}
.catalog-shell {
  width: min(1530px, calc(100% - 32px));
  margin: 0 auto 90px;
  display: grid;
  grid-template-columns: minmax(0, 1200px) 300px;
  gap: 20px;
  align-items: start;
}
.scroll {
  width: 100%;
  min-height: calc(100vh - 125px);
  margin: 0;
  padding: 164px 28px 182px;
  position: relative;
  background: #8a580de3;
  border-radius: 24px;
  box-shadow: 0 24px 64px #0009;
}
h1 {
  margin: 0 0 18px;
  text-align: center;
  font-family: Cinzel, Georgia, serif;
}
.tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}
.tabs button {
  padding: 9px 16px;
  border: 1px solid #704214;
  border-radius: 8px;
  background: #fff5dc;
  color: #3e2723;
  font-weight: bold;
  cursor: pointer;
}
.tabs .active {
  background: #704214;
  color: #fff;
}
.status {
  text-align: center;
  color: #704214;
}
.basic-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #8b623d88;
  border-radius: 12px;
  overflow: visible;
  background: #f6dfae;
}
.basic-left {
  border-right: 1px solid #8b623d88;
}
.section {
  padding: 15px;
  min-height: 98px;
}
.section + .section {
  border-top: 1px solid #8b623d88;
}
.section h2 {
  margin: 0 0 9px;
  font:
    700 1rem Cinzel,
    Georgia,
    serif;
  color: #4a2c13;
}
.equipment {
  border-bottom: 1px solid #8b623d88;
}
.secret {
  background: transparent;
}
.icons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.item {
  width: 48px;
  height: 48px;
  position: relative;
  cursor: pointer;
}
.item img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  border: 1px solid #744d27;
  border-radius: 4px;
  background: #31261d;
}
.item:hover img,
.item:focus img {
  border-color: #e3b953;
  outline: 2px solid #e3b953;
  transform: scale(1.06);
}
.tooltip {
  display: none;
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 7px);
  left: 50%;
  width: 300px;
  max-width: 78vw;
  padding: 11px;
  transform: translateX(-50%);
  border: 1px solid #c49d52;
  border-radius: 8px;
  background: #17120ef8;
  color: #f5e7c8;
  box-shadow: 0 12px 28px #0009;
  white-space: pre-line;
  font-size: 0.8rem;
  line-height: 1.4;
}
.item:hover .tooltip,
.item:focus .tooltip {
  display: block;
}
.tooltip .item-stats {
  display: block;
  margin: 4px 0;
  color: #f8dfab;
}
.tooltip .item-stats b {
  display: block;
  color: #ffe09a;
}
.tooltip .item-skills {
  display: block;
  margin: 6px 0;
  color: #f8dfab;
}
.tooltip .item-skills > b {
  display: block;
  color: #ffe09a;
}
.tooltip .item-skill {
  display: block;
  margin: 5px 0;
  padding-left: 7px;
  border-left: 2px solid #c49d52;
}
.tooltip .item-skill em {
  display: block;
  color: #e3b953;
  font-style: normal;
  font-weight: bold;
}
.tooltip .item-skill small {
  display: block;
  color: #d9c4a1;
}
.tooltip strong {
  display: block;
  color: #ffe09a;
  font-size: 0.98rem;
}
.tooltip .gold {
  display: block;
  margin: 3px 0;
  color: #f0c45c;
  font-weight: bold;
}
.upgraded {
  display: none;
}
.upgraded.visible {
  display: block;
}
.upgraded-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #8b623d88;
  border-radius: 12px;
  overflow: visible;
  background: #f6dfae;
}
.upgraded-layout .section {
  padding: 15px;
  min-height: 98px;
}
.upgraded-layout .section:nth-child(odd) {
  border-right: 1px solid #8b623d88;
}
.upgraded-layout .section:nth-child(n + 3) {
  border-top: 1px solid #8b623d88;
}
.recipe-panel {
  position: sticky;
  top: 86px;
  margin-left: 30px;
  min-height: 220px;
  padding: 18px 15px;
  background: #8a580de3;
  border: 1px solid #9d7045;
  border-radius: 14px;
  box-shadow: 0 16px 35px #0009;
}
.recipe-panel h2 {
  margin: 0 0 12px;
  text-align: center;
  font:
    700 1.15rem Cinzel,
    Georgia,
    serif;
  color: #4a2c13;
}
.recipe-panel p {
  margin: 0;
  color: #654321;
  font-size: 0.9rem;
  line-height: 1.4;
}
.recipe-panel .item,
.recipe-panel .item img {
  width: 44px;
  height: 44px;
}
.recipe-panel .item.selected img {
  outline: 3px solid #d2a23b;
}
.recipe-empty {
  font-style: italic;
}
.recipe-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.recipe-root {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-weight: bold;
  color: #3e2715;
}
.recipe-root .item,
.recipe-root .item img {
  width: 60px;
  height: 60px;
}
.recipe-root .item img {
  border-width: 2px;
}
.recipe-link {
  width: 2px;
  height: 18px;
  background: #8b623d;
  position: relative;
}
.recipe-link::after {
  content: '';
  position: absolute;
  left: -4px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}
.recipe-link.up::after {
  top: -1px;
  border-bottom: 7px solid #8b623d;
}
.recipe-link.down::after {
  bottom: -1px;
  border-top: 7px solid #8b623d;
}
.recipe-branch {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  max-width: 100%;
  padding: 8px 0;
  position: relative;
}
.recipe-branch::before {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  height: 2px;
  background: #8b623d;
}
.recipe-branch.up::before {
  bottom: 0;
}
.recipe-branch.down::before {
  top: 0;
}
.recipe-caption {
  font:
    700 0.78rem Cinzel,
    Georgia,
    serif;
  color: #5b3519;
  margin: 4px 0;
}
.recipe-tree.basic .recipe-caption {
  order: -1;
}
@media (max-width: 1350px) {
  .catalog-shell {
    width: min(1200px, calc(100% - 32px));
    display: block;
  }
  .recipe-panel {
    position: relative;
    top: auto;
    margin-left: 0;
    width: min(720px, 100%);
    margin: 20px auto 0;
  }
}
@media (max-width: 700px) {
  .catalog-shell {
    width: calc(100% - 20px);
  }
  .scroll {
    padding: 132px 12px 150px;
  }
  .basic-layout,
  .upgraded-layout {
    grid-template-columns: 1fr;
  }
  .basic-left {
    border-right: 0;
  }
  .basic-right {
    border-top: 1px solid #8b623d88;
  }
  .upgraded-layout .section:nth-child(odd) {
    border-right: 0;
  }
  .upgraded-layout .section + .section {
    border-top: 1px solid #8b623d88;
  }
  .item,
  .item img {
    width: 44px;
    height: 44px;
  }
}
.scroll-cap {
  position: absolute;
  left: 50%;
  width: min(calc(100% + 96px), 1296px);
  height: 150px;
  background: url('/pic/ScrollBelow.png') center/100% 100% no-repeat;
  pointer-events: none;
  z-index: 2;
}
.scroll-cap.top {
  top: -12px;
  transform: translateX(-50%) scaleY(-1);
  filter: drop-shadow(0 -12px 12px #0005);
}
.scroll-cap.bottom {
  bottom: -18px;
  transform: translateX(-50%);
  filter: drop-shadow(0 12px 12px #0005);
} /* High-contrast typography for parchment surfaces. */
.scroll *,
.recipe-panel * {
  color: #080604 !important;
}
.tooltip * {
  color: #f5e7c8 !important;
}
