@font-face{font-family:Rounded;src:url('../assets/fonts/MPLUSRounded1c-Regular.subset.woff2') format('woff2');font-weight:400;font-display:swap}
@font-face{font-family:Rounded;src:url('../assets/fonts/MPLUSRounded1c-Bold.subset.woff2') format('woff2');font-weight:700;font-display:swap}
:root{--bg:#faf5ed;--ink:#493f36;--green:#dce9d5;--purple:#e7ddef;--gold:#e6c979;--line:#d8cfc2;--brown:#8a5a3c}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;overscroll-behavior:none}[hidden]{display:none!important}
body{background:var(--bg);color:var(--ink);font-family:Rounded,system-ui,sans-serif;line-height:1.55;-webkit-tap-highlight-color:transparent}
button,a{touch-action:manipulation}button{font:inherit;color:inherit;cursor:pointer}button:disabled{cursor:default;opacity:.42}button:focus-visible,a:focus-visible{outline:3px solid #7459a8;outline-offset:3px}button:active:not(:disabled){transform:translateY(1px)}
#app{max-width:620px;margin:auto;padding:10px 16px max(12px,env(safe-area-inset-bottom));min-height:100svh}
.toolbar{display:flex;align-items:center;gap:8px;height:48px}.toolbar-caption{flex:1;font-size:13px;color:#756b60}.icon{border:0;border-radius:14px;background:#fff;color:var(--brown);width:46px;height:46px;display:grid;place-items:center;text-decoration:none;flex-shrink:0}.icon svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.mic-state{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:#ece4d6;color:#918671}.mic{width:26px;height:26px;fill:currentColor}.mic .slash{display:none;stroke:#b94436;stroke-width:2.5}.mic-state.listening{background:#f2e2a8;color:#806121}.mic-state.denied .slash{display:block}.mic-state.restarting{opacity:.6}
.screen{width:100%}h1{margin:16px auto 18px;text-align:center;line-height:1}h2{text-align:center;font-size:clamp(21px,5vw,28px);margin:20px 0 12px}.wordmark{display:block;width:min(100%,430px);height:auto;margin:auto}.menu-options{display:grid;gap:12px}.seg{display:flex;gap:4px;padding:4px;background:#eae2d6;border-radius:16px}.seg button{flex:1;border:0;border-radius:12px;background:transparent;min-height:44px;font-weight:700;padding:8px 4px;font-size:clamp(13px,3.6vw,16px)}.seg button[aria-pressed=true]{background:#fff;color:#4e3869;box-shadow:0 1px 3px #493f3620}.option-pair{display:grid;gap:10px}.note{font-size:13px;text-align:center;margin:0;color:#746758;line-height:1.55}.difficulty{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.difficulty button{border:2px solid transparent;background:var(--purple);border-radius:16px;min-height:58px;font-weight:700;font-size:14px}.difficulty button[aria-pressed=true]{border-color:#78649b;background:#dcd0ec}
.big{display:block;border:0;border-radius:18px;width:100%;min-height:54px;padding:12px;font-size:18px;font-weight:700}.green{background:var(--green);color:#30462e}.purple{background:var(--purple);color:#4e3869}.gold{background:var(--gold);color:#503e17}.subtle{background:#eae2d6;color:#6b5a49}.menu-actions{display:grid;gap:9px;margin-top:16px}.record{text-align:center;color:#776443;font-weight:700;min-height:1.5em;font-size:14px;margin:12px 0}.title-footer{text-align:center;font-size:11px;color:#8c8071;margin-top:14px}
.scores{display:flex;gap:10px;justify-content:center;margin:10px auto}.score{display:flex;align-items:center;justify-content:center;gap:8px;flex:1;min-width:0;padding:8px;border-radius:15px;background:#fff;border:2px solid transparent;line-height:1.3}.score.active{border-color:#a58a51}.owner-chip{border:1px solid #493f3650;border-radius:8px;width:32px;height:32px;display:grid;place-items:center;font-weight:700;flex-shrink:0}.score-name{font-size:12px}.score-count{font-weight:700;font-size:25px}.stock{font-size:11px;color:#796d5d;white-space:nowrap}.palette{display:grid;grid-template-columns:repeat(6,1fr);gap:9px 6px;margin:16px 0}.swatch{border:2px solid transparent;border-radius:12px;background:none;padding:4px 2px;display:flex;flex-direction:column;gap:5px;align-items:center}.swatch[aria-pressed=true]{border-color:#aa832a;background:#fff1c9}.swatch .chip{width:100%;aspect-ratio:1;border:1px solid #493f3650;border-radius:9px}.swatch span:last-child{font-size:10px;white-space:nowrap}.swatch:disabled{opacity:.25}.selection-status{text-align:center;min-height:26px;font-weight:700;font-size:16px;margin:8px 0;color:#6b4c85}#setup>.big{margin:12px 0}#setup .note{margin-bottom:12px}.dice-face{width:180px;height:180px;border:4px solid #d3b67c;background:#fff;border-radius:35px;display:grid;place-items:center;margin:32px auto;font-size:110px;font-weight:700;color:#8a5a3c}
.match-info{display:flex;justify-content:space-between;font-size:12px;margin-top:8px;color:#766958}.turn-status{text-align:center;font-size:16px;font-weight:700;min-height:25px;margin:2px 0 5px}.board{--n:6;--hdr:17px;display:grid;grid-template-columns:var(--hdr) repeat(var(--n),1fr) var(--hdr);grid-template-rows:var(--hdr) repeat(var(--n),1fr) var(--hdr);gap:3px;width:min(100%,430px,calc(100svh - 380px));aspect-ratio:1;margin:0 auto;padding:3px;background:#cfc4b2;border-radius:12px}.board-label{display:grid;place-items:center;font-weight:700;font-size:11px;color:#786a54}.cell{position:relative;min-width:0;min-height:0;border:0;border-radius:4px;padding:0;font-weight:700;font-size:clamp(12px,3.5vw,21px);display:grid;place-items:center;background:#efe7d8;color:#756449}.cell.empty{background:repeating-linear-gradient(45deg,#efe7d8,#efe7d8 6px,#e8decc 6px,#e8decc 12px)}.cell.legal.empty::after{content:'';width:6px;height:6px;border-radius:50%;background:#9b8e75;opacity:.55}.cell.preview{outline:2px dashed #fff;outline-offset:-4px;box-shadow:inset 0 0 0 2px #7b6543}.cell.extra{outline:3px dashed #aa7521;outline-offset:-4px}.cell.selected{outline:3px solid #a0731c;outline-offset:-2px;z-index:1}.choice-badge{position:absolute;right:-2px;top:-4px;background:#fff8df;border:1px solid #8d6428;border-radius:50%;width:19px;height:19px;font-size:13px;line-height:17px;color:#603e14;z-index:2}.cell:disabled{opacity:1}.board[aria-busy=true] .cell{cursor:default}.direction-options{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin:5px 0}.direction-options button{min-height:48px;min-width:48px;border:2px solid transparent;border-radius:12px;background:var(--purple);padding:5px 9px;font-weight:700}.direction-options button[aria-pressed=true]{border-color:#74579a;background:#fff}.item-options{display:flex;gap:8px;max-width:430px;margin:6px auto}.item{flex:1;min-height:48px;border:2px solid transparent;border-radius:14px;background:var(--purple);font-weight:700;font-size:15px}.item[aria-pressed=true]{border-color:#7859a5;background:#d9c8eb}.move-actions{display:grid;grid-template-columns:1fr 2fr;gap:8px;max-width:430px;margin:8px auto}.move-actions .big{min-height:54px}
.result-mark{text-align:center;color:#b99948;font-size:100px;line-height:1.2;margin:30px 0 0}.result-detail{text-align:center;white-space:pre-line}#result>.big{margin:12px 0}.save-status{background:#fff1d1;border-radius:10px;font-size:12px;padding:8px;margin:8px 0}.toast{position:fixed;z-index:20;left:50%;bottom:max(18px,env(safe-area-inset-bottom));transform:translateX(-50%);width:max-content;max-width:calc(100% - 24px);background:#493f36;color:#fff;border-radius:16px;padding:14px 20px;text-align:center;font-size:clamp(20px,5vw,24px);font-weight:700;line-height:1.5;white-space:pre-line;overflow-wrap:anywhere;box-shadow:0 3px 15px #0002;pointer-events:none}dialog{background:var(--bg);color:var(--ink);border:0;border-radius:22px;padding:20px;width:min(94vw,480px);max-height:90svh;overflow:auto;font:inherit}dialog::backdrop{background:#30291f80}dialog h2{margin-top:0}#dialog-actions{display:grid;gap:9px;margin-top:18px}#dialog-body p{font-size:14px}.help-example{background:#eae2d6;padding:12px;border-radius:12px;font-weight:700;text-align:center}
@media(max-height:700px){#app{padding:6px 12px 10px}.toolbar{height:40px}.icon{width:40px;height:40px}.toolbar-caption{font-size:11px}.mic-state{width:36px;height:36px}h1{margin:8px auto 12px}.wordmark{max-width:300px}.menu-options{gap:7px}.option-pair{gap:7px}.seg{padding:3px}.seg button{min-height:36px;padding:6px 3px}.difficulty button{min-height:44px}.menu-actions{margin-top:9px;gap:6px}.menu-actions .big{min-height:44px;padding:8px;font-size:16px}.record{margin:6px 0;font-size:12px}.title-footer{margin-top:8px;font-size:10px}.scores{margin:5px 0;gap:6px}.score{padding:4px;gap:5px}.score-count{font-size:21px}.stock{font-size:10px}.board{width:min(100%,430px,calc(100svh - 368px));gap:2px;--hdr:15px}.selection-status{font-size:14px;margin:4px 0;min-height:22px}.item-options{margin:4px auto}.item{min-height:42px}.move-actions{margin:5px auto}.move-actions .big{min-height:46px;padding:8px}.direction-options button{min-height:40px}.direction-options{margin:3px 0}.board:has(~ .direction-options:not(:empty)){width:min(100%,430px,calc(100svh - 415px))}h2{margin:12px 0 8px}.palette{margin:10px 0;gap:5px}.dice-face{margin:20px auto;width:150px;height:150px;font-size:90px}}
@media(min-width:700px){#app{padding:20px 30px}.board{width:min(100%,490px,calc(100svh - 404px))}.option-pair{grid-template-columns:1fr 1fr}.palette .swatch span:last-child{font-size:12px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}

#dialog-body{white-space:pre-line}
.menu-actions:has(#resume:not([hidden])){grid-template-columns:1fr 1fr}
.menu-actions:has(#resume:not([hidden])) .big{font-size:16px;padding-inline:8px}

.stock{white-space:pre-line}

/* 承認済みのタイトル配置。盤面や設定画面には適用しない。 */
#app:has(#title:not([hidden])) {padding:0 16px;position:relative;}
#app:has(#title:not([hidden])) .toolbar {position:absolute;top:8px;left:16px;right:16px;}
.toolbar [data-action="help"] {margin-left:auto;}
#title {display:flex;flex-direction:column;min-height:100svh;padding:58px 0 max(8px,env(safe-area-inset-bottom));}
#title>h1 {width:min(380px,100%);height:93px;flex-shrink:0;margin:0 auto;}
#title>h1 .wordmark {width:100%;height:100%;object-fit:contain;object-position:top;}
#title .title-caption {margin:25px 0 29px;text-align:center;font-size:15px;line-height:24px;color:#756b60;}
#title #menu-options {width:min(420px,100%);margin:0 auto;gap:14px;}
#title #series-options {gap:14px;}
#title .seg {min-height:58px;}
#title .difficulty button {min-height:62px;}
#title .menu-actions {width:min(420px,100%);margin:22px auto 0;}
#title .menu-actions .big {min-height:60px;}
#title #record {margin:12px 0 0;}
#title #record:empty {min-height:0;}
#title .title-footer {margin:auto 0 0;padding-top:20px;font-size:10px;line-height:14px;}
@media(max-height:819px){
#title>h1 {height:74px;width:min(300px,100%);}
#title .title-caption {margin:10px 0 16px;}
#title #menu-options,#title #series-options {gap:7px;}
#title .seg {min-height:42px;}
#title .seg button {min-height:36px;padding:6px 3px;}
#title .difficulty button {min-height:44px;}
#title .menu-actions {margin-top:10px;}
#title .menu-actions .big {min-height:44px;}
#title .title-footer {padding-top:12px;}
}
@media(max-height:620px){
#title>h1 {height:50px;width:204px;}
#title .title-caption {margin:4px 0 8px;font-size:13px;line-height:21px;}
}

/* 確定前：置く石は実線と＋、反転する石は破線と↻。色だけで区別しない。 */
.cell.placing {outline:3px solid #fff;outline-offset:-5px;box-shadow:inset 0 0 0 3px #225b92;z-index:2;}
.cell.flipping {outline:2px dashed #fff;outline-offset:-4px;box-shadow:inset 0 0 0 2px #225b92;}
.cell.extra.flipping {box-shadow:inset 0 0 0 3px #aa7521;}
.cell.placing.empty::after {display:none;}
.preview-mark {position:absolute;left:0;bottom:0;min-width:14px;height:14px;padding:0 1px;border-radius:3px;background:#173e63;color:#fff;font-size:12px;line-height:14px;font-weight:700;pointer-events:none;}
.cell.placing .preview-mark {background:#fff;color:#173e63;}
@media(max-height:700px){
  .selection-status {min-height:44px;}
  .board {width:min(100%,430px,calc(100svh - 400px));}
  .board:has(~ .direction-options:not(:empty)) {width:min(100%,430px,calc(100svh - 447px));}
}

.hint-toggle{min-height:44px;padding:6px 10px;border:1px solid var(--line);border-radius:12px;background:#eee7dd;color:var(--ink);font:inherit;font-size:13px;font-weight:700;white-space:nowrap}
.hint-toggle[aria-pressed=true]{background:var(--green);border-color:#8fa97d}
.hint-toggle:focus-visible{outline:3px solid #78649b;outline-offset:2px}
