:root { --line:#c6d1d6; --ink:#17375f; }
html { scroll-padding-top:18px; }
.shell { max-width:1280px; padding:24px 28px 70px; }
.hero { background:linear-gradient(110deg,#17375f,#1d3f6b); border-radius:14px; }
.hero h1 { font-size:clamp(28px,3.9vw,54px); line-height:1.35; letter-spacing:0; }
.edition { color:#f2d598; }
.layout { grid-template-columns:250px minmax(0,1fr); gap:30px; }
.side { padding:16px; }
.missable-note { margin:20px 0 0; padding:15px 20px; background:#fbf3df; border:1px solid #c0ac7c; border-radius:10px; color:#594820; }
.missable-note h2 { margin:0 0 5px; font-size:17px; }
.missable-note p { margin:0; }
.overview-grid { grid-template-columns:1fr; }
.overview-tags { margin-top:12px; }
.controls { grid-template-columns:minmax(0,1fr) 180px; }
#clear-search { flex:0 0 auto; white-space:nowrap; min-width:58px; }
.sound { justify-self:start; }
.chapter-name { font-family:"Yu Mincho",YuMincho,serif; font-size:1.2rem; font-weight:700; }
.chapter-number { width:auto; height:auto; background:transparent; color:var(--gold); border-radius:0; }
.chapter-summary,.puzzle-group>summary { border-bottom:0; }
.chapter-card[open]>.chapter-summary,.puzzle-group[open]>summary { border-bottom:1px solid var(--line); }
.route-tools { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0 15px; }
.action-list { padding-left:1.5rem; margin:12px 0 0; }
.action-list li { margin:0 0 10px; }
.action-list li:last-child { margin-bottom:0; }
.route-step.is-done,.puzzle-card.is-done .puzzle-body { border-color:var(--green); box-shadow:none; background:#f3f8ef; }
.is-done>.stamp,.is-done .puzzle-body>.stamp { animation:stamp-in .3s ease-out; }
@keyframes stamp-in { from { transform:scale(1.12); opacity:.1; } to { transform:scale(1); opacity:1; } }
.puzzle-find { margin:9px 0; color:#526572; }
.answer-copy { margin:12px 0; }
.solution-table { min-width:430px; }
.table-wrap { max-width:100%; }
#puzzle-index table { min-width:610px; table-layout:fixed; }
#puzzle-index th:first-child { width:48px; }
#puzzle-index th:nth-child(2) { width:160px; }
#puzzle-index th:last-child { width:75px; }
.puzzle-references { display:flex; flex-wrap:wrap; gap:8px; margin:15px 0; }
.puzzle-references a { font-size:14px; }
.answer-figure { margin:18px 0; padding:12px; border:1px solid var(--line); border-radius:10px; background:#f9faf5; }
.figure-window,.model-diagram { overflow:auto; max-width:100%; }
.answer-figure img { display:block; width:100%; max-width:640px; min-width:370px; height:auto; margin:auto; }
.answer-figure figcaption { margin-top:10px; font-size:14px; color:#526572; }
.model { margin:16px 0; padding:14px; border:1px solid var(--line); border-radius:10px; }
.model-diagram svg { display:block; width:100%; min-width:450px; max-width:650px; margin:auto; }
.model-legend { margin:0 0 12px; padding-left:1.2rem; font-size:14px; }
.model-controls { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:12px 0; }
.model-controls output { font-weight:700; }
.model-moves { margin:0; padding-left:1.8rem; max-height:290px; overflow:auto; }
.model-moves li { padding:3px 0; }
.model-moves button { text-align:left; border:1px solid transparent; border-radius:5px; color:var(--link); background:transparent; padding:4px 8px; cursor:pointer; }
.model-moves button[aria-current="step"] { background:#e0ecf3; border-color:#9eb3c2; }
button:disabled { cursor:default; opacity:.5; }
.model-current { margin:8px 0; min-height:28px; font-weight:600; }
.extra-card { margin:15px 0; padding:16px; border:1px solid var(--line); border-radius:10px; }
.extra-card h3 { margin:0 0 8px; }
.extra-card p { margin:0; }
.footer { padding-right:70px; }
@media(max-width:1350px) { .shell { padding-right:70px; } }
@media(max-width:950px) { .layout { grid-template-columns:1fr; gap:16px; } }
@media(max-width:620px) {
 body { font-size:16px; }
 .shell { padding:10px 62px 65px 10px; }
 .hero { padding:19px 17px; }
 .hero h1 { font-size:28px; line-height:1.42; }
 .main { padding-right:0; }
 .controls { grid-template-columns:1fr; }
 .control-actions { display:flex; }
 .action-btn { white-space:normal; }
 .chapter-name { font-size:18px; }
 .step-head { flex-wrap:wrap; }
 .step-copy,.answer-copy { font-size:16px; }
 .action-list { padding-left:1.25rem; }
 .puzzle-meta { grid-template-columns:1fr; gap:3px; }
 .puzzle-summary { flex-wrap:wrap; }
 .puzzle-title { min-width:160px; }
 .table-wrap { overflow-x:auto; border:1px solid var(--line); background:#fff; }
 table { display:table; width:100%; }
 thead { display:table-header-group; }
 tbody { display:table-row-group; }
 tbody tr { display:table-row; border:0; }
 td,td:nth-child(2),td:nth-child(3) { display:table-cell; padding:8px 10px; border-top:1px solid var(--line); color:var(--ink); font-size:14px; }
 td.number-cell { display:table-cell; width:48px; border-right:0; background:transparent; }
 th { font-size:14px; }
 .answer-figure,.model { padding:8px; }
 .top-button { right:6px; bottom:12px; }
 .missable-note { padding:13px 15px; }
}
@media(prefers-reduced-motion:reduce) {
 *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
}
@media print {
 .route-tools,.model-controls,.model-current,.model-moves button::after,.puzzle-references,.footer,.missable-note { display:none!important; }
 .layout,.main { display:block; padding:0; }
 .puzzle-body,.route-step { break-inside:auto; }
 .model-moves { max-height:none; overflow:visible; }
 .model-moves button { color:#000; padding:0; }
 .answer-figure,.model { break-inside:avoid; }
 .model-diagram svg,.answer-figure img { min-width:0; max-width:450px; }
 .table-wrap,.figure-window,.model-diagram { overflow:visible; }
 table,.solution-table,#puzzle-index table { min-width:0; }
 .is-done .stamp { display:none; }
 .hero h1 { font-size:24pt; }
}
