.pt-relic-case {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  box-sizing: border-box;
  pointer-events: auto;
  overscroll-behavior: contain;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 12px;
  overflow: auto;
  background: rgba(5, 5, 4, .78);
  color: #d5c7ad;
  font-family: var(--pt-font-vi, 'Be Vietnam Pro', 'Segoe UI', Tahoma, Arial, sans-serif);
}

.pt-relic-case[hidden] {
  display: none;
}

.pt-relic-case__window {
  box-sizing: border-box;
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  position: relative;
  background:
    linear-gradient(90deg, rgba(111, 77, 38, .23), transparent 3px, transparent calc(100% - 3px), rgba(111, 77, 38, .2)),
    linear-gradient(180deg, #25221d, #161614 55%, #10100f);
  border: 1px solid #72552d;
  box-shadow: 0 0 0 2px #080807, 0 18px 44px rgba(0, 0, 0, .72), inset 0 0 0 1px #30291e;
}

.pt-relic-case__header {
  min-height: 24px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  border-bottom: 1px solid #5e472a;
  background: linear-gradient(#302a21, #191713);
}

.pt-relic-case__crest {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #c9af78;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #86683a;
  background: #1c1915;
}

.pt-relic-case h2,
.pt-relic-case h3,
.pt-relic-case p {
  margin: 0;
}

.pt-relic-case h2 {
  color: #d7c397;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.pt-relic-case__header p {
  color: #92856e;
  font-size: 9px;
  line-height: 1.2;
}

.pt-relic-case button {
  box-sizing: border-box;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.pt-relic-case button:focus-visible {
  outline: 2px solid #d8b65d;
  outline-offset: 1px;
}

.pt-relic-case button:disabled {
  cursor: default;
  opacity: .42;
}

.pt-relic-case__close {
  width: 30px;
  min-height: 30px;
  margin-left: auto;
  padding: 0;
  color: #bba379;
  font-size: 19px;
  line-height: 1;
  border: 1px solid #5d472b;
  background: #1a1815;
}

.pt-relic-case__close:hover {
  color: #e0c381;
  background: #302a21;
}

.pt-relic-case__body {
  display: grid;
  grid-template-columns: 298px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.pt-relic-case__collection {
  min-width: 0;
  height: 405px;
  padding: 64px 0 0 49px;
  position: relative;
  box-sizing: border-box;
  border: 0;
  background: url('/assets/relics/wartale-case.png') 0 0 / 298px 365px no-repeat;
}

.pt-relic-case__grid {
  display: grid;
  grid-template-columns: repeat(4, 33px);
  grid-auto-rows: 68px;
  justify-content: start;
  row-gap: 29px;
  column-gap: 21px;
}

.pt-relic-case__collection-title {
  position: absolute;
  top: 11px;
  left: 65px;
  right: 65px;
  text-align: center;
  color: #eee0c4;
  font-size: 12px;
  font-weight: 600;
}

.pt-relic-case__plaque {
  position: relative;
  width: 33px;
  min-width: 0;
  height: 68px;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
}

.pt-relic-case__plaque:hover {
  border-color: #a8864d;
  background: rgba(159, 126, 68, .12);
}

.pt-relic-case__plaque.is-selected {
  border-color: #d0ac59;
  box-shadow: 0 0 0 1px #8c6f38, inset 0 0 0 1px #201c15;
}

.pt-relic-case__art {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.pt-relic-case__art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.pt-relic-case__art-pending { font-size: 9px; line-height: 1.4; text-align: center; color: #b8aa8e; }

.pt-relic-case__plaque.is-locked .pt-relic-case__art {
  filter: grayscale(1) brightness(.2);
}

.pt-relic-case__plaque.is-owned .pt-relic-case__art {
  filter: none;
}

.pt-relic-case__seal {
  display: none;
  position: absolute;
  right: 2px;
  bottom: 2px;
  min-width: 12px;
  height: 12px;
  padding: 0 1px;
  place-items: center;
  color: #cbb37d;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid #6e542d;
  background: #201b14;
}

.pt-relic-case__pages {
  position: absolute;
  left: 32px;
  right: 32px;
  top: 363px;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 0;
  color: #9c9079;
  font-size: 10px;
}

.pt-relic-case__pages button,
.pt-relic-case__craft button,
.pt-relic-case__footer button {
  min-height: 30px;
  padding: 4px 8px;
  color: #cdb98d;
  font-size: 10px;
  border: 1px solid #68502d;
  background: linear-gradient(#393128, #201d19);
}

.pt-relic-case__pages button:hover:not(:disabled),
.pt-relic-case__craft button:hover:not(:disabled),
.pt-relic-case__footer button:hover:not(:disabled) {
  color: #ead49b;
  border-color: #a78243;
  background: linear-gradient(#4a3e2e, #29231c);
}

.pt-relic-case__detail {
  min-width: 0;
  padding: 8px;
  color: #b9af9a;
  overflow-wrap: anywhere;
  border: 1px solid #4e402c;
  background: linear-gradient(145deg, #201e1b, #151514);
  box-shadow: inset 0 0 0 1px #0d0d0c;
}

.pt-relic-case__detail-art {
  width: 74px;
  height: 74px;
  overflow: hidden;
  margin: 0 auto 7px;
  display: grid;
  place-items: center;
  border: 1px solid #5d4a2e;
  background: #151411;
}

.pt-relic-case__detail-art img {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
  max-width: 74px;
  max-height: 74px;
  min-width: 0;
  min-height: 0;
}

.pt-relic-case__boss {
  color: #96876d;
  font-size: 10px;
  line-height: 1.4;
}

.pt-relic-case h3 {
  margin-top: 2px;
  color: #d5c192;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.35;
}

.pt-relic-case__rule {
  margin: 8px 0;
  padding: 6px;
  display: grid;
  gap: 2px;
  border-top: 1px solid #4c3c27;
  border-bottom: 1px solid #4c3c27;
  color: #90846e;
  font-size: 10px;
  line-height: 1.4;
}

.pt-relic-case__rule strong {
  color: #d5bd7d;
  font-size: 11px;
  font-weight: 700;
}

.pt-relic-case__state,
.pt-relic-case__craft p {
  color: #aaa18f;
  font-size: 10px;
  line-height: 1.45;
}

.pt-relic-case__craft {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #4c3c27;
}

.pt-relic-case__craft button {
  width: 100%;
}

.pt-relic-case__footer {
  min-height: 30px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 5px 12px;
  flex-wrap: wrap;
  color: #a89c85;
  font-size: 10px;
  line-height: 1.45;
  border-top: 1px solid #5e472a;
  background: #1b1a17;
}

.pt-relic-case__footer b {
  color: #d0bb82;
}

@media (max-width: 600px) {
  .pt-relic-case {
    display: block;
    padding: 8px;
  }

  .pt-relic-case__window {
    width: min(100%, 375px);
    margin: 0 auto;
  }

  .pt-relic-case__body {
    grid-template-columns: 298px;
    justify-content: center;
    gap: 8px;
    padding: 8px;
  }

.pt-relic-case__collection {
    min-height: 365px;
  }

  .pt-relic-case__detail {
    min-height: 0;
  }
}
