/* ═══════════════════════════════════════════════════════════════════
   GUARDIANS · THE PATH CARDS (paths.css)
   The fourth metaphor. The Grimoire is a book, the Vault a case, the
   Atlas a codex — the Paths are CARDS: thirty-one laid out face up,
   and the one you choose stands alone. Each card wears its own
   discipline's colour, drawn from --accent set per card by paths.js
   (the same eight hues the Book of Paths prints).
   portal.css is LAW; toolbar dress comes from compendium.css.
   ═══════════════════════════════════════════════════════════════════ */

html:not(.paths-on) .pv-workshop,
html:not(.paths-on) #pv-room { display: none; }
html.paths-on #pv-fallback { display: none; }

/* Title zone — matches the Grimoire's grammar */
/* Title zone — the same grammar as the Grimoire's tome: a small emblem beside the
   name, never a hero. Without the flex row and the width clamp the art rendered at its
   natural size and pushed the text below it. */
.pv-titlezone {
  display: flex; align-items: center; justify-content: center; gap: clamp(18px, 3vw, 40px);
  flex-wrap: wrap; max-width: 1100px; margin: 0 auto 22px; text-align: left;
}
.pv-titlezone img {
  width: clamp(140px, 18vw, 220px); height: auto;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 22px rgba(255, 207, 136, 0.14));
}
.pv-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);
}
.pv-titlezone .pv-sub {
  margin: 6px 0 0; font-family: var(--f-arc); font-style: italic;
  color: #ab9fc4; font-size: 1.02rem;
}

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

#pv-room { max-width: 1180px; margin: 0 auto; }

/* ── THE TABLE: thirty-one cards, face up ───────────────────────── */
.pv-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
}
.pv-card {
  --accent: var(--arc);
  position: relative; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 18px 16px; border: 1px solid var(--arc-line); border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%),
    var(--panel);
  color: #e8e2f4; font: inherit;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}
.pv-card::before {                       /* the discipline's edge */
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
  border-radius: 12px 0 0 12px; background: var(--accent);
}
.pv-card:hover, .pv-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55), 0 0 26px -6px var(--accent);
  outline: none;
}
.pv-card .pv-emoji { font-size: 1.5rem; line-height: 1; }
.pv-card h3 {
  margin: 0; font-family: var(--f-arc); font-weight: 400;
  font-size: 1.16rem; color: #f4f0fb; letter-spacing: 0.02em;
}
.pv-card .pv-class { font-family: var(--f-arc); font-style: italic; font-size: 0.9rem; color: var(--accent); }
.pv-card .pv-line { font-size: 0.82rem; color: #a99fc0; line-height: 1.5; }
.pv-card .pv-foot {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  font-family: var(--f-ui); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: #8f86a8;
}
.pv-card .pv-n { color: var(--accent); font-weight: 700; }

/* the tier ribbon: how many effects sit at each tier, at a glance */
.pv-ribbon { display: flex; gap: 3px; align-items: flex-end; height: 20px; }
.pv-ribbon i {
  flex: 1 1 0; min-width: 3px; border-radius: 2px 2px 0 0;
  background: var(--accent); opacity: 0.85;
}
.pv-ribbon i.zero { background: rgba(255, 255, 255, 0.12); height: 2px !important; }

.pv-badge {
  position: absolute; top: 12px; right: 12px;
  font-family: var(--f-ui); font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: #ffcf88; border: 1px solid var(--gold-soft); border-radius: 999px;
  padding: 2px 9px; background: rgba(10, 9, 22, 0.6);
}
.pv-badge.new { color: var(--teal-hi); border-color: var(--teal-line); }

/* ── THE CHOSEN CARD: one, standing alone ──────────────────────── */
.pv-one {
  --accent: var(--arc);
  border: 1px solid var(--accent); border-radius: 14px; overflow: hidden;
  background: var(--panel);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.65), 0 0 60px -20px var(--accent);
}
.pv-one-head {
  padding: clamp(18px, 3vw, 30px); border-bottom: 1px solid var(--arc-line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent);
}
.pv-one-head h3 {
  margin: 0; font-family: var(--f-arc); font-weight: 400;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem); color: #f6f2fc;
}
.pv-one-head .pv-class { font-family: var(--f-arc); font-style: italic; color: var(--accent); font-size: 1.05rem; }
.pv-back {
  cursor: pointer; margin-bottom: 14px;
  font-family: var(--f-ui); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--arc-hi); background: transparent;
  border: 1px solid var(--arc-soft); border-radius: 4px; padding: 10px 18px;
}
.pv-back:hover { border-color: var(--arc); color: #f2ecfa; box-shadow: 0 0 18px var(--arc-glow); }

.pv-body { padding: clamp(18px, 3vw, 30px); }
.pv-body h4 {
  margin: 26px 0 10px; font-family: var(--f-arc); font-weight: 400;
  font-size: 1.22rem; color: var(--accent); letter-spacing: 0.03em;
}
.pv-body h4:first-child { margin-top: 0; }
.pv-over { font-family: var(--f-arc); font-size: 1.04rem; line-height: 1.75; color: #d9d2e8; margin: 0 0 18px; }

/* meta strip */
.pv-facts { display: grid; gap: 1px; background: var(--arc-line); border-radius: 8px; overflow: hidden; }
.pv-facts div { display: flex; gap: 12px; padding: 10px 14px; background: rgba(8, 14, 22, 0.7); }
.pv-facts dt {
  flex: 0 0 clamp(96px, 22%, 168px); margin: 0;
  font-family: var(--f-ui); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: #8f86a8;
}
.pv-facts dd { margin: 0; font-size: 0.94rem; color: #e2dcf0; }

/* mastery ladder */
.pv-ladder { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.pv-ladder th {
  text-align: left; padding: 9px 12px; color: #060a10; background: var(--accent);
  font-family: var(--f-ui); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.pv-ladder td { padding: 10px 12px; border-top: 1px solid var(--arc-line); color: #ddd6ec; vertical-align: top; }
.pv-ladder tr:nth-child(even) td { background: rgba(255, 255, 255, 0.025); }
.pv-ladder td.r { font-weight: 700; color: var(--accent); white-space: nowrap; }
.pv-ladder td.x { color: #a99fc0; white-space: nowrap; }
.pv-proposed {
  font-family: var(--f-arc); font-style: italic; font-size: 0.9rem;
  color: #ffcf88; margin: 0 0 10px;
}

/* abilities */
.pv-ab { border-left: 3px solid var(--accent); padding: 2px 0 2px 14px; margin: 0 0 14px; }
.pv-ab b { color: #f0eaf8; }
.pv-ab .k { font-family: var(--f-arc); font-style: italic; color: #a99fc0; font-size: 0.88rem; margin-left: 6px; }
.pv-ab ul { margin: 6px 0 0; padding-left: 18px; }
.pv-ab li { color: #c9c1da; font-size: 0.9rem; line-height: 1.55; margin: 0 0 3px; }

/* effects, folded by tier */
.pv-tier { border: 1px solid var(--arc-line); border-radius: 10px; margin: 0 0 8px; background: rgba(8, 14, 22, 0.55); }
.pv-tier > summary {
  cursor: pointer; padding: 12px 16px; list-style: none;
  font-family: var(--f-ui); font-size: 0.76rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: #f0eaf8;
}
.pv-tier > summary::-webkit-details-marker { display: none; }
.pv-tier > summary::before { content: "▸ "; color: var(--accent); }
.pv-tier[open] > summary::before { content: "▾ "; }
.pv-tier > summary .ct {
  float: right; font-size: 0.7rem; color: var(--accent);
  border: 1px solid var(--arc-line); border-radius: 999px; padding: 1px 9px;
}
.pv-spell { padding: 12px 16px; border-top: 1px solid rgba(183, 154, 224, 0.12); }
.pv-spell h5 { margin: 0 0 3px; font-size: 1rem; color: #ffe3ae; font-weight: 700; }
.pv-spell .m { font-size: 0.78rem; color: #9d92b8; margin: 0 0 5px; }
.pv-spell .e { font-family: var(--f-arc); font-size: 0.96rem; line-height: 1.6; color: #cdc5de; margin: 0 0 6px; }
.pv-spell ul { margin: 0 0 6px; padding-left: 18px; }
.pv-spell li { font-size: 0.86rem; color: #b3aac6; line-height: 1.5; }
.pv-spell .t span {
  display: inline-block; margin: 0 5px 4px 0; padding: 1px 10px;
  font-size: 0.72rem; color: var(--accent);
  border: 1px solid var(--arc-line); border-radius: 999px;
}
.pv-cap { color: var(--gold) !important; }

.pv-none { font-family: var(--f-arc); font-style: italic; color: #9d92b8; padding: 14px 4px; }

@media (max-width: 620px) {
  .pv-grid { grid-template-columns: 1fr; }
  .pv-facts dt { flex-basis: 100%; }
  .pv-facts div { flex-wrap: wrap; gap: 4px; }
  .pv-ladder td.x { display: none; }
  .pv-ladder th:nth-child(2) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pv-card { transition: none; }
  .pv-card:hover { transform: none; }
}

/* No-JS chain — also the print truth */
#pv-fallback { max-width: 980px; margin: 0 auto; }
.fp-path {
  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;
}
.fp-path summary { cursor: pointer; padding: 14px 0; font-weight: 700; color: #f0eaf8; }
.fp-path 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;
}
.fp-meta { font-size: 0.82rem; color: #ab9fc4; margin: 0 0 8px; }
.fp-over { font-family: var(--f-arc); line-height: 1.6; color: #c9bfdd; margin: 0 0 10px; }
.fp-rank { font-size: 0.86rem; color: #c9bfdd; margin: 0 0 4px; }
.fp-rank b { color: #ffe3ae; }
.fp-spell { border-top: 1px solid rgba(183, 154, 224, 0.12); padding: 10px 0; }
.fp-spell h4 { margin: 0 0 3px; color: #ffe3ae; font-size: 0.98rem; }
.fp-spell h4 em { font-weight: 400; font-size: 0.8rem; color: #9d92b8; margin-left: 8px; }
.fp-spell p { margin: 0 0 5px; font-family: var(--f-arc); line-height: 1.55; color: #c9bfdd; font-size: 0.94rem; }

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