:root {
  color-scheme: light;
  --navy: #17375f;
  --navy-light: #1d3f6b;
  --paper: #f2efe7;
  --panel: #fffef9;
  --ink: #172338;
  --muted: #495568;
  --line: #b8ac97;
  --blue: #075b9a;
  --gold: #a76800;
  --green: #237858;
  --stamp: #b3332f;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 22px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.78 "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
}
button, input, select { font: inherit; color: inherit; }
button, select, input[type="checkbox"] { cursor: pointer; }
button, select, input[type="search"] {
  min-height: 42px;
  border: 1px solid #7e8998;
  border-radius: 7px;
  padding: 7px 13px;
  background: var(--panel);
}
button:hover { background: #f1eadc; }
a { color: var(--blue); text-underline-offset: .22em; }
a:hover { color: #003b64; }
:focus-visible { outline: 3px solid #bf852e; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip { position: fixed; top: -100px; left: 12px; z-index: 1000; padding: 9px; background: white; }
.skip:focus { top: 8px; }
.language-strip {
  min-height: 54px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 7px max(106px, calc((100vw - 1480px) / 2 + 110px)) 7px 20px;
  background: #eee8dc;
  border-bottom: 1px solid var(--line);
}
.language-strip button { min-height: 35px; padding: 4px 15px; border-radius: 30px; font-size: .82rem; }
.language-strip button[aria-pressed="true"] { color: white; background: var(--navy); border-color: var(--navy); }
.hero { background: linear-gradient(118deg, var(--navy), var(--navy-light)); color: white; }
.hero-inner { max-width: 1480px; margin: auto; padding: 32px 100px 34px clamp(24px, 5.2vw, 80px); }
.edition { margin: 0 0 6px; font-size: .84rem; font-weight: 700; letter-spacing: .04em; }
h1 { margin: 0; font: 700 clamp(2rem, 4.1vw, 3.45rem)/1.24 YuMincho, "Yu Mincho", serif; text-wrap: balance; }
html[lang="en"] h1 { font-size: clamp(1.8rem, 3.7vw, 3.25rem); }
.site-nav { background: #fffdf8; border-bottom: 1px solid #aeb8c7; box-shadow: 0 3px 12px #14233c12; padding-right: 100px; }
.site-nav-inner { display: flex; gap: 24px; align-items: center; max-width: 1480px; margin: auto; padding: 10px clamp(24px, 5.2vw, 80px); overflow-x: auto; scrollbar-width: thin; }
.site-nav a { min-height: 31px; display: inline-flex; align-items: center; font-size: .92rem; font-weight: 800; white-space: nowrap; text-decoration: none; border-bottom: 2px solid transparent; }
.site-nav a[aria-current="page"] { color: var(--navy); border-color: var(--gold); }
.guide-link { font-size: .82rem !important; }
.return-bar { display: contents; }
.tools { max-width: 1440px; margin: auto; padding: 16px 100px 0 clamp(20px, 4vw, 56px); }
.tool-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.search-field { flex: 1 1 330px; min-width: 0; }
.search-field label { display: block; color: var(--muted); font-size: .83rem; font-weight: 700; }
.search-field input { width: 100%; background: white; cursor: text; }
.utility-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.utility-group button { font-size: .86rem; font-weight: 700; }
.search-results { margin-top: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }
.search-results p { margin: 0; font-weight: 700; }
.search-results ol { margin: 8px 0 0; max-height: 420px; overflow-y: auto; padding: 0 0 0 26px; }
.search-results li { padding: 9px 4px; border-bottom: 1px solid #e0d7c7; }
.search-context { display: block; color: var(--muted); font-size: .87rem; }
.search-category { color: var(--gold); font-weight: 800; margin-right: 8px; font-size: .8rem; }
.shell { max-width: 1440px; margin: auto; padding: 24px 100px 80px clamp(20px, 4vw, 56px); }
.essential { margin: 0 0 26px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.essential article { background: #fff4dc; border: 1px solid #b58a43; border-radius: 12px; padding: 15px 18px; }
.essential article:nth-child(2) { background: #e9f1f7; border-color: #8199af; }
.essential article:nth-child(3) { background: #e7f0e9; border-color: #7c9b88; }
.essential h2 { font-size: .97rem; margin: 0 0 4px; color: var(--navy); }
.essential p { font-size: .88rem; margin: 0; }
.columns { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 34px; align-items: start; }
.toc { position: sticky; top: 20px; border: 1px solid var(--line); background: var(--panel); padding: 19px 16px; border-radius: 15px; box-shadow: 0 8px 24px #16253d0b; }
.toc h2 { color: var(--gold); font-size: .9rem; margin: 0 0 14px; }
.toc a { display: block; margin: 0; padding: 7px 6px; font-size: .88rem; text-decoration: none; line-height: 1.55; }
.toc hr { border: 0; border-top: 1px solid #cfc2ac; margin: 15px 0; }
main { min-width: 0; }
.section-title { color: var(--navy); margin: 0 0 15px; font: 700 clamp(1.38rem, 2.1vw, 1.8rem)/1.4 YuMincho, "Yu Mincho", serif; }
.section-lead { color: var(--muted); margin: 0 0 20px; }
.progress-panel { border: 1px solid var(--line); border-radius: 15px; padding: 21px 24px; background: var(--panel); box-shadow: 0 9px 25px #1723380b; margin-bottom: 24px; }
.progress-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.progress-head h2 { color: var(--navy); margin: 0; font-size: 1rem; }
.progress-number { color: var(--gold); font-weight: 850; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.progress-panel p { margin: 7px 0 10px; font-size: .87rem; }
.progress-track { height: 10px; border: 1px solid #ac9e85; border-radius: 20px; background: #e7e1d5; overflow: hidden; }
.progress-fill { width: 0; height: 100%; background: var(--green); transition: width .3s ease; }
.progress-actions { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; margin-top: 12px; }
.progress-actions button { font-size: .84rem; }
.persistence-note { background: #fff1d3; padding: 11px 14px; border: 1px solid #b48c45; border-radius: 8px; }
.floating-progress { position: fixed; z-index: 50; right: max(14px, calc((100vw - 1480px) / 2 + 18px)); top: 16px; width: 72px; height: 72px; display: grid; place-items: center; border: 3px solid var(--navy-light); border-radius: 50%; color: #194a3c; background: #fffef9f7; box-shadow: 0 7px 22px #09182c30, inset 0 0 0 4px #fff; font-weight: 850; font-variant-numeric: tabular-nums; pointer-events: none; }
.floating-progress.bump { animation: progress-bump .64s cubic-bezier(.22,1.35,.36,1); }
.story { margin: 0 0 22px; padding: 12px 0; border-bottom: 1px solid #cbbda6; }
.story summary { font-weight: 800; cursor: pointer; }
.bulk-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 22px; }
.chapter { margin: 0 0 24px; }
.chapter > summary { cursor: pointer; padding: 13px 0; color: var(--navy); font-size: 1.25rem; font-weight: 800; border-bottom: 1px solid #b8ac97; }
.chapter-body { padding-top: 16px; }
.route-card { position: relative; margin: 0 0 14px; padding: 19px 21px 19px; border: 1px solid #bcaf97; border-radius: 13px; background: var(--panel); box-shadow: 0 6px 18px #1723380c; }
.route-card h3 { margin: 0 0 10px; font-size: 1.02rem; line-height: 1.55; }
.check-label { display: flex; align-items: flex-start; gap: 13px; cursor: pointer; }
.check-label input { width: 24px; height: 24px; flex: 0 0 24px; margin-top: 2px; accent-color: #087653; }
.route-card ol, .route-card ul { margin: 10px 0 0 35px; padding-left: 22px; }
.route-card li { margin-bottom: 6px; padding-left: 1px; }
.route-card .step-note { margin: 12px 0 0 37px; padding: 11px 13px; border-radius: 8px; background: #f2e9d5; font-size: .9rem; }
.step-links { margin: 12px 0 0 37px; display: flex; gap: 8px; flex-wrap: wrap; }
.step-links a { border: 1px solid #8396aa; padding: 2px 8px; border-radius: 5px; font-size: .8rem; text-decoration: none; background: white; }
.step-badge { display: inline-block; border: 1px solid #a78146; border-radius: 20px; color: #785014; font-size: .73rem; font-weight: 700; padding: 0 7px; margin: 6px 0 0 37px; }
.route-card:has(input:checked) { padding-bottom: 61px; border-color: var(--green); }
.route-card:has(input:checked)::after { content: "完了"; position: absolute; right: 15px; bottom: 12px; width: 62px; height: 31px; display: grid; place-items: center; border: 2px solid #b3332feb; border-radius: 4px 6px 5px 3px; background: radial-gradient(circle at 16% 28%,#fffdf8eb 0 1px,transparent 1.35px) 0 0/9px 8px, #fffdf8d9; color: var(--stamp); font-size: .92rem; font-weight: 900; letter-spacing: .12em; line-height: 1; text-shadow: .5px 0 #78191770; box-shadow: inset 0 0 0 1px #b3332f29; transform: none; }
html[lang="en"] .route-card:has(input:checked)::after { content: "DONE"; letter-spacing: .08em; }
.route-card.bump { animation: card-bump .58s cubic-bezier(.22,1.3,.36,1); }
.route-card.bump:has(input:checked)::after { animation: stamp-pop .58s cubic-bezier(.22,1.3,.36,1); }
.data-section { margin-bottom: 34px; }
.table-wrap { max-width: 100%; overflow: auto; border: 1px solid #9eacbf; border-radius: 10px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; min-width: 740px; font-size: .9rem; }
th { background: #233e65; color: white; text-align: left; font-weight: 800; white-space: nowrap; }
td, th { padding: 11px 12px; vertical-align: top; border-bottom: 1px solid #c8d0da; }
td p { margin: 6px 0 0; }
th + th, td + td { border-left: 1px solid #d5dbe3; }
tbody tr:nth-child(even) { background: #f0f3f7; }
td:first-child { min-width: 160px; font-weight: 700; color: var(--navy); }
td:not(:first-child) { min-width: 135px; }
#weapons td:nth-child(2) { min-width: 100px; }
#weapons td:nth-child(3), #weapons td:nth-child(4) { min-width: 145px; }
#weapons td:nth-child(n+5) { min-width: 90px; }
.context-link { white-space: normal; }
.plain-note { margin: 15px 0; padding: 15px 18px; background: #e9e3d5; border: 1px solid #baab8e; border-radius: 10px; }
.ending-card { padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; }
.ending-card h3 { color: var(--navy); margin-top: 0; }
.ending-card p { margin: 8px 0; }
.back-top { position: fixed; z-index: 70; right: max(18px,env(safe-area-inset-right)); bottom: max(18px,env(safe-area-inset-bottom)); width: 46px; height: 46px; padding: 0; border-radius: 50%; border: 1px solid #7e8998; color: var(--navy); background: #fffdf8; box-shadow: 0 8px 22px #09182c38; font-weight: 900; font-size: 1.15rem; }
footer { padding: 22px 24px 76px; text-align: center; border-top: 1px solid #b8ac97; background: #eee8dc; }
@keyframes card-bump { 0%,100% { transform: scale(1); } 36% { transform: scale(1.012); } 68% { transform: scale(.997); } }
@keyframes stamp-pop { 0% { opacity: 0; transform: scale(1.42); } 58% { opacity: 1; transform: scale(.92); } 100% { opacity: 1; transform: scale(1); } }
@keyframes progress-bump { 0%,100% { transform: scale(1); } 34% { transform: scale(1.16); } 62% { transform: scale(.94); } }
@media(max-width:900px) {
  .columns { grid-template-columns: 210px minmax(0,1fr); gap: 22px; }
  .essential { grid-template-columns: 1fr; gap: 10px; }
}
@media(max-width:760px) {
  .hero-inner { padding: 26px 76px 26px 20px; }
  h1 { font-size: clamp(1.55rem,7vw,2.15rem); }
  html[lang="en"] h1 { font-size: clamp(1.55rem,7.4vw,2.15rem); }
  .edition { font-size: .75rem; }
  .language-strip { padding-right: 80px; min-height: 54px; }
  .language-strip button { padding: 4px 12px; font-size: .77rem; }
  .floating-progress { width: 58px; height: 58px; border-width: 2px; right: 10px; top: 7px; font-size: .9rem; }
  .site-nav { padding-right: 76px; }
  .site-nav-inner { padding: 9px 20px; gap: 18px; }
  .site-nav a { font-size: .84rem; }
  .shell { padding: 20px 76px 80px 15px; }
  .tools { padding: 15px 76px 0 15px; }
  .columns { display: block; }
  .toc { position: static; margin: 0 0 23px; padding: 14px 16px; }
  .toc a { display: inline-block; margin-right: 12px; padding: 6px 0; }
  .toc hr { margin: 10px 0; }
  .essential { margin-bottom: 21px; }
  .essential article { padding: 13px 15px; }
  .route-card { padding: 17px 15px; }
  .route-card h3 { font-size: 1rem; }
  .route-card ol, .route-card ul { margin-left: 10px; padding-left: 22px; }
  .route-card .step-note, .step-links { margin-left: 0; }
  .progress-panel { padding: 18px; }
  .progress-number { font-size: 1.05rem; }
  td:first-child { min-width: 175px; }
}
@media(prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .no-print, .site-nav, .tools, .toc, .floating-progress, .back-top, footer, .step-links { display: none !important; }
  body { background: white; color: black; }
  .hero { background: none; color: black; border-bottom: 1px solid #888; }
  .hero-inner { padding: 0 0 20px; }
  h1, html[lang="en"] h1 { font-size: 25pt; }
  .shell { padding: 15px 0; }
  .columns { display: block; }
  .essential { display: block; }
  .essential article { margin-bottom: 10px; }
  .route-card, .progress-panel { box-shadow: none; break-inside: avoid; }
  .route-card { margin-bottom: 13px; }
  .table-wrap { overflow: visible; }
  table { min-width: 0; font-size: 9pt; }
  td, th { min-width: 0 !important; padding: 6px; }
}

.toc ol { list-style:none; padding:0; margin:0; }
.reference-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:14px; }
.reference-card { border:1px solid var(--line); border-radius:10px; background:var(--panel); padding:14px 17px; margin-bottom:14px; }
.reference-card { margin:0; }
.reference-card summary { cursor:pointer; font-weight:800; color:var(--navy); }
.reference-body p { margin:10px 0; }
@media (max-width:760px) { .reference-grid { grid-template-columns:1fr; } .toc li { display:inline; } .toc li[hidden] { display:none !important; } }


.collection-check { position: relative; display: block; min-width: 105px; padding: 0 0 36px; }
.collection-check input { width: 22px; height: 22px; accent-color: var(--green); }
.collection-check:has(input:checked)::after { content: "完了"; position: absolute; left: 0; bottom: 0; width: 56px; height: 26px; display: grid; place-items: center; border: 2px solid var(--stamp); border-radius: 4px; color: var(--stamp); background: #fffdf8; font-size: .82rem; font-weight: 900; line-height: 1; }
html[lang="en"] .collection-check:has(input:checked)::after { content: "DONE"; }
.collection-check.bump:has(input:checked)::after { animation: stamp-pop .58s cubic-bezier(.22,1.3,.36,1); }
.data-actions { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin: 0 0 14px; }
.data-actions label { display: grid; font-size: .86rem; }
.data-actions input { width: min(100%, 420px); }
.entry-detail { margin-top: 12px; }
.entry-detail p { margin: 7px 0; }
.entry-detail ol { margin: 8px 0; padding-left: 24px; }
.table-wrap caption { text-align: left; color: var(--navy); font-weight: 800; padding: 10px 12px; background: #e9e3d5; }
.compact-table { min-width: 620px; }
.clock-helper { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin: 18px 0; }
.clock-helper label { display: block; font-weight: 800; }
.clock-helper input { width: 100%; cursor: text; margin: 8px 0; min-height: 42px; border: 1px solid #7e8998; border-radius: 7px; padding: 8px 10px; }
.clock-helper ol { padding-left: 24px; }
.clock-helper li { margin: 5px 0; }
.result-note { font-weight: 800; color: var(--navy); }
@media(max-width:760px) {
  .reference-grid { grid-template-columns: minmax(0, 1fr); }
  h1 { overflow-wrap: break-word; }
  .collection-check { min-width: 96px; }
}
