/* ═══════════════════════════════════════════════════════════════════
   GUARDIANS · THE RELIC VAULT (vault.css)
   Not a third book — a vault. A wall of shadowed shelves (Erez's
   backdrop), every relic an engraved brass plaque (Erez's plate),
   rarity as the color thread running through the room. Click a plaque
   and the relic comes off the shelf into the DISPLAY CASE — an overlay
   that obeys the [hidden] law. The vault keeps night hours: ivory ink
   on velvet, gold labels; the books keep the daylight parchment.
   portal.css is LAW; toolbar dress from compendium.css.
   ═══════════════════════════════════════════════════════════════════ */

html:not(.vault-on) .rv-scriptorium,
html:not(.vault-on) #rv-room { display: none; }
html.vault-on #rv-fallback { display: none; }

/* Title zone: the door, ajar */
.rv-titlezone {
  display: flex; align-items: center; justify-content: center; gap: clamp(18px, 3vw, 44px);
  flex-wrap: wrap; max-width: 1100px; margin: 0 auto 22px; text-align: left;
}
.rv-titlezone img {
  width: clamp(120px, 13vw, 175px); height: auto;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 26px rgba(216, 166, 88, 0.14));
}
.rv-titlezone h2 {
  font-family: var(--f-arc); font-weight: 400; margin: 0;
  font-size: clamp(1.9rem, 4.4vw, 3rem); letter-spacing: 0.06em; color: #f0eaf8;
  text-shadow: 0 0 34px rgba(183, 154, 224, 0.35);
}
.rv-titlezone .rv-sub {
  margin: 6px 0 0; font-family: var(--f-arc); font-style: italic;
  color: #ab9fc4; font-size: 1.02rem;
}

/* Field desk */
.rv-scriptorium { max-width: 1100px; margin: 0 auto 8px; }
.rv-scriptorium .toolbar { margin-bottom: 8px; }
.rv-meta { display: flex; align-items: center; gap: 14px; }
.rv-meta #count { flex: 1 1 auto; margin: 0; }
.rv-scriptorium .export-options { flex: 0 0 auto; justify-content: flex-end; }
.rv-scriptorium .export-options button { padding: 9px 16px; font-size: 0.7rem; }
#rv-status { max-width: 1100px; margin: 0 auto 10px; }
#rv-status:empty { display: none; }

/* ── The room: the shelf wall ── */
#rv-room {
  max-width: 1180px; margin: 0 auto; border-radius: 10px; overflow: hidden;
  padding: clamp(20px, 3vw, 40px);
  background:
    linear-gradient(rgba(6, 7, 16, 0.4), rgba(6, 7, 16, 0.6)),
    url("../images/vault/shelf.webp") center / 620px repeat;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.75), inset 0 0 120px rgba(0, 0, 0, 0.55);
}
.rv-band {
  display: flex; align-items: baseline; gap: 12px; margin: 26px 4px 12px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.26em;
  text-transform: uppercase; color: #d8b06a;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.rv-band:first-child { margin-top: 4px; }
.rv-band::after { content: ""; flex: 1 1 auto; border-top: 1px solid rgba(216, 176, 106, 0.32); }
.rv-band .ct {
  font-size: 0.72rem; letter-spacing: 0.04em; color: #b9a37c;
  border: 1px solid rgba(216, 176, 106, 0.35); border-radius: 999px; padding: 0 9px;
}
.rv-shelf {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 16px 18px;
}

/* the plaque itself */
.rv-plaque {
  position: relative; aspect-ratio: 3.7 / 1; min-height: 64px;
  border: none; cursor: pointer; padding: 8% 11%;
  background: url("../images/vault/plaque.webp") center / 100% 100% no-repeat;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
  transition: transform 0.18s ease, filter 0.18s ease;
}
.rv-plaque:hover, .rv-plaque:focus-visible {
  transform: translateY(-3px);
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 14px rgba(216, 176, 106, 0.3));
}
.rv-plaque:focus-visible { outline: 2px solid #d8b06a; outline-offset: 3px; border-radius: 6px; }
.rv-plaque .nm {
  font-family: var(--f-arc); font-size: clamp(0.82rem, 1.1vw, 0.98rem); line-height: 1.15;
  color: #1d1204; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  -webkit-text-stroke: 0.3px rgba(29, 18, 4, 0.8);
  text-shadow: 0 1px 0 rgba(255, 242, 205, 0.6), 0 2px 2px rgba(255, 236, 190, 0.18);
}
.rv-plaque .tp {
  margin-top: 2px; font-size: 0.58rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: #2c1c07; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  text-shadow: 0 1px 0 rgba(255, 242, 205, 0.5);
}
.rv-plaque .gem {
  position: absolute; top: 14%; left: 6.5%; width: 9px; height: 9px; border-radius: 50%;
  background: var(--gem, #8d8f98);
  box-shadow: 0 0 6px var(--gem, #8d8f98), inset 0 -1px 2px rgba(0, 0, 0, 0.5);
}
.rv-none {
  font-family: var(--f-arc); font-style: italic; color: #b9a37c;
  padding: 18px 6px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* rarity: the color thread (base band → gem + case accent) */
.rb-common     { --gem: #9094a0; }
.rb-uncommon   { --gem: #7d9c6f; }
.rb-rare       { --gem: #8a6dc0; }
.rb-epic       { --gem: #b05a9a; }
.rb-legendary  { --gem: #d8a94f; }
.rb-mythic     { --gem: #efe3c2; }
.rb-unique     { --gem: #c9b8ff; }
.rb-artifact   { --gem: #c07840; }
.rb-other      { --gem: #9a8f7a; }

/* ── THE DISPLAY CASE (the overlay; [hidden] always wins — LAW) ── */
.rv-case[hidden] { display: none !important; }
.rv-case {
  position: fixed; inset: 0; z-index: 80; display: flex;
  align-items: center; justify-content: center; padding: 4vh 4vw;
  background: rgba(4, 4, 10, 0.82); backdrop-filter: blur(3px);
}
.rv-case-panel {
  position: relative; width: min(680px, 100%); max-height: 92vh; overflow-y: auto;
  border-radius: 12px; padding: clamp(22px, 3.5vw, 40px);
  background:
    linear-gradient(rgba(10, 11, 24, 0.86), rgba(10, 11, 24, 0.92)),
    url("../images/vault/shelf.webp") center / 620px repeat;
  border: 1px solid rgba(216, 176, 106, 0.45);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 40px var(--gem, rgba(216, 176, 106, 0.18));
}
.rv-case-plaque {
  position: relative; margin: 0 auto 18px; width: min(440px, 92%); aspect-ratio: 3.7 / 1;
  background: url("../images/vault/plaque.webp") center / 100% 100% no-repeat;
  display: flex; align-items: center; justify-content: center; padding: 7% 11%;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.6));
}
.rv-case-plaque .nm {
  font-family: var(--f-arc); font-size: clamp(0.95rem, 2vw, 1.25rem); line-height: 1.12;
  color: #1d1204; text-align: center;
  -webkit-text-stroke: 0.3px rgba(29, 18, 4, 0.8);
  text-shadow: 0 1px 0 rgba(255, 242, 205, 0.6), 0 2px 2px rgba(255, 236, 190, 0.18);
}
.rv-case-plaque .gem {
  position: absolute; top: 15%; left: 7%; width: 11px; height: 11px; border-radius: 50%;
  background: var(--gem, #8d8f98);
  box-shadow: 0 0 8px var(--gem, #8d8f98), inset 0 -1px 2px rgba(0, 0, 0, 0.5);
}
.rv-rarityline {
  text-align: center; margin: 0 0 4px; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--gem, #d8b06a);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.rv-kind {
  text-align: center; font-family: var(--f-arc); font-style: italic;
  color: #b6a9cf; margin: 0 0 16px; font-size: 0.95rem;
}
.rv-blurb {
  font-family: var(--f-arc); font-style: italic; font-size: 1.08rem; line-height: 1.7;
  color: #e9e2f4; text-align: center; margin: 0 0 14px;
}
.rv-appear { font-family: var(--f-arc); font-size: 0.99rem; line-height: 1.7; color: #cfc6e0; margin: 0 0 14px; }
.rv-h {
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase;
  color: #d8b06a; margin: 16px 0 8px; display: flex; align-items: center; gap: 10px;
}
.rv-h::after { content: ""; flex: 1 1 auto; border-top: 1px solid rgba(216, 176, 106, 0.28); }
.rv-margin {
  font-size: 0.9rem; line-height: 1.55; color: #cfc6e0;
  border-left: 3px solid rgba(216, 176, 106, 0.4); padding-left: 12px; margin: 0 0 10px;
}
.rv-margin b { color: #d8b06a; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.66rem; }
.rv-tags { margin-top: 4px; }
.rv-tags span {
  display: inline-block; margin: 0 6px 6px 0; padding: 2px 12px;
  font-size: 0.72rem; color: #d8c9a0; border: 1px solid rgba(216, 176, 106, 0.4);
  border-radius: 999px; background: rgba(216, 176, 106, 0.08);
}
.rv-prov {
  font-family: var(--f-arc); font-style: italic; font-size: 0.8rem; color: #b6a9cf;
  border-top: 1px solid rgba(216, 176, 106, 0.25); padding-top: 8px; margin-top: 16px;
}
.rv-close {
  position: absolute; top: 10px; right: 12px; cursor: pointer;
  background: none; border: 1px solid rgba(216, 176, 106, 0.45); border-radius: 50%;
  width: 34px; height: 34px; color: #d8b06a; font-size: 1rem; line-height: 1;
}
.rv-close:hover { background: rgba(216, 176, 106, 0.14); }

@keyframes rv-lift {
  0%   { opacity: 0; transform: translateY(14px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.rv-case:not([hidden]) .rv-case-panel { animation: rv-lift 0.28s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .rv-case:not([hidden]) .rv-case-panel { animation: none; }
  .rv-plaque, .rv-plaque:hover { transition: none; transform: none; }
}

@media (max-width: 560px) {
  .rv-shelf { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
  .rv-plaque { padding: 7% 10%; }
}

/* No-JS chain (also the print truth) */
#rv-fallback { max-width: 940px; margin: 0 auto; }
.fv-band {
  border: 1px solid rgba(183, 154, 224, 0.22); border-radius: 10px;
  background: rgba(16, 13, 30, 0.72); margin: 0 0 12px; padding: 0 18px;
}
.fv-band summary { cursor: pointer; padding: 14px 0; font-weight: 700; color: #f0eaf8; }
.fv-band summary .count { font-size: 0.75rem; color: var(--arc-hi); border: 1px solid var(--arc-line); border-radius: 999px; padding: 1px 9px; margin-left: 8px; }
.fv-item { border-top: 1px solid rgba(183, 154, 224, 0.12); padding: 12px 0; }
.fv-item h4 { margin: 0 0 4px; color: #ffe3ae; }
.fv-item h4 em { font-weight: 400; font-size: 0.8rem; color: #9d92b8; margin-left: 8px; }
.fv-item p { margin: 0 0 6px; font-family: var(--f-arc); line-height: 1.55; color: #c9bfdd; }
.fv-mech { font-size: 0.82rem; color: #ab9fc4 !important; }
.fv-blurb { font-style: italic; color: #9d92b8 !important; }

@media print {
  .rv-scriptorium, #rv-room, .rv-titlezone img, .rv-case { display: none !important; }
  #rv-fallback { display: block !important; }
}
