:root {
  color-scheme: light;
  --ink: #243246;
  --muted: #526176;
  --navy: #17375f;
  --blue: #2f6f9f;
  --pale-blue: #edf4f9;
  --paper: #f3f6f9;
  --line: #ccd6e0;
  --gold: #b28a37;
  --green: #3e7858;
  --red: #a24240;
  --shadow: 0 5px 18px rgb(24 49 75 / 8%);
  font-family: "Yu Gothic UI", "Meiryo", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1rem; }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.75; }
a { color: #145b91; text-underline-offset: .18em; }
a:hover { color: #0d3f68; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #e0a83b; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; z-index: 20; top: .5rem; left: .5rem; padding: .6rem 1rem; color: #fff; background: var(--navy); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.site-header { color: #fff; background: var(--navy); }
.return-bar, .title-row, .section-nav { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.return-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 0; }
.guide-return { color: #fff; font-weight: 700; }
.guide-return:hover { color: #e4eff8; }
.header-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.small-button, .quiet-button, .outline-button { min-height: 42px; padding: .45rem .8rem; border: 1px solid #fff; border-radius: 8px; color: #fff; background: #244c77; }
.small-button:hover, .quiet-button:hover { background: #315e8e; }
.title-row { padding: clamp(2.2rem, 7vw, 5rem) 0 2rem; }
.platform-label, .eyebrow { margin: 0; color: #d2e0ee; font-size: .78rem; font-weight: 800; letter-spacing: .14em; }
h1 { max-width: 1120px; margin: .25rem 0 0; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.2; }
.title-break { display: none; }
.english-title { margin: .55rem 0 0; color: #dce8f3; font-size: clamp(1rem, 2.3vw, 1.4rem); letter-spacing: .04em; }
.section-nav { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0 0 1rem; }
.section-nav a { padding: .35rem .7rem; border: 1px solid #718ba6; border-radius: 999px; color: #fff; text-decoration: none; }
.section-nav a:hover { background: #315e8e; }
main { width: min(1120px, calc(100% - 2rem)); margin: 1.5rem auto 4rem; }
.opening-note, .progress-panel, .content-section, .page-footer { border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.opening-note { margin-bottom: 1rem; padding: 1rem 1.2rem; background: #fff8e8; border-color: #e4cf9e; }
.note-heading { display: flex; align-items: center; gap: .65rem; }
.note-heading h2 { margin: 0; font-size: 1.15rem; }
.note-mark { display: grid; width: 1.7rem; height: 1.7rem; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: #735318; font-weight: 900; }
.opening-note ul { margin: .55rem 0 0; padding-left: 1.35rem; }
.opening-note li + li { margin-top: .35rem; }
.progress-panel { display: grid; grid-template-columns: minmax(170px, .85fr) minmax(180px, 2fr) auto; align-items: center; gap: 1rem; margin-bottom: 1rem; padding: 1rem 1.2rem; }
.progress-copy h2 { margin: 0; font-size: 1rem; }
.progress-copy p { margin: .2rem 0 0; }
#progressCount { color: var(--navy); font-weight: 800; font-variant-numeric: tabular-nums; }
.storage-status { color: var(--muted); font-size: .82rem; }
.progress-track { height: 14px; overflow: hidden; border: 1px solid #c2ced9; border-radius: 999px; background: #e8edf2; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: #4b8a70; transition: width .28s ease; }
.quiet-button { border-color: #9aa9b8; color: var(--navy); background: #fff; }
.quiet-button:hover { color: #102e4d; background: var(--pale-blue); }
.content-section { margin-top: 1.2rem; padding: clamp(1rem, 3vw, 2rem); scroll-margin-top: 1rem; }
.section-heading { max-width: 880px; margin-bottom: 1.35rem; }
.section-heading .eyebrow { color: #63758a; }
h2 { line-height: 1.35; }
.section-heading h2 { margin: .25rem 0 .55rem; color: var(--navy); font-size: clamp(1.45rem, 3vw, 2rem); }
.section-heading p:last-child { margin-bottom: 0; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.info-card, .callout { border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; }
.info-card { padding: 1rem 1.1rem; }
.info-card h3, .callout h3 { margin: 0 0 .5rem; color: var(--navy); font-size: 1.08rem; }
.info-card ul, .callout ol { margin: .4rem 0 0; padding-left: 1.35rem; }
.info-card li + li, .callout li + li { margin-top: .35rem; }
.callout { margin-top: 1rem; padding: 1rem 1.1rem; background: var(--pale-blue); }
.callout p { margin: .45rem 0 0; }
.guide-tools { margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: #f6f9fc; }
.guide-tools > label { display: block; margin-bottom: .35rem; font-weight: 700; }
#guideSearch { width: 100%; min-height: 46px; padding: .55rem .7rem; border: 1px solid #9cabb9; border-radius: 8px; background: #fff; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; margin-top: .8rem; }
.filter-row > label:not(.checkbox-filter) { font-weight: 700; }
#routeFilter { min-height: 42px; max-width: 100%; padding: .4rem .6rem; border: 1px solid #9cabb9; border-radius: 8px; background: #fff; }
.checkbox-filter { display: inline-flex; align-items: center; gap: .45rem; }
.checkbox-filter input { width: 1.15rem; height: 1.15rem; }
.result-count { margin: .55rem 0 0; color: var(--muted); font-size: .9rem; }
.search-results { margin-top: .8rem; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.search-results h3 { margin: 0 0 .45rem; color: var(--navy); font-size: 1rem; }
.search-result-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem .8rem; margin: 0; padding-left: 1.25rem; }
.search-result-list li { min-width: 0; padding: .25rem .2rem; }
.search-result-list a { overflow-wrap: anywhere; }
.warning-box { margin: .8rem 0; padding: .8rem .9rem; border: 1px solid #d9bd7f; border-radius: 9px; background: #fff9e9; }
.warning-box h4 { margin: 0 0 .25rem; color: #705213; }
.warning-box p { margin: 0; }
.outline-button { margin: 0 0 1rem; border-color: var(--blue); color: var(--navy); background: #fff; }
.outline-button:hover { background: var(--pale-blue); }
.guide-list, .report-list { display: grid; gap: .65rem; }
.guide-card, .report-card { position: relative; overflow: clip; border: 1px solid #cbd5df; border-radius: 10px; background: #fff; scroll-margin-top: 1rem; }
.guide-card.is-complete, .report-card.is-complete { background: #f2f8f4; }
.guide-card.just-completed, .report-card.just-completed { animation: guide-complete .58s ease-out; }
@keyframes guide-complete { 0% { box-shadow: 0 0 0 0 rgb(57 126 84 / 0%); } 35% { box-shadow: 0 0 0 4px rgb(57 126 84 / 24%); } 100% { box-shadow: 0 0 0 0 rgb(57 126 84 / 0%); } }
.guide-card summary, .report-card summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: .75rem; padding: .85rem .95rem; cursor: pointer; list-style: none; }
.guide-card summary::-webkit-details-marker, .report-card summary::-webkit-details-marker { display: none; }
.guide-card summary::after, .report-card summary::after { content: "+"; color: var(--navy); font-size: 1.2rem; font-weight: 800; }
.guide-card[open] summary::after, .report-card[open] summary::after { content: "−"; }
.guide-id { min-width: 5rem; padding: .18rem .4rem; border: 1px solid #cbd5df; border-radius: 6px; color: #46576a; background: #f4f7fa; font-size: .78rem; font-weight: 800; text-align: center; }
.guide-title { display: grid; gap: .12rem; }
.guide-title strong { color: var(--navy); }
.guide-meta { color: var(--muted); font-size: .87rem; }
.guide-body, .report-body { padding: 0 1rem 1rem; }
.guide-body p, .report-body p { margin: .55rem 0; }
.guide-body h4, .report-body h4 { margin: .9rem 0 .25rem; color: var(--navy); font-size: 1rem; }
.guide-body ul, .report-body ul { margin: .4rem 0; padding-left: 1.35rem; }
.loot-list { display: grid; gap: .45rem; margin: .65rem 0; }
.loot-group { padding: .65rem .75rem; border: 1px solid #d5dee7; border-radius: 8px; background: #f9fbfd; }
.loot-group h5 { margin: 0 0 .15rem; color: #344b65; font-size: .92rem; }
.loot-group p { margin: 0; }
.boss-tip { padding: .8rem; border: 1px solid #e2cfc7; border-radius: 9px; background: #fff8f5; }
.boss-tip h4 { margin-top: 0; color: #763d36; }
.card-check { display: flex; align-items: flex-start; gap: .55rem; margin-top: .9rem; padding: .55rem .65rem; border: 1px solid #ccd8cf; border-radius: 8px; background: #f3f8f4; font-weight: 700; }
.card-check input { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; margin-top: .22rem; accent-color: var(--green); }
.completion-stamp { position: absolute; top: .55rem; right: 3rem; display: none; padding: .16rem .45rem; transform: rotate(-7deg); border: 2px solid var(--green); border-radius: 5px; color: var(--green); font-size: .78rem; font-weight: 900; letter-spacing: .08em; pointer-events: none; }
.is-complete .completion-stamp { display: block; }
.report-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.report-card .guide-id { min-width: 4rem; }
.report-note { padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.table-wrap { max-width: 100%; margin-top: 1rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.table-swipe-hint { display: none; }
table { width: 100%; border-collapse: collapse; }
th, td { min-width: 10rem; padding: .7rem .8rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #fff; background: var(--navy); }
td { background: #fff; }
.empty-state { padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: center; }
.page-footer { margin-top: 1.2rem; padding: .9rem 1.1rem; color: var(--muted); text-align: center; }
.page-footer p { margin: 0; }
.back-to-top { position: fixed; right: 1rem; bottom: 1rem; z-index: 5; min-width: 3rem; min-height: 3rem; border: 1px solid #fff; border-radius: 50%; color: #fff; background: var(--navy); box-shadow: var(--shadow); }
.back-to-top:hover { background: #244c77; }
@media (max-width: 760px) {
  .table-swipe-hint { display: block; margin: 0; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: #edf3f8; color: var(--ink); font-size: .9rem; }
  .progress-panel { grid-template-columns: 1fr; gap: .55rem; }
  .progress-track { grid-row: 2; }
  .progress-panel .quiet-button { justify-self: start; }
  .card-grid, .report-list { grid-template-columns: 1fr; }
  .search-result-list { grid-template-columns: 1fr; }
  .return-bar { align-items: flex-start; flex-direction: column; }
  .header-tools { justify-content: flex-start; }
  .title-break { display: initial; }
  .completion-stamp { display: none !important; }
}
@media (max-width: 480px) {
  main, .return-bar, .title-row, .section-nav { width: min(100% - 1rem, 1120px); }
  .guide-card summary, .report-card summary { grid-template-columns: auto minmax(0, 1fr) auto; gap: .45rem; padding: .72rem .65rem; }
  .guide-id { min-width: 4rem; font-size: .72rem; }
  .guide-body, .report-body { padding-inline: .7rem; }
  .completion-stamp { top: .45rem; right: 2.45rem; }
  th, td { min-width: 9rem; padding: .55rem .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  :root { color-scheme: light; }
  body { background: #fff; font-size: 10.5pt; }
  .site-header { color: #111; background: #fff; border-bottom: 2px solid var(--navy); }
  .return-bar, .section-nav, .header-tools, .progress-track, .quiet-button, .guide-tools, .outline-button, .back-to-top, .card-check input { display: none !important; }
  .title-row, main { width: 100%; }
  .title-row { padding: 1rem 0; }
  .platform-label, .english-title { color: #333; }
  .content-section, .opening-note, .progress-panel, .page-footer { break-inside: avoid; box-shadow: none; }
  details:not([open]) > *:not(summary) { display: block !important; }
  .guide-card, .report-card { break-inside: avoid; }
  .guide-card summary::after, .report-card summary::after { display: none; }
  a { color: inherit; text-decoration: none; }
}

.walkthrough-card { position: relative; overflow: clip; border: 1px solid #cbd5df; border-radius: 10px; background: #fff; scroll-margin-top: 1rem; }
.walkthrough-card.is-complete, .info-card.is-complete { background: #f2f8f4; }
.walkthrough-card summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: .75rem; padding: .85rem .95rem; cursor: pointer; list-style: none; }
.walkthrough-card summary::-webkit-details-marker { display: none; }
.walkthrough-card summary::after { content: "+"; color: var(--navy); font-size: 1.2rem; font-weight: 800; }
.walkthrough-card[open] summary::after { content: "−"; }
.walkthrough-card .guide-body { padding: 0 1rem 1rem; }
.walkthrough-card .guide-body h3 { margin: .9rem 0 .25rem; color: var(--navy); font-size: 1rem; }
.walkthrough-steps { display: grid; gap: .6rem; margin: .5rem 0; padding: 0; list-style: none; }
.walkthrough-steps li { display: grid; grid-template-columns: 2rem minmax(0, 1fr); align-items: start; gap: .6rem; padding: .65rem; border: 1px solid #d5dee7; border-radius: 9px; background: #fbfcfd; }
.walkthrough-steps p { margin: 0; }
.step-number { display: grid; width: 1.8rem; height: 1.8rem; place-items: center; border: 1px solid #9eafc0; border-radius: 50%; color: var(--navy); font-weight: 800; }
.command-grid, .quest-grid, .ending-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.command-grid .info-card, .quest-grid .info-card, .ending-grid .info-card, #bossCards .info-card, #postgameCards .info-card, #systemCards .info-card, #keybladeList .info-card, #accessoryList .info-card { min-width: 0; position: relative; scroll-margin-top: 1rem; }
.info-card h3 { padding-right: 2.4rem; }
.section-tag { display: block; margin-bottom: .35rem; color: #526176; font-size: .78rem; font-weight: 800; letter-spacing: .04em; }
.story-reference { margin: .75rem 0 0; font-weight: 700; }
.subsection-heading { margin: 1.5rem 0 .8rem; }
.subsection-heading h3 { margin: 0; color: var(--navy); }
.subsection-heading p { margin: .3rem 0; }
.table-check { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.table-check input { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; accent-color: var(--green); }
.table-check [data-en] { white-space: nowrap; }
.trophy-row.is-complete th, .trophy-row.is-complete td, .enemy-row.is-complete th, .enemy-row.is-complete td { background: #f1f8f3; }
.system-reward-row td { min-width: 12rem; }
.command-summary-row td, .command-summary-row th { min-width: 11rem; }
.enemy-row th, .enemy-row td { min-width: 9rem; }
.trophy-row th, .trophy-row td { min-width: 10rem; }
.search-results { scroll-margin-top: 1rem; }
@media (max-width: 760px) {
  .command-grid, .quest-grid, .ending-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .walkthrough-card summary { grid-template-columns: auto minmax(0, 1fr) auto; gap: .45rem; padding: .72rem .65rem; }
  .walkthrough-card .guide-body { padding-inline: .7rem; }
  .walkthrough-steps li { grid-template-columns: 1.7rem minmax(0, 1fr); gap: .45rem; padding: .55rem; }
  .step-number { width: 1.6rem; height: 1.6rem; }
}
@media print {
  .walkthrough-card { break-inside: avoid; }
  .walkthrough-card summary::after { display: none; }
}
