:root {
  --bg: #100c0a;
  --bg-2: #1a1410;
  --card: #241c17;
  --card-2: #2c221c;
  --ink: #f6f0e6;
  --muted: #cbb89f;
  --gold: #e4bc6a;
  --gold-soft: rgba(228, 188, 106, 0.22);
  --line: rgba(228, 188, 106, 0.28);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, #4a3428 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(80, 50, 30, 0.35), transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif;
  line-height: 1.7;
}

a { color: var(--gold); }

img { max-width: 100%; height: auto; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: #fff;
  color: #1a120c;
  padding: 0.5rem 0.8rem;
}
.skip:focus { top: 1rem; }

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(16, 12, 10, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-family: "Shippori Mincho", serif;
  letter-spacing: 0.12em;
}

.play {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #f0c36a, #d3923a);
  color: #24180f;
  text-decoration: none;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 244, 214, 0.55);
}

.nav {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 14, 12, 0.72);
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.nav a:hover { color: var(--ink); border-color: var(--line); }
.nav a[aria-current="page"] {
  color: #24180f;
  background: var(--gold);
  border-color: var(--gold);
  font-weight: 700;
}

.wrap {
  width: min(72rem, calc(100% - 2rem));
  margin: 0 auto;
  padding-bottom: 3.5rem;
}

.crumbs {
  padding: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.crumbs ol {
  display: flex;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

h1, h2, h3 {
  font-family: "Shippori Mincho", serif;
  font-weight: 500;
  line-height: 1.35;
}
h1 {
  font-size: clamp(1.85rem, 4vw, 2.7rem);
  margin: 0.55rem 0 0.35rem;
}
h2 { font-size: 1.35rem; margin: 0 0 0.35rem; }

.lead {
  color: var(--muted);
  max-width: 36rem;
  font-size: 1.02rem;
  margin: 0 0 1.2rem;
}

/* Hero portal */
.hero-portal {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  min-height: clamp(14rem, 42vw, 22rem);
  margin: 0.8rem 0 1.4rem;
  box-shadow: var(--shadow);
  background: #0c0908;
}
.hero-portal img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
.hero-portal::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 8, 6, 0.88) 0%, rgba(10, 8, 6, 0.45) 48%, rgba(10, 8, 6, 0.2) 100%),
    linear-gradient(0deg, rgba(10, 8, 6, 0.75), transparent 45%);
}
.hero-portal-copy {
  position: relative;
  z-index: 1;
  max-width: 28rem;
  padding: clamp(1.2rem, 4vw, 2.2rem);
}
.hero-portal-copy h1 { margin-top: 0; }
.hero-portal-copy p { color: #efe4d4; margin: 0.35rem 0 1rem; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.hero-actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}
.hero-actions .primary {
  background: linear-gradient(180deg, #f0c36a, #d3923a);
  color: #24180f;
}
.hero-actions .ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(20, 14, 10, 0.45);
}

/* Cards */
.cards, .mons, .heroes, .bands, .tile-grid {
  display: grid;
  gap: 0.85rem;
}
.cards {
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  margin-top: 0.4rem;
}
.card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: 0;
  color: inherit;
  text-decoration: none;
  display: grid;
  grid-template-rows: 7.5rem auto;
  min-height: 11.5rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(228, 188, 106, 0.55);
}
.card-art {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 30%, var(--gold-soft), transparent 60%),
    #15100d;
  border-bottom: 1px solid var(--line);
}
.card-art img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  image-rendering: pixelated;
}
.card-body { padding: 0.85rem 0.95rem 1rem; }
.card strong {
  display: block;
  font-family: "Shippori Mincho", serif;
  font-size: 1.12rem;
  margin-bottom: 0.2rem;
}
.card span, .note { color: var(--muted); font-size: 0.92rem; }

/* Visual story blocks */
.viz {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) 1fr;
  gap: 1rem;
  align-items: center;
  margin: 0.85rem 0;
  padding: 0.95rem 1rem;
  background: linear-gradient(145deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}
.viz-media {
  display: grid;
  place-items: center;
  min-height: 7.5rem;
  padding: 0.6rem;
  border-radius: 0.9rem;
  background:
    radial-gradient(circle at 50% 40%, var(--gold-soft), transparent 65%),
    #120e0b;
  border: 1px solid var(--line);
}
.viz-media img {
  width: min(100%, 120px);
  height: 110px;
  object-fit: contain;
  image-rendering: pixelated;
}
.viz-media.wide img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  image-rendering: auto;
  border-radius: 0.55rem;
}
.viz-copy h2 { margin-top: 0; }
.viz-copy p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  max-width: 38rem;
}
.viz-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(16, 12, 10, 0.45);
  color: var(--ink);
  font-size: 0.88rem;
}
.chip img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  image-rendering: pixelated;
}

.sheet {
  margin: 1rem 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  padding: 1rem 1.05rem;
}
.sheet h2 { margin-top: 0; }
.sheet h3 {
  margin: 1.1rem 0 0.55rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
}
.sheet > p:last-child { margin-bottom: 0; }
.sheet ol, .sheet ul {
  margin: 0.55rem 0 0;
  padding-left: 1.25rem;
}
.sheet li { margin: 0.45rem 0; }
.sheet li > strong {
  display: block;
  margin: 0 0 0.25rem;
}
.sheet li > .note { margin: 0.35rem 0 0.15rem; }
.sheet li > p,
.viz-copy > p {
  margin: 0.35rem 0;
}
.sheet li > p:first-of-type,
.viz-copy > h2 + p {
  margin-top: 0.2rem;
}

.lead + .lead,
p.lead + p.lead {
  margin-top: 0.35rem;
}

.tile-grid {
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  margin: 0.9rem 0 0.2rem;
}
.tile {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  text-align: center;
  padding: 0.85rem 0.6rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: #1b1512;
  color: inherit;
  text-decoration: none;
}
.tile img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  image-rendering: pixelated;
}
.tile strong {
  font-family: "Shippori Mincho", serif;
  font-weight: 500;
}
.tile span { color: var(--muted); font-size: 0.85rem; }

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--gold);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  margin: 0.55rem 0 0;
}
.page-kicker img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  image-rendering: pixelated;
}

html:has(body.page-stage) {
  overscroll-behavior: none;
}
body.page-stage {
  min-height: 100dvh;
  overflow-x: clip;
  overscroll-behavior: none;
  display: flex;
  flex-direction: column;
}
body.page-stage .bar,
body.page-stage .nav {
  flex: 0 0 auto;
}
.wrap-stage {
  width: min(78rem, calc(100% - 1.5rem));
  padding-bottom: 0.55rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.wrap-stage .crumbs {
  padding: 0.35rem 0 0;
  flex: 0 0 auto;
}
.hero-stage {
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: minmax(14rem, 1fr) auto;
  gap: 0.65rem;
  min-height: 0;
  margin-top: 0.2rem;
}
.hero-stage-main {
  display: grid;
  grid-template-columns: minmax(16rem, 1.05fr) minmax(16rem, 0.95fr);
  gap: 1rem 1.25rem;
  min-height: 14rem;
  align-items: stretch;
}
.hero-stage-art {
  display: grid;
  place-items: end center;
  min-height: 14rem;
  overflow: hidden;
  padding: 0.6rem 0.6rem 0;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at 50% 18%, var(--gold-soft), transparent 52%),
    linear-gradient(180deg, #2a2018 0%, #15100c 62%, #0e0a08 100%);
  box-shadow: var(--shadow);
}
.hero-stage-art img {
  width: min(100%, 34rem);
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: bottom center;
  image-rendering: auto;
}
.hero-stage-info {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--card);
  padding: 1.05rem 1.15rem 1.2rem;
  display: flex;
  align-items: center;
}

/* 十分な画面だけ FV 固定。狭い／低い画面は切らずページスクロール */
@media (min-width: 901px) and (min-height: 740px) {
  html:has(body.page-stage) {
    height: 100%;
    overflow: hidden;
  }
  body.page-stage {
    height: 100dvh;
    overflow: hidden;
  }
  .wrap-stage,
  .hero-stage,
  .hero-stage-main {
    overflow: hidden;
    min-height: 0;
  }
  .hero-stage-art {
    min-height: 0;
  }
}
.hero-panel[hidden] { display: none; }
.hero-panel {
  width: 100%;
}
.hero-panel h2 {
  margin: 0.15rem 0 0.55rem;
  font-size: clamp(1.7rem, 3.2vw, 2.35rem);
}
.hero-panel .job {
  margin: 0;
  color: var(--gold);
  letter-spacing: 0.06em;
}
.hero-panel .lead {
  margin: 0 0 1.15rem;
  max-width: none;
}
.hero-openers {
  display: grid;
  gap: 0.55rem;
}
.hero-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.95rem;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  background: #1b1512;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: left;
}
.hero-open::after {
  content: "›";
  color: var(--gold);
  font-size: 1.2rem;
  line-height: 1;
}
.hero-open:hover {
  border-color: rgba(228, 188, 106, 0.55);
  background: #241c17;
}
.hero-dialog {
  width: min(36rem, calc(100vw - 1.5rem));
  max-height: min(78dvh, 40rem);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: #1a1410;
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-dialog::backdrop {
  background: rgba(8, 5, 4, 0.72);
}
.hero-dialog-frame {
  display: flex;
  flex-direction: column;
  max-height: min(78dvh, 40rem);
  overflow: hidden;
}
.hero-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.hero-dialog-head h2 {
  margin: 0;
  font-size: 1.15rem;
}
.hero-dialog-close {
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1.4rem;
  cursor: pointer;
}
.hero-dialog-close:hover { color: var(--ink); }
.hero-dialog-body {
  padding: 0.85rem 1rem 1.1rem;
  overflow: auto;
  overscroll-behavior: contain;
}
.hero-dialog-body .scale {
  margin: 0;
}
.hero-modal-level {
  margin: 0 0 1rem;
}
.hero-modal-level:last-child { margin-bottom: 0; }
.hero-modal-level h4 {
  margin: 0 0 0.45rem;
  color: var(--gold);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}
.hero-modal-level ul,
.hero-trait-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.hero-skill-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0.7rem;
  align-items: center;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: #221a15;
}
.hero-skill-row img {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  image-rendering: auto;
  background: #100c0a;
  border-radius: 0.65rem;
}
.hero-skill-row strong,
.hero-trait-row strong {
  display: block;
  margin: 0 0 0.2rem;
}
.hero-skill-row p,
.hero-trait-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}
.hero-trait-row {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: #221a15;
}
.hero-stage-picks {
  display: flex;
  gap: 0.45rem;
  justify-content: stretch;
  overflow-x: auto;
  padding: 0.15rem 0 0.25rem;
  scrollbar-width: thin;
}
.hero-pick {
  flex: 1 1 0;
  min-width: 4.4rem;
  display: grid;
  justify-items: center;
  gap: 0.28rem;
  padding: 0.45rem 0.3rem 0.5rem;
  border-radius: 0.95rem;
  border: 1px solid var(--line);
  background: #1b1512;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}
.hero-pick img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: pixelated;
}
.hero-pick span {
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
}
.hero-pick:hover {
  color: var(--ink);
  border-color: rgba(228, 188, 106, 0.5);
}
.hero-pick[aria-current="true"] {
  color: #24180f;
  background: linear-gradient(180deg, #f0c36a, #d3923a);
  border-color: transparent;
  font-weight: 700;
}

.search { margin: 1rem 0 0.4rem; }
.search input {
  width: min(28rem, 100%);
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #1b1512;
  color: var(--ink);
  padding: 0.4rem 1rem;
  font: inherit;
}

.hits { list-style: none; padding: 0; margin: 0.4rem 0 1rem; }
.hits li { margin: 0.2rem 0; }
.hits .empty { color: var(--muted); }

.band-groups { display: grid; gap: 1rem; margin: 1rem 0 2rem; }
.band-groups h2 { margin-bottom: 0.4rem; }
.bands { grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); }
.band-link {
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.55rem 0.7rem;
}

.bosses, .dex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.75rem;
}
.boss, .dex-card {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 0.75rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.boss img, .dex-card img, .mon img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  image-rendering: pixelated;
  background: #100c0a;
  border-radius: 0.85rem;
  border: 1px solid var(--line);
}
.dex-card, .mon, .boss {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.05rem;
  padding: 0.75rem 0.85rem;
  min-height: 44px;
}
.dex-card.is-boss, .mon.is-boss { border-color: var(--gold); }
.dex-card strong, .mon h2, .boss strong {
  display: block;
  font-family: "Shippori Mincho", serif;
  font-weight: 500;
}
.dex-card p, .mon p, .boss p {
  margin: 0.15rem 0 0;
  color: var(--muted);
}

.rank-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.4rem 0 1.4rem;
}
.rank-jump a, .rank-jump button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.rank-jump button[aria-pressed="true"] {
  color: #24180f;
  background: var(--gold);
  border-color: var(--gold);
}
.rank-block { margin: 1.6rem 0 2rem; }
.rank-block h2 { scroll-margin-top: 4.5rem; }

.detail {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.1rem;
  align-items: center;
  margin: 0.5rem 0 1.1rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
}
.detail img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  image-rendering: pixelated;
  background: #100c0a;
  border-radius: 1rem;
  border: 1px solid var(--line);
}
.detail h1 { margin-top: 0; }

.dex-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.6rem;
  margin: 0.8rem 0 0.4rem;
  scroll-margin-top: 4.5rem;
}
.dex-tools label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.dex-tools input, .dex-tools select {
  width: 100%;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #1b1512;
  color: var(--ink);
  padding: 0.4rem 0.9rem;
  font: inherit;
}

.place {
  font-family: "Shippori Mincho", serif;
  font-size: 1.45rem;
  margin: 0.2rem 0;
}
.resist, .scale { width: 100%; border-collapse: collapse; }
.resist { table-layout: fixed; }
.resist th:first-child,
.resist td:first-child { width: 42%; }
.resist th:last-child,
.resist td:last-child { width: 58%; }
.resist th, .resist td, .scale th, .scale td {
  text-align: left;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--line);
}
.resist thead th, .scale thead th { color: var(--muted); font-weight: 500; }
.resist .g-weak th, .resist .g-weak td { color: #f3b4a4; }
.resist .g-absorb th, .resist .g-absorb td { color: #9fd8c8; }
.resist .g-immune th, .resist .g-immune td { color: #9a8f84; }

.skill-names {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.learn { width: auto; max-width: 100%; }
.learn th:first-child { width: 4.5rem; white-space: nowrap; }
.skill-names li { position: relative; }
.skill-tip {
  position: relative;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.skill-tip .tip {
  position: absolute;
  z-index: 6;
  top: calc(100% + 0.45rem);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(18rem, calc(100vw - 2rem));
  padding: 0.45rem 0.75rem;
  border-radius: 0.7rem;
  border: 1px solid var(--line);
  background: #2a211b;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.55;
  text-align: left;
  white-space: normal;
  box-shadow: 0 0.6rem 1.4rem rgba(0, 0, 0, 0.35);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.skill-tip:hover .tip,
.skill-tip:focus-visible .tip,
.skill-tip[aria-expanded="true"] .tip {
  visibility: visible;
  opacity: 1;
}
.trait { margin: 0.9rem 0 0; }
.trait b {
  display: block;
  font-family: "Shippori Mincho", serif;
  font-weight: 500;
}

.trees { display: grid; gap: 1.4rem; }
.pedigree { margin: 0; }
.pedigree figcaption { color: var(--muted); margin-bottom: 0.35rem; }
.ped-child, .ped-node {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: #1b1512;
  text-align: center;
  padding: 0.45rem 0.7rem;
}
.ped-child { width: fit-content; margin: 0 auto; }
.ped-child strong, .ped-node strong {
  display: block;
  font-family: "Shippori Mincho", serif;
  font-weight: 500;
}
.ped-stem {
  width: 1px;
  height: 0.85rem;
  margin: 0 auto;
  background: var(--gold);
  opacity: 0.65;
}
.ped-parents {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(36rem, 100%);
  margin: 0 auto;
  position: relative;
  padding-top: 0.85rem;
  gap: 0.8rem;
}
.ped-parents::before {
  content: "";
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 1px;
  background: var(--gold);
  opacity: 0.65;
}
.ped-gen1 {
  width: min(44rem, 100%);
  align-items: start;
}
.ped-branch {
  display: grid;
  justify-items: center;
  gap: 0;
  position: relative;
}
.ped-branch > .ped-node {
  width: min(100%, 12rem);
}
.ped-gen2 {
  width: 100%;
  min-width: 0;
}
.ped-gen2::before {
  left: 25%;
  right: 25%;
}
.ped-any {
  border-style: dashed;
  color: var(--muted);
}
.ped-node { position: relative; }
a.ped-node { color: inherit; text-decoration: none; display: block; }
.ped-parents > .ped-node::before,
.ped-parents > a.ped-node::before,
.ped-parents > .ped-branch::before,
.ped-gen2 > .ped-node::before,
.ped-gen2 > a.ped-node::before {
  content: "";
  position: absolute;
  top: -0.85rem;
  left: 50%;
  width: 1px;
  height: 0.85rem;
  background: var(--gold);
  opacity: 0.65;
}
.ped-role { display: block; color: var(--muted); font-size: 0.8rem; }
.ped-many ul { list-style: none; padding: 0; margin: 0.15rem 0; }
.ped-node img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  image-rendering: pixelated;
  background: #100c0a;
  border-radius: 0.5rem;
}
@media (min-width: 860px) {
  .trees.two { grid-template-columns: 1fr 1fr; }
}

.mons {
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  margin-top: 1rem;
}
.mon {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 0.75rem;
  align-items: center;
}
.tag { color: var(--gold); font-size: 0.85rem; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.4rem;
}
.pager a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.4rem 0 0;
  margin-top: 2rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .hero-stage {
    grid-template-rows: auto auto;
  }
  .hero-stage-main {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(11rem, 34dvh) auto;
    min-height: 0;
  }
  .hero-stage-art {
    min-height: 11rem;
  }
  .hero-stage-info {
    align-items: stretch;
    overflow: visible;
  }
  .hero-panel .lead {
    margin-bottom: 0.9rem;
  }
}

@media (max-width: 720px) {
  .viz { grid-template-columns: 1fr; }
  .viz-media { min-height: 6.5rem; }
  .boss, .detail, .mon, .dex-card { grid-template-columns: 72px 1fr; }
  .detail img { width: 96px; height: 96px; }
  .detail { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .card { grid-template-rows: 6.5rem auto; }
  .hero-pick {
    min-width: 3.8rem;
    padding: 0.35rem 0.2rem 0.4rem;
  }
  .hero-pick img {
    width: 40px;
    height: 40px;
  }
  .hero-pick span { font-size: 0.65rem; }
  .hero-skill-row {
    grid-template-columns: 3rem 1fr;
  }
  .hero-panel h2 {
    font-size: clamp(1.45rem, 7vw, 2rem);
  }
  .hero-dialog {
    width: min(36rem, calc(100vw - 1rem));
    max-height: min(84dvh, 40rem);
  }
  .hero-dialog-frame {
    max-height: min(84dvh, 40rem);
  }
}
