:root{color-scheme:light;--ink:#173e46;--deep:#123844;--teal:#22696d;--accent:#ba463b;--paper:#fffcf1;--line:#b6c8bb;--sans:"Hiragino Kaku Gothic ProN","Yu Gothic","Noto Sans JP",system-ui,sans-serif;--serif:"Hiragino Mincho ProN","Yu Mincho","Noto Serif CJK JP",serif}
*{box-sizing:border-box}
body{margin:0;color:var(--ink);background-color:#e4eee8;background-image:linear-gradient(90deg,#9fb8ad20 1px,transparent 1px),linear-gradient(#9fb8ad20 1px,transparent 1px);background-size:24px 24px;font-family:var(--sans);font-weight:550}
button{font:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}button:disabled{opacity:.4;cursor:default}button:focus-visible,canvas:focus-visible{outline:3px solid #de6a37;outline-offset:3px}
.mast{color:#fff9e7;background:var(--ink);border-bottom:4px solid #d9ad66}.mast-in{max-width:1120px;margin:auto;min-height:52px;padding:0 26px;display:flex;align-items:center;justify-content:space-between}.brand{display:flex;align-items:center;gap:9px;font-size:.97rem;font-weight:800;letter-spacing:.09em}.brand svg{color:#efd7a2}.help-button{border:1px solid #9db5ac;background:transparent;color:#fff9ec;padding:5px 14px;border-radius:3px;font-size:.86rem;min-height:34px;display:flex;gap:8px;align-items:center}.help-button span{width:16px;height:16px;border:1px solid currentColor;border-radius:50%;font:bold 12px/15px system-ui}
.game-wrap{width:min(1100px,100%);padding:clamp(17px,3.6vw,47px) 24px 32px;margin:auto;display:grid;grid-template-columns:minmax(270px,.79fr) minmax(395px,1.21fr);grid-template-rows:auto auto 1fr;grid-template-areas:"intro play" "actions play" "log play";gap:18px 30px;align-items:start}
.intro{grid-area:intro;min-width:0}.hero{background:#f9eed4;border:1px solid #a8bcae;position:relative;isolation:isolate;overflow:hidden;min-height:240px;border-radius:5px;box-shadow:0 3px 0 #79958a36}
.skyline{position:absolute;inset:0;z-index:-2;background:linear-gradient(90deg,#faf2dcd9 0%,#faf2dc55 55%,transparent 90%),url('assets/ridge.svg') bottom center / cover no-repeat}
.hero-copy{position:relative;z-index:1;padding:24px 20px 65px;pointer-events:none}.series{margin:0 0 6px;font-size:.85rem;letter-spacing:.19em;font-weight:800;color:#526962}
h1{font-family:var(--serif);font-weight:900;font-size:clamp(2.75rem,4.3vw,4.15rem);letter-spacing:-.035em;line-height:1.12;margin:0;color:#173f45;text-shadow:1px 1px #ffeec9}.lead{margin:12px 0 0;font-weight:750;font-size:clamp(.9rem,1.3vw,1.04rem);line-height:1.65}.courier{width:35%;max-width:151px;position:absolute;z-index:0;right:2%;bottom:-4%;filter:drop-shadow(0 2px 0 #ffffff60)}
.play-area{grid-area:play;width:100%;max-width:622px;background:var(--paper);border:1px solid #9aaea4;border-radius:8px;box-shadow:0 5px 0 #63847930;overflow:hidden}.board-heading{height:76px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 18px}.route{display:flex;align-items:center;gap:13px}.dispatch-number{height:43px;min-width:62px;padding:0 7px;display:flex;align-items:baseline;justify-content:center;align-content:center;flex-wrap:wrap;border:1.5px solid #b64c3e;outline:1px solid #b64c3e;outline-offset:-4px;color:#a74639;font-size:.72rem;font-weight:800;transform:rotate(-3deg);border-radius:3px}.dispatch-number span{font-family:Georgia,serif;font-size:1.35rem;letter-spacing:.03em;margin:0 1px}h2{margin:0;font-weight:800}.route h2{font-family:var(--serif);font-size:clamp(1.05rem,2.2vw,1.7rem);line-height:1.2}.budget{display:flex;align-items:baseline;white-space:nowrap;gap:4px;font-size:.83rem}.budget strong{color:var(--accent);font-family:Georgia,serif;font-size:2rem}.budget b{font-weight:700}
.field{margin:0 13px;border:6px solid #2b626a;box-shadow:0 0 0 1px #133f46,inset 0 0 0 1px #c3e6df;border-radius:3px;overflow:hidden;background:#a9d9dd}.field canvas{display:block;width:100%;height:auto;aspect-ratio:1;touch-action:none;user-select:none;outline-offset:-3px}.statebar{display:flex;align-items:center;gap:9px;padding:12px 17px;min-height:50px}.statebar p{margin:0;font-size:.92rem;line-height:1.45;font-weight:650}.state-icon{font-size:1.22rem;color:var(--teal)}[data-phase=won] .statebar{background:#d9edd0}[data-phase=failed] .statebar{background:#fae2ce}
.actions,.log{background:var(--paper);border:1px solid #aabdae;border-radius:5px;box-shadow:0 3px 0 #79958a28;padding:17px 20px}.actions{grid-area:actions}.log{grid-area:log}.actions h2,.log h2{font-family:var(--serif);font-size:1.25rem}.action-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.controls-info p{font-size:.87rem;line-height:1.7;color:#506660;margin:7px 0}.dpad{display:grid;grid-template:repeat(3,34px)/repeat(3,41px);gap:3px;align-items:stretch;justify-items:stretch}.dir{display:grid;place-items:center;padding:0;background:#e1e9d8;border:1px solid #859d8d;border-bottom:3px solid #789485;border-radius:5px;touch-action:manipulation}.dir:not(:disabled):active{transform:translateY(2px);border-bottom-width:1px;background:#ccdccc}.dir span{width:9px;height:9px;border-right:3px solid var(--ink);border-top:3px solid var(--ink);display:block;transform:rotate(-45deg)}.north{grid-area:1/2}.west{grid-area:2/1}.west span{transform:rotate(-135deg)}.east{grid-area:2/3}.east span{transform:rotate(45deg)}.south{grid-area:3/2}.south span{transform:rotate(135deg)}.pad-mid{grid-area:2/2;align-self:center;justify-self:center;width:9px;height:9px;border:2px solid #b3c7b6;transform:rotate(45deg)}
.action-tools{display:flex;gap:8px;margin-top:14px}.action-tools button{flex:1;background:transparent;border:1px solid #acbeb2;border-radius:4px;min-height:38px;font-size:.91rem;font-weight:700}.action-tools span{font:1.15rem system-ui}.action-tools button:not(:disabled):hover,.dir:not(:disabled):hover{background:#dbeadd}
.log{position:relative;border-top:4px solid #c85c4a}.log-head,.mechanism-line{display:flex;align-items:baseline;justify-content:space-between;gap:8px}.log-total{font-size:.82rem}.log-total strong{font: bold 1.35rem Georgia,serif;color:var(--accent)}.stamp-track{display:flex;align-items:center;gap:8px;margin:13px 0 8px}.stamp{width:29px;height:29px;display:grid;place-items:center;border:1px dashed #a0afa4;border-radius:50%;font-size:0;color:#acc2ad}.stamp:before{content:'✉';font-size:16px;opacity:.55}.stamp.is-stamped{border:2px solid #b95141;transform:rotate(-8deg);background:#fae5d6;color:#a94437}.stamp.is-stamped:before{opacity:1}.log p{margin:0;font-size:.85rem;font-weight:650;color:#536960}.mechanism-line{border-top:1px dashed #bdc8b8;padding-top:10px;margin-top:12px;font-size:.82rem}.mechanism-line strong{font-size:.89rem;color:#206268}
dialog{background:#fffbef;color:var(--ink);width:min(440px,calc(100% - 32px));padding:0;border:2px solid var(--ink);border-radius:8px;box-shadow:5px 7px 0 #183e4640}dialog::backdrop{background:#132f39a8}.guide-wrap{padding:22px}.guide-top{display:flex;align-items:center;justify-content:space-between}.guide-top h2{font-family:var(--serif);font-size:1.55rem}.guide-top button{width:38px;height:38px;border:1px solid #afbbad;background:none;border-radius:50%;font-size:1.2rem}.guide-wrap>p,.legend dd{line-height:1.65;font-size:.95rem}.legend{margin:14px 0}.legend>div{border-top:1px dashed #bdc8b8;display:grid;grid-template-columns:87px 1fr;gap:8px;padding:10px 0}.legend dt{font-weight:800;display:flex;align-items:flex-start;gap:5px}.legend dt span{width:20px;text-align:center}.legend dd{margin:0}.key-turn{color:#a74639}.key-fan{color:#21777c}.guide-tip{margin-bottom:0}
@media(min-width:1200px) and (max-height:820px){.game-wrap{max-width:1010px;padding-top:23px;column-gap:26px}.hero{min-height:206px}.hero-copy{padding-bottom:39px}.board-heading{height:61px}.actions,.log{padding:13px 17px}}
@media(max-width:760px){.mast-in{min-height:41px;padding:0 14px}.mast{border-bottom-width:3px}.brand{font-size:.83rem;gap:5px}.brand svg{width:27px}.help-button{font-size:.8rem;padding:3px 10px;min-height:30px}.game-wrap{width:min(100%,570px);padding:10px 10px 22px;grid-template: 'intro' auto 'play' auto 'actions' auto 'log' auto / 1fr;gap:10px}.hero{min-height:0}.hero-copy{padding:10px 13px 12px;max-width:77%}.series{font-size:.68rem;margin:0 0 3px}.hero h1{font-size:clamp(2rem,7.1vw,2.6rem)}.lead{font-size:.82rem;margin:4px 0 0}.lead br{display:initial}.courier{width:21%;max-width:86px;bottom:-3%;right:3%}.board-heading{height:52px;padding:0 11px}.dispatch-number{min-width:51px;height:32px}.dispatch-number span{font-size:1.1rem}.route{gap:9px}.route h2{font-size:1.12rem}.budget{font-size:.77rem}.budget strong{font-size:1.55rem}.field{margin:0 8px;border-width:4px}.statebar{padding:7px 10px;min-height:39px}.statebar p{font-size:.84rem}.actions,.log{padding:12px 15px}.actions{display:flex;align-items:center;justify-content:space-between;gap:12px}.action-row{display:contents}.actions h2,.controls-info{display:none}.dpad{display:flex;gap:4px;flex:1}.dir{min-width:0;width:25%;height:43px}.west{order:0}.north{order:1}.south{order:2}.east{order:3}.pad-mid{display:none}.action-tools{margin:0;display:flex;flex-wrap:wrap;max-width:135px;gap:4px}.action-tools button{font-size:.75rem;min-height:36px;white-space:nowrap;padding:3px 5px}.action-tools span{display:none}.log h2{font-size:1.08rem}.stamp-track{margin:8px 0}.stamp{width:24px;height:24px}.log .mechanism-line{margin-top:8px}}
@media(max-width:365px){.game-wrap{padding-inline:6px}.actions{gap:6px;padding-inline:8px}.lead{font-size:.74rem}.route h2{font-size:1rem}.budget{gap:2px}.courier{right:1%}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
.field{position:relative}
[data-phase=won] .field:after{content:'配達完了';position:absolute;top:42%;left:50%;color:#a43e31;background:#fff5deeb;border:3px double #af493a;box-shadow:0 2px 8px #33463738;border-radius:5px;transform:translate(-50%,-50%) rotate(-9deg);padding:.1em .48em .16em;white-space:nowrap;font:900 clamp(1.75rem,4vw,3rem)/1.25 var(--serif);letter-spacing:.12em;pointer-events:none;animation:stamp-in .24s ease-out}
@keyframes stamp-in{from{transform:translate(-50%,-50%) rotate(-13deg) scale(1.28);opacity:0}to{transform:translate(-50%,-50%) rotate(-9deg) scale(1);opacity:1}}

.hint-open {
  display: flex; align-items: center; justify-content: center; gap: .55em;
  width: 100%; margin-top: 9px; min-height: 42px;
  border: 1px solid #bc8f62; border-radius: 4px; background: #fbefcf;
  color: #704125; font-weight: 750; font-size: .95rem;
}
.hint-open span { font: 1.2rem/1 Georgia, serif; }
.hint-open:hover:enabled { background: #f4e1ac; }
.hint-wrap { border-top: 6px solid transparent; border-image: repeating-linear-gradient(130deg,#c1634e 0 11px,#f9f4df 11px 21px,#467578 21px 32px,#f9f4df 32px 43px) 6; }
.hint-wrap .hint-result { padding: 13px 16px; border-left: 3px solid #bd8b50; background: #f5eaca; font-weight: bold; }
.hint-confirm { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); border-radius: 4px; min-height: 43px; width: 100%; font-size: 1rem; font-weight: bold; }
.post-footer { text-align: center; margin: 0 auto 18px; font-size: .85rem; }
.post-footer a,.privacy-sheet a { color: #285755; text-underline-offset: .2em; }
.privacy-sheet { width: min(620px,calc(100% - 32px)); margin: 30px auto; padding: clamp(18px,5vw,36px); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.privacy-sheet h1 { font-size: clamp(1.5rem,5vw,2.1rem); }
.privacy-sheet h2 { font-size: 1.1rem; margin: 1.5rem 0 .4rem; }
.privacy-sheet p { line-height: 1.8; margin: .4rem 0 1rem; }
@media(max-width:760px) {
  .actions { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; }
  .hint-open { grid-column: 1 / -1; margin: 0; }
}
