:root{font-family:"Yu Gothic UI","Hiragino Kaku Gothic ProN",system-ui,sans-serif;color:#233d45;background:#edf7f3;font-synthesis:none;--teal:#078b8a;--board-size:min(calc(100vw - 16px),calc((100dvh - 178px)/2));}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer;border:1px solid #b4d4cf;border-radius:10px;background:#fff;color:#24414a;padding:9px 12px;font-weight:700;touch-action:manipulation}button:disabled{opacity:.5;cursor:default}button:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid #f1a739;outline-offset:2px}[hidden]{display:none!important}.setup{max-width:580px;margin:0 auto;padding:24px 20px 36px}.brand{text-align:center;margin-bottom:24px}.badge{font-size:11px;letter-spacing:.16em;font-weight:800;color:#087773}.brand h1{font-size:clamp(27px,6vw,38px);margin:12px 0 6px;letter-spacing:.02em}.brand h1 span{display:inline-grid;place-items:center;background:#ffcf74;color:#5b492b;width:42px;height:42px;border-radius:50%;margin-left:7px}.brand p{margin:0;color:#608078;font-size:14px}.names{display:grid;grid-template-columns:1fr 1fr;gap:12px}.names label{font-size:13px;font-weight:700}.names input{width:100%;margin-top:7px;border:1px solid #bad1c8;border-radius:9px;background:white;padding:11px 10px;color:#25413b}fieldset{margin:24px 0 16px;border:0;padding:0}legend{font-weight:800;font-size:15px;margin-bottom:9px}.mode-card{display:flex;gap:10px;background:white;border:1px solid #cfdfd7;border-radius:13px;padding:15px;margin:8px 0;cursor:pointer}.mode-card:has(input:checked){border:2px solid #168a80;padding:14px;background:#f2fffa}.mode-card input{accent-color:var(--teal)}.mode-card small{display:block;margin-top:5px;color:#617570;font-size:12px;line-height:1.6}.line{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:13px;margin:13px 0}.line select{max-width:64%;padding:8px;border:1px solid #bed3cb;border-radius:8px;background:white;color:#24414a}.primary{background:var(--teal);border-color:var(--teal);color:white}.wide{width:100%;padding:14px 8px}.quiet{background:transparent;font-size:12px}.trial-options{background:#fff5d8;border:1px solid #efd79b;border-radius:12px;padding:14px;margin-bottom:12px;font-size:13px}.trial-options p,details p{font-size:12px;line-height:1.7;color:#766341}.small{font-size:12px;line-height:1.8;color:#61756e}details{border-top:1px solid #cfdfd7;margin:18px 0;padding-top:16px}summary{font-size:13px;font-weight:700;cursor:pointer}details ul{padding-left:21px;font-size:12px;line-height:1.8}details li{margin:7px 0}.warning{font-size:12px;color:#a23220;line-height:1.5}.saved{background:#e0f2ed;padding:14px;border-radius:12px;margin-bottom:20px;text-align:center}.saved p{margin:0 0 9px;font-size:13px}
body.playing{overflow:hidden;overscroll-behavior:none;touch-action:none;background:#d5ece5}#arena{height:100dvh;min-height:460px;display:flex;flex-direction:column;padding:env(safe-area-inset-top) 4px env(safe-area-inset-bottom);max-width:700px;margin:auto;overflow:hidden;user-select:none;-webkit-user-select:none}.player{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;position:relative;padding:3px 0;gap:2px}.upper{transform:rotate(180deg)}.hud{width:var(--board-size);height:50px;display:grid;grid-template-columns:1fr 53px 1fr;gap:3px;background:#bce8f0;border-radius:9px 9px 0 0;align-items:center;padding:2px 6px}.score-box{min-width:0}.score-box.them{text-align:right}.player-name{font-size:clamp(10px,2.5vw,14px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.score{font-size:clamp(17px,3.5vw,23px);font-weight:750;line-height:1.1}.score-box small{font-size:9px;color:#496d78;margin-left:3px}.character-help{height:49px;position:relative;border:0;border-radius:6px;padding:0;background:#fff9da}.character-help img{height:34px;max-width:100%;object-fit:contain}.character-help span{font-size:9px;display:block;line-height:11px;color:#597066}.status{height:16px;line-height:16px;width:var(--board-size);font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;color:#43665f}.board-wrap{position:relative;width:var(--board-size);height:var(--board-size);flex-shrink:0}.board{width:100%;height:100%;display:grid;grid-template-columns:repeat(5,1fr);grid-template-rows:repeat(5,1fr);gap:3px;background:#c6e3dc;border:3px solid #c6e3dc;border-radius:8px;touch-action:none}.cell{padding:0;border:0;border-radius:9px;font-size:calc(var(--board-size)/9);display:grid;place-items:center;background:#edf7f3;line-height:1;touch-action:none;position:relative}.cell.blue,.drop.blue,.help-token.blue{background:#b9e8fc}.cell.yellow,.drop.yellow,.help-token.yellow{background:#ffedaa}.cell.pink,.drop.pink,.help-token.pink{background:#f9cee5}.cell.selected{box-shadow:inset 0 0 0 3px #027b71;filter:brightness(1.04)}.cell.selected.dragging{box-shadow:none;outline:3px dashed #027b71;outline-offset:-4px}.cell.hint{box-shadow:inset 0 0 0 3px #ff8e14}.cell.clearing{opacity:.25;transform:scale(.8);transition:transform .2s,opacity .2s}.cell.flash{box-shadow:inset 0 0 0 3px #f14f77}.drops{position:absolute;inset:3px;pointer-events:none;overflow:hidden;z-index:3}.drop{position:absolute;width:calc(20% - 3px);height:calc(20% - 3px);border-radius:9px;display:grid;place-items:center;font-size:calc(var(--board-size)/9);box-shadow:0 2px 7px #456a5a40;opacity:.85}.drop.warning{height:5px;top:0!important;font-size:0;box-shadow:0 0 0 2px #f39931}.clock-personal{position:absolute;top:0;left:3px;font-size:10px;background:#f4fff8;padding:1px 4px;border-radius:3px;color:#207165}.center{height:36px;flex:0 0 36px;display:flex;align-items:center;gap:6px;padding:1px 5px;z-index:6}.center button{font-size:11px;padding:5px 8px;white-space:nowrap;height:30px}.central-clock{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;gap:1px}.bar{height:10px;border-radius:20px;width:100%;background:#bdcfc9;display:flex;justify-content:center;overflow:hidden}#time-fill{display:block;height:100%;background:#1d93c5;width:100%}#time-label{height:12px;line-height:12px;font-size:9px;white-space:nowrap}.layer{position:absolute;inset:2px;z-index:5;display:flex;align-items:center;justify-content:center;background:#e9f8f2ed;border-radius:10px;text-align:center}.layer-inner{width:min(90%,340px)}.layer h2{font-size:20px;margin:5px}.layer p{font-size:12px;line-height:1.7;margin:8px 0}.layer .portrait{height:min(13vh,100px);max-width:100%;object-fit:contain}.layer select{padding:7px;max-width:100%;border:1px solid #bbd4cb;border-radius:7px;background:white;margin:3px 0 8px;font-size:12px}.layer button{font-size:12px;margin:3px}.count-number{font-size:76px;font-weight:900;color:#087d70}.result-name{font-size:13px}.result-score{font-size:28px;font-weight:800}.win{color:#cb8230}.pause-dialog{position:absolute;inset:0;background:#1b353ad9;z-index:20;display:grid;place-items:center;text-align:center;color:#28433c}.pause-dialog>div{background:#f5fcf8;padding:24px;border-radius:16px;max-width:90vw}.pause-dialog h2{margin:0 0 12px}.pause-dialog p{font-size:13px}.paused .board{filter:blur(8px)}
@media(max-height:600px){:root{--board-size:min(calc(100vw - 16px),calc((100dvh - 166px)/2))}.hud{height:44px}.character-help{height:43px}.character-help img{height:28px}.layer .portrait{height:45px}.layer p{font-size:10px;margin:4px 0}.layer h2{font-size:16px}.layer button{padding:6px}.status{height:14px;font-size:8px}.score{font-size:16px}}
/* Trial title selected by the owner; no additional judging feature is implied. */
:root{--board-size:min(calc(100vw - 16px),calc((100dvh - 178px)/2),680px)}.brand h1{font-size:clamp(27px,6vw,36px);line-height:1.5}.brand h1 .subtitle{display:inline;background:none;color:#26766b;width:auto;height:auto;border-radius:0;margin:0;font-size:.72em;letter-spacing:.01em}
@media(max-height:600px){:root{--board-size:min(calc(100vw - 16px),calc((100dvh - 166px)/2),680px)}}
#replace-dialog{position:fixed}
.character-picker{display:flex;align-items:center;justify-content:center;gap:24px}.character-picker .character-arrow{width:40px;height:40px;border-radius:50%;padding:0;flex-shrink:0;font-size:18px;background:#fff;color:#087d70}.layer .character-label{font-size:12px;margin:6px 0 9px}.character-picker .portrait{width:110px;object-fit:contain}
.layer h2.result-outcome{font-size:clamp(48px,12vw,88px);font-weight:950;line-height:1.05;letter-spacing:.04em;margin:4px 0 7px}.result-outcome.win{color:#e32935}.result-outcome.lose{color:#2665d8}.layer h2.result-outcome.draw{color:#53716b;font-size:clamp(28px,8vw,46px);letter-spacing:0}.result-scores{display:grid;grid-template-columns:1fr 1fr;gap:12px;background:#fff9;border-radius:10px;padding:8px;margin:8px 0 10px}.result-person-name{font-size:12px;overflow-wrap:anywhere}.result-points{font-size:26px;font-weight:800;line-height:1.3}@media(max-height:600px){.layer h2.result-outcome{font-size:42px}.layer h2.result-outcome.draw{font-size:28px}.result-scores{padding:4px;margin:4px 0;gap:6px}.result-points{font-size:20px}.result-person-name{font-size:10px}}

.language-row{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin:0 0 18px;font-size:14px}.language-row select{min-width:135px}.status{overflow-wrap:anywhere}html[lang="th"]{line-height:1.5}html[lang="en"] .subtitle,html[lang="th"] .subtitle{font-size:.68em}

.help-moves{position:absolute;inset:0;pointer-events:none;z-index:5}.help-token{position:absolute;width:18%;height:18%;display:grid;place-items:center;border:2px solid #fff;border-radius:12px;box-shadow:0 2px 9px #304a4855;font-size:calc(var(--board-size)*.115)}.help-moving-source{visibility:hidden}

@keyframes help-pulse{0%,100%{opacity:1}50%{opacity:.35}}.cell.hint{animation:help-pulse .36s ease-in-out infinite}.paused .cell.hint{animation-play-state:paused}.help-cost{position:absolute;right:1px;top:1px;padding:0 2px;border-radius:4px;background:#fff0c0;color:#8a411d;font-size:8px;line-height:11px}@media(prefers-reduced-motion:reduce){.cell.hint{animation:none}}

.setup{padding-top:68px}.language-flags{position:fixed;right:max(12px,env(safe-area-inset-right));top:max(10px,env(safe-area-inset-top));display:flex;gap:6px;z-index:12;padding:4px;border-radius:12px;background:#f5fbf7ed;box-shadow:0 2px 8px #25453f16}.language-flag{display:grid;place-items:center;padding:5px;width:46px;height:38px;border-radius:7px;border:2px solid transparent;background:transparent}.language-flag svg{display:block;width:32px;height:22px;border:1px solid #91aaa4;border-radius:2px}.language-flag[aria-pressed="true"]{border-color:#078b8a;background:#d9f4ed}.quick-guide{padding:14px;margin:16px 0 24px;border:1px solid #c8ded5;border-radius:14px;background:#fffdfa}.quick-guide h2{font-size:20px;margin:0 0 8px}.quick-guide p{font-size:13px;line-height:1.5;margin:8px 0}.guide-steps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.guide-step{margin:0;min-width:0;padding:8px;background:#f0f5ef;border-radius:10px}.guide-step figcaption{font-size:12px;line-height:1.4;min-height:2.8em;font-weight:800}.guide-crop{position:relative;width:100%;aspect-ratio:423/230;overflow:hidden}.guide-crop img{position:absolute;width:255.31915%;max-width:none;height:auto;top:-186.95652%}.guide-before img{left:-20.33097%}.guide-after img{left:-134.98818%}

.quick-guide summary{font-size:18px;line-height:1.6;color:#126c64}.quick-guide .guide-content{padding-top:8px}.quick-guide[open] .guide-open-label,.quick-guide:not([open]) .guide-close-label{display:none}.voice-options{padding:8px 12px;border:1px solid #c8ded5;border-radius:12px;margin:16px 0;background:#fffdfa}.voice-options .line{margin:5px 0}.voice-options button{font-size:12px;white-space:nowrap}.voice-options input{accent-color:var(--teal)}.voice-options p{margin:6px 0}.count-audio-note{font-size:10px!important}.layer h2.count-number{font-size:76px;line-height:1.2}

.layer h2.count-number{font-size:clamp(100px,min(65vw,32dvh),300px);line-height:1.05;margin:0;font-weight:950;letter-spacing:-.04em}.layer h2.count-number.count-go{font-size:clamp(80px,min(38vw,25dvh),200px);letter-spacing:-.04em}.layer:has(.count-number) .layer-inner{width:96%;max-width:650px}

.center #bgm-toggle{width:37px;height:32px;padding:1px 3px;display:flex;flex-direction:column;align-items:center;justify-content:center;flex-shrink:0;gap:0;background:#ddf5e9;color:#176d59}.center #bgm-toggle svg{width:20px;height:20px}.center #bgm-toggle span{font-size:8px;line-height:8px}.center #bgm-toggle[aria-pressed="false"]{background:#f4e8e5;color:#7a6c6a}.center #bgm-toggle[aria-pressed="true"] .music-muted{display:none}

.chain-guide{margin-top:22px;padding-top:18px;border-top:1px dashed #b9d3c9}.chain-guide h3{margin:0;color:#126c64;font-size:20px}.chain-frames{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:14px 0}.chain-frame{margin:0;min-width:0;padding:12px 10px;background:#eff7f2;border:1px solid #c9ddd2;border-radius:12px}.chain-frame figcaption{font-size:14px;font-weight:800;line-height:1.5;min-height:3em}.chain-grid{position:relative;display:grid;grid-template-columns:repeat(5,1fr);grid-template-rows:repeat(5,1fr);gap:3px;aspect-ratio:1;width:100%;max-width:250px;margin:8px auto;background:#daeae2;border:3px solid #c6dbd0;border-radius:8px}.chain-cell{min-width:0;display:grid;place-items:center;border-radius:6px;font-size:clamp(18px,4.7vw,30px);line-height:1;aspect-ratio:1}.chain-cell.blue{background:#b9e8fc}.chain-cell.yellow{background:#ffedaa}.chain-cell.pink{background:#f9cee5}.chain-empty{background:#eaf3ee}.chain-match{box-shadow:inset 0 0 0 3px #df832c}.chain-swap{box-shadow:inset 0 0 0 3px #087d70}.chain-arrow{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}.chain-arrow path{fill:none;stroke:#087d70;stroke-width:8;stroke-linecap:round;stroke-linejoin:round}.chain-frame .chain-reward{font-size:13px;font-weight:850;color:#9b4d13;background:#fff3d9;border-radius:8px;padding:7px;line-height:1.6}.chain-frame .chain-caption{font-size:12px;line-height:1.7}.chain-frame:last-child{grid-column:1/-1;max-width:310px;justify-self:center;width:100%}@media(max-width:420px){.chain-frames{grid-template-columns:1fr}.chain-frame{padding:12px 16px}.chain-frame figcaption{min-height:0}.chain-cell{font-size:30px}.chain-frame:last-child{max-width:none}}

/* Disruption example: a planned drag loses its source tile. */
.attack-frames .attack-frame:last-child{grid-column:auto;max-width:none;justify-self:stretch}.attack-remove{box-shadow:inset 0 0 0 3px #d84550}.attack-remain{box-shadow:inset 0 0 0 3px #087d70}.attack-target{outline:2px dashed #557f77;outline-offset:-4px}.attack-gone{position:relative;border:2px dashed #d84550;background:#fff2ef}.attack-gone::after{content:"×";font-size:37px;line-height:1;color:#c13b46;font-weight:900}.attack-drag-arrow{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.attack-drag-arrow path{fill:none;stroke:#087d70;stroke-width:7;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:12 13}.attack-drag-arrow .attack-arrow-head{stroke-dasharray:none}.attack-drag-lost path{stroke:#9b9e9b;opacity:.7}.attack-legend{padding-left:20px;font-size:11px;line-height:1.8;color:#526e65}
