@charset "UTF-8";
:root{font-family:"Yu Gothic UI","Hiragino Kaku Gothic ProN",Meiryo,sans-serif;color:#263e39;background:#eef2ef;font-synthesis:none;--red:#bf574e;--blue:#477e9f;--ink:#263e39}*{box-sizing:border-box}body{margin:0}button,a{-webkit-tap-highlight-color:transparent;touch-action:manipulation}button{font:inherit;cursor:pointer;border:1px solid #c9d3cc;background:#f9fbf8;border-radius:9px;padding:13px 18px;color:var(--ink);font-weight:700}button:hover:not(:disabled){filter:brightness(.95)}button:focus-visible,a:focus-visible{outline:3px solid #477e9f;outline-offset:3px}button:disabled{cursor:default;opacity:.5}[hidden]{display:none!important}#app{max-width:1080px;margin:auto;padding:0 40px}.mast{height:94px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #cdd6d0}.mast a{color:var(--ink);text-decoration:none;font-weight:900;letter-spacing:.06em}.mast a span{display:block;font-size:9px;letter-spacing:.15em;margin-top:5px;font-weight:500}.edition,.eyebrow{font-size:10px;letter-spacing:.2em;font-weight:700}.edition{color:#788780}.intro{padding:58px 0 34px;text-align:center}.eyebrow{color:#75867c;margin:0 0 20px}h1{font-size:clamp(34px,5vw,56px);line-height:1.3;letter-spacing:.06em;margin:0;font-weight:900}h1 br{display:none}h1 em{font-style:normal}h1 span{display:block;font-size:22px;margin-top:12px;letter-spacing:.12em;font-weight:600}.lead{font-size:14px;line-height:2;color:#677a70;margin:25px 0}.title-actions{display:flex;justify-content:center;gap:20px;align-items:center}.primary{background:var(--ink);color:white;border-color:var(--ink);min-height:49px}.title-actions .primary{min-width:220px;text-align:left}.primary span{float:right;margin-left:20px}.text-button{border:0;background:transparent;font-size:13px}.small{font-size:10px;color:#7b8b82;margin:18px 0 0}.restroom{position:relative;overflow:hidden;isolation:isolate;border:1px solid #c3cec6;border-radius:14px;background-color:#e0e7e1;background-image:linear-gradient(#cbd5cd80 1px,transparent 1px),linear-gradient(90deg,#cbd5cd80 1px,transparent 1px);background-size:48px 40px;height:320px;box-shadow:0 15px 30px #243d3610}.restroom:before{content:"";position:absolute;left:0;right:0;bottom:0;height:95px;background:repeating-linear-gradient(90deg,transparent 0,transparent 79px,#b5c3b880 80px),repeating-linear-gradient(0deg,#ced8cf 0,#ced8cf 30px,#bbc9be 31px);border-top:7px solid #a9bbb0;z-index:-1}.wall-label{position:absolute;top:20px;left:0;right:0;text-align:center;font-size:8px;letter-spacing:.23em;color:#8a9b8e}.rail{position:absolute;top:78px;height:5px;background:#a4b5a9;left:0;right:0;box-shadow:0 2px 0 #eef4ee}.slots{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));position:absolute;inset:48px 18px 0;gap:0}.slot{border:0;border-radius:0;background:transparent;padding:0;position:relative;min-width:0;opacity:1!important}.slot:hover:not(:disabled){background:#ffffff35;filter:none}.pipe{position:absolute;top:13px;left:calc(50% - 3px);width:6px;height:57px;background:linear-gradient(90deg,#9aaca2,#edf2ed,#98a99e)}.pipe:before{content:"";position:absolute;width:14px;height:9px;top:8px;left:-4px;background:#afbeb3;border:1px solid #94a99b;border-radius:2px}.urinal{position:absolute;top:61px;left:17%;width:66%;height:91px;border-radius:12px 12px 45% 45%;background:linear-gradient(100deg,#e6ece6,#fff 50%,#e3eae3);border:1px solid #b7c7bb;box-shadow:2px 4px 3px #64827120}.urinal:before{content:"";position:absolute;inset:9px 12% 22px;border:2px solid #d4dfd6;border-top-width:5px;border-radius:9px 9px 50% 50%;background:linear-gradient(#e6eee7,#f9fcf8)}.urinal i{position:absolute;bottom:18px;width:9px;height:4px;background:#bccdc0;border-radius:50%;left:calc(50% - 4px)}.spot-number{position:absolute;bottom:15px;left:0;right:0;font:10px monospace;color:#6d8475}.plus{position:absolute;left:50%;top:172px;transform:translateX(-50%);font-size:13px;color:#3c5c4b;font-weight:800;background:#f3f7f0;border:1px solid #b7cbb7;padding:6px 8px;border-radius:20px;white-space:nowrap}.plus.danger{color:#af4f43;border-color:#d9b7ad;background:#fff0e9}.man{position:absolute;top:66px;left:50%;width:48px;height:151px;transform:translateX(-50%);--shirt:var(--red);filter:drop-shadow(1px 3px 1px #31533d25)}.man.blue{--shirt:var(--blue)}.man i{position:absolute;display:block}.head{width:25px;height:30px;background:#dfb497;left:12px;top:5px;border-radius:40% 40% 45% 45%;z-index:4}.hair{width:28px;height:24px;background:#34423b;top:0;left:10px;border-radius:45% 45% 20% 20%;z-index:5;box-shadow:inset 2px 3px 0 #46534a}.neck{width:12px;height:10px;background:#c99d80;left:18px;top:29px;z-index:3}.body{width:34px;height:54px;left:7px;top:35px;background:var(--shirt);border-radius:10px 10px 5px 5px;z-index:3;box-shadow:inset -5px 0 0 #0000000c}.arm{height:47px;width:10px;top:40px;border-radius:6px;background:linear-gradient(var(--shirt) 55%,#dfb497 55%);z-index:2}.arm.left{left:0;transform:rotate(-6deg)}.arm.right{right:0;transform:rotate(6deg)}.leg{top:84px;width:14px;height:54px;background:#35434b;border-radius:0 0 3px 3px}.leg.left{left:9px;transform:rotate(2deg)}.leg.right{right:9px;transform:rotate(-2deg);background:#2c3941}.shoe{top:133px;width:16px;height:9px;background:#253332;border-radius:3px}.shoe.left{left:6px}.shoe.right{right:6px}.sweat{display:none;background:#a3d2d7;width:6px;height:10px;border-radius:70% 0 70% 70%;top:22px;right:2px}.tense .sweat{display:block}.bubble{position:absolute;top:19px;left:50%;transform:translateX(-50%);background:#fffdf6;padding:8px 9px;border-radius:9px;font-size:11px;white-space:nowrap;z-index:10;box-shadow:0 3px 8px #213e3320;pointer-events:none}.bubble:after{content:"";position:absolute;bottom:-5px;left:50%;border-width:6px 5px 0;border-style:solid;border-color:#fffdf6 transparent transparent}.slot:first-child .bubble{left:0;transform:none}.slot:last-child .bubble{left:auto;right:0;transform:none}.enter{animation:enter .6s ease-out}.escape{animation:escape .65s ease-in forwards}@keyframes enter{0%{translate:0 85px;opacity:0}30%{opacity:1;rotate:-3deg}60%{rotate:3deg}100%{translate:0 0;rotate:0deg}}@keyframes escape{15%{rotate:-10deg}40%{rotate:10deg}100%{translate:0 170px;opacity:0}}.title-footer{display:flex;justify-content:space-between;font-size:11px;color:#7d8e82;padding:22px 4px}.page-footer{display:flex;justify-content:space-between;font-size:10px;color:#88988e;border-top:1px solid #d3ddd4;margin:28px 0 0;padding:23px 0}.page-footer span{font-size:8px;letter-spacing:.15em}.game-heading{display:flex;justify-content:space-between;align-items:center;margin:28px 0 20px}.game-heading .eyebrow{margin:0}.scores{display:grid;grid-template-columns:1fr 1fr;gap:18px}.score{background:#f8faf6;border:1px solid #cfd9d0;padding:18px 22px;border-radius:12px;--color:var(--red)}.score.blue{--color:var(--blue)}.score.active{border-color:var(--color);box-shadow:0 2px 0 var(--color)}.score-top{display:flex;justify-content:space-between;align-items:center;font-size:14px;font-weight:800}.dot{display:inline-block;background:var(--color,var(--red));width:9px;height:9px;border-radius:50%;margin-right:8px}.dot.blue{background:var(--blue)}.stage{font-size:11px;color:#748275;font-weight:500}.score-number{display:flex;gap:8px;align-items:baseline;margin:10px 0}.score-number strong{font-size:34px;color:var(--color);font-variant-numeric:tabular-nums}.score-number span{font-size:11px;color:#8b978b}.meter{height:6px;background:#e3e9e1;border-radius:8px;overflow:hidden}.meter i{display:block;height:100%;background:var(--color);border-radius:8px;transition:width .65s ease}.turn-line{display:flex;justify-content:space-between;align-items:center;margin:30px 0 18px;font-size:13px}#turn span{font-size:12px;color:#89958a;margin-left:15px}#move-count{font-size:11px;color:#778a7b}.board-help{text-align:center;font-size:12px;margin:20px 0 8px}.board-help span{color:#8b998e;margin-left:12px;font-size:10px}.tools{display:flex;justify-content:center;gap:10px}.tools button{font-size:12px;font-weight:500;padding:10px 15px}.resign{display:block;margin:22px auto 0;width:290px;background:#e5eae2;border-color:#c7d0c4;font-size:18px}.resign span{font-size:10px;font-weight:400;color:#7a8b7c;margin-left:16px}dialog{border:1px solid #c3cec4;border-radius:18px;max-width:450px;width:calc(100% - 32px);padding:32px;color:var(--ink);background:#f8faf5;box-shadow:0 20px 90px #19382e30;max-height:90dvh;overflow:auto}dialog::backdrop{background:#19382d66;backdrop-filter:blur(4px)}dialog h2{font-size:25px;margin:10px 0 16px}dialog p,dialog li{font-size:13px;line-height:1.9;color:#64786a}dialog ul{padding-left:18px}.dialog-actions{display:flex;gap:10px;margin-top:25px}.dialog-actions button{flex:1;font-size:13px}.dialog-icon{font-size:28px;color:#8c9b8b}.result-scores{display:flex;justify-content:space-around;padding:20px 0;margin:20px 0;border-block:1px solid #d4ded0}.result-scores span:first-child{color:var(--red)}.result-scores span:last-child{color:var(--blue)}.result-scores strong{font-size:30px;margin-left:10px}.result-actions{display:grid;gap:10px}.result-actions button{font-size:13px}.rule-diagram{display:grid;grid-template-columns:repeat(4,1fr);align-items:center;background:#e9eee5;border-radius:9px;padding:18px 8px;text-align:center;gap:4px}.rule-diagram>span{font-size:24px;color:var(--red)}.rule-diagram b{font-size:20px}.rule-diagram small{display:block;font-size:8px;font-weight:400;margin-top:7px}
@media(max-width:600px){#app{padding:0 16px}.mast{height:72px}.mast a{font-size:13px}.edition{font-size:7px;max-width:90px;text-align:right;line-height:1.8}.intro{padding:38px 0 28px}.intro .eyebrow{font-size:9px}h1{font-size:36px}h1 br{display:block}h1 span{font-size:17px}.lead{font-size:12px;margin:20px 0}.title-actions{gap:7px}.title-actions .primary{min-width:175px}.text-button{padding:10px;font-size:12px}.small{font-size:9px}.restroom{height:244px;border-radius:10px;background-size:32px 32px}.restroom:before{height:75px}.wall-label{top:16px;font-size:6px}.rail{top:55px;height:4px}.slots{inset:35px 3px 0}.pipe{top:4px;width:4px;left:calc(50% - 2px);height:44px}.pipe:before{width:9px;left:-3px;height:6px}.urinal{top:42px;height:65px;left:10%;width:80%;border-radius:7px 7px 45% 45%}.urinal:before{inset:6px 10% 16px;border-width:1px;border-top-width:3px}.urinal i{bottom:13px;width:6px;height:3px}.man{top:48px;scale:.63;transform-origin:0 0;left:50%;transform:translateX(-50%)}.plus{top:129px;font-size:10px;padding:5px 4px;min-width:29px}.spot-number{bottom:12px;font-size:8px}.title-footer{font-size:9px;padding:16px 0}.page-footer{margin-top:18px;padding:20px 0;font-size:8px}.page-footer span{display:none}.game-heading{margin:20px 0 15px}.game-heading .eyebrow{font-size:8px}.scores{gap:10px}.score{padding:13px 12px}.score-top{font-size:12px}.stage{font-size:9px}.score-number strong{font-size:29px}.turn-line{margin:25px 0 15px;font-size:12px}#turn span{font-size:10px;margin-left:7px}#move-count{font-size:9px}.board-help{font-size:10px}.board-help span{font-size:9px;margin-left:4px}.tools{gap:6px}.tools button{font-size:10px;padding:11px 8px}.resign{margin-top:18px;max-width:100%}.bubble{font-size:9px;padding:6px;top:12px}dialog{padding:25px}dialog h2{font-size:22px}}
.score[data-level="medium"] .stage{font-weight:700}.score[data-level="high"] .meter i{background:#95674f}.score[data-level="critical"] .meter i,.score[data-level="lost"] .meter i{background:#9c413e}.score[data-level="critical"] .stage,.score[data-level="lost"] .stage{color:#9c413e;font-weight:800}
.mode-picker{border:0;padding:0;margin:24px auto 0;display:flex;justify-content:center;gap:10px}.mode-picker legend{text-align:center;font-size:11px;color:#647b71;margin-bottom:10px}.mode-picker label{position:relative;cursor:pointer}.mode-picker input{position:absolute;opacity:0;width:1px;height:1px}.mode-picker span{display:block;padding:12px 22px;border:1px solid #b9cac0;border-radius:10px;background:#f6faf5;font-size:13px;font-weight:700}.mode-picker input:checked+span{background:#e0eae4;border:2px solid #416858;padding:11px 21px;box-shadow:0 3px 0 #becfc3}.mode-picker input:focus-visible+span{outline:3px solid #477e9f;outline-offset:3px}.intrusion-status{font-size:11px;line-height:1.8;color:#5c6964;background:#e1e5de;border:1px solid #c3cec3;padding:9px 12px;border-radius:8px;margin:0 0 12px}.man.grandpa{background-image:url("./assets/grandpa-v2.webp");background-size:100% 100%;background-position:center}.grandpa-enter{animation:grandpa-arrive 1.4s ease-out}.grandpa-bubble{background:#fffef8;color:#5a6057}@keyframes grandpa-arrive{0%{translate:0 150px;opacity:0;rotate:-7deg}20%{opacity:1;rotate:6deg}40%{rotate:-5deg}60%{rotate:4deg}80%{rotate:-2deg}100%{translate:0 0;rotate:0deg}}
@media(max-width:600px){.mode-picker{margin-top:20px}.mode-picker span{padding:11px 18px}.mode-picker input:checked+span{padding:10px 17px}#mode-label{max-width:74%;line-height:1.7}.intrusion-status{font-size:10px}}
.time-panel{display:flex;align-items:center;justify-content:space-between;margin:-5px 0 14px;padding:9px 16px;border:1px solid #c6d5cc;border-radius:10px;background:#f6faf5}#turn-clock{display:flex;align-items:baseline;gap:10px}#time-value{font-size:30px;font-variant-numeric:tabular-nums;line-height:1.2}#clock-status,#match-time{font-size:10px;color:#6e8073}#turn-clock.urgent{color:#a23b3c}#turn-clock.urgent #clock-status{color:#a23b3c;font-weight:800}#turn-clock.urgent{border-left:4px solid #a23b3c;padding-left:9px}.stay-label{position:absolute;top:222px;left:0;right:0;font-size:9px;white-space:nowrap;color:#557462}.stay-label.leaving-soon{color:#9a5243;font-weight:800}.event-hidden{visibility:hidden}.walk-away{animation:walk-away .55s ease-in forwards}@keyframes walk-away{from{translate:0 0;opacity:1}to{translate:0 100px;opacity:0}}.grandpa-enter{animation-duration:.55s}
@media(max-width:600px){.stay-label{top:137px;font-size:6px;letter-spacing:-.04em}.time-panel{padding:7px 11px}.turn-line{margin-top:18px}.time-panel #time-value{font-size:27px}}
/* Illustrated edition */
body{background:radial-gradient(ellipse at top,#fafcf9,#e3eae6 80%)}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.mast{height:82px;justify-content:center;border-bottom:0}.mast a{display:block;width:235px;height:64px;overflow:hidden;border-radius:8px}.mast a img{width:235px;height:auto;display:block;transform:translateY(-11px)}
#title-screen .title-art{border-radius:20px;overflow:hidden;box-shadow:0 14px 45px #233b3930;border:4px solid #fff;background:#d9e7e3;max-width:850px;margin:12px auto 0;animation:art-reveal .7s ease-out}
.title-art img{display:block;width:100%;height:auto}.title-actions{margin:28px auto 40px;gap:12px;flex-wrap:wrap}.title-actions button{min-width:190px;min-height:54px;font-size:16px}.title-actions .text-button{min-width:auto;font-size:13px}.title-actions .primary{text-align:center;background:linear-gradient(#426e73,#274b54);border-color:#274b54;box-shadow:0 5px 0 #163740,0 8px 18px #294d5220}.title-actions #start{box-shadow:0 4px 0 #bdcbc5;border-color:#b8c9c1}
.game-heading{margin-top:8px}.restroom{border:3px solid #fff;border-radius:16px;box-shadow:0 10px 30px #27464222;background-image:linear-gradient(#c0d0cc80 1px,transparent 1px),linear-gradient(90deg,#c0d0cc80 1px,transparent 1px),linear-gradient(120deg,#edf5f1,#cadad5 65%,#dce8e4);background-size:48px 40px,48px 40px,100% 100%}
.restroom:after{content:"";position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 12px 30px #223e4215;background:linear-gradient(115deg,#ffffff40,transparent 40%);z-index:-1}.restroom:before{background:repeating-linear-gradient(90deg,transparent 0,transparent 79px,#839e9850 80px),repeating-linear-gradient(0deg,#ccd9d4 0,#ccd9d4 30px,#aebfb8 31px);border-top-color:#8fa69b}
.wall-label{background:#eff7f2;border:1px solid #a9bfb4;border-radius:4px;left:calc(50% - 19px);right:auto;width:38px;padding:3px 0;top:13px;font-weight:800;color:#607d71;letter-spacing:.12em}.urinal{box-shadow:3px 8px 7px #41635225,inset 3px 0 3px white,inset -3px -2px 4px #c3d3c8}.slot:not(:disabled):hover .urinal{filter:brightness(1.08);outline:2px solid #7aa9a3;outline-offset:4px}.slot:not(:disabled):hover .plus{translate:0 -4px}.plus{transition:translate .2s;box-shadow:0 3px 7px #284a3920}.score{box-shadow:0 4px 13px #2b42390a}.resign{background:#f3e9e5;border-color:#d8c0b7;color:#86534a;box-shadow:0 3px 0 #ccb5aa}.resign span{color:#a27b70}
.man{width:110px;height:155px;background-image:url('./assets/pieces-v1.webp');background-size:200% 100%;background-repeat:no-repeat;background-position:left center;filter:drop-shadow(2px 6px 2px #29403630)}.man.blue{background-position:right center}.man i{display:none}.man.tense:after{content:"";position:absolute;right:2px;top:28px;width:5px;height:10px;border-radius:80% 0 80% 80%;background:#93c7d5;border:1px solid #608da7}.enter{animation:piece-arrive .7s cubic-bezier(.2,.7,.2,1)}.escape{animation:piece-escape .65s ease-in forwards}.bubble{animation:bubble-pop .22s ease-out}.occupied:has(.enter):after{content:"";position:absolute;left:20%;right:20%;bottom:32px;height:7px;background:#789b9125;border-radius:50%;animation:landing .7s ease-out;pointer-events:none}
@keyframes piece-arrive{0%{translate:0 130px;opacity:0;rotate:-5deg}25%{opacity:1;rotate:4deg}50%{rotate:-4deg}75%{rotate:2deg}100%{translate:0 0;rotate:0deg}}
@keyframes piece-escape{15%{translate:0 -10px;rotate:-8deg}35%{rotate:9deg}65%{rotate:-9deg}100%{translate:0 190px;opacity:0}}
@keyframes bubble-pop{from{opacity:0;translate:0 7px}to{opacity:1;translate:0 0}}
@keyframes landing{from{scale:.3;opacity:0}to{scale:1;opacity:1}}
@keyframes art-reveal{from{opacity:0;translate:0 12px}to{opacity:1;translate:0 0}}
@media(max-width:600px){.mast{height:64px}.mast a{width:195px;height:52px}.mast a img{width:195px;transform:translateY(-10px)}#title-screen .title-art{margin-top:8px;border-radius:12px;border-width:2px}.title-actions{display:grid;grid-template-columns:1fr;gap:14px;max-width:320px;margin-top:24px}.title-actions button{width:100%;min-width:0!important}.title-actions .text-button{min-height:40px}.man{scale:.53;top:48px}.restroom{border-width:2px}.wall-label{top:10px;font-size:7px;width:28px;left:calc(50% - 14px);padding:2px 0}.game-heading .eyebrow{letter-spacing:.05em;font-size:10px}#turn strong{font-size:11px}#turn span{font-size:9px;margin-left:5px}.title-actions .primary{min-height:56px}}
.opponent-picker{margin-top:24px}.opponent-picker+.title-actions{margin-top:18px}.occupant-meter{position:absolute;top:40px;left:50%;translate:-50% 0;width:64%;max-width:58px;z-index:6;pointer-events:none}.occupant-track{display:block;height:8px;border:1px solid #637d71;border-radius:5px;background:#f2f8f1;overflow:hidden;box-shadow:0 1px 3px #29473820}.occupant-fill{display:block;height:100%;border-radius:3px;transition:width .12s linear,background .12s linear}.occupant-caption{display:block;font-size:9px;line-height:1.5;color:#3f6050;font-weight:700;white-space:nowrap;text-align:center;text-shadow:0 1px #f7fff8}.occupant-meter.almost-done .occupant-track{border-color:#258455}.occupant-meter.completed .occupant-track{background:#31915f;border-color:#206d46}.occupant-meter.completed .occupant-caption{color:#216f47}.finish-and-leave{animation:finish-shiver var(--shiver-ms,360ms) linear,walk-away var(--exit-ms,500ms) ease-in var(--shiver-ms,360ms) forwards}.occupant-meter.completed{animation:finished-meter-exit var(--exit-ms,500ms) ease-in var(--shiver-ms,360ms) forwards}@keyframes finish-shiver{0%,100%{translate:0 0;rotate:0deg}15%,45%,75%{translate:-1.8px 0;rotate:-2deg}30%,60%,90%{translate:1.8px 0;rotate:2deg}}@keyframes finished-meter-exit{to{opacity:0;translate:-50% 5px}}.slot .bubble{top:4px}
.man.grandpa-enter{animation-duration:.55s}@media(max-width:600px){.stay-label{font-size:8px;letter-spacing:0}.occupant-meter{top:23px;width:81%;max-width:35px}.occupant-track{height:6px;border-radius:4px}.occupant-caption{font-size:8px;line-height:1.5}.slot .bubble{top:1px}.opponent-picker{margin-top:20px}.opponent-picker+.title-actions{margin-top:18px}}
.mast a{width:auto;height:auto;overflow:visible;border-radius:0;padding:8px 4px;font-family:Georgia,"Times New Roman",serif;font-size:31px;line-height:1.1;font-weight:700;letter-spacing:-.045em}.title-brand{text-align:center;margin:24px 0 23px}.title-brand h1{font-family:Georgia,"Times New Roman",serif;font-size:clamp(46px,8vw,80px);line-height:1.05;letter-spacing:-.045em;font-weight:700}.title-brand p{margin:14px 0 0;font-size:18px;font-weight:600;letter-spacing:.08em}#title-screen .title-art{aspect-ratio:1536/568;margin-top:0}.title-art img{width:100%;height:100%;object-fit:cover;object-position:center bottom}
@media(max-width:600px){.mast a{width:auto;height:auto;font-size:27px}.title-brand{margin:19px 0 20px}.title-brand h1{font-size:clamp(44px,12vw,62px)}.title-brand p{font-size:14px;letter-spacing:.04em;margin-top:12px}#title-screen .title-art{margin-top:0}}
#title-screen .title-art{aspect-ratio:1731/909}.title-art img{object-fit:contain;object-position:center}.spot-number,.occupant-caption{display:none}
@media(max-width:600px){
 #app{min-height:100svh;min-height:100dvh;display:flex;flex-direction:column}
 .mast{flex:0 0 64px}
 #title-screen{flex:1;min-height:calc(100svh - 64px);min-height:calc(100dvh - 64px);display:flex;flex-direction:column;justify-content:space-between;gap:clamp(14px,3.2dvh,30px);padding:4px 0 max(8px,env(safe-area-inset-bottom));}
 #title-screen .title-art{flex:none;width:100%;margin:0;max-width:none;}
 .opponent-picker{flex:1;align-items:center;justify-content:center;gap:12px;margin:0;min-height:64px;}
 .opponent-picker span{padding:16px 24px;font-size:14px}.opponent-picker input:checked+span{padding:15px 23px}
 .opponent-picker+.title-actions{margin:0 auto;width:100%;max-width:none;gap:14px;}
 .title-actions .primary{min-height:clamp(56px,8dvh,78px);font-size:18px}.title-actions .text-button{min-height:52px;padding:14px 10px;}
}
@media(max-width:600px) and (max-height:560px){#title-screen{gap:10px}.opponent-picker{min-height:52px}.opponent-picker span{padding:10px 20px}.opponent-picker input:checked+span{padding:9px 19px}.title-actions .text-button{min-height:44px;padding:10px}.opponent-picker+.title-actions{gap:10px}}
/* A quiet gentlemen's club: bottle-green wall cloth and fine brass lines. */
:root{background:#102b27}body{background-color:#102b27;background-image:radial-gradient(ellipse at 50% 0,#34554a90,transparent 66%),repeating-linear-gradient(90deg,transparent 0,transparent 63px,#c8ab6720 64px,transparent 65px,transparent 127px),repeating-linear-gradient(45deg,transparent 0,transparent 44px,#baa77509 45px,transparent 46px,transparent 90px);background-attachment:fixed}
#app{min-height:100dvh}.mast{border-bottom:1px solid #c3a86a35}.mast a{color:#e4cf9e;text-shadow:0 2px 9px #0004}.sound-controls{height:36px;display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:0 0 36px}.sound-controls button{font-size:10px;line-height:1;padding:7px 10px;min-height:27px;border-radius:6px;color:#ecdfbd;background:#173830;border:1px solid #b4a07177;letter-spacing:.04em;font-weight:600}.sound-controls button[aria-pressed="false"]{color:#a4b2a6;background:#142e28;border-color:#6d837255}.sound-controls button:focus-visible{outline-color:#dec68e}
#title-screen .title-art{border-color:#c1aa74;box-shadow:0 12px 28px #0004}.opponent-picker span{background:#f4f0e4;color:#304337;border-color:#c4b58d}.opponent-picker input:checked+span{background:#e8dfc5;border-color:#c1a567;box-shadow:0 3px 0 #917b47;color:#233a2b}.title-actions .primary{background:linear-gradient(#a9935c,#7c673b);color:#fff9ea;border-color:#c7b27e;box-shadow:0 5px 0 #56472c,0 8px 18px #0003}.title-actions #start{border-color:#c7b27e;box-shadow:0 5px 0 #56472c}.title-actions .text-button{color:#e0d2ab}.game-heading .eyebrow{color:#e1d1a6}.game-heading .text-button{color:#e4d9bb}#turn{color:#f3eddd}#move-count{color:#c7cbb7}.board-help{color:#e1d8bf}.board-help span{color:#b9c4ae}.score{background:#f6f2e6;border-color:#bdc4ae}.score.active{box-shadow:0 2px 0 var(--color),0 4px 18px #0002}.time-panel{background:#eee9d9;border-color:#b9bd9e}.intrusion-status{background:#253f30;color:#e4d9ba;border-color:#a28e5e88}.tools button{background:#eee9da;border-color:#b9bba0}.resign{background:#e9dfd0;border-color:#b29e7d}.restroom{box-shadow:0 10px 30px #0004;border-color:#e1dac2}dialog{background:#f7f2e6;border-color:#c3af7c}dialog::backdrop{background:#061c18b3}.primary{background:#254b3b;border-color:#254b3b}
@media(max-width:600px){#title-screen{min-height:calc(100svh - 100px);min-height:calc(100dvh - 100px)}.sound-controls{height:36px;min-height:36px}.sound-controls button{min-height:28px}.mast{border-bottom-color:#c3a86a35}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
/* Compact play surface: retain visible controls inside the current viewport. */
.brand-footer{display:flex;justify-content:center;padding:10px 0 12px;margin-top:auto}
.brand-footer a{display:flex;align-items:center;justify-content:center;min-height:32px;padding:4px 12px;border-radius:6px;background:#f7f5ee}
.brand-footer img{display:block;width:116px;height:auto;max-height:32px;object-fit:contain}
.share-x{display:flex;justify-content:center;align-items:center;min-height:46px;padding:12px 18px;border:1px solid #172c26;border-radius:9px;background:#172c26;color:#fff;text-decoration:none;font-size:13px;font-weight:700}
#app:has(#game-screen:not([hidden])){height:100dvh;min-height:0;display:flex;flex-direction:column;padding-bottom:max(8px,env(safe-area-inset-bottom))}
#app:has(#game-screen:not([hidden])) .mast{height:48px;flex:0 0 48px}
#app:has(#game-screen:not([hidden])) .mast a{font-size:26px}
#app:has(#game-screen:not([hidden])) .sound-controls{height:32px;flex:0 0 32px;min-height:0}
#game-screen{flex:1;min-height:0;display:flex;flex-direction:column;gap:8px;padding:0}
#game-screen .game-heading{margin:0;min-height:28px;flex:none}
#game-screen .game-heading .text-button{padding:5px 10px;min-height:28px}
#game-screen .scores{flex:none}
#game-screen .score{padding:10px 14px}
#game-screen .score-number{margin:3px 0}
#game-screen .score-number strong{font-size:26px;line-height:1.1}
#game-screen .turn-line{margin:0;min-height:24px;flex:none}
#game-screen .time-panel{margin:0;padding:5px 12px;flex:none}
#game-screen #time-value{font-size:25px}
#game-screen .intrusion-status{margin:0;padding:3px 10px;line-height:1.5;flex:none}
#game-board{flex:1;min-height:230px;display:flex;flex-direction:column}
#game-board .restroom{flex:1;height:auto;min-height:230px}
#game-screen .board-help{margin:0;line-height:1.5;flex:none}

#game-screen .resign{margin:0 auto;width:min(100%,360px);min-height:44px;padding:9px 16px;flex:none}
@media(max-width:600px){
 #title-screen{gap:clamp(8px,2dvh,18px)}
 .brand-footer{padding:0 0 2px}
 #title-screen .opponent-picker{min-height:52px}
 #app:has(#game-screen:not([hidden])){padding-inline:12px}
 #game-screen{gap:6px}
 #game-board,#game-board .restroom{min-height:180px}
 #game-screen .score{padding:8px 10px}
 #game-screen .score-top{font-size:12px}
 #game-screen .stage{font-size:9px}
 #game-screen .board-help span{display:block}
}
@media(max-height:680px){
 #app:has(#game-screen:not([hidden])) .mast{height:34px;flex-basis:34px}
 #app:has(#game-screen:not([hidden])) .mast a{font-size:22px;padding:3px}
 #app:has(#game-screen:not([hidden])) .sound-controls{height:30px;flex-basis:30px}
 #game-screen{gap:4px}
 #game-screen .game-heading{min-height:24px}
 #game-screen .game-heading .text-button{min-height:24px;padding-block:2px}
 #game-screen .score{padding:6px 10px}
 #game-screen .score-top{line-height:1.2}
 #game-screen .score-number{margin:2px 0}
 #game-screen .score-number strong{font-size:22px}
 #game-screen .time-panel{padding:4px 10px}
 #game-screen #time-value{font-size:23px}
 #game-screen .board-help{display:none}
 
 #game-screen .resign{min-height:40px;padding:7px 16px;font-size:16px}
 #game-board,#game-board .restroom{min-height:174px}
 #title-screen{gap:8px}
 #title-screen .opponent-picker span{padding:10px 20px}
 #title-screen .opponent-picker input:checked+span{padding:9px 19px}
 #title-screen .title-actions{gap:8px}
 #title-screen .title-actions .text-button{min-height:40px;padding:8px}
}
/* Keep the illustrated scene compact; anchor fixtures and feet to the floor. */
#game-board{justify-content:center}
#game-board .restroom{flex:0 1 320px;height:320px;min-height:230px;max-height:320px}
#game-board .slots{top:auto;bottom:0;height:280px}
#game-board .rail{top:auto;bottom:247px}
@media(max-width:600px){
 #game-board .restroom{flex-basis:220px;height:220px;min-height:180px;max-height:220px}
 #game-board .slots{height:185px}
 #game-board .rail{bottom:165px}
}
@media(max-height:680px) and (max-width:600px){#game-board .restroom{min-height:174px}}

.title-art picture{display:block;width:100%;height:100%}
/* A steady glow identifies the active player without changing scene geometry. */
#game-screen[data-turn="red"]{--turn-glow:#f47972;--turn-halo:#f0605866}
#game-screen[data-turn="blue"]{--turn-glow:#75beff;--turn-halo:#389cfb66}
#game-screen[data-turn="red"] .restroom,#game-screen[data-turn="blue"] .restroom{border-color:var(--turn-glow);box-shadow:0 0 0 2px var(--turn-glow),0 0 19px 5px var(--turn-halo),0 10px 30px #0004}
#game-screen[data-turn="red"] #turn,#game-screen[data-turn="blue"] #turn{border-left:3px solid var(--turn-glow);padding-left:8px}
/* Language controls fit alongside sound settings, including narrow phones. */
.sound-controls{height:44px!important;min-height:44px!important;flex:0 0 44px!important;gap:4px;justify-content:flex-end}
#language-controls{margin-left:auto;flex:none}
.language-picker{display:flex;gap:2px;align-items:center}
.language-picker button{padding:8px 6px;min-width:44px;min-height:40px;font-size:11px;line-height:1.2;border-radius:6px;background:#173830;color:#ecdfbd;border:1px solid #b4a07177}
.language-picker button[aria-pressed="true"]{background:#e8dfc5;color:#233a2b;border-color:#c1a567}
dialog>.language-picker{justify-content:flex-end;margin:-12px -8px 10px 0}
html[lang="en"] .mast a{font-size:24px;letter-spacing:.015em}
html[lang="en"] .stage{font-size:10px}
html[lang="en"] .score-top{gap:4px}
html[lang="en"] .rule-diagram small{font-size:9px;white-space:normal;line-height:1.35}
html[lang="en"] .bubble{font-size:10px}
html[lang="en"] .resign{font-size:16px}
html[lang="en"] .resign span{margin-left:8px}
html[lang="en"] #turn strong{font-size:12px}
@media(max-width:600px){
 #title-screen{min-height:calc(100dvh - 108px)}
 .sound-controls>button{padding:7px 6px;font-size:10px}
 .language-picker button{padding:8px 5px;min-height:40px}
 html[lang="en"] .stage{font-size:8px}
 html[lang="en"] .board-help{font-size:10px}
 html[lang="en"] .bubble{font-size:8px;padding:5px}
 html[lang="en"] #clock-status,html[lang="en"] #match-time{font-size:9px}
 html[lang="en"] .title-actions .primary{font-size:16px}
 html[lang="en"] .score-top{font-size:11px}
 html[lang="en"] .turn-line{gap:5px}
 html[lang="en"] #turn strong{font-size:11px}
}
.mast #home{position:relative;display:block;width:235px;height:70px;padding:14px 0 0;overflow:visible}
.mast .header-logo{display:block;width:100%;height:100%;object-fit:contain;transform:none;border-radius:0}

#app:has(#game-screen:not([hidden])) .mast #home{height:46px;width:180px;padding-top:10px}
#app:has(#game-screen:not([hidden])) 
@media(max-width:600px){.mast #home{width:200px;height:60px;padding-top:12px}}
@media(max-height:680px){#app:has(#game-screen:not([hidden])) .mast #home{height:32px;width:140px;padding-top:8px}#app:has(#game-screen:not([hidden])) }
/* An antique ivory and walnut chessboard, softened by a green club-room glaze. */
body{background-color:#21362b;background-image:radial-gradient(ellipse at 50% 12%,#102b2733 0,#081b17bb 100%),repeating-linear-gradient(2deg,#ffffff04 0px,#ffffff04 1px,#1a130b09 2px,transparent 4px),conic-gradient(from 90deg,#a99a72 25%,#394335 0 50%,#a99a72 0 75%,#394335 0);background-size:100% 100%,100% 7px,144px 144px;background-attachment:fixed}
#app{background:linear-gradient(90deg,#102b27b0,#102b2780 18%,#102b2780 82%,#102b27b0);box-shadow:0 0 0 1px #c9b57b35,0 0 60px #06160e55}
.mast #home{padding-top:0}
#app:has(#game-screen:not([hidden])) .mast #home{padding-top:0}
@media(max-width:600px){body{background-size:100% 100%,100% 7px,112px 112px}.mast #home{padding-top:0}}
@media(max-height:680px){#app:has(#game-screen:not([hidden])) .mast #home{padding-top:0}}
/* Compact, left-aligned header wordmark. */
.mast{justify-content:flex-start}
.mast #home{width:160px;height:48px;margin:0;padding:0}
#app:has(#game-screen:not([hidden])) .mast #home{width:130px;height:38px;padding:0}
@media(max-width:600px){.mast #home{width:140px;height:42px}#app:has(#game-screen:not([hidden])) .mast #home{width:120px;height:34px}}
@media(max-height:680px){#app:has(#game-screen:not([hidden])) .mast #home{width:110px;height:30px}}
/* Optional analytics: the banner is part of the title, never over the board. */
#analytics-tools{margin-left:auto}#analytics-tools button{border:1px solid #b4a07177;border-radius:6px;color:#ecdfbd;background:#173830;padding:6px 10px;font-size:11px}.analytics-banner{margin:12px auto 0;padding:10px 12px;max-width:470px;text-align:left;border:1px solid #b9cac0;border-radius:8px;background:#edf3eb;color:#263e35;font-size:11px;line-height:1.5}.analytics-banner[hidden]{display:none}.analytics-banner h2{font-size:12px;margin:0 0 4px}.analytics-banner p{margin:0 0 5px}.analytics-banner button{min-height:36px;font-size:11px;padding:6px 10px;white-space:normal}.analytics-actions{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}.analytics-actions button{flex:1;min-height:44px;white-space:normal}#analytics-policy{background:transparent;text-decoration:underline;border:0}#analytics-close{min-height:44px;width:100%}#analytics-settings{min-width:44px;min-height:36px}#modal:has(#analytics-close) p{font-size:13px;line-height:1.7}#modal:has(#analytics-close) a{color:#315f4e;text-decoration:underline}@media(max-width:600px){.analytics-banner{font-size:10px;margin-top:8px;padding:8px}.analytics-banner h2{font-size:11px}}
/* A gentleman flips a coin before CPU matches. */
.coin-dialog{width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:30px 20px 24px;border:1px solid #d7bd78;border-radius:20px;text-align:center;color:var(--ink);background:radial-gradient(ellipse at 50% 45%,#fffdf3,#eef2e9);box-shadow:0 24px 90px #142e3950;overflow:auto}
.coin-dialog::backdrop{background:#142b29c9;backdrop-filter:blur(5px)}
.coin-dialog h2{font-size:23px;margin:0 0 10px}.coin-rule{font-size:13px;color:#66796b;margin:0}
.coin-stage{position:relative;width:min(360px,100%);height:270px;margin:auto;perspective:900px}
.gentleman-hand{width:100%;height:100%;animation:gentleman-flick 2.2s ease-in-out both}
.coin-flight{position:absolute;left:54%;top:139px;width:58px;height:58px;margin-left:-29px;animation:coin-arc 2.2s ease-in-out both}
.toss-coin{position:relative;width:100%;height:100%;transform-style:preserve-3d;animation:coin-spin 2.2s linear both}
.coin-face{position:absolute;inset:0;display:grid;place-items:center;border:3px solid #a77b29;border-radius:50%;background:radial-gradient(circle at 35% 28%,#fff2b8,#e8c366 60%,#b58b34);box-shadow:inset 0 0 0 3px #fbe4a0,inset 0 0 0 5px #be933f,0 4px 8px #503d2425;color:#825d20;font:34px Georgia,serif;backface-visibility:hidden}
.coin-back{transform:rotateY(180deg)}
.landed .coin-flight{animation:none;transform:translateY(0)}.landed .toss-coin{animation:none;transform:rotateY(0)}.landed.tails .toss-coin{transform:rotateY(180deg)}
.coin-announcement{min-height:78px;display:flex;flex-direction:column;justify-content:center}.coin-announcement strong{font-size:22px}.coin-announcement p{margin:8px 0 0;font-size:15px}.landed .coin-announcement{animation:coin-reveal .3s ease-out}
@keyframes coin-arc{0%,12%{transform:translateY(0) scale(.8)}42%,48%{transform:translateY(-120px) scale(1.15)}90%,100%{transform:translateY(0) scale(1)}}
@keyframes coin-spin{0%,12%{transform:rotateY(0) rotateZ(-15deg)}90%,100%{transform:rotateY(1800deg) rotateZ(0)}}
@keyframes gentleman-flick{0%,100%{transform:translateY(0)}15%{transform:translateY(-10px) rotate(-3deg)}35%,80%{transform:translateY(4px)}}
@keyframes coin-reveal{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.coin-dialog *{animation:none!important}}
