:root {
  --navy:#17375f;
  --blue:#075b9a;
  --gold:#9a6500;
  --green:#237858;
  --red:#b3332f;
  --paper:#fffef9;
  --ink:#172033;
  --line:#b9ac96;
  --soft:#eee6d7;
  --shadow:0 10px 28px #2e261917;
  font-family:"Yu Gothic UI","Yu Gothic",Meiryo,sans-serif;
  color:var(--ink);
  background:#f2efe7;
  line-height:1.78;
}
* { box-sizing:border-box; }
html { scroll-behavior:smooth; scroll-padding-top:108px; }
body { margin:0; min-width:320px; }
a { color:var(--blue); text-underline-offset:3px; }
a:hover { color:var(--gold); }
button,input { font:inherit; }
button {
  border:1px solid #8b8070;
  border-radius:9px;
  background:var(--paper);
  color:var(--navy);
  min-height:42px;
  padding:7px 15px;
  cursor:pointer;
  font-size:.88rem;
  font-weight:700;
}
button:hover { background:#f2eadb; }
:focus-visible { outline:3px solid #d0a143; outline-offset:3px; }
[hidden] { display:none!important; }
.skip { position:fixed; top:-100px; z-index:1000; background:var(--paper); padding:12px; }
.skip:focus { top:5px; left:5px; }
.utility {
  min-height:88px;
  padding:12px max(114px,calc((100vw - 1440px)/2 + 114px)) 12px clamp(20px,4vw,56px);
  background:#eee8dc;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  gap:20px;
  position:sticky;
  top:0;
  z-index:50;
}
.guides-link { font-size:.85rem; white-space:nowrap; }
.utility-actions { margin-left:auto; display:flex; flex:0 0 auto; flex-wrap:wrap; justify-content:flex-end; gap:7px; }
.utility-actions button { white-space:nowrap; }
.utility-actions button { min-height:36px; border-radius:30px; padding:5px 13px; font-size:.78rem; }
.utility-actions [aria-pressed="true"] { background:var(--navy); color:white; border-color:var(--navy); }
.progress-circle {
  position:absolute;
  right:18px;
  top:8px;
  width:72px;
  height:72px;
  display:grid;
  place-items:center;
  border:3px solid #2b507c;
  border-radius:50%;
  background:var(--paper);
  box-shadow:inset 0 0 0 4px #e7e9eb,0 5px 14px #1720331c;
  font-weight:800;
  color:#1e6650;
  pointer-events:none;
}
.hero { background:linear-gradient(118deg,#17375f,#1d3f6b); color:white; }
.hero-inner { max-width:1480px; margin:auto; padding:36px clamp(24px,5.2vw,80px) 38px; }
.edition { font-size:.8rem; margin:0 0 8px; opacity:.9; letter-spacing:.04em; }
h1 { font-family:YuMincho,"Yu Mincho",serif; font-size:clamp(2rem,4.1vw,3.45rem); line-height:1.24; margin:0; text-wrap:balance; }
html[lang="en"] h1 { font-size:clamp(1.8rem,3.7vw,3.25rem); }
.categories { background:var(--paper); border-bottom:1px solid var(--line); box-shadow:0 3px 12px #14233c12; overflow:auto; }
.category-inner { width:max-content; min-width:min(100%,1480px); margin:auto; padding:12px clamp(24px,5.2vw,80px); display:flex; gap:24px; }
.categories a { font-weight:800; text-decoration:none; border-bottom:2px solid transparent; white-space:nowrap; font-size:.92rem; padding:4px 0; }
.categories a[aria-current="page"] { border-color:var(--gold); color:var(--navy); }
.early-notice { max-width:1328px; margin:18px auto 0; padding:12px 18px; border:1px solid #a6855d; border-radius:10px; background:#f4ead6; font-size:.88rem; font-weight:700; }
.search-panel { max-width:1328px; margin:24px auto 0; padding:16px 20px; background:#faf8f1; border:1px solid #b1bdcf; border-radius:12px; box-shadow:var(--shadow); }
.search-panel label { display:block; font-size:.83rem; font-weight:700; color:var(--navy); margin-bottom:6px; }
.search-controls { display:flex; gap:10px; align-items:center; }
.search-controls button { flex:0 0 auto; white-space:nowrap; }
input[type="search"] { min-width:0; width:100%; min-height:44px; padding:10px 12px; border:1px solid #899cb6; border-radius:7px; background:white; font-size:1rem; }
#search-summary { font-size:.84rem; margin-top:4px; }
#search-results { padding-left:24px; margin:8px 0 0; max-height:360px; overflow:auto; }
#search-results:empty { display:none; }
#search-results li { padding:6px 4px; }
.search-context { display:block; font-size:.83rem; color:#46536a; }
.search-category { font-size:.72rem; color:var(--gold); font-weight:800; margin-right:6px; }
.layout { display:grid; grid-template-columns:250px minmax(0,1fr); gap:34px; max-width:1440px; margin:auto; padding:28px clamp(20px,4vw,56px) 60px; }
.contents { align-self:start; position:sticky; top:106px; max-height:calc(100vh - 124px); overflow:auto; padding:18px 16px; background:var(--paper); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow); }
.contents h2 { font-size:.8rem; color:var(--gold); letter-spacing:.1em; margin:0 0 12px; }
.contents a { display:block; font-size:.85rem; padding:7px 8px; text-decoration:none; line-height:1.5; }
.contents a:hover { background:var(--soft); border-radius:6px; }
main { min-width:0; }
body:not([data-page="walkthrough"]) .progress-card { display:none; }
h2 { font-size:1.25rem; line-height:1.5; margin:0 0 14px; color:var(--navy); }
h3 { font-size:1.1rem; line-height:1.5; margin:0; }
p { margin:8px 0; }
.progress-card { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:16px; padding:22px 24px; background:linear-gradient(120deg,var(--paper),#f7f1e4); border:1px solid #c8b99c; border-radius:18px; box-shadow:var(--shadow); margin-bottom:22px; }
.progress-card h2 { font-size:.94rem; margin:0 0 5px; }
.progress-card p { font-size:.82rem; color:#445269; }
.progress-actions { display:flex; flex-direction:column; gap:7px; align-items:flex-end; }
.progress-actions strong { color:var(--gold); font-size:1.15rem; }
.progress-actions button { font-size:.8rem; }
.progress-track { height:10px; border:1px solid #a99b82; border-radius:99px; background:#ece6d8; margin-top:12px; overflow:hidden; }
#progress-fill { display:block; height:100%; width:0; background:var(--green); transition:width .3s ease; }
#save-status { grid-column:1/-1; margin:0; }
#save-status:empty { display:none; }
.notice-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-bottom:24px; }
.notice { padding:16px 18px; border:1px solid #9b5b46; background:#f5e7dd; border-radius:14px; font-size:.92rem; line-height:1.75; }
.notice:nth-child(2) { border-color:#45846d; background:#e3f0e9; }
.notice:nth-child(3) { grid-column:1/-1; border-color:#b19a66; background:#f4eddb; }
.chart-actions { display:flex; flex-wrap:wrap; gap:10px; margin:0 0 16px; }
details.chapter { border:1px solid var(--line); border-radius:18px; overflow:clip; background:#e9e1d2; margin:0 0 20px; box-shadow:var(--shadow); }
details.chapter>summary { display:flex; gap:16px; justify-content:space-between; align-items:center; cursor:pointer; list-style:none; padding:20px 22px; background:var(--paper); color:var(--navy); }
summary::-webkit-details-marker { display:none; }
details.chapter>summary::after { content:'+'; display:grid; place-items:center; border:1px solid var(--line); border-radius:50%; min-width:30px; height:30px; color:var(--gold); }
details.chapter[open]>summary::after { content:'−'; }
.chapter-body { padding:0 20px 22px; }
.route-card { margin-top:14px; padding:18px 18px 18px 62px; position:relative; border:1px solid #c4b8a4; border-radius:14px; background:var(--paper); box-shadow:0 4px 10px #2e26190a; }
.route-check { position:absolute; left:18px; top:21px; width:24px; height:24px; accent-color:var(--green); cursor:pointer; }
.route-card h3 { color:#172033; font-size:1.04rem; }
.route-card p { margin:10px 0 0; }
.route-card.is-done { border-color:var(--green); padding-bottom:58px; box-shadow:0 6px 16px #18574214; }
.route-card.is-done::after { position:absolute; right:15px; bottom:12px; display:grid; place-items:center; width:62px; height:31px; content:'完了'; border:2px solid var(--red); color:var(--red); border-radius:4px 6px 5px 3px; font-size:.9rem; font-weight:900; line-height:1; letter-spacing:.12em; transform:none; background:radial-gradient(circle at 16% 28%,#fffdf8 0 1px,transparent 1.4px) 0 0/9px 8px,#fffdf8dc; }
html[lang="en"] .route-card.is-done::after { content:'DONE'; letter-spacing:.08em; }
.route-card.bump { animation:card-bump .58s ease; }
.route-card.bump::after { animation:stamp-pop .58s ease; }
@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.35); } 58% { opacity:1; transform:scale(.94); } 100% { opacity:1; transform:scale(1); } }
.step-badge { display:inline-block; margin-bottom:5px; border:1px solid #a88b42; color:var(--gold); border-radius:30px; font-size:.7rem; padding:1px 8px; }
.step-warning { padding:10px 12px; border:1px solid #b99b71; border-radius:8px; background:#f4ead6; font-size:.9rem; font-weight:700; }
.reference-link { display:inline-block; margin-top:12px; font-size:.85rem; }
.data-section,.note-card { padding:22px 24px; border:1px solid var(--line); border-radius:16px; background:var(--paper); box-shadow:var(--shadow); margin-bottom:22px; scroll-margin-top:108px; }
.table-wrap { overflow-x:auto; border:1px solid #b5c0d0; border-radius:10px; margin-top:16px; }
table { width:100%; border-collapse:collapse; line-height:1.65; font-size:.88rem; }
th { background:#223f68; color:white; text-align:left; padding:12px 11px; border:1px solid #60728f; font-weight:800; vertical-align:top; white-space:nowrap; }
td { border:1px solid #d0d7e2; padding:10px 11px; vertical-align:top; }
tbody tr:nth-child(even) { background:#eff3f7; }
tbody tr:nth-child(odd) { background:white; }
td:first-child { min-width:130px; font-weight:700; }
td { min-width:140px; }
#weapons table { min-width:940px; }
#weapons th,#weapons td { min-width:0; white-space:normal; }
#weapons th:nth-child(1),#weapons td:nth-child(1) { width:15%; }
#weapons th:nth-child(2),#weapons td:nth-child(2) { width:8%; }
#weapons th:nth-child(3),#weapons td:nth-child(3),
#weapons th:nth-child(4),#weapons td:nth-child(4) { width:6%; }
#weapons th:nth-child(5),#weapons td:nth-child(5),
#weapons th:nth-child(6),#weapons td:nth-child(6) { width:9%; }
#weapons th:nth-child(7),#weapons td:nth-child(7) { width:14%; }
#weapons th:nth-child(8),#weapons td:nth-child(8) { width:33%; }
.stat-table td { min-width:68px; white-space:nowrap; }
.stat-table td:first-child { min-width:155px; }
.row-link { display:block; margin-top:5px; font-size:.78rem; font-weight:400; }
tr:target { outline:3px solid #d0a143; outline-offset:-3px; }
tr[id] { scroll-margin-top:108px; }
footer { border-top:1px solid var(--line); padding:25px 70px 36px; text-align:center; background:#ebe5d8; }
footer a { font-weight:700; font-size:.9rem; }
.back-top { position:fixed; z-index:70; right:18px; bottom:18px; border:1px solid #7e8998; border-radius:50%; width:46px; height:46px; min-height:0; padding:0; background:#fffdf8; box-shadow:0 6px 18px #09182c2e; font-size:1.15rem; color:var(--navy); }
@media(max-width:760px) {
  tr[id] { scroll-margin-top:118px; }
  #weapons th:nth-child(5),#weapons td:nth-child(5),
  #weapons th:nth-child(6),#weapons td:nth-child(6) { width:11%; }
  #weapons th:nth-child(8),#weapons td:nth-child(8) { width:29%; }
  html { scroll-padding-top:118px; }
  .utility { min-height:100px; padding:10px 86px 10px 16px; display:block; }
  .guides-link { display:inline-block; font-size:.72rem; line-height:1.4; margin:0 0 6px; }
  .utility-actions { justify-content:flex-start; gap:5px; }
  .utility-actions button { font-size:.7rem; padding:4px 10px; min-height:30px; }
  .progress-circle { width:58px; height:58px; right:14px; top:18px; border-width:2px; font-size:.9rem; }
  .hero-inner { padding:26px 20px 27px; }
  h1 { font-size:clamp(1.55rem,7vw,2.15rem); }
  html[lang="en"] h1 { font-size:1.8rem; }
  .edition { font-size:.72rem; line-height:1.5; }
  .category-inner { padding:9px 20px; gap:22px; }
  .categories a { font-size:.84rem; }
  .search-panel { margin:18px 54px 0 14px; padding:13px 14px; }
  .early-notice { margin:16px 54px 0 14px; padding:12px 14px; font-size:.83rem; }
  .search-controls { gap:7px; }
  .search-controls button { padding:8px 10px; font-size:.8rem; }
  .layout { display:block; padding:18px 54px 44px 14px; }
  .contents { position:static; max-height:none; padding:14px 16px; margin-bottom:18px; border-radius:14px; }
  .contents a { padding:5px 4px; font-size:.8rem; }
  .progress-card { padding:17px; grid-template-columns:1fr; gap:10px; }
  .progress-actions { flex-direction:row; flex-wrap:wrap; align-items:center; justify-content:space-between; }
  .progress-actions strong { font-size:1.06rem; }
  .notice-grid { grid-template-columns:1fr; gap:12px; }
  .notice { padding:14px 16px; }
  .notice:nth-child(3) { grid-column:auto; }
  details.chapter>summary { padding:16px; }
  details.chapter>summary h2 { font-size:1.04rem; }
  .chapter-body { padding:0 10px 14px; }
  .route-card { padding:58px 15px 17px; }
  .route-check { left:16px; top:18px; }
  .route-card p { font-size:1rem; line-height:1.78; }
  .data-section,.note-card { padding:18px 16px; scroll-margin-top:118px; }
  td { min-width:180px; }
  td:first-child { min-width:140px; }
  h2 { font-size:1.15rem; }
  footer { padding:22px 65px 30px 20px; }
  .back-top { right:2px; bottom:16px; }
}
@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto!important; }
  *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
}
@media print {
  .utility,.categories,.search-panel,.contents,.chart-actions,.back-top,footer,.progress-actions,.skip { display:none!important; }
  .layout { display:block; padding:0; }
  .hero { color:black; background:white; }
  .hero-inner { padding:0 0 16px; }
  h1,html[lang="en"] h1 { font-size:26pt; }
  .progress-card,.route-card,.data-section,.note-card,.notice { box-shadow:none; }
  .route-card { break-inside:avoid; }
  .table-wrap { overflow:visible; }
  table { font-size:9pt; }
  th,td { min-width:0!important; white-space:normal!important; }
  th { background:#ddd; color:black; }
}
.reference-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
}
