:root {
  --ink: #201a14;
  --muted-ink: #665846;
  --night: #07111c;
  --night-2: #0c1e2e;
  --night-3: #142d40;
  --parchment: #f2dfb6;
  --parchment-light: #fff6df;
  --parchment-deep: #d7b77b;
  --gold: #d7a63b;
  --gold-bright: #f0c96a;
  --gold-dark: #7a4f16;
  --red: #7b241f;
  --blue: #12335b;
  --line: rgba(88, 55, 20, .28);
  --shadow: 0 18px 50px rgba(0, 0, 0, .25);
  --radius: 18px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 126px;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 4%, rgba(45, 103, 139, .2), transparent 28rem),
    radial-gradient(circle at 88% 28%, rgba(122, 36, 31, .12), transparent 30rem),
    linear-gradient(180deg, var(--night) 0, #091724 50%, #060d15 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, summary { font: inherit; }
img { display: block; max-width: 100%; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  transform: translateY(-160%);
  padding: 8px 14px;
  color: #111;
  background: #fff;
  border-radius: 8px;
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  color: #f9ecd1;
  background: rgba(7, 17, 28, .94);
  border-bottom: 1px solid rgba(215, 166, 59, .4);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .22);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(1120px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-die {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--gold-bright);
  border: 1px solid rgba(240, 201, 106, .72);
  transform: rotate(45deg);
}

.brand-die i {
  display: block;
  transform: rotate(-45deg);
  font-size: .55rem;
  font-style: normal;
}

.brand small {
  display: block;
  color: #a9b8c4;
  font-size: .68rem;
  line-height: 1.2;
  letter-spacing: .12em;
}

.brand strong {
  display: block;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .05em;
}

.draft-label {
  padding: 3px 10px;
  color: var(--gold-bright);
  border: 1px solid rgba(215, 166, 59, .55);
  border-radius: 999px;
  font-size: .75rem;
  letter-spacing: .08em;
}

.jump-nav {
  display: flex;
  gap: 4px;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0 16px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.jump-nav::-webkit-scrollbar { display: none; }

.jump-nav a {
  flex: 0 0 auto;
  padding: 4px 11px;
  color: #bdc9d1;
  border-radius: 999px;
  font-size: .79rem;
  text-decoration: none;
  transition: color .2s ease, background .2s ease;
}

.jump-nav a:hover,
.jump-nav a:focus-visible,
.jump-nav a.is-active {
  color: #0b1722;
  background: var(--gold-bright);
  outline: none;
}

main { overflow: clip; }

.hero {
  width: min(1120px, calc(100% - 32px));
  min-height: 600px;
  margin: 0 auto;
  padding: 64px 0 70px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(310px, .8fr);
  align-items: center;
  gap: clamp(34px, 7vw, 92px);
  color: #fff9ec;
}

.hero-copy { position: relative; z-index: 1; }

.eyebrow,
.kicker {
  margin: 0 0 8px;
  color: var(--gold-bright);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(2.55rem, 6vw, 5.2rem);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: .015em;
  text-shadow: 0 6px 26px rgba(0, 0, 0, .5);
}

.hero-lead {
  max-width: 640px;
  margin: 24px 0 0;
  color: #d6e0e6;
  font-size: 1.08rem;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  min-height: 48px;
  padding: 10px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
}

.button-primary {
  color: #211407;
  background: linear-gradient(135deg, #f5d77d, #c98b27);
  box-shadow: 0 10px 24px rgba(207, 147, 43, .22);
}

.button-ghost {
  color: #f9ecd1;
  border: 1px solid rgba(249, 236, 209, .32);
  background: rgba(255, 255, 255, .04);
}

.button:hover { filter: brightness(1.08); }
.button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 34px 0 0;
}

.hero-facts div {
  min-width: 108px;
  padding: 8px 14px;
  border-left: 2px solid var(--gold);
  background: rgba(255, 255, 255, .04);
}

.hero-facts dt { color: #9fb0bc; font-size: .75rem; }
.hero-facts dd { margin: 0; color: #fff; font-weight: 800; }

.dragon-card {
  position: relative;
  margin: 0;
  border: 1px solid rgba(240, 201, 106, .75);
  border-radius: 4px;
  background: #050b10;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .56), 0 0 60px rgba(22, 91, 141, .18);
  transform: rotate(1.1deg);
}

.dragon-card::before,
.dragon-card::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 8px;
  pointer-events: none;
  border: 1px solid rgba(240, 201, 106, .42);
}

.dragon-card::after {
  inset: -14px;
  z-index: -1;
  border-color: rgba(89, 166, 213, .12);
}

.dragon-card img {
  width: 100%;
  aspect-ratio: 2 / 2.86;
  object-fit: cover;
}

.dragon-card figcaption {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  padding: 10px 12px;
  color: #fff4dd;
  background: rgba(3, 9, 14, .78);
  border-left: 2px solid var(--gold);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: .9rem;
  backdrop-filter: blur(8px);
}

.dragon-card figcaption span {
  display: block;
  color: var(--gold-bright);
  font-family: inherit;
  font-size: .63rem;
  font-weight: 800;
  letter-spacing: .16em;
}

.section {
  position: relative;
  width: min(1060px, calc(100% - 32px));
  margin: 0 auto 30px;
  padding: clamp(30px, 6vw, 64px);
  scroll-margin-top: 126px;
  background:
    linear-gradient(rgba(255, 255, 255, .2), rgba(255, 255, 255, 0)),
    radial-gradient(circle at 82% 2%, rgba(255, 255, 255, .48), transparent 18rem),
    var(--parchment);
  border: 1px solid var(--parchment-deep);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section::before {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  border: 1px solid rgba(122, 79, 22, .35);
  border-radius: calc(var(--radius) - 6px);
}

.section-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 30px;
}

.section-number {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: var(--gold-bright);
  background: var(--night-2);
  border: 1px solid var(--gold-dark);
  transform: rotate(45deg);
  font-family: Georgia, serif;
  font-size: .82rem;
  font-weight: 700;
}

.section-number i {
  display: block;
  transform: rotate(-45deg);
  font-style: normal;
}

.section-heading > div { min-width: 0; }
.section-heading .kicker { margin-bottom: 0; color: var(--red); }

.section-heading h2 {
  margin: 0;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(1.65rem, 4vw, 2.55rem);
  line-height: 1.35;
  letter-spacing: .035em;
}

.compact-heading { margin-bottom: 22px; }

.goal-banner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 17px;
  margin-bottom: 24px;
  padding: 18px 20px;
  color: #fff7e6;
  background: linear-gradient(135deg, #611c19, #30100f);
  border: 1px solid #b07031;
  border-radius: 14px;
}

.goal-banner p { margin: 2px 0 0; color: #ead4b5; }
.goal-icon { color: var(--gold-bright); font-size: 2rem; }

.flow-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-grid li {
  min-height: 178px;
  padding: 16px;
  background: rgba(255, 249, 233, .68);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.flow-grid li > span {
  width: 31px;
  height: 31px;
  display: grid;
  margin-bottom: 12px;
  place-items: center;
  color: #fff;
  background: var(--red);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: .84rem;
}

.flow-grid strong { display: block; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; }
.flow-grid p { margin: 6px 0 0; color: var(--muted-ink); font-size: .91rem; line-height: 1.65; }

.turn-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 9px;
  margin: 22px 0;
  padding: 17px;
  color: #edf4f8;
  background: var(--night-2);
  border-radius: 14px;
}

.turn-strip div { text-align: center; }
.turn-strip span { display: block; color: var(--gold-bright); font-size: .72rem; }
.turn-strip strong { font-size: .92rem; }
.turn-strip i { color: var(--gold); font-size: 1.5rem; font-style: normal; }

.choice-grid,
.two-column,
.event-grid,
.dungeon-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.rule-card {
  padding: 22px;
  background: rgba(255, 250, 237, .68);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.rule-card h3 { margin: 2px 0 8px; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: 1.22rem; }
.rule-card p { margin: 0; color: #514536; }
.rule-card p + p, .rule-card ul + p, .rule-card ol + p { margin-top: 11px; }
.card-label { color: var(--red) !important; font-size: .75rem; font-weight: 800; letter-spacing: .12em; }
.terrain-card { border-top: 4px solid #47805e; }
.battle-card { border-top: 4px solid var(--red); }
.victory-card { border-top: 4px solid #9b7225; }
.defeat-card { border-top: 4px solid #343c46; }
.wide-card { grid-column: 1 / -1; }

.formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 12px 0 !important;
}

.formula span,
.formula em {
  padding: 4px 9px;
  border-radius: 7px;
  background: rgba(117, 67, 25, .1);
  font-style: normal;
  font-weight: 800;
}

.formula em { color: #fff; background: var(--red); }

.story-section {
  color: #f5ead3;
  background:
    linear-gradient(rgba(7, 17, 28, .87), rgba(7, 17, 28, .94)),
    url("assets/dragon.webp") center 44% / cover;
  border-color: #8a6324;
}

.story-section::before { border-color: rgba(240, 201, 106, .38); }
.story-section .section-heading .kicker { color: var(--gold-bright); }
.story-copy { max-width: 760px; margin-left: auto; padding: 6px 0 0; }
.story-copy p { color: #d9e1e5; }
.story-close { color: #fff0c7 !important; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: 1.18rem; text-align: right; }

.rules-stack { position: relative; z-index: 1; display: grid; gap: 12px; }

.rule-panel {
  overflow: hidden;
  background: rgba(255, 250, 237, .62);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.rule-panel summary,
.talent-card summary,
.epilogue-panel summary {
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.rule-panel summary::-webkit-details-marker,
.talent-card summary::-webkit-details-marker,
.epilogue-panel summary::-webkit-details-marker { display: none; }

.rule-panel summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font-weight: 800;
}

.rule-panel summary > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff6e1;
  background: var(--red);
  border-radius: 7px;
  font-family: Georgia, serif;
}

.rule-panel summary::after,
.talent-card summary::after {
  content: "+";
  margin-left: auto;
  color: var(--red);
  font-size: 1.35rem;
  font-weight: 500;
}

.rule-panel[open] summary::after,
.talent-card[open] summary::after { content: "−"; }

.panel-body {
  padding: 0 18px 18px 58px;
  border-top: 1px solid rgba(99, 62, 24, .12);
}

.panel-body > :first-child { margin-top: 16px; }
.panel-body > :last-child { margin-bottom: 0; }
.panel-body ul, .panel-body ol { padding-left: 1.25rem; }

.dice-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.dice-row div {
  padding: 13px;
  text-align: center;
  background: rgba(12, 30, 46, .92);
  border: 1px solid #a27b36;
  border-radius: 11px;
}

.dice-row b { display: block; color: var(--gold-bright); font-family: Georgia, serif; font-size: 1.5rem; }
.dice-row span { display: block; color: #fff; font-weight: 800; }
.dice-row small { display: block; color: #b8c4cb; font-size: .72rem; }

.note {
  position: relative;
  z-index: 1;
  color: var(--muted-ink);
  font-size: .86rem;
}

.number-list { margin: 0; padding: 0; list-style: none; }
.number-list li { display: grid; grid-template-columns: 142px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.number-list li:last-child { border-bottom: 0; }
.number-list b { color: #66231e; }
.number-list span { color: #554839; }
.number-list.large li { grid-template-columns: 150px 1fr; }

.subheading {
  position: relative;
  z-index: 1;
  margin: 30px 0 14px;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 1.25rem;
}

.terrain-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.terrain-grid article {
  padding: 16px;
  text-align: center;
  background: rgba(255, 250, 237, .68);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.terrain-grid h4 { margin: 7px 0 2px; }
.terrain-grid p { margin: 0; color: var(--muted-ink); font-size: .84rem; }
.terrain-grid small { display: block; margin-top: 7px; font-weight: 800; }

.terrain-icon {
  width: 42px;
  height: 42px;
  display: block;
  margin: auto;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .22);
}

.info-pair {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.info-pair div { padding: 14px 16px; background: rgba(88, 56, 24, .08); border-radius: 10px; }
.info-pair p { margin: 2px 0 0; color: var(--muted-ink); font-size: .88rem; }

.battle-formula {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding: 18px;
  color: #fff;
  background: var(--night-2);
  border: 1px solid #896025;
  border-radius: 14px;
}

.battle-formula div { text-align: center; }
.battle-formula small { display: block; color: #aebdc6; font-size: .72rem; }
.battle-formula strong { font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: 1.16rem; }
.battle-formula > b { color: var(--gold-bright); font-size: 1.35rem; }
.battle-formula .damage { padding: 9px; background: #631e1b; border-radius: 9px; }

.battle-steps { position: relative; z-index: 1; display: grid; grid-template-columns: .75fr 1.25fr; gap: 16px; margin-bottom: 16px; }
.battle-steps article { padding: 22px; background: rgba(255, 250, 237, .68); border: 1px solid var(--line); border-radius: 14px; }
.battle-steps article > span { color: var(--red); font-size: .72rem; font-weight: 900; letter-spacing: .13em; }
.battle-steps h3 { margin: 2px 0 8px; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; }
.battle-steps p { color: var(--muted-ink); }
.battle-steps ol { margin-bottom: 0; padding-left: 1.25rem; }
.battle-steps li + li { margin-top: 5px; }

.glossary-panel { margin-top: 16px; }
.term-grid, .skill-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 22px; }
.term-grid div, .skill-list div { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.term-grid p, .skill-list p { margin: 3px 0 0; color: var(--muted-ink); font-size: .88rem; }
.term-grid .term-wide { grid-column: 1 / -1; }

.facility-tabs {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding: 5px;
  background: rgba(69, 43, 19, .12);
  border-radius: 13px;
}

.tab-button {
  flex: 1;
  min-height: 43px;
  padding: 8px 12px;
  color: #514536;
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-weight: 800;
  cursor: pointer;
}

.tab-button.is-active {
  color: #fff5de;
  background: var(--night-2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .16);
}

.tab-button:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.tab-panel { position: relative; z-index: 1; }
.tab-panel[hidden] { display: none; }
.lead-text { position: relative; z-index: 1; margin: 0 0 18px; color: var(--muted-ink); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 590px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: #fff2d5; background: var(--night-2); font-size: .82rem; }
td:first-child { font-weight: 800; }
tbody tr:nth-child(even) { background: rgba(104, 67, 27, .05); }

.compact-list { margin: 8px 0; padding-left: 1.2rem; }

.village-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.village-grid article { padding: 20px; background: rgba(255, 250, 237, .7); border: 1px solid var(--line); border-radius: 13px; }
.village-grid span { color: var(--red); font-weight: 900; }
.village-grid h3 { margin: 5px 0; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; }
.village-grid p { margin: 0; color: var(--muted-ink); font-size: .9rem; }

.check-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; margin: 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 24px; }
.check-list li::before { content: "◆"; position: absolute; left: 0; color: var(--red); font-size: .7rem; }

.class-up-rule {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px 18px;
  color: #fff4db;
  background: linear-gradient(135deg, #201505, #0c1b29);
  border: 1px solid #a8792d;
  border-radius: 13px;
}

.class-up-rule span { color: var(--gold-bright); font-size: 1.5rem; }
.class-up-rule p { margin: 0; }

.talent-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.talent-card { overflow: hidden; background: rgba(255, 250, 237, .7); border: 1px solid var(--line); border-radius: 13px; }
.talent-card summary { min-height: 82px; display: flex; align-items: center; gap: 13px; padding: 13px 15px; }
.talent-card summary > div { min-width: 0; }
.talent-card summary small { display: block; color: var(--muted-ink); font-size: .72rem; }
.talent-card summary strong { display: block; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: 1.05rem; }
.talent-card summary i { color: var(--red); font-style: normal; }
.talent-mark { flex: 0 0 auto; width: 46px; height: 46px; display: grid; place-items: center; color: white; background: #4b3424; border: 2px solid #c79846; border-radius: 50%; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-weight: 800; }
.talent-mark.explore { background: #285f55; }
.talent-mark.thief { background: #432d61; }
.talent-mark.mage { background: #245381; }
.talent-mark.berserk { background: #712c24; }
.talent-mark.smith { background: #545c63; }
.talent-body { padding: 2px 18px 18px; border-top: 1px solid var(--line); }
.talent-body h3 { margin: 14px 0 3px; font-size: .92rem; }
.talent-body p { margin: 0; color: var(--muted-ink); font-size: .88rem; }
.talent-body .class-condition { margin-top: 14px; padding: 10px 12px; color: #3c2a1b; background: rgba(176, 116, 34, .12); border-left: 3px solid var(--gold-dark); }

.event-card { overflow: hidden; color: #271d16; background: var(--parchment-light); border: 1px solid #a77a37; border-radius: 15px; box-shadow: 0 10px 28px rgba(75, 43, 13, .13); }
.event-title { padding: 20px; color: #fff; background: #3a1110; }
.janken-event .event-title { background: #0c213c; }
.event-title span { color: var(--gold-bright); font-size: .68rem; font-weight: 900; letter-spacing: .16em; }
.event-title h3 { margin: 2px 0 0; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: 1.45rem; }
.event-body { padding: 20px; }
.event-body h4 { display: inline-block; min-width: 94px; margin: 8px 0 4px; padding: 3px 10px; color: #fff3d8; background: #471514; border-radius: 5px; font-size: .8rem; }
.janken-event .event-body h4 { background: #102a4b; }
.event-body p { margin: 3px 0 10px; color: var(--muted-ink); }

.dungeon-section {
  color: #f6ead4;
  background: radial-gradient(circle at 78% 24%, rgba(33, 112, 164, .3), transparent 22rem), linear-gradient(145deg, #101921, #05090e);
  border-color: #446b85;
}

.dungeon-section::before { border-color: rgba(93, 167, 215, .28); }
.dungeon-section .section-heading .kicker { color: #79c6f2; }
.dungeon-section .number-list li { border-color: rgba(142, 181, 205, .18); }
.dungeon-section .number-list b { color: var(--gold-bright); }
.dungeon-section .number-list span { color: #c9d6de; }

.dungeon-icon {
  width: 66px;
  height: 66px;
  margin: 0 0 12px;
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(80, 169, 222, .25);
}

.boss-stat-card { padding: 24px; align-self: start; background: linear-gradient(145deg, rgba(111, 27, 21, .84), rgba(22, 12, 13, .9)); border: 1px solid #b16d31; border-radius: 14px; }
.boss-stat-card > p:first-child { margin: 0; color: var(--gold-bright); font-size: .69rem; font-weight: 900; letter-spacing: .16em; }
.boss-stat-card h3 { margin: 2px 0 14px; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: 1.85rem; }
.boss-stat-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 0 0 18px; }
.boss-stat-card dl div { padding: 9px; text-align: center; background: rgba(0, 0, 0, .22); border-radius: 8px; }
.boss-stat-card dt { color: #d9b77d; font-size: .7rem; }
.boss-stat-card dd { margin: 0; color: white; font-size: 1.22rem; font-weight: 900; }
.boss-stat-card > strong { color: var(--gold-bright); }
.boss-stat-card > p:last-child { margin-bottom: 0; color: #dec9b8; font-size: .9rem; }

.score-list { margin: 12px 0; padding: 0; list-style: none; }
.score-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }

.epilogue-panel {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  color: #eef1ed;
  background: linear-gradient(145deg, #25160e, #0b1721);
  border: 1px solid #9e742f;
  border-radius: 14px;
}

.epilogue-panel summary { padding: 16px 20px; color: var(--gold-bright); font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-weight: 800; text-align: center; }
.epilogue-panel > div { padding: 2px 24px 22px; }
.epilogue-panel p { color: #cdd6d9; }

.reference-section { background: linear-gradient(145deg, #f6e7c5, #dec08a); }
.reference-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.reference-grid article { padding: 16px; background: rgba(255, 250, 237, .72); border: 1px solid var(--line); border-radius: 12px; }
.reference-grid h3 { margin: 0 0 5px; color: var(--red); font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: 1rem; }
.reference-grid p { margin: 0; color: var(--muted-ink); font-size: .86rem; }
.version-note { position: relative; z-index: 1; margin: 24px 0 0; color: #765f42; font-size: .78rem; text-align: right; }

footer {
  width: min(1060px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #aebdc6;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
}

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

.mobile-dock { display: none; }

.back-top {
  position: fixed;
  z-index: 25;
  right: 20px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  color: #111c24;
  background: var(--gold-bright);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: .2s ease;
}

.back-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-top:focus-visible { outline: 3px solid white; outline-offset: 3px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr .62fr; gap: 34px; }
  .flow-grid { grid-template-columns: 1fr 1fr; }
  .terrain-grid { grid-template-columns: 1fr 1fr; }
  .reference-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  html { scroll-padding-top: 112px; }
  body { padding-bottom: 72px; }
  .header-inner { min-height: 60px; }
  .brand small { display: none; }
  .brand strong { font-size: .94rem; }
  .brand-die { width: 29px; height: 29px; }
  .jump-nav { padding-bottom: 8px; }
  .jump-nav a { font-size: .74rem; }

  .hero {
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 38px 0 46px;
  }

  .hero h1 { font-size: clamp(2.45rem, 13vw, 4rem); }
  .hero-lead { font-size: 1rem; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .button { padding-inline: 12px; font-size: .9rem; }
  .hero-facts { margin-top: 25px; display: grid; grid-template-columns: repeat(3, 1fr); }
  .hero-facts div { min-width: 0; padding: 7px 9px; }
  .hero-facts dd { font-size: .9rem; }

  .dragon-card {
    width: min(70vw, 310px);
    margin: -2px auto 0;
    transform: rotate(.7deg);
  }

  .section {
    width: min(100% - 20px, 680px);
    margin-bottom: 16px;
    padding: 30px 20px;
    scroll-margin-top: 112px;
    border-radius: 14px;
  }

  .section::before { inset: 6px; border-radius: 9px; }
  .section-heading { gap: 14px; margin-bottom: 22px; }
  .section-number { width: 42px; height: 42px; font-size: .72rem; }
  .section-heading h2 { font-size: 1.65rem; }

  .flow-grid,
  .choice-grid,
  .two-column,
  .event-grid,
  .dungeon-layout,
  .talent-grid,
  .battle-steps { grid-template-columns: 1fr; }

  .flow-grid li { min-height: 0; display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
  .flow-grid li > span { margin: 0; }

  .turn-strip {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 14px;
  }

  .turn-strip i { transform: rotate(90deg); line-height: 1; }
  .turn-strip div { padding: 5px; }
  .number-list li, .number-list.large li { grid-template-columns: 1fr; gap: 2px; }
  .panel-body { padding-left: 18px; }
  .term-grid, .skill-list, .check-list { grid-template-columns: 1fr; }
  .village-grid { grid-template-columns: 1fr; }
  .facility-tabs { overflow-x: auto; }
  .tab-button { flex: 0 0 auto; min-width: 108px; }
  .battle-formula { gap: 7px; padding: 13px 8px; }
  .battle-formula small { font-size: .62rem; }
  .battle-formula strong { font-size: .89rem; }
  .battle-formula > b { font-size: 1rem; }
  .reference-grid { grid-template-columns: 1fr 1fr; }

  footer { padding: 30px 8px 40px; flex-direction: column; text-align: center; }

  .mobile-dock {
    position: fixed;
    z-index: 40;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    left: 8px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 60px;
    padding: 5px;
    color: #dce6eb;
    background: rgba(6, 15, 24, .96);
    border: 1px solid rgba(215, 166, 59, .46);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .48);
    backdrop-filter: blur(14px);
  }

  .mobile-dock a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    color: #b9c7cf;
    border-radius: 10px;
    font-size: .67rem;
    line-height: 1.2;
    text-decoration: none;
  }

  .mobile-dock a span { color: var(--gold-bright); font-size: 1rem; }
  .mobile-dock a.is-active { color: #101c25; background: var(--gold-bright); }
  .mobile-dock a.is-active span { color: #5b3811; }
  .back-top { right: 14px; bottom: 82px; width: 42px; height: 42px; }
}

@media (max-width: 440px) {
  .hero { width: calc(100% - 24px); }
  .hero-actions { grid-template-columns: 1fr; }
  .hero-facts { gap: 5px; }
  .hero-facts dt { font-size: .66rem; }
  .hero-facts dd { font-size: .8rem; }
  .dice-row { grid-template-columns: 1fr; }
  .dice-row div { display: grid; grid-template-columns: 45px 50px 1fr; align-items: center; text-align: left; }
  .dice-row b { font-size: 1.2rem; }
  .terrain-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .terrain-grid article { padding: 13px 8px; }
  .info-pair { grid-template-columns: 1fr; }
  .reference-grid { grid-template-columns: 1fr; }
  table { min-width: 520px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
