/* ==========================================================================
   Telephantim Relics — "Steel Hall" art direction
   Palette: brushed silver, pale steel blue, soft gold, navy ink, ember accents.
   No pink / purple, no pure black. Light, masculine, calm.
   ========================================================================== */
:root {
  --rh-silver: #e9eef4;
  --rh-silver-2: #cfd9e5;
  --rh-steel: #9fb2c9;
  --rh-steel-deep: #5c7392;
  --rh-navy: #14264d;
  --rh-ink: #1c2c4e;
  --rh-gold: #c9a227;
  --rh-gold-soft: #e3c46c;
  --rh-ember: #e0701f;
  --rh-red: #a3262a;
}

/* Gold Relic Hall chip only — stage re-skin omitted so the local Relics
   background (navy #070e20, contained caduceus loop, video behind relics)
   is not overwritten. See README: skip section 1 to keep the existing look. */
#stage-telephantim .btn-chip.btn-hall,
.btn-chip.btn-hall {
  background: linear-gradient(180deg, #f1d98c, #c9a227);
  border: 1px solid #a6851a;
  color: #1c2c4e;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---- 2. The Relic Hall overlay ---- */
.relic-hall {
  position: fixed; inset: 0; z-index: 140; /* above sprites (134-135) and the Pay sheet; tab bar stays on top */
  padding: 3.4rem 1rem 2rem;
  overflow-y: auto;
  color: var(--rh-ink);
  font-family: inherit;
  background: #cfd9e5; /* fallback while the muted portrait loop loads */
}
.rh-bg-video, .rh-bg-dim {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}
.rh-bg-video {
  object-fit: cover;
  object-position: center;
}
.rh-bg-dim {
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(255,255,255,0.78) 0%, rgba(233,238,244,0.82) 45%, rgba(207,217,229,0.88) 100%);
}
.relic-hall[hidden] { display: none; }
.rh-frame {
  position: relative; z-index: 1;
  max-width: 1180px; margin: 0 auto;
  padding: 1.4rem 1.4rem 1.6rem;
  border: 1px solid rgba(92,115,146,0.5);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(233,238,244,0.62));
  box-shadow: 0 18px 50px rgba(20,38,77,0.22), inset 0 1px 0 #fff, inset 0 0 0 5px rgba(201,162,39,0.10);
  min-height: min(660px, calc(100vh - 9rem));
}
.rh-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.rh-head h2 { font-size: clamp(1.2rem, 3.2vw, 1.8rem); letter-spacing: 0.28em; text-transform: uppercase; color: var(--rh-navy); border-bottom: 2px solid var(--rh-gold); display: inline-block; padding-bottom: 0.25rem; }
.rh-head p { margin-top: 0.5rem; font-size: 0.85rem; color: var(--rh-steel-deep); }
.rh-head-right { display: flex; align-items: center; gap: 0.7rem; }
.rh-count { font-size: 0.78rem; letter-spacing: 0.08em; color: var(--rh-navy); padding: 0.35rem 0.7rem; border-radius: 999px; background: linear-gradient(180deg, #f4f7fb, #dbe4ef); border: 1px solid rgba(92,115,146,0.45); }
.rh-close, .rh-back, .rh-pager button {
  appearance: none; cursor: pointer;
  padding: 0.5rem 0.95rem; border-radius: 10px;
  border: 1px solid rgba(92,115,146,0.6);
  background: linear-gradient(180deg, #f4f7fb, #c8d4e2);
  color: var(--rh-navy); font-size: 0.8rem; font-weight: 600;
  box-shadow: 0 2px 5px rgba(20,38,77,0.15), inset 0 1px 0 #fff;
}
.rh-close:hover, .rh-back:hover, .rh-pager button:hover { border-color: var(--rh-gold); }
.rh-filters { display: flex; gap: 0.45rem; flex-wrap: wrap; margin: 1rem 0 0.9rem; }
.rh-fchip { appearance: none; cursor: pointer; padding: 0.38rem 0.85rem; border-radius: 999px; font-size: 0.75rem; letter-spacing: 0.06em; border: 1px solid rgba(92,115,146,0.5); background: rgba(255,255,255,0.65); color: var(--rh-steel-deep); }
.rh-fchip.on { background: linear-gradient(180deg, #f1d98c, #c9a227); border-color: #a6851a; color: var(--rh-navy); font-weight: 700; }

.rh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.rh-card {
  position: relative; appearance: none; text-align: left; cursor: pointer;
  padding: 0; overflow: hidden; border-radius: 14px;
  border: 1px solid rgba(92,115,146,0.5);
  background: linear-gradient(180deg, #f8fafc 0%, #dbe4ef 100%);
  color: var(--rh-ink);
  box-shadow: 0 6px 16px rgba(20,38,77,0.16), inset 0 1px 0 #fff;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.rh-card:hover, .rh-card:focus-visible { transform: translateY(-3px); border-color: var(--rh-gold); box-shadow: 0 12px 26px rgba(20,38,77,0.24), 0 0 0 2px rgba(201,162,39,0.35); outline: none; }
.rh-thumb { display: block; width: 100%; height: 250px; background: radial-gradient(ellipse at 50% 70%, rgba(201,162,39,0.22) 0%, rgba(255,255,255,0) 60%); }
.rh-meta { display: grid; gap: 0.2rem; padding: 0.7rem 0.9rem 0.9rem; border-top: 1px solid rgba(92,115,146,0.3); background: rgba(255,255,255,0.5); }
.rh-meta strong { font-size: 0.98rem; color: var(--rh-navy); letter-spacing: 0.02em; }
.rh-meta small { color: var(--rh-steel-deep); font-size: 0.75rem; }
.rh-card.beheld::after { content: "✓ beheld"; position: absolute; top: 0.6rem; right: 0.7rem; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rh-steel-deep); }
.rh-new { position: absolute; top: 0.6rem; left: 0.7rem; z-index: 2; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; padding: 0.2rem 0.5rem; border-radius: 6px; background: var(--rh-ember); color: #fff; }
.rh-rarity { justify-self: start; margin-top: 0.25rem; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; padding: 0.2rem 0.55rem; border-radius: 6px; color: #fff; background: var(--rc, #8fa0b6); box-shadow: inset 0 -2px 0 rgba(0,0,0,0.12); }
.rh-rarity[style*="#c9a227"] { color: var(--rh-navy); }

/* detail */
.rh-detail { position: absolute; inset: 0; border-radius: 16px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.2rem; padding: 1.2rem; background: linear-gradient(180deg, rgba(248,250,252,0.98), rgba(223,231,240,0.98)); z-index: 3; }
.rh-detail[hidden] { display: none; }
.rh-d-view { position: relative; border-radius: 14px; border: 1px solid rgba(92,115,146,0.5); background: radial-gradient(ellipse at 50% 75%, rgba(201,162,39,0.25) 0%, rgba(255,255,255,0) 62%), linear-gradient(180deg, #ffffff, #d5dfeb); min-height: 360px; overflow: hidden; }
.rh-d-view canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.rh-hint { position: absolute; left: 0; right: 0; bottom: 0.6rem; text-align: center; font-size: 0.72rem; color: var(--rh-steel-deep); pointer-events: none; }
.rh-d-info { display: flex; flex-direction: column; gap: 0.7rem; align-items: flex-start; overflow-y: auto; }
.rh-d-info h3 { font-size: clamp(1.4rem, 3vw, 2rem); color: var(--rh-navy); letter-spacing: 0.04em; }
.rh-epithet { color: var(--rh-steel-deep); font-style: italic; }
.rh-facts { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.rh-facts dt { font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--rh-steel-deep); }
.rh-facts dd { font-weight: 700; color: var(--rh-navy); }
.rh-stats { width: 100%; display: grid; gap: 0.4rem; }
.rh-stat { display: grid; grid-template-columns: 4.6rem 1fr 1.6rem; gap: 0.6rem; align-items: center; font-size: 0.75rem; text-transform: capitalize; color: var(--rh-ink); }
.rh-stat i { height: 8px; border-radius: 99px; background: rgba(92,115,146,0.25); overflow: hidden; }
.rh-stat b { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #5c7392, #c9a227); }
.rh-stat em { font-style: normal; font-weight: 700; text-align: right; }
.rh-lore { margin: 0.2rem 0; padding: 0.8rem 1rem; border-left: 3px solid var(--rh-gold); background: rgba(255,255,255,0.6); border-radius: 0 10px 10px 0; line-height: 1.55; color: var(--rh-ink); }
.rh-pager { display: flex; gap: 0.6rem; margin-top: auto; }

body.relic-hall-open .world-switch { z-index: 150 !important; }
body.relic-hall-open #cad-bar-row, body.relic-hall-open #tp-pets-btn, body.relic-hall-open #tp-pets-mode { visibility: hidden !important; }
body.relic-hall-open .mw-walker, body.relic-hall-open #tp-pets-tip, body.relic-hall-open #tp-pets-press { visibility: hidden !important; }

@media (max-width: 760px) {
  .rh-bg-dim {
    background:
      radial-gradient(ellipse 80% 60% at 50% 20%, rgba(255,255,255,0.86) 0%, rgba(233,238,244,0.90) 45%, rgba(207,217,229,0.92) 100%);
  }
  .relic-hall { padding: 4rem 0.6rem 1.5rem; }
  .rh-frame { padding: 1rem 0.8rem 1.2rem; }
  .rh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
  .rh-thumb { height: 190px; }
  .rh-detail { position: fixed; inset: 3.6rem 0.5rem 1rem; grid-template-columns: 1fr; grid-template-rows: minmax(240px, 40vh) 1fr; overflow-y: auto; }
  .rh-d-view { min-height: 240px; }
}
@media (prefers-reduced-motion: reduce) { .rh-card { transition: none; } }

@media (prefers-reduced-motion: reduce) {
  .rh-bg-video { display: none; }
}
