:root{--bg: #f5f1e6;--card: #fffdf7;--ink: #3a3226;--muted: #8a7f6d;--gold: #b8963e;--gold-dark: #97781f;--green: #7a8f5a;--alert: #b0483a;--line: #d9cfb8}*{box-sizing:border-box}html,body{margin:0;padding:0}body{background:var(--bg);color:var(--ink);font-family:Hiragino Kaku Gothic ProN,Noto Sans JP,Yu Gothic,sans-serif;font-size:15px;line-height:1.6}.shell{max-width:900px;margin:0 auto;padding:0 10px 40px}.shell.wide{max-width:1500px}.topbar{display:flex;justify-content:space-between;align-items:center;padding:10px 4px;border-bottom:2px solid var(--gold)}.topbar h1{font-size:1.15rem;margin:0;cursor:pointer;letter-spacing:.05em}h2{font-size:1.1rem;margin:0 0 10px}h3{font-size:1rem;margin:16px 0 6px;color:var(--gold-dark)}.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:16px;margin:14px 0;box-shadow:0 1px 4px #3c321e0f}.card.narrow{max-width:480px;margin-inline:auto}.center{text-align:center;padding:40px 0}.muted{color:var(--muted)}.small{font-size:.82rem}.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.card>.row:not(:first-child){margin-top:12px}.row.between{justify-content:space-between}.row.between>h2{flex:0 0 auto}.row.wrap{flex-wrap:wrap}button{font:inherit;padding:8px 14px;border-radius:8px;cursor:pointer;border:1px solid var(--line);background:#fff;color:var(--ink);white-space:nowrap;min-height:42px}button.primary{background:var(--gold);border-color:var(--gold-dark);color:#fff;font-weight:700}button.primary:disabled{opacity:.45;cursor:not-allowed}button.danger{background:#fff;color:var(--alert);border-color:var(--alert)}button.link{border:none;background:none;color:var(--gold-dark);text-decoration:underline;padding:4px 6px;min-height:0}button.big{padding:12px 20px;font-size:1.05rem;width:100%}input,select,textarea{font-family:inherit;font-size:16px;line-height:1.3;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);max-width:100%}form{display:flex;gap:8px;flex-wrap:wrap}.code-input{flex:1 1 8em;min-width:7em;width:8.5em;text-transform:uppercase}.name-edit{flex:1 1 14em;justify-content:flex-end}.name-edit input{flex:1 1 8em;min-width:7em;max-width:14em}.lobby-actions{align-items:stretch}.lobby-actions>form{flex:1 1 16em}.lobby-actions .make-room{flex:0 0 auto}.role-mode{display:flex;flex-direction:column;font-size:.85rem;color:var(--muted);max-width:16em}.role-pick{width:100%;margin-top:8px;padding-top:8px;border-top:1px dashed var(--line)}.role-pick button small{color:var(--muted);margin-left:4px}.role-pick button:disabled{opacity:.4}.player-list select{font-size:16px;padding:3px 6px}.create-form{flex-direction:column;align-items:stretch;background:#faf6ea;border:1px dashed var(--gold);border-radius:10px;padding:12px;margin:10px 0}.steppers{display:flex;gap:14px;flex-wrap:wrap}.steppers label{display:flex;flex-direction:column;font-size:.85rem;color:var(--muted)}.num-input{width:6em}.tag{display:inline-block;background:#efe7d2;color:var(--gold-dark);padding:1px 8px;border-radius:999px;font-size:.78rem;margin-left:6px}.tag.big{font-size:1rem;letter-spacing:.15em}.tag.me{background:var(--green);color:#fff}.room-list,.player-list{list-style:none;padding:0;margin:8px 0 4px}.room-list li,.player-list li{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;padding:10px;border-bottom:1px solid var(--line)}.room-list li>div:first-child{flex:1 1 12em;min-width:0}.player-list li.empty{color:var(--muted);font-style:italic}.waiting-banner{background:#efe7d2;border-radius:10px;text-align:center;padding:14px;margin:12px 0;font-size:1.05rem}.statusbar{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;background:var(--ink);color:#f5efe2;border-radius:10px;padding:8px 14px;margin:10px 0;font-weight:700}.statusbar.myturn{background:var(--gold-dark)}.board-wrap{position:relative;background:var(--card);border:1px solid var(--line);border-radius:12px;overflow:hidden}.legend-toggle{position:absolute;top:8px;right:8px;z-index:2;padding:6px 12px;min-height:36px;font-size:.84rem;background:#fffdf7eb;border-color:var(--gold)}.board{width:100%;height:auto;display:block;max-height:calc(100vh - 150px)}.zoom-ctrl{position:absolute;top:8px;left:8px;z-index:2;display:flex;flex-direction:column;gap:4px}.zoom-ctrl button{width:38px;height:38px;min-height:38px;padding:0;font-size:1rem;line-height:1;background:#fffdf7eb;border-color:var(--gold)}.mapbg{image-rendering:pixelated}.edge-outer{stroke:#8a7a5a;stroke-width:7;opacity:.5;stroke-linecap:round}.edge{stroke:#fff3da;stroke-width:4;stroke-linecap:round}.node{stroke:#8d8062;stroke-width:1.5;cursor:default}.node.settlement{fill:#fff}.node.farmland{fill:#e9d789}.node.forest{fill:#9fb583}.node.selectable{stroke:var(--gold-dark);stroke-width:4;cursor:pointer}.node.selected{fill:#f2b866;stroke:var(--alert);stroke-width:4}.node-name{font-size:13px;font-weight:700;text-anchor:middle;fill:#4a4230;paint-order:stroke;stroke:#fffcf2e6;stroke-width:3.5px}.node-id{font-size:11px;text-anchor:middle;fill:#9c9077}.emoji{font-size:18px;text-anchor:middle;pointer-events:none}.pin{pointer-events:none;filter:drop-shadow(0 2px 3px rgba(40,33,20,.5))}.pin-body{stroke:#fffdf7;stroke-width:2.5}.pin-face{fill:#fffdf7}.pin-icon{font-size:23px;text-anchor:middle}.pin.hunter .pin-body{fill:#c0562f}.pin.resident .pin-body{fill:#3f7ea6}.pin.boar .pin-body{fill:#6d4b2f}.pin.mine .pin-body{stroke:#ffd34d;stroke-width:4.5}.pin.mine{filter:drop-shadow(0 0 6px rgba(255,200,60,.95)) drop-shadow(0 3px 3px rgba(40,33,20,.45))}.pin.captured{opacity:.5}.me-highlight{pointer-events:none}.me-ring{fill:none;stroke:#e8562f;stroke-width:4;opacity:.9}.me-pulse{fill:none;stroke:#ffb020;stroke-width:5;transform-origin:center;animation:mePulse 1.6s ease-out infinite}@keyframes mePulse{0%{transform:scale(.7);opacity:.9}to{transform:scale(1.5);opacity:0}}.me-tag{pointer-events:none}.me-tag-bg{fill:#e8562f}.me-tag-text{fill:#fff;font-size:15px;font-weight:700;text-anchor:middle}@media(prefers-reduced-motion:reduce){.me-pulse{animation:none;opacity:0}}.rejoin-code .hint{opacity:.8}.rejoin-banner{background:#efe7d2}.rejoin-list{border-color:var(--gold);background:#fbf7ec}.rejoin-list h3{margin-top:0}.rejoin-room{padding:6px 0;border-top:1px dashed var(--line)}.rejoin-room:first-of-type{border-top:none}.rejoin-seat{border-color:var(--gold);font-weight:700}.rejoin-seat small{color:var(--muted);font-weight:400;margin-left:4px}.legend{cursor:pointer}.legend-bg{fill:#fffdf7ed;stroke:var(--gold);stroke-width:2}.legend-title{font-size:24px;font-weight:700;fill:var(--gold-dark)}.legend-label{font-size:18px;fill:#4a4230}.legend-hint{font-size:16px;fill:var(--muted);text-anchor:end}.legend-pin-icon{font-size:17px}.legend-emoji{font-size:24px}.sel-path{fill:none;stroke:var(--alert);stroke-width:5;stroke-dasharray:8 6}.track{fill:none;stroke-width:4;stroke-dasharray:10 6;opacity:.75}.panel{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:12px;margin:10px 0}.panel.active{border-color:var(--gold);box-shadow:0 0 0 2px #b8963e40}.guide{margin:6px 0}.chip{display:inline-flex;gap:5px;align-items:center;border:1px solid var(--line);border-radius:999px;padding:5px 12px;background:#fff;cursor:pointer;font-size:.9rem}.chip.disabled{opacity:.4}.boar-status{margin-top:10px;padding-top:8px;border-top:1px dashed var(--line);font-size:.88rem;display:flex;gap:14px;flex-wrap:wrap}.food.captured{color:var(--muted);text-decoration:line-through}.game-actions{justify-content:flex-end;margin-top:12px}.log{background:#2f2a20;color:#e8e0cd;border-radius:10px;padding:10px 14px;height:140px;overflow-y:auto;font-size:.85rem;margin:10px 0}.log-line.alert{color:#f0b95e;font-weight:700}.result .winner{text-align:center;font-size:1.5rem;margin:8px 0 4px}.result-board{margin:10px 0}.result-board .board{max-height:46vh}.result .stats{max-height:22vh;overflow-y:auto}.stats{list-style:none;padding:0;font-size:.88rem}.stats li{padding:3px 0}.modal-bg{position:fixed;inset:0;background:#2821148c;display:flex;align-items:center;justify-content:center;z-index:50;padding:14px}.qr-modal{text-align:center;max-width:420px}.qr{background:#fff;padding:12px;border-radius:12px;margin:12px auto;max-width:300px}.qr svg{width:100%;height:auto;display:block}.qr-url{word-break:break-all;font-size:.85rem;color:var(--muted);margin:8px 0}.qr-modal .row{justify-content:center}.modal{background:var(--card);border-radius:14px;max-width:560px;max-height:85vh;overflow-y:auto;padding:20px}.toasts{position:fixed;bottom:16px;left:0;right:0;display:flex;flex-direction:column;align-items:center;gap:8px;z-index:99;pointer-events:none}.toast{background:var(--ink);color:#fff;border-radius:999px;padding:8px 20px;font-size:.9rem;box-shadow:0 3px 10px #0000004d;max-width:92vw}.toast.alert{background:var(--alert)}.toast.error{background:#7c2d12}@media(max-width:480px){.shell{padding:0 8px 32px}.card{padding:13px}.lobby-actions{flex-direction:column;align-items:stretch}.lobby-actions>form{flex-direction:row}.lobby-actions .make-room,.lobby-actions .refresh{width:100%}.room-list li>.row{width:100%;justify-content:space-between}.steppers{gap:10px}.steppers label{flex:1 1 5.5em}}@media(min-width:760px){.game{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:12px;grid-template-areas:"status status" "board panel" "board log"}.game.finished{grid-template-areas:"status status" "result log"}.statusbar{grid-area:status}.board-wrap{grid-area:board}.panel{grid-area:panel;margin:0;align-self:start}.log{grid-area:log;height:auto;min-height:180px;max-height:70vh;margin:0}.result{grid-area:result;min-width:0}.result .card{margin:0}.game-actions{grid-column:1 / -1}}
