*{box-sizing:border-box}body{margin:0;background:#17131d;color:#fff;font-family:system-ui,-apple-system,sans-serif;overscroll-behavior:none}.screen{display:none;min-height:100vh;padding:18px;position:relative}.screen.active{display:flex;flex-direction:column;align-items:center;justify-content:center}.logo{text-align:center;font-weight:1000;font-size:42px;line-height:.9;color:#ffd23f;text-shadow:5px 5px #c62f37}.logo strong{font-size:58px;color:#fff}.blink{margin-top:45px;animation:blink 1s steps(2) infinite;font-weight:900}.panel{background:#292130;border:4px solid #fff;padding:18px;display:grid;gap:14px;min-width:min(92vw,420px);box-shadow:8px 8px #000}select,button{font:inherit;font-size:18px;padding:12px;border:3px solid #111}button{font-weight:900;background:#ffd23f}.help{text-align:center;line-height:1.8}.storybox{height:min(72vh,620px);width:min(92vw,620px);overflow:hidden;position:relative;border-block:2px solid #ffd23f}.storyroll{text-align:center;font-size:21px;line-height:2;font-weight:800;position:absolute;width:100%;top:100%;animation:roll 23s linear forwards}.storyroll b{font-size:30px;color:#ffd23f}#skip{position:absolute;right:14px;top:14px;z-index:3;background:#fff;padding:8px 12px}#game{justify-content:flex-start;padding:8px}header{width:min(100%,960px);display:flex;gap:10px;align-items:center;margin:auto auto 5px}#timer{font-size:28px}#scores{display:flex;flex:1}.score{flex:1;text-align:center;font-weight:900;font-size:13px}canvas{width:min(100%,960px);height:auto;background:#e8d39c;border:5px solid #111;image-rendering:pixelated;outline:none}#message{min-height:28px;font-weight:900;text-align:center}#joystick{display:none;width:150px;height:150px;border:4px solid #fff8;border-radius:50%;background:#2228;position:relative;touch-action:none;margin:5px auto}#stick{width:62px;height:62px;border-radius:50%;background:#ffd23f;border:4px solid #111;position:absolute;left:40px;top:40px}.mobile{display:none}#winlose{font-size:58px;font-weight:1000;text-shadow:5px 5px #000}.winner{font-size:27px;color:#ffd23f}#ranking{text-align:center;line-height:1.7}#statueScene{height:250px;width:min(90vw,420px);position:relative;margin:12px;background:linear-gradient(#75c8ee 0 60%,#d9c393 60%);overflow:hidden;border:5px solid #111}.station{text-align:center;background:#eee;color:#333;font-weight:900;padding:9px}.pedestal{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);background:#777;border:4px solid #444;padding:7px 28px;font-weight:900;white-space:nowrap}#statue{position:absolute;left:50%;bottom:48px;transform:translate(-50%,240px);text-align:center;font-size:50px;filter:grayscale(1)}#statue b{display:block;background:#777;border:4px solid #444;color:#ddd;font-size:16px;padding:14px}.rise{animation:rise 2s cubic-bezier(.2,.8,.2,1) forwards}#resultButtons{opacity:0;pointer-events:none;text-align:center}.show{animation:fade .4s 2.1s forwards;pointer-events:auto!important}#result button{margin:5px;min-width:230px}@keyframes roll{to{top:-135%}}@keyframes blink{50%{opacity:.25}}@keyframes rise{to{transform:translate(-50%,0)}}@keyframes fade{to{opacity:1}}@media(max-width:700px),(pointer:coarse){#joystick,.mobile{display:block}canvas{max-height:57vh;object-fit:contain}.score{font-size:10px}.storyroll{font-size:18px}}.modes .mode{display:flex;justify-content:space-between;align-items:center;gap:14px;text-align:left}.modes .mode small{font-size:12px;font-weight:700}.modes .mode:nth-child(3){background:#eee;color:#555}#eventInfo{text-align:center;max-width:420px}.recruit{font-size:24px;font-weight:900;text-shadow:2px 2px #fff}.baseLabel{font-size:12px;font-weight:900}.fix-logo{display:block;width:min(80vw,460px);max-width:460px;height:auto;object-fit:contain;image-rendering:pixelated}.logo-fallback{display:none}.visual-logo{background:none;text-shadow:none}
.story-bg{background-image:linear-gradient(rgba(8,12,25,.28),rgba(8,12,25,.42)),url('assets_v02/backgrounds/festival_story.jpg');background-size:cover;background-position:center}.story-bg .storybox{background:rgba(15,12,20,.55);border-radius:14px;padding-inline:12px;text-shadow:0 2px 4px #000}.story-bg>small{background:#111a;padding:5px 10px;border-radius:10px}
#statue img{width:120px;height:120px;object-fit:contain;display:block;margin:auto}#statue{filter:none}
#opening{background-image:linear-gradient(rgba(8,12,25,.18),rgba(8,12,25,.38)),url('assets_v02/backgrounds/festival_story.jpg');background-size:cover;background-position:center;text-align:center;overflow:hidden}.opening-title{font-size:clamp(30px,6vw,64px);font-weight:1000;color:#ffd23f;text-shadow:4px 4px #b6252d,0 3px 8px #000}.opening-cast{display:flex;align-items:end;justify-content:center;gap:clamp(0px,2vw,18px);margin-top:10px}.opening-cast img{width:min(20vw,150px);height:min(20vw,150px);object-fit:contain;filter:drop-shadow(0 6px 3px #0008);animation:castBounce .65s ease-in-out infinite alternate}.opening-cast img:nth-child(2){animation-delay:.12s}.opening-cast img:nth-child(3){animation-delay:.24s}.opening-cast img:nth-child(4){animation-delay:.36s}.opening-mikoshi img{width:min(38vw,270px);filter:drop-shadow(0 8px 5px #0008);animation:mikoshiBob .5s ease-in-out infinite alternate}#opening p{font-size:clamp(17px,3vw,28px);font-weight:900;text-shadow:0 3px 5px #000}#opening small{background:#111b;border:2px solid #fff;border-radius:999px;padding:8px 18px;font-weight:900}.mode,#result button{border-radius:18px;border:4px solid #fff;box-shadow:0 5px 0 #7b241c,0 8px 12px #0007;background:linear-gradient(#ff745f,#df322d);color:#fff;text-shadow:0 2px #7a1717}.modes .mode:nth-child(2){background:linear-gradient(#5ba8ff,#2373d8);box-shadow:0 5px 0 #164c9a,0 8px 12px #0007}.modes .mode:nth-child(3){background:linear-gradient(#75d477,#2e9e45);color:#fff;box-shadow:0 5px 0 #176b2a,0 8px 12px #0007}#countdown{display:none;position:absolute;z-index:30;inset:0;align-items:center;justify-content:center;background:#07101c88;pointer-events:none}#countdown.show{display:flex}#countdown b{font-size:min(34vw,230px);font-weight:1000;color:#fff;text-shadow:8px 8px #d72f2f,0 0 30px #ffd23f;animation:countPop .72s ease both}@keyframes countPop{0%{transform:scale(1.8);opacity:0}30%{transform:scale(1);opacity:1}100%{transform:scale(.8);opacity:.25}}@keyframes castBounce{to{transform:translateY(-10px) rotate(2deg)}}@keyframes mikoshiBob{to{transform:translateY(-7px)}}
#splash{display:none!important}.title-loop{overflow:hidden;background-image:linear-gradient(rgba(7,11,22,.18),rgba(7,11,22,.34)),url('assets_v02/backgrounds/festival_story.jpg');background-size:cover;background-position:center}.title-logo{position:absolute;z-index:20;top:3vh;width:min(72vw,520px);max-height:30vh;object-fit:contain;filter:drop-shadow(0 7px 2px #0008)}.title-stage{position:absolute;inset:0;overflow:hidden}.tl{position:absolute;object-fit:contain;filter:drop-shadow(0 5px 3px #0008);pointer-events:none}.tl.mikoshi{width:min(35vw,270px);left:50%;top:42%;transform:translate(-50%,-50%);animation:titleMikoshi .55s ease-in-out infinite alternate}.tl.east,.tl.west,.tl.south,.tl.north{width:min(17vw,125px);animation:heroHop .7s ease-in-out infinite alternate}.tl.east{left:17%;top:42%}.tl.west{right:17%;top:42%;animation-delay:.18s}.tl.south{left:28%;top:61%;animation-delay:.34s}.tl.north{right:28%;top:61%;animation-delay:.5s}.tl.carrier{width:82px;bottom:11%;animation:crossRight 8s linear infinite}.tl.c1{left:-12%;animation-delay:-1s}.tl.c2{left:-12%;bottom:21%;animation-delay:-5s}.tl.cat{width:68px;bottom:5%;left:-12%;animation:crossRight 7s linear infinite -3s}.tl.delivery{width:78px;bottom:30%;right:-12%;animation:crossLeft 6s linear infinite -1s}.tl.drunk{width:76px;left:7%;bottom:31%;animation:drunkWobble 2.4s ease-in-out infinite}.tl.police{width:82px;right:5%;bottom:26%;animation:popGuest 9s ease-in-out infinite}.tl.madam{width:82px;left:4%;top:27%;animation:popGuest 11s ease-in-out infinite -5s}.tl.dango,.tl.kakigori,.tl.dorayaki{width:55px;animation:itemPop 5s ease-in-out infinite}.tl.dango{left:13%;top:24%}.tl.kakigori{right:12%;top:25%;animation-delay:-2s}.tl.dorayaki{right:7%;bottom:10%;animation-delay:-3.5s}.title-touch{position:absolute;z-index:30;bottom:3.5vh;margin:0;background:#111b;border:3px solid #fff;border-radius:999px;padding:10px 25px;font-size:clamp(18px,3vw,28px);font-weight:1000;text-shadow:0 2px #000;animation:blink 1s steps(2) infinite}@keyframes titleMikoshi{to{transform:translate(-50%,-56%) rotate(1deg)}}@keyframes heroHop{to{transform:translateY(-12px) rotate(3deg)}}@keyframes crossRight{from{transform:translateX(0)}to{transform:translateX(125vw)}}@keyframes crossLeft{from{transform:translateX(0) scaleX(-1)}to{transform:translateX(-125vw) scaleX(-1)}}@keyframes drunkWobble{0%,100%{transform:rotate(-8deg) translateX(-8px)}50%{transform:rotate(9deg) translateX(18px)}}@keyframes popGuest{0%,68%,100%{opacity:0;transform:translateY(25px) scale(.8)}74%,92%{opacity:1;transform:translateY(0) scale(1)}}@keyframes itemPop{0%,55%,100%{opacity:0;transform:scale(.5) rotate(-10deg)}65%,88%{opacity:1;transform:scale(1.1) rotate(5deg)}}
/* v0.7.2 visual scale +20% */
.tl.mikoshi{width:min(42vw,324px)}.tl.east,.tl.west,.tl.south,.tl.north{width:min(20.4vw,150px)}.tl.carrier{width:98px}.tl.cat{width:82px}.tl.delivery{width:94px}.tl.drunk{width:91px}.tl.police,.tl.madam{width:98px}.tl.dango,.tl.kakigori,.tl.dorayaki{width:66px}.title-logo{width:min(78vw,570px)}

/* v0.7.5 title: mikoshi procession + heroes running */
.title-mikoshi-group{position:absolute;z-index:8;left:50%;top:47%;width:min(44vw,350px);height:min(35vw,280px);transform:translate(-50%,-50%);animation:processionBob .48s ease-in-out infinite alternate}.tmg{position:absolute;object-fit:contain;filter:drop-shadow(0 5px 3px #0008)}.mikoshi-main{z-index:1;width:78%;left:11%;top:0}.bearer{z-index:3;width:25%;bottom:2%}.b1{left:8%}.b2{left:23%;bottom:-1%}.b3{left:38%;bottom:2%}.b4{right:38%;bottom:-1%}.b5{right:23%;bottom:2%}.b6{right:8%;bottom:-1%}.bearer{animation:bearerStep .34s ease-in-out infinite alternate}.b2,.b4,.b6{animation-delay:-.17s}.tl.east,.tl.west,.tl.south,.tl.north{top:auto;right:auto;animation:none}.tl.east{left:-18%;bottom:39%;animation:heroRunRight 7.2s linear infinite}.tl.west{right:-18%;bottom:47%;animation:heroRunLeft 8.1s linear infinite -2.4s}.tl.south{left:-18%;bottom:18%;animation:heroRunRight 9s linear infinite -5s}.tl.north{right:-18%;bottom:25%;animation:heroRunLeft 7.6s linear infinite -4s}@keyframes processionBob{to{transform:translate(-50%,-55%) rotate(.8deg)}}@keyframes bearerStep{to{transform:translateY(-5px)}}@keyframes heroRunRight{0%{transform:translateX(0)}100%{transform:translateX(140vw)}}@keyframes heroRunLeft{0%{transform:translateX(0) scaleX(-1)}100%{transform:translateX(-140vw) scaleX(-1)}}
/* v0.7.6 festival ending */
.result-festival{background-image:linear-gradient(rgba(8,10,24,.16),rgba(8,10,24,.32)),url('assets_v02/backgrounds/result_bg_v01.jpg');background-size:cover;background-position:center;overflow:hidden}.result-festival #winlose{margin-top:12vh;color:#ffd23f;font-size:clamp(44px,8vw,78px);text-shadow:5px 5px #b62328,0 4px 8px #000}.result-festival #ranking{background:#101522d9;border:4px solid #fff;border-radius:18px;padding:10px 24px;min-width:min(88vw,420px);box-shadow:0 7px 0 #6b1d20}.result-festival #statueScene{background:transparent;border:0;overflow:visible;height:270px;margin:0}.result-festival .station{display:none}.result-festival .pedestal{background:#8b673e;border-color:#4b3420;color:#fff;bottom:8px}.result-festival #statue{bottom:45px}.result-festival #statue img{width:150px;height:150px}.result-festival #winnerHero{position:absolute;left:7%;bottom:14%;z-index:8;animation:winnerEnter .8s cubic-bezier(.2,.9,.2,1) both}.result-festival #winnerHero img{width:min(22vw,145px);height:min(22vw,145px);object-fit:contain;filter:drop-shadow(0 6px 4px #0008)}#resultSparkles{position:absolute;left:50%;top:18%;transform:translateX(-50%);font-size:44px;color:#ffe45c;opacity:0;pointer-events:none}.sparkleOn{animation:sparkle 1s ease-in-out infinite!important}.result-festival #resultButtons button{border-radius:18px;border:4px solid #fff;color:#fff}.result-festival #resultButtons{position:relative;z-index:20}@keyframes winnerEnter{from{transform:translateX(-180px) rotate(-12deg);opacity:0}to{transform:translateX(0);opacity:1}}@keyframes sparkle{0%,100%{opacity:.2;transform:translateX(-50%) scale(.8) rotate(-8deg)}50%{opacity:1;transform:translateX(-50%) scale(1.2) rotate(8deg)}}
#dailyRank{width:min(90vw,520px);max-height:260px;overflow:auto;background:#101522e8;border:4px solid #fff;border-radius:18px;padding:8px 16px;margin:6px 0;box-shadow:0 6px 0 #6b1d20;z-index:15}#dailyRank h2{font-size:18px;margin:2px 0 6px;color:#ffd23f}#dailyRank ol{margin:0;padding-left:34px;columns:2;column-gap:28px;text-align:left;font-weight:900}#dailyRank li{break-inside:avoid;padding:2px 0}#yourDailyRank{margin-top:6px;color:#ffd23f;font-weight:1000}.maxTag{font-size:10px;background:#d62f2f;color:#fff;border-radius:8px;padding:1px 5px;margin-left:4px}@media(max-width:700px){#dailyRank{max-height:210px}#dailyRank ol{columns:1}}
/* v0.7.9 title police dash */
.tl.police{right:auto;left:-14%;bottom:26%;animation:policeDash 3.4s linear infinite -1.2s}@keyframes policeDash{0%{transform:translateX(0);opacity:0}4%{opacity:1}92%{opacity:1}100%{transform:translateX(135vw);opacity:0}}

/* v0.7.11 fit daily TOP10 without scrolling */
.result-festival{justify-content:flex-start;padding:8px 12px}.result-festival #winlose{margin-top:8.5vh;font-size:clamp(34px,6vw,58px);line-height:1}.result-festival #ranking{padding:5px 16px;line-height:1.25;min-width:min(82vw,390px);font-size:14px}.result-festival .winner{font-size:20px}.result-festival #statueScene{height:190px}.result-festival #statue{bottom:32px}.result-festival #statue img{width:112px;height:112px}.result-festival .pedestal{bottom:2px;padding:4px 20px;font-size:13px}.result-festival #winnerHero{bottom:10%}.result-festival #winnerHero img{width:min(17vw,110px);height:min(17vw,110px)}#dailyRank{width:min(92vw,600px);max-height:none;height:auto;overflow:visible;padding:5px 12px;margin:3px 0;border-width:3px}#dailyRank h2{font-size:15px;margin:0 0 3px}#dailyRank ol{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:repeat(5,auto);grid-auto-flow:column;columns:auto;gap:0 24px;padding-left:27px;font-size:13px;line-height:1.15}#dailyRank li{padding:1px 0;white-space:nowrap}#yourDailyRank{margin-top:3px;font-size:12px}.maxTag{font-size:8px;padding:1px 4px}#resultButtons{display:flex;gap:6px;justify-content:center;flex-wrap:wrap}.result-festival #resultButtons button{min-width:0;margin:2px;padding:7px 12px;font-size:13px}@media(max-width:700px){#dailyRank{max-height:none;overflow:visible}#dailyRank ol{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:repeat(5,auto);grid-auto-flow:column;font-size:11px;gap:0 10px;padding-left:23px}.result-festival #statueScene{height:165px}.result-festival #winlose{margin-top:7vh}.result-festival #ranking{font-size:12px}.result-festival .winner{font-size:17px}}

#audioControls{position:fixed;z-index:100;right:8px;top:8px;display:flex;gap:5px}#audioControls button{font-size:11px;padding:6px 9px;min-width:0;border:2px solid #fff;border-radius:999px;background:#17131dcc;color:#fff;box-shadow:none;text-shadow:none}#audioControls button.off{opacity:.55;text-decoration:line-through}

/* v0.8.3 title start button */
.title-touch{cursor:pointer;min-width:min(76vw,360px);background:linear-gradient(#ffdf4e,#f39a21);color:#4a1b0b;border:5px solid #fff;border-radius:999px;box-shadow:0 7px 0 #a53b22,0 10px 18px #0009;padding:13px 30px;font-size:clamp(20px,4vw,32px);font-weight:1000;text-shadow:0 2px #fff8;animation:titleStartPulse 1s ease-in-out infinite!important}.title-touch:active{transform:translateY(5px);box-shadow:0 2px 0 #a53b22}@keyframes titleStartPulse{0%,100%{scale:1}50%{scale:1.045}}

/* v0.8.4 global title asset scale +20% */
.title-mikoshi-group{width:min(52.8vw,420px);height:min(42vw,336px)}.tl.east,.tl.west,.tl.south,.tl.north{width:min(24.5vw,180px)}.tl.carrier{width:118px}.tl.cat{width:98px}.tl.delivery{width:113px}.tl.drunk{width:109px}.tl.police,.tl.madam{width:118px}.tl.dango,.tl.kakigori,.tl.dorayaki{width:79px}

/* v0.8.5 raise title start button */
.title-touch{bottom:9vh}

#eventInfo{width:min(94vw,680px);text-align:center}.modes .mode:nth-child(3){opacity:1}#eventSeats{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:10px}#eventSeats span{background:#181523;border:2px solid #fff;border-radius:10px;padding:8px}#eventQR{width:150px;height:150px;margin:10px auto;background:#fff;color:#111;display:grid;place-items:center;font-size:28px;font-weight:1000;border:8px solid #111}#eventDaily{background:#111b;border-radius:14px;padding:8px;margin:8px}#eventDaily h3{margin:5px;color:#ffd23f}#eventTop10{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:repeat(5,auto);grid-auto-flow:column;text-align:left;margin:5px auto;max-width:480px}#eventStart{background:linear-gradient(#ff745f,#df322d);color:#fff;border-color:#fff;border-radius:16px}

#eventQR img{width:150px;height:150px;display:block}#eventRoomCode{font-size:22px;font-weight:1000;color:#ffd23f;letter-spacing:3px}

/* v0.9.12 event seat status */
#eventSeats .joined{background:#176b2a;border-color:#8dff9d}#eventSeats .cpu{opacity:.7}

/* v0.9.13 title composition tuning */
#skip{display:none!important}.title-logo{top:7vh;width:min(90vw,690px);max-height:36vh}.title-mikoshi-group{top:58%;width:min(61vw,480px);height:min(48vw,380px)}.title-touch{bottom:13vh;min-width:min(78vw,380px)}@media(max-width:700px),(pointer:coarse){.title-logo{top:8vh;width:min(94vw,680px);max-height:31vh}.title-mikoshi-group{top:59%;width:min(78vw,480px);height:min(62vw,390px)}.title-touch{bottom:14vh}}

/* v0.9.14 compact story panel */
.story-bg{justify-content:flex-start!important;padding-top:10vh}.story-bg .storybox{height:min(32vh,290px);width:min(92vw,620px);margin-top:0}.story-bg .storyroll{top:82%;line-height:1.65;font-size:18px;animation-duration:23s}.story-bg>small{margin-top:8px}@media(max-width:700px),(pointer:coarse){.story-bg{padding-top:8vh}.story-bg .storybox{height:30vh;max-height:270px}.story-bg .storyroll{font-size:16px;line-height:1.55}}

/* v0.9.15 center compact story panel */
.story-bg{justify-content:center!important;padding-top:18px}.story-bg .storybox{margin-top:0}@media(max-width:700px),(pointer:coarse){.story-bg{justify-content:center!important;padding-top:18px}}

/* v0.9.16 story panel height */
.story-bg .storybox{height:60vh;max-height:600px}@media(max-width:700px),(pointer:coarse){.story-bg .storybox{height:60vh;max-height:600px}}

/* v0.9.17 title depth staging */
.title-mikoshi-group{top:53%;z-index:10}.tl.east,.tl.south,.tl.carrier.c1,.tl.cat,.tl.drunk,.tl.dango{z-index:14}.tl.west,.tl.north,.tl.carrier.c2,.tl.delivery,.tl.police,.tl.madam,.tl.kakigori,.tl.dorayaki{z-index:6}@media(max-width:700px),(pointer:coarse){.title-mikoshi-group{top:54%}}

/* v0.9.18 all moving title characters in front of mikoshi */
.tl.east,.tl.west,.tl.south,.tl.north,.tl.carrier.c1,.tl.carrier.c2,.tl.cat,.tl.delivery,.tl.drunk,.tl.police,.tl.madam,.tl.dango,.tl.kakigori,.tl.dorayaki{z-index:14}

/* v0.9.21 audio controls removed */
#audioControls{display:none!important}

/* v0.9.23 title-only audio controls */
#titleAudioControls{position:absolute;z-index:50;right:10px;top:10px;display:flex;gap:6px}#titleAudioControls button{font-size:11px;padding:6px 9px;min-width:0;border:2px solid #fff;border-radius:999px;background:#17131dcc;color:#fff;box-shadow:none;text-shadow:none}#titleAudioControls button.off{opacity:.5;text-decoration:line-through}

/* v0.9.26 raise game canvas and joystick */
#game{justify-content:flex-start!important;padding-top:2px}#game header{margin:0 auto 2px}#game canvas{margin-top:0}#message{min-height:22px;line-height:22px}#joystick{margin:-2px auto 0}@media(max-width:700px),(pointer:coarse){#game{padding-top:0}#game header{margin:0 auto 1px}#joystick{margin:-6px auto 0}.mobile{margin-top:2px}}

/* v0.9.27 raise title mikoshi closer to logo */
.title-mikoshi-group{top:49%}@media(max-width:700px),(pointer:coarse){.title-mikoshi-group{top:50%}}

/* v0.9.28 rebalance mobile game vertical spacing */
#game{padding-top:7px}#game header{margin:2px auto 5px}#message{min-height:30px;line-height:30px;font-size:15px;color:#fff;text-shadow:0 2px 3px #000,0 0 4px #000;font-weight:1000}#joystick{margin:10px auto 3px}.mobile{margin-top:5px;color:#fff;font-size:13px;font-weight:900;text-shadow:0 2px 3px #000}@media(max-width:700px),(pointer:coarse){#game{padding-top:5px}#game header{margin:2px auto 4px}#message{min-height:28px;line-height:28px;font-size:14px;background:rgba(0,0,0,.38);border-radius:8px;padding:0 8px;margin-top:3px}#joystick{margin:10px auto 3px}.mobile{margin-top:4px}}

/* v0.9.29 force title mikoshi position above legacy overrides */
#opening .title-stage .title-mikoshi-group{top:43%!important}@media(max-width:700px),(pointer:coarse){#opening .title-stage .title-mikoshi-group{top:44%!important}}

/* v0.9.30 event lobby participant cards */
#eventSeats span{display:flex;flex-direction:column;gap:2px;text-align:left}#eventSeats span small{font-size:12px}.resting{background:#665b22!important;border-color:#ffe36b!important}.joined b{color:#9dffab}.resting b{color:#ffe36b}

/* v0.9.31 restore preferred title mikoshi height */
#opening .title-stage .title-mikoshi-group{top:49%!important}@media(max-width:700px),(pointer:coarse){#opening .title-stage .title-mikoshi-group{top:50%!important}}

/* v0.9.35 desktop title logo clearance */
@media(min-width:701px) and (pointer:fine){#opening .title-logo{top:4.5vh}}

/* v0.9.36 slightly reduce title mikoshi */
#opening .title-stage .title-mikoshi-group{width:min(56vw,440px);height:min(44vw,350px)}@media(max-width:700px),(pointer:coarse){#opening .title-stage .title-mikoshi-group{width:min(72vw,440px);height:min(57vw,360px)}}

/* v0.9.37 desktop title: keep logo and mikoshi visually separate */
@media(min-width:701px) and (pointer:fine){#opening .title-logo{top:1.5vh;width:min(76vw,620px);max-height:32vh}#opening .title-stage .title-mikoshi-group{top:53%!important;width:min(47vw,390px);height:min(37vw,310px)}.title-touch{bottom:9vh}}

/* v0.9.42 programmatic result celebration */
#result{--team:#ffd23f}#statueScene{filter:drop-shadow(0 0 16px var(--team)) drop-shadow(0 0 30px var(--team))}#winnerDance{position:absolute;z-index:16;left:58%;bottom:15%;animation:victoryDance .42s ease-in-out infinite alternate}#winnerDance img{width:min(20vw,125px);height:125px;object-fit:contain;filter:drop-shadow(0 5px 3px #0008)}#loserReactions{position:absolute;z-index:12;inset:auto 2% 11% 2%;display:flex;justify-content:space-between;pointer-events:none}.loserUnit{text-align:center;opacity:.9}.loserUnit img{width:min(12vw,80px);height:80px;object-fit:contain;filter:grayscale(.25) drop-shadow(0 4px 2px #0008);animation:loserBob .8s ease-in-out infinite alternate}.loserUnit small{display:block;background:#111c;border-radius:999px;padding:2px 6px;font-weight:900}.celebrateNpc{position:absolute;z-index:13;width:min(9vw,62px);height:62px;object-fit:contain;animation:cheerHop .5s ease-in-out infinite alternate;filter:drop-shadow(0 4px 2px #0008)}#confettiLayer{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:30}.confetti{position:absolute;top:-8%;width:10px;height:18px;background:var(--c);animation:confettiFall var(--d) linear infinite;animation-delay:var(--delay);transform:rotate(var(--r))}@keyframes victoryDance{to{transform:translateY(-13px) rotate(7deg) scale(1.06)}}@keyframes loserBob{to{transform:translateY(7px) rotate(-4deg)}}@keyframes cheerHop{to{transform:translateY(-12px) rotate(5deg)}}@keyframes confettiFall{to{top:108%;transform:translateX(var(--drift)) rotate(720deg)}}

/* v0.9.44 result character composition */
.result-festival #winnerHero{display:none!important}#winnerDance{left:18%;bottom:20%;z-index:18;animation:victoryDance .42s ease-in-out infinite alternate}#winnerDance img{width:min(27vw,180px);height:min(27vw,180px);object-fit:contain;filter:drop-shadow(0 7px 4px #0009)}#loserReactions{left:auto;right:3%;bottom:7%;width:42%;display:flex;justify-content:flex-end;align-items:flex-end;gap:4px;z-index:17}.loserUnit{position:relative;flex:0 1 33%;min-width:0}.loserUnit img{width:min(9vw,58px);height:min(9vw,58px);filter:grayscale(.3) saturate(.75) drop-shadow(0 3px 2px #0009);animation:loserTremble .38s ease-in-out infinite alternate}.loserUnit small{font-size:9px;padding:1px 4px;white-space:nowrap}.loserUnit:before{content:'💢';position:absolute;right:-2px;top:-14px;font-size:18px;animation:angerPop .55s ease-in-out infinite alternate}.loserUnit:nth-child(2):before{content:'💧'}.loserUnit:nth-child(3):before{content:'😣'}@keyframes loserTremble{0%{transform:translateX(-2px) rotate(-3deg)}100%{transform:translateX(2px) translateY(3px) rotate(3deg)}}@keyframes angerPop{to{transform:scale(1.28) rotate(8deg)}}@media(max-width:700px),(pointer:coarse){#winnerDance{left:8%;bottom:21%}#winnerDance img{width:min(32vw,150px);height:min(32vw,150px)}#loserReactions{right:2%;bottom:8%;width:46%;gap:1px}.loserUnit img{width:min(12vw,52px);height:min(12vw,52px)}.loserUnit small{display:none}}

/* v0.9.45 winner statue always visible + team-color tint */
#result #statueScene{display:block}#result #statueImg{filter:grayscale(1) sepia(1) saturate(3.2) drop-shadow(0 0 12px var(--team)) drop-shadow(0 0 24px var(--team));transition:filter .3s}#result[data-winner-team="0"] #statueImg{filter:grayscale(.35) sepia(1) saturate(6) hue-rotate(325deg) brightness(1.02) drop-shadow(0 0 14px #e33b3b) drop-shadow(0 0 30px #e33b3b)}#result[data-winner-team="1"] #statueImg{filter:grayscale(.25) sepia(1) saturate(6) hue-rotate(165deg) brightness(1.05) drop-shadow(0 0 14px #317bd6) drop-shadow(0 0 30px #317bd6)}#result[data-winner-team="2"] #statueImg{filter:grayscale(.25) sepia(1) saturate(5) hue-rotate(70deg) brightness(1.02) drop-shadow(0 0 14px #35a853) drop-shadow(0 0 30px #35a853)}#result[data-winner-team="3"] #statueImg{filter:grayscale(.15) sepia(1) saturate(5.5) hue-rotate(350deg) brightness(1.12) drop-shadow(0 0 14px #e3b52b) drop-shadow(0 0 30px #e3b52b)}

/* v0.9.46 bring winner and loser reactions closer to statue */
#winnerDance{left:29%;bottom:22%}#winnerDance img{width:min(25vw,170px);height:min(25vw,170px)}#loserReactions{right:17%;bottom:12%;width:31%;gap:2px}.loserUnit img{width:min(8vw,54px);height:min(8vw,54px)}@media(max-width:700px),(pointer:coarse){#winnerDance{left:18%;bottom:22%}#winnerDance img{width:min(29vw,145px);height:min(29vw,145px)}#loserReactions{right:10%;bottom:11%;width:35%}.loserUnit img{width:min(10vw,48px);height:min(10vw,48px)}}

/* v0.9.47 result characters just above ranking panel */
#winnerDance{left:27%;bottom:auto;top:20%}#loserReactions{right:19%;bottom:auto;top:29%;width:30%}@media(max-width:700px),(pointer:coarse){#winnerDance{left:15%;bottom:auto;top:22%}#loserReactions{right:8%;bottom:auto;top:31%;width:38%}}

/* v0.9.48 all result players in one row above ranking */
#winnerDance{left:18%;top:19%;bottom:auto}#winnerDance img{width:min(23vw,160px);height:min(23vw,160px)}#loserReactions{left:43%;right:auto;top:23%;bottom:auto;width:48%;display:flex;justify-content:flex-start;align-items:flex-end;gap:10px}.loserUnit{flex:0 0 auto}.loserUnit img{width:min(10vw,64px);height:min(10vw,64px)}@media(max-width:700px),(pointer:coarse){#winnerDance{left:7%;top:21%;bottom:auto}#winnerDance img{width:min(28vw,140px);height:min(28vw,140px)}#loserReactions{left:38%;right:auto;top:27%;bottom:auto;width:58%;gap:3px}.loserUnit img{width:min(13vw,54px);height:min(13vw,54px)}}

/* v0.9.49 countdown over game MAP */
#game{position:relative}#countdown{position:absolute;z-index:30;left:50%;top:0;right:auto;bottom:auto;width:min(100%,960px);aspect-ratio:960/640;transform:translateX(-50%);align-items:center;justify-content:center;background:rgba(7,16,28,.34);pointer-events:none}#countdown b{white-space:nowrap;word-break:keep-all;line-height:1;font-size:clamp(64px,18vw,190px)}@media(max-width:700px),(pointer:coarse){#countdown{top:38px;width:calc(100% - 16px);max-width:960px}#countdown b{white-space:nowrap;font-size:clamp(54px,20vw,120px);letter-spacing:-.03em}}

/* v0.9.50 smartphone landscape play mode */
#landscapeToggle{display:none;position:absolute;z-index:45;right:10px;bottom:8px;font-size:12px;padding:6px 10px;border:2px solid #fff;border-radius:999px;background:#111b;color:#fff;box-shadow:none}@media(max-width:900px),(pointer:coarse){#game.active #landscapeToggle{display:block}}body.landscape-play{overflow:hidden}body.landscape-play #game{position:fixed;inset:0;padding:0!important;background:#111;display:block!important}body.landscape-play #game header{position:absolute;z-index:42;left:8px;right:8px;top:4px;width:auto;margin:0;background:#1118;border-radius:10px;padding:3px 8px;pointer-events:none}body.landscape-play #timer{font-size:20px}body.landscape-play #scores .score{font-size:10px}body.landscape-play #cv{position:absolute;inset:0;width:100vw;height:100vh;max-height:none;object-fit:contain;border:0;margin:0;background:#111}body.landscape-play #message{position:absolute;z-index:42;left:18%;right:4%;bottom:7px;min-height:24px;line-height:24px;margin:0;background:#1119;border-radius:9px;font-size:12px;pointer-events:none}body.landscape-play #joystick{display:block!important;position:absolute;z-index:46;left:16px;bottom:14px;margin:0;width:132px;height:132px;opacity:.56;background:#1118;border-color:#fff9}body.landscape-play #joystick:active{opacity:.82}body.landscape-play #stick{width:56px;height:56px;left:34px;top:34px;opacity:.78}body.landscape-play .mobile{display:none!important}body.landscape-play #landscapeToggle{display:block;top:42px;right:8px;bottom:auto}body.landscape-play #countdown{position:absolute;z-index:44;inset:0;width:100%;height:100%;aspect-ratio:auto;transform:none;left:0;top:0}body.landscape-play #countdown b{font-size:min(24vh,180px);white-space:nowrap}

/* v0.9.51 reliable iPhone landscape + simulated landscape fallback */
@media (orientation:landscape) and (pointer:coarse){body:not(.landscape-play) #game.active{position:fixed;inset:0;padding:0!important;background:#111;display:block!important}body:not(.landscape-play) #game.active header{position:absolute;z-index:42;left:8px;right:8px;top:4px;width:auto;margin:0;background:#1118;border-radius:10px;padding:3px 8px}body:not(.landscape-play) #game.active #cv{position:absolute;inset:0;width:100vw;height:100vh;max-height:none;object-fit:contain;border:0}body:not(.landscape-play) #game.active #joystick{display:block!important;position:absolute;z-index:46;left:16px;bottom:14px;margin:0;width:132px;height:132px;opacity:.58}body:not(.landscape-play) #game.active #message{position:absolute;z-index:42;left:18%;right:4%;bottom:7px;background:#1119;border-radius:9px}body:not(.landscape-play) #game.active .mobile{display:none!important}}
@media (orientation:portrait) and (pointer:coarse){body.landscape-play #game{width:100vh;height:100vw;left:50%;top:50%;right:auto;bottom:auto;transform:translate(-50%,-50%) rotate(90deg);transform-origin:center center}body.landscape-play #cv{width:100%;height:100%;object-fit:contain}body.landscape-play #landscapeToggle{transform:rotate(-90deg);transform-origin:center}}

/* v0.9.52 landscape controls + compact title */
body.landscape-play #joystick{left:auto!important;right:18px!important;bottom:14px!important}@media (orientation:landscape) and (pointer:coarse){body:not(.landscape-play) #game.active #joystick{left:auto!important;right:18px!important;bottom:14px!important}#opening .title-logo{top:3vh!important;width:min(58vw,470px)!important;max-height:25vh!important}#opening .title-stage .title-mikoshi-group{top:52%!important;width:min(38vw,330px)!important;height:min(30vw,260px)!important}.title-touch{bottom:5vh!important;min-width:min(48vw,300px)!important;font-size:clamp(15px,2vw,21px)!important;padding:7px 18px!important}}

/* v0.9.53 landscape title: logo upper-left, compact start button */
@media (orientation:landscape) and (pointer:coarse){#opening .title-logo{left:4%!important;right:auto!important;top:5%!important;transform:none!important;width:min(34vw,330px)!important;max-height:27vh!important}#opening .title-stage .title-mikoshi-group{top:50%!important;width:min(34vw,300px)!important;height:min(27vw,235px)!important}.title-touch{left:50%!important;bottom:5vh!important;transform:translateX(-50%)!important;min-width:0!important;width:min(28vw,230px)!important;font-size:clamp(11px,1.45vw,15px)!important;padding:5px 10px!important;border-width:3px!important;box-shadow:0 5px 0 #9c341f!important}}

/* v0.9.54 landscape joystick right-middle */
body.landscape-play #joystick{left:auto!important;right:18px!important;top:50%!important;bottom:auto!important;transform:translateY(-50%)!important}@media (orientation:landscape) and (pointer:coarse){body:not(.landscape-play) #game.active #joystick{left:auto!important;right:18px!important;top:50%!important;bottom:auto!important;transform:translateY(-50%)!important}}

/* v0.9.55 result layout polish */
#result #winnerDance{left:calc(50% - 155px);top:18.5%;bottom:auto;z-index:21}#result #winnerDance img{width:120px;height:120px}#result #loserReactions{left:calc(50% + 58px);right:auto;top:22.5%;bottom:auto;width:205px;gap:2px;justify-content:flex-start;z-index:21}#result .loserUnit img{width:54px;height:54px}#result #statueScene{z-index:15}#result #statue{position:relative}#result #statue b{display:block;margin:-2px auto 0;width:max-content;min-width:128px;padding:7px 18px;border-radius:999px;background:linear-gradient(180deg,#fff4c5,#d8a83d);border:3px solid #fff2a4;box-shadow:0 4px 0 #6b431d,0 0 14px var(--team);color:#4a2a08;font-size:16px;font-weight:1000;text-shadow:0 1px 0 #fff9;letter-spacing:.08em}#result .pedestal{margin:7px auto 0;width:max-content;min-width:150px;padding:8px 20px;border-radius:10px;background:linear-gradient(180deg,var(--team),#29212c);border:3px solid #ffe9a6;box-shadow:0 5px 0 #3a2519,0 0 16px var(--team);color:#fff;font-size:17px;font-weight:1000;text-shadow:0 2px 2px #000;letter-spacing:.06em}@media(max-width:700px),(pointer:coarse){#result #winnerDance{left:calc(50% - 128px);top:28.5%}#result #winnerDance img{width:88px;height:88px}#result #loserReactions{left:calc(50% + 30px);top:31%;width:150px;gap:0}#result .loserUnit img{width:42px;height:42px}#result #statue b{min-width:105px;padding:5px 12px;font-size:13px}#result .pedestal{min-width:125px;padding:6px 12px;font-size:14px;margin-top:5px}}

/* v0.9.57 fit complete MAP inside Safari visible viewport */
@media (orientation:landscape) and (pointer:coarse){body:not(.landscape-play) #game.active{height:100dvh!important;min-height:0!important;overflow:hidden}body:not(.landscape-play) #game.active #cv{left:50%!important;top:50%!important;right:auto!important;bottom:auto!important;width:min(100vw,calc(100dvh * 1.5))!important;height:min(100dvh,calc(100vw / 1.5))!important;transform:translate(-50%,-50%)!important;object-fit:contain!important}body:not(.landscape-play) #game.active header{left:50%!important;transform:translateX(-50%)!important;width:min(96vw,calc(100dvh * 1.5 - 12px))!important;right:auto!important}body:not(.landscape-play) #game.active #joystick{right:max(12px,calc((100vw - min(100vw,100dvh * 1.5))/2 + 12px))!important}body:not(.landscape-play) #game.active #countdown{left:50%!important;top:50%!important;width:min(100vw,calc(100dvh * 1.5))!important;height:min(100dvh,calc(100vw / 1.5))!important;transform:translate(-50%,-50%)!important}}

/* v0.9.58 landscape start button readability */
@media (orientation:landscape) and (pointer:coarse){#opening .title-touch{width:min(38vw,330px)!important;min-width:250px!important;font-size:clamp(15px,2.1vw,21px)!important;padding:9px 18px!important;border-width:4px!important;bottom:4vh!important}}

/* v0.9.59 place landscape joystick in spare area outside fitted MAP */
@media (orientation:landscape) and (pointer:coarse){body:not(.landscape-play) #game.active #joystick{left:auto!important;right:max(14px,calc((100vw - min(100vw,100dvh * 1.5))/4 - 66px))!important;top:50%!important;bottom:auto!important;transform:translateY(-50%)!important;width:118px!important;height:118px!important;opacity:.68!important;background:#1119!important;border-color:#fff9!important}body:not(.landscape-play) #game.active #stick{width:50px!important;height:50px!important;left:30px!important;top:30px!important}body:not(.landscape-play) #game.active #message{left:calc((100vw - min(100vw,100dvh * 1.5))/2 + 8px)!important;right:calc((100vw - min(100vw,100dvh * 1.5))/2 + 8px)!important}}

/* v0.9.60 result character scale/position refinement */
#result #winnerDance{left:calc(50% - 205px);top:25%;z-index:22}#result #winnerDance img{width:145px;height:145px}#result #loserReactions{left:calc(50% + 82px);top:29%;width:190px;gap:4px;z-index:22}#result .loserUnit img{width:58px;height:58px}#result .loserUnit:before{font-size:20px;top:-18px}@media(max-width:700px),(pointer:coarse){#result #winnerDance{left:calc(50% - 145px);top:30%}#result #winnerDance img{width:105px;height:105px}#result #loserReactions{left:calc(50% + 42px);top:34%;width:145px;gap:1px}#result .loserUnit img{width:44px;height:44px}}

/* v0.9.61 interactive title parade */
#opening .title-stage .tl{pointer-events:auto;cursor:pointer;z-index:16;min-width:58px;min-height:58px;object-fit:contain}#opening .title-stage .komakame{position:absolute;width:76px;height:76px;left:-12%;top:66%;animation:titlePassR 9.5s linear infinite;z-index:16}#titleInfo{position:absolute;z-index:70;left:50%;top:67%;transform:translate(-50%,-50%) scale(.94);min-width:220px;max-width:min(84vw,430px);padding:10px 16px;border:3px solid #fff;border-radius:14px;background:#17131ee8;color:#fff;font-weight:1000;text-align:center;opacity:0;pointer-events:none;transition:.16s;box-shadow:0 6px 0 #0007}#titleInfo.show{opacity:1;transform:translate(-50%,-50%) scale(1)}#opening .title-logo{pointer-events:none}.title-touch{z-index:60}@media(max-width:700px),(pointer:coarse){#opening .title-stage .tl{min-width:66px;min-height:66px}#opening .title-stage .komakame{width:82px;height:82px;top:68%}#titleInfo{top:70%;font-size:14px}}

/* v0.9.62 portrait title: keep madam and komakame visible */
@media (orientation:portrait) and (pointer:coarse){#opening .title-stage .madam{width:78px!important;height:78px!important;top:62%!important;z-index:18!important;animation-duration:10.8s!important}#opening .title-stage .komakame{width:84px!important;height:84px!important;top:72%!important;z-index:18!important;animation-duration:9.2s!important;animation-delay:-4.2s!important}#opening .title-stage .madam,#opening .title-stage .komakame{filter:drop-shadow(0 4px 3px #0009)} }

/* v0.9.76 safe title lanes: randomize position only, never animation timing */
#opening .title-stage .tl.title-lane{top:var(--title-lane)!important;bottom:auto!important;z-index:16!important;pointer-events:auto!important;min-width:58px;min-height:58px}@media(max-width:700px),(pointer:coarse){#opening .title-stage .tl.title-lane{min-width:66px;min-height:66px}}

/* v0.9.77 result statue: keep statue gold; team color is aura only */
#result #statueImg{filter:drop-shadow(0 0 10px var(--team)) drop-shadow(0 0 24px var(--team))!important}#result[data-winner-team="0"] #statueImg{filter:drop-shadow(0 0 12px #e33b3b) drop-shadow(0 0 28px #e33b3b)!important}#result[data-winner-team="1"] #statueImg{filter:drop-shadow(0 0 12px #317bd6) drop-shadow(0 0 28px #317bd6)!important}#result[data-winner-team="2"] #statueImg{filter:drop-shadow(0 0 12px #35a853) drop-shadow(0 0 28px #35a853)!important}#result[data-winner-team="3"] #statueImg{filter:drop-shadow(0 0 12px #e3b52b) drop-shadow(0 0 28px #e3b52b)!important}

/* v0.9.78 canonical town colors: East blue / West red / South green / North yellow */
#result[data-winner-team="0"] #statueImg{filter:drop-shadow(0 0 12px #317bd6) drop-shadow(0 0 28px #317bd6)!important}#result[data-winner-team="1"] #statueImg{filter:drop-shadow(0 0 12px #e33b3b) drop-shadow(0 0 28px #e33b3b)!important}#result[data-winner-team="2"] #statueImg{filter:drop-shadow(0 0 12px #35a853) drop-shadow(0 0 28px #35a853)!important}#result[data-winner-team="3"] #statueImg{filter:drop-shadow(0 0 12px #e3b52b) drop-shadow(0 0 28px #e3b52b)!important}

/* v0.9.79 statue body tint follows canonical leader color, preserving shading */
#result[data-winner-team="0"] #statueImg{filter:grayscale(.25) sepia(1) saturate(6) hue-rotate(165deg) brightness(1.05) drop-shadow(0 0 14px #317bd6) drop-shadow(0 0 30px #317bd6)!important}#result[data-winner-team="1"] #statueImg{filter:grayscale(.35) sepia(1) saturate(6) hue-rotate(325deg) brightness(1.02) drop-shadow(0 0 14px #e33b3b) drop-shadow(0 0 30px #e33b3b)!important}#result[data-winner-team="2"] #statueImg{filter:grayscale(.25) sepia(1) saturate(5) hue-rotate(70deg) brightness(1.02) drop-shadow(0 0 14px #35a853) drop-shadow(0 0 30px #35a853)!important}#result[data-winner-team="3"] #statueImg{filter:grayscale(.15) sepia(1) saturate(5.5) hue-rotate(350deg) brightness(1.12) drop-shadow(0 0 14px #e3b52b) drop-shadow(0 0 30px #e3b52b)!important}

/* v0.9.80 result character emphasis + DRAW cat */
#result #winnerDance{left:calc(50% - 245px)!important;top:27%!important;z-index:24!important}#result #winnerDance img{width:180px!important;height:180px!important}#result #loserReactions{left:calc(50% + 92px)!important;top:31%!important;width:245px!important;gap:6px!important;z-index:24!important}#result .loserUnit img{width:76px!important;height:76px!important}#result .loserUnit:before{font-size:24px!important;top:-21px!important}.drawCat{position:absolute;z-index:28;left:50%;top:43%;width:190px;height:190px;object-fit:contain;transform:translate(-50%,-50%);filter:drop-shadow(0 9px 5px #0009);animation:drawCatPop .7s cubic-bezier(.2,.9,.2,1) both,drawCatBob .65s .7s ease-in-out infinite alternate}.draw-mode #statueScene{filter:none!important}.draw-mode #statueScene:after{content:'にゃ〜ん…勝負はおあずけ！';position:absolute;left:50%;bottom:13%;transform:translateX(-50%);z-index:29;white-space:nowrap;background:#17131ee8;color:#fff;border:3px solid #fff;border-radius:999px;padding:7px 16px;font-weight:1000;box-shadow:0 5px 0 #0007}.draw-mode #resultSparkles{display:none}@keyframes drawCatPop{from{opacity:0;transform:translate(-50%,-20%) scale(.35) rotate(-12deg)}to{opacity:1;transform:translate(-50%,-50%) scale(1) rotate(0)}}@keyframes drawCatBob{from{transform:translate(-50%,-50%) rotate(-3deg)}to{transform:translate(-50%,-57%) rotate(3deg)}}@media(max-width:700px),(pointer:coarse){#result #winnerDance{left:calc(50% - 170px)!important;top:31%!important}#result #winnerDance img{width:125px!important;height:125px!important}#result #loserReactions{left:calc(50% + 50px)!important;top:35%!important;width:180px!important;gap:2px!important}#result .loserUnit img{width:58px!important;height:58px!important}.drawCat{width:145px;height:145px;top:44%}.draw-mode #statueScene:after{font-size:12px;padding:6px 10px;bottom:9%}}

/* v0.9.81 center winner plaque + gather festival NPCs around statue */
#result #statue b{position:relative!important;left:50%!important;transform:translateX(-50%)!important;text-align:center!important;box-sizing:border-box}#result .pedestal{left:50%!important;right:auto!important;transform:translateX(-50%)!important;text-align:center!important;box-sizing:border-box}#result #celebrationCrowd{position:absolute!important;inset:0!important;z-index:19!important;pointer-events:none!important}#result #celebrationCrowd .celebrateNpc{width:72px!important;height:72px!important;bottom:auto!important}@media(max-width:700px),(pointer:coarse){#result #celebrationCrowd .celebrateNpc{width:52px!important;height:52px!important}}

/* v0.9.82 countdown mask follows actual rendered MAP bounds */
#game #countdown{position:absolute!important;margin:0!important;max-width:none!important;box-sizing:border-box!important;background:rgba(7,16,28,.42)!important}#game #countdown.show{display:flex!important}

/* v0.9.84 result composition: clear ranking, center statue labels, group cast around statue */
#result #statue b{left:auto!important;transform:none!important;margin:-2px auto 0!important;text-align:center!important}#result .pedestal{left:50%!important;transform:translateX(-50%)!important;text-align:center!important}#result #winnerDance{left:calc(50% - 235px)!important;top:39%!important}#result #winnerDance img{width:165px!important;height:165px!important}#result #loserReactions{left:calc(50% + 92px)!important;top:40%!important;width:230px!important;gap:5px!important}#result .loserUnit img{width:70px!important;height:70px!important}#result #celebrationCrowd .celebrateNpc{width:66px!important;height:66px!important}#result #celebrationCrowd .celebrateNpc:nth-child(1){left:23%!important;top:53%!important}#result #celebrationCrowd .celebrateNpc:nth-child(2){left:30%!important;top:62%!important}#result #celebrationCrowd .celebrateNpc:nth-child(3){left:36%!important;top:69%!important}#result #celebrationCrowd .celebrateNpc:nth-child(4){left:64%!important;top:69%!important}#result #celebrationCrowd .celebrateNpc:nth-child(5){left:70%!important;top:62%!important}#result #celebrationCrowd .celebrateNpc:nth-child(6){left:77%!important;top:53%!important}#result #celebrationCrowd .celebrateNpc:nth-child(7){left:27%!important;top:72%!important}#result #celebrationCrowd .celebrateNpc:nth-child(8){left:73%!important;top:72%!important}@media(max-width:700px),(pointer:coarse){#result #winnerDance{left:calc(50% - 155px)!important;top:39%!important}#result #winnerDance img{width:115px!important;height:115px!important}#result #loserReactions{left:calc(50% + 52px)!important;top:41%!important;width:165px!important;gap:1px!important}#result .loserUnit img{width:52px!important;height:52px!important}#result #celebrationCrowd .celebrateNpc{width:46px!important;height:46px!important}}

/* v0.9.85 audio toggle: indicate OFF by opacity only, no strike-through */
#audioControls button.off{text-decoration:none!important}

/* v0.9.86 in-game BGM/SE controls */
#gameAudioControls{position:absolute;z-index:60;right:10px;top:48px;display:flex;gap:5px}#gameAudioControls button{min-width:0;padding:5px 8px;border:2px solid #fff;border-radius:999px;background:#17131dcc;color:#fff;font-size:10px;font-weight:900;box-shadow:none;text-shadow:none;white-space:nowrap}#gameAudioControls button.off{opacity:.55;text-decoration:none!important}@media(max-width:700px),(pointer:coarse){#gameAudioControls{right:8px;top:46px;gap:4px}#gameAudioControls button{padding:4px 6px;font-size:9px}}@media(orientation:landscape) and (pointer:coarse){#gameAudioControls{position:fixed;right:8px;top:42px;z-index:70}}

/* v0.9.87 game header: timer left, audio controls right */
#gameHeaderTop{display:flex;align-items:center;justify-content:space-between;width:100%;gap:10px}#gameHeaderTop #timer{flex:0 0 auto}#gameHeaderTop #gameAudioControls{position:static!important;display:flex;align-items:center;gap:5px;margin-left:auto}#gameHeaderTop #gameAudioControls button{min-width:0;padding:5px 8px;border:2px solid #fff;border-radius:999px;background:#17131dcc;color:#fff;font-size:10px;font-weight:900;box-shadow:none;text-shadow:none;white-space:nowrap}#gameHeaderTop #gameAudioControls button.off{opacity:.55;text-decoration:none!important}@media(max-width:700px),(pointer:coarse){#gameHeaderTop{gap:6px}#gameHeaderTop #gameAudioControls{gap:3px}#gameHeaderTop #gameAudioControls button{padding:4px 6px;font-size:9px}}@media(orientation:landscape) and (pointer:coarse){#gameHeaderTop #gameAudioControls{position:static!important;right:auto!important;top:auto!important}}

/* v0.9.88 all audio toggles: OFF uses opacity only */
#titleAudioControls button.off,#audioControls button.off,#gameAudioControls button.off,#gameHeaderTop #gameAudioControls button.off{text-decoration:none!important;text-decoration-line:none!important}

/* v0.9.89 game HUD: timer left / audio right / scores full-width second row */
#game header{flex-direction:column!important;align-items:stretch!important;gap:3px!important}#gameHeaderTop{width:100%!important;display:flex!important;align-items:center!important;justify-content:space-between!important}#gameHeaderTop #timer{margin-right:auto!important}#gameHeaderTop #gameAudioControls{margin-left:auto!important}#game #scores{width:100%!important;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:4px!important}#game #scores .score{display:block!important;width:auto!important;white-space:nowrap!important;text-align:center!important;line-height:1.15!important}@media(orientation:landscape) and (pointer:coarse){body:not(.landscape-play) #game.active header,body.landscape-play #game header{flex-direction:column!important;align-items:stretch!important}body:not(.landscape-play) #game.active #scores,body.landscape-play #game #scores{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;width:100%!important}}

/* v0.9.90 DRAW result readability */
#result.draw-mode #ranking{padding:9px 22px!important;line-height:1.32!important;min-height:142px!important;overflow:visible!important}#result.draw-mode #ranking>div{white-space:nowrap!important}#result.draw-mode .drawCat{top:48%!important;width:180px!important;height:180px!important}#result.draw-mode #statueScene:after{bottom:8%!important}@media(max-width:700px),(pointer:coarse){#result.draw-mode #ranking{padding:7px 12px!important;min-height:126px!important}#result.draw-mode .drawCat{top:49%!important;width:135px!important;height:135px!important}}

/* v0.9.91 DRAW: show all four town characters around cat */
#result.draw-mode #celebrationCrowd{position:absolute!important;inset:0!important;z-index:25!important;pointer-events:none!important}.drawTown{position:absolute;transform:translate(-50%,-50%);text-align:center;z-index:27}.drawTown img{width:92px;height:92px;object-fit:contain;filter:drop-shadow(0 6px 4px #0009)}.drawTown small{display:block;margin-top:-8px;padding:2px 8px;border-radius:999px;background:#17131ed9;color:#fff;font-size:11px;font-weight:1000;white-space:nowrap}.drawTown.drawTie img{width:118px;height:118px;animation:drawTieBounce .55s ease-in-out infinite alternate}.drawTown.drawTie small{color:#ffd23f;border:2px solid #ffd23f}.drawTown.drawOther{opacity:.82}.drawTown.drawOther img{filter:grayscale(.2) saturate(.8) drop-shadow(0 5px 3px #0008);animation:loserTremble .45s ease-in-out infinite alternate}.drawTown.drawOther:before{content:'💧';position:absolute;right:0;top:-12px;font-size:22px}.draw-mode .drawCat{z-index:30!important}@keyframes drawTieBounce{to{transform:translateY(-10px) rotate(4deg) scale(1.05)}}@media(max-width:700px),(pointer:coarse){.drawTown img{width:66px;height:66px}.drawTown.drawTie img{width:84px;height:84px}.drawTown small{font-size:9px;padding:1px 5px}.drawTown.drawOther:before{font-size:16px}}

/* v0.9.92 portrait result: keep celebration cast around statue and out of daily ranking */
@media(orientation:portrait) and (pointer:coarse){#result #celebrationCrowd .celebrateNpc{width:44px!important;height:44px!important}#result #celebrationCrowd .celebrateNpc:nth-child(1){left:18%!important;top:48%!important}#result #celebrationCrowd .celebrateNpc:nth-child(2){left:24%!important;top:56%!important}#result #celebrationCrowd .celebrateNpc:nth-child(3){left:32%!important;top:60%!important}#result #celebrationCrowd .celebrateNpc:nth-child(4){left:68%!important;top:60%!important}#result #celebrationCrowd .celebrateNpc:nth-child(5){left:76%!important;top:56%!important}#result #celebrationCrowd .celebrateNpc:nth-child(6){left:82%!important;top:48%!important}#result #celebrationCrowd .celebrateNpc:nth-child(7){left:40%!important;top:61%!important}#result #celebrationCrowd .celebrateNpc:nth-child(8){left:60%!important;top:61%!important}#result #dailyRank{position:relative!important;z-index:32!important}}

/* v0.9.92 portrait result: keep celebration NPCs around statue, out of daily ranking */
@media(max-width:700px) and (orientation:portrait){#result #celebrationCrowd .celebrateNpc{width:44px!important;height:44px!important}#result #celebrationCrowd .celebrateNpc:nth-child(1){left:18%!important;top:49%!important}#result #celebrationCrowd .celebrateNpc:nth-child(2){left:27%!important;top:54%!important}#result #celebrationCrowd .celebrateNpc:nth-child(3){left:37%!important;top:56%!important}#result #celebrationCrowd .celebrateNpc:nth-child(4){left:63%!important;top:56%!important}#result #celebrationCrowd .celebrateNpc:nth-child(5){left:73%!important;top:54%!important}#result #celebrationCrowd .celebrateNpc:nth-child(6){left:82%!important;top:49%!important}#result #celebrationCrowd .celebrateNpc:nth-child(7){left:31%!important;top:48%!important}#result #celebrationCrowd .celebrateNpc:nth-child(8){left:69%!important;top:48%!important}#result #dailyRank{position:relative!important;z-index:35!important}#result #resultButtons{position:relative!important;z-index:36!important}}

/* v0.9.93 title safe zone: never place tappable cast below START or outside portrait */
#opening .title-stage{overflow:hidden!important}#opening .title-stage .tl.title-lane{top:var(--title-lane)!important;bottom:auto!important;max-height:96px}#opening .title-stage .komakame.title-lane{left:7%!important;right:auto!important;animation:komakamePatrol 6.8s ease-in-out infinite alternate!important}#opening .title-stage .madam.title-lane{left:7%!important;right:auto!important}@keyframes komakamePatrol{0%{transform:translateX(0) translateY(0) rotate(-4deg)}100%{transform:translateX(min(72vw,520px)) translateY(-8px) rotate(4deg)}}@media(orientation:portrait) and (pointer:coarse){#opening .title-stage .madam.title-lane,#opening .title-stage .komakame.title-lane{top:var(--title-lane)!important}#opening .title-stage .komakame.title-lane{left:5%!important;animation:komakamePatrolPortrait 6.2s ease-in-out infinite alternate!important}@keyframes komakamePatrolPortrait{0%{transform:translateX(0) translateY(0) rotate(-4deg)}100%{transform:translateX(68vw) translateY(-7px) rotate(4deg)}}}

/* v0.9.95 title cast must stay below logo */
#opening .title-logo{z-index:40!important}#opening .title-stage .tl{visibility:hidden}#opening.active.title-lanes-ready .title-stage .tl{visibility:visible}

/* v0.9.96 robust title reveal: no permanent hidden state */
#opening .title-stage .tl{opacity:0;visibility:visible!important;transition:opacity .12s}#opening.active.title-lanes-ready .title-stage .tl{opacity:1}

/* v1.0.0-rc9 clean portrait title runtime rules */
@media(orientation:portrait) and (pointer:coarse){
#opening.portrait-js-parade .title-stage .tl.title-lane{animation:none!important;transition:none!important;right:auto!important;will-change:transform,opacity}
#opening.portrait-js-parade .title-stage .tl.title-lane:not(.dango):not(.kakigori):not(.dorayaki){left:0!important;opacity:1!important}
#opening.portrait-js-parade .title-stage .tl.dango,#opening.portrait-js-parade .title-stage .tl.kakigori,#opening.portrait-js-parade .title-stage .tl.dorayaki{left:var(--title-item-x,50%)!important;opacity:0}
#opening.portrait-js-parade .title-stage .tl.east,#opening.portrait-js-parade .title-stage .tl.west,#opening.portrait-js-parade .title-stage .tl.south,#opening.portrait-js-parade .title-stage .tl.north{width:72px!important;height:72px!important}
#opening.portrait-js-parade .title-stage .tl.carrier{width:64px!important;height:64px!important}
#opening.portrait-js-parade .title-stage .tl.delivery,#opening.portrait-js-parade .title-stage .tl.police,#opening.portrait-js-parade .title-stage .tl.madam,#opening.portrait-js-parade .title-stage .tl.komakame{width:70px!important;height:70px!important}
#opening.portrait-js-parade .title-stage .tl.dango,#opening.portrait-js-parade .title-stage .tl.kakigori,#opening.portrait-js-parade .title-stage .tl.dorayaki{width:58px!important;height:58px!important}
}

/* v1.0.0-rc11: JS owns character visibility; prevent legacy active rule from revealing queued cast */
@media(orientation:portrait) and (pointer:coarse){#opening.active.portrait-js-parade .title-stage .tl.title-lane:not(.dango):not(.kakigori):not(.dorayaki){opacity:0!important}#opening.active.portrait-js-parade .title-stage .tl.title-lane.title-running{opacity:1!important}}


/* v1.0.0-rc13 Safari-safe serialized title parade */
@media(orientation:portrait) and (pointer:coarse){
  #opening.portrait-js-parade .title-stage .tl.title-lane{
    animation:none!important;
    transition:none!important;
    right:auto!important;
  }
  #opening.portrait-js-parade .title-stage .tl.title-lane:not(.dango):not(.kakigori):not(.dorayaki){
    left:0!important;
    visibility:hidden!important;
    opacity:0!important;
  }
  #opening.portrait-js-parade .title-stage .tl.title-lane.title-running:not(.dango):not(.kakigori):not(.dorayaki){
    visibility:visible!important;
    opacity:1!important;
  }
  #opening.portrait-js-parade .title-stage .tl.dango,
  #opening.portrait-js-parade .title-stage .tl.kakigori,
  #opening.portrait-js-parade .title-stage .tl.dorayaki{
    visibility:visible!important;
    animation:none!important;
  }
}


/* v1.0.0-rc18: ambient bridge characters stay visible between title scenes */
@media(orientation:portrait) and (pointer:coarse){
  #opening.portrait-js-parade .title-stage .tl.title-lane.title-ambient:not(.dango):not(.kakigori):not(.dorayaki){
    visibility:visible!important;
    opacity:1!important;
  }
}


/* v1.0.0-rc21: lightweight festival pulse for title logo */
#opening .title-logo{
  transform-origin:50% 58%;
  animation:titleLogoFestivalPulse 10s ease-in-out infinite!important;
  will-change:transform;
}
@keyframes titleLogoFestivalPulse{
  0%{transform:translate3d(0,0,0) rotate(-.6deg) scale(1)}
  12%{transform:translate3d(0,-3px,0) rotate(.7deg) scale(1.008)}
  24%{transform:translate3d(0,1px,0) rotate(-.5deg) scale(1)}
  36%{transform:translate3d(0,-2px,0) rotate(.6deg) scale(1.006)}
  48%{transform:translate3d(0,0,0) rotate(-.4deg) scale(1)}
  60%{transform:translate3d(0,-3px,0) rotate(.5deg) scale(1.008)}
  72%{transform:translate3d(0,0,0) rotate(-.5deg) scale(1)}
  82%{transform:translate3d(0,-7px,0) rotate(1deg) scale(1.035)}
  87%{transform:translate3d(0,2px,0) rotate(-.8deg) scale(1.012)}
  92%{transform:translate3d(0,-3px,0) rotate(.5deg) scale(1.02)}
  100%{transform:translate3d(0,0,0) rotate(-.6deg) scale(1)}
}
@media(prefers-reduced-motion:reduce){
  #opening .title-logo{animation:none!important}
}


/* v1.0.0-rc22: hide legacy cast during title handoff + stronger logo pulse */
#opening.title-preparing .title-stage .tl{
  visibility:hidden!important;
  opacity:0!important;
}
#opening .title-logo{
  animation:titleLogoFestivalPulseStrong 9s ease-in-out infinite!important;
}
@keyframes titleLogoFestivalPulseStrong{
  0%{transform:translate3d(0,0,0) rotate(-.8deg) scale(1)}
  12%{transform:translate3d(0,-4px,0) rotate(.9deg) scale(1.012)}
  24%{transform:translate3d(0,1px,0) rotate(-.7deg) scale(1)}
  36%{transform:translate3d(0,-3px,0) rotate(.8deg) scale(1.01)}
  48%{transform:translate3d(0,0,0) rotate(-.6deg) scale(1)}
  60%{transform:translate3d(0,-4px,0) rotate(.7deg) scale(1.012)}
  72%{transform:translate3d(0,0,0) rotate(-.6deg) scale(1)}
  80%{transform:translate3d(0,2px,0) rotate(-1deg) scale(.97)}
  84%{transform:translate3d(0,-12px,0) rotate(1.4deg) scale(1.07)}
  88%{transform:translate3d(0,3px,0) rotate(-1.1deg) scale(1.02)}
  92%{transform:translate3d(0,-5px,0) rotate(.8deg) scale(1.035)}
  100%{transform:translate3d(0,0,0) rotate(-.8deg) scale(1)}
}
@media(prefers-reduced-motion:reduce){
  #opening .title-logo{animation:none!important}
}


/* v1.0.0-rc25: double town leader size on portrait title */
@media(orientation:portrait) and (pointer:coarse){
  #opening.portrait-js-parade .title-stage .tl.east,
  #opening.portrait-js-parade .title-stage .tl.west,
  #opening.portrait-js-parade .title-stage .tl.south,
  #opening.portrait-js-parade .title-stage .tl.north{
    width:140px!important;
    height:140px!important;
    max-height:140px!important;
  }
}


/* v1.0.0-rc28: flat story panel and non-button result plaque */
/* Story: keep the current box size/position, change only the visual treatment. */
.story-bg .storybox{
  background:#fff!important;
  border:3px solid #202020!important;
  border-radius:2px!important;
  box-shadow:0 5px 16px rgba(0,0,0,.28)!important;
  color:#202020!important;
  text-shadow:none!important;
  box-sizing:border-box!important;
}
.story-bg .storyroll{
  color:#202020!important;
  text-shadow:none!important;
}
.story-bg .storyroll b{
  color:#b3262d!important;
  text-shadow:none!important;
}

/* Result: chairman name is a flat plaque, not a tappable button. */
#result .pedestal{
  background:rgba(255,255,255,.94)!important;
  border:2px solid rgba(35,35,35,.78)!important;
  border-radius:3px!important;
  box-shadow:0 2px 7px rgba(0,0,0,.24)!important;
  color:#202020!important;
  text-shadow:none!important;
  font-weight:1000!important;
  letter-spacing:.06em!important;
}
#result #statue b{
  background:rgba(255,255,255,.88)!important;
  border:1px solid rgba(45,45,45,.55)!important;
  border-radius:2px!important;
  box-shadow:none!important;
  color:#333!important;
  text-shadow:none!important;
}


/* v1.0.0-rc29: story panel = white border + translucent black */
.story-bg .storybox{
  background:rgba(0,0,0,.58)!important;
  border:3px solid #fff!important;
  border-radius:2px!important;
  box-shadow:0 5px 16px rgba(0,0,0,.26)!important;
  color:#fff!important;
  text-shadow:0 2px 4px rgba(0,0,0,.65)!important;
  box-sizing:border-box!important;
}
.story-bg .storyroll{
  color:#fff!important;
  text-shadow:0 2px 4px rgba(0,0,0,.65)!important;
}
.story-bg .storyroll b{
  color:#ffd23f!important;
  text-shadow:0 2px 4px rgba(0,0,0,.7)!important;
}


/* v1.0.0-rc30: simplify result plaque and enlarge result cast */
/* Show only the winner-town plaque beneath the statue. */
#result #statue b{
  display:none!important;
}
#result .pedestal{
  min-width:170px!important;
  padding:8px 18px!important;
  font-size:16px!important;
}

/* Make result characters clearly larger without changing result layout structure. */
#result #winnerDance img{
  width:190px!important;
  height:190px!important;
}
#result .loserUnit img{
  width:88px!important;
  height:88px!important;
}
#result #celebrationCrowd .celebrateNpc{
  width:78px!important;
  height:78px!important;
}
@media(max-width:700px),(pointer:coarse){
  #result #winnerDance img{
    width:150px!important;
    height:150px!important;
  }
  #result .loserUnit img{
    width:68px!important;
    height:68px!important;
  }
  #result #celebrationCrowd .celebrateNpc{
    width:58px!important;
    height:58px!important;
  }
  #result .pedestal{
    min-width:145px!important;
    padding:7px 14px!important;
    font-size:14px!important;
  }
}


/* v1.0.0-rc31: rebalance portrait result composition */
/* Keep the winner plaque clearly beneath the statue and above decorative NPCs. */
#result .pedestal{
  z-index:36!important;
  bottom:8px!important;
  left:50%!important;
  right:auto!important;
  transform:translateX(-50%)!important;
  white-space:nowrap!important;
}
#result #statueImg{
  position:relative;
  z-index:30;
}

/* Rebalance winner/loser cast around the statue. */
#result #winnerDance{
  z-index:28!important;
}
#result #loserReactions{
  z-index:28!important;
}
#result .loserUnit{
  position:relative!important;
}
#result .loserUnit:before{
  right:50%!important;
  top:-18px!important;
  transform:translateX(50%)!important;
  line-height:1!important;
  z-index:31!important;
}

/* Decorative festival cast stays behind the main players and plaque. */
#result #celebrationCrowd{
  z-index:18!important;
}

@media(max-width:700px),(pointer:coarse){
  #result #winnerDance{
    left:calc(50% - 178px)!important;
    top:39%!important;
    bottom:auto!important;
  }
  #result #winnerDance img{
    width:160px!important;
    height:160px!important;
  }

  #result #loserReactions{
    left:calc(50% + 62px)!important;
    right:auto!important;
    top:42%!important;
    bottom:auto!important;
    width:205px!important;
    display:flex!important;
    justify-content:flex-start!important;
    align-items:flex-end!important;
    gap:3px!important;
  }
  #result .loserUnit{
    flex:0 0 62px!important;
    width:62px!important;
  }
  #result .loserUnit img{
    width:62px!important;
    height:62px!important;
  }
  #result .loserUnit:before{
    top:-17px!important;
    font-size:20px!important;
  }

  #result .pedestal{
    bottom:5px!important;
    min-width:150px!important;
    padding:7px 15px!important;
  }

  /* Pull decorative NPCs away from the center plaque. */
  #result #celebrationCrowd .celebrateNpc:nth-child(1){left:18%!important;top:55%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(2){left:25%!important;top:66%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(3){left:33%!important;top:72%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(4){left:67%!important;top:72%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(5){left:75%!important;top:66%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(6){left:82%!important;top:55%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(7){left:22%!important;top:76%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(8){left:78%!important;top:76%!important}
}


/* v1.0.0-rc32: clean portrait result character zone */
@media(max-width:700px) and (orientation:portrait){
  /* Main winner: large and clearly separated from statue */
  #result #winnerDance{
    left:calc(50% - 182px)!important;
    top:40%!important;
    bottom:auto!important;
    z-index:29!important;
  }
  #result #winnerDance img{
    width:166px!important;
    height:166px!important;
  }

  /* Three losers: keep all three visible in one compact row on the right */
  #result #loserReactions{
    left:calc(50% + 58px)!important;
    right:auto!important;
    top:41%!important;
    bottom:auto!important;
    width:188px!important;
    display:flex!important;
    justify-content:flex-start!important;
    align-items:flex-end!important;
    gap:1px!important;
    overflow:visible!important;
    z-index:30!important;
  }
  #result .loserUnit{
    flex:0 0 61px!important;
    width:61px!important;
    overflow:visible!important;
  }
  #result .loserUnit img{
    width:61px!important;
    height:61px!important;
  }
  #result .loserUnit:before{
    left:50%!important;
    right:auto!important;
    top:-19px!important;
    transform:translateX(-50%)!important;
    font-size:19px!important;
    line-height:1!important;
  }

  /* Keep winner plaque cleanly under the statue. */
  #result .pedestal{
    z-index:38!important;
    bottom:7px!important;
  }

  /* Decorative NPCs stay inside the statue/character zone only. */
  #result #celebrationCrowd{
    z-index:18!important;
    overflow:hidden!important;
  }
  #result #celebrationCrowd .celebrateNpc{
    width:54px!important;
    height:54px!important;
  }
  #result #celebrationCrowd .celebrateNpc:nth-child(1){left:16%!important;top:58%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(2){left:24%!important;top:68%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(3){left:34%!important;top:73%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(4){left:66%!important;top:73%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(5){left:76%!important;top:68%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(6){left:84%!important;top:58%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(7){left:28%!important;top:78%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(8){left:72%!important;top:78%!important}

  /* Ranking and buttons must remain visually above any decorative cast. */
  #result #dailyRank{
    position:relative!important;
    z-index:40!important;
  }
  #result #resultButtons{
    position:relative!important;
    z-index:41!important;
  }
}


/* v1.0.0-rc33: integrate winner name plaque into statue pedestal */
/* Winner name should read as the front plate of the statue pedestal, not a floating UI panel. */
#result #statue{
  position:relative!important;
}
#result .pedestal{
  position:absolute!important;
  left:50%!important;
  right:auto!important;
  bottom:2px!important;
  transform:translateX(-50%)!important;
  margin:0!important;

  min-width:138px!important;
  width:max-content!important;
  padding:6px 15px 7px!important;

  background:linear-gradient(180deg,#f2f2f2 0%,#d9d9d9 58%,#bdbdbd 100%)!important;
  border:2px solid #666!important;
  border-radius:2px!important;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.78),
    0 2px 3px rgba(0,0,0,.18)!important;

  color:#222!important;
  text-shadow:none!important;
  font-weight:1000!important;
  letter-spacing:.04em!important;
  text-align:center!important;
  z-index:39!important;
}

/* Slightly extend the visual base under the statue so the plaque feels attached. */
#result #statue:after{
  content:'';
  display:block;
  width:150px;
  height:16px;
  margin:-5px auto 0;
  background:linear-gradient(180deg,#d5d5d5,#9e9e9e);
  border:2px solid #666;
  border-top:0;
  box-sizing:border-box;
}

/* Mobile portrait tuning */
@media(max-width:700px) and (orientation:portrait){
  #result .pedestal{
    bottom:0!important;
    min-width:128px!important;
    padding:6px 13px 7px!important;
    font-size:13px!important;
  }
  #result #statue:after{
    width:138px;
    height:14px;
    margin:-4px auto 0;
  }
}


/* v1.0.0-rc34: place winner plaque directly below statue base */
#result .pedestal{
  bottom:-18px!important;
}
@media(max-width:700px) and (orientation:portrait){
  #result .pedestal{
    bottom:-16px!important;
  }
}


/* v1.0.0-rc35: raise story panel and title start button */
/* Raise the story panel without changing its size. */
.story-bg .storybox{
  transform:translateY(-3vh)!important;
}
.story-bg>small{
  transform:translateY(-3vh)!important;
}

/* Raise the START button slightly on the title screen. */
#opening .title-touch{
  bottom:16vh!important;
}

@media(max-width:700px) and (orientation:portrait){
  .story-bg .storybox{
    transform:translateY(-3.5vh)!important;
  }
  .story-bg>small{
    transform:translateY(-3.5vh)!important;
  }
  #opening .title-touch{
    bottom:17vh!important;
  }
}

@media(orientation:landscape) and (pointer:coarse){
  #opening .title-touch{
    bottom:7vh!important;
  }
}


/* v1.0.0-rc37: attach winner plaque to statue and clip decorative cast */
/* The winner plaque now lives inside #statue, directly beneath the statue image. */
#result #statue{
  overflow:visible!important;
}
#result #statue:after{
  display:none!important;
}
#result #statue .pedestal{
  position:relative!important;
  left:auto!important;
  right:auto!important;
  bottom:auto!important;
  top:auto!important;
  transform:none!important;
  margin:-2px auto 0!important;
  width:max-content!important;
  min-width:132px!important;
  padding:6px 14px 7px!important;
  z-index:39!important;
}

/* Keep decorative celebration NPCs in the visual band above the ranking panel. */
#result #celebrationCrowd{
  top:36%!important;
  bottom:auto!important;
  height:34%!important;
  overflow:hidden!important;
  z-index:18!important;
}
#result #celebrationCrowd .celebrateNpc:nth-child(1){left:16%!important;top:18%!important}
#result #celebrationCrowd .celebrateNpc:nth-child(2){left:25%!important;top:42%!important}
#result #celebrationCrowd .celebrateNpc:nth-child(3){left:34%!important;top:62%!important}
#result #celebrationCrowd .celebrateNpc:nth-child(4){left:66%!important;top:62%!important}
#result #celebrationCrowd .celebrateNpc:nth-child(5){left:75%!important;top:42%!important}
#result #celebrationCrowd .celebrateNpc:nth-child(6){left:84%!important;top:18%!important}
#result #celebrationCrowd .celebrateNpc:nth-child(7){left:28%!important;top:78%!important}
#result #celebrationCrowd .celebrateNpc:nth-child(8){left:72%!important;top:78%!important}

@media(max-width:700px) and (orientation:portrait){
  #result #statue .pedestal{
    margin:-1px auto 0!important;
    min-width:126px!important;
    padding:6px 12px 7px!important;
    font-size:13px!important;
  }
  #result #celebrationCrowd{
    top:38%!important;
    height:30%!important;
  }
}


/* v1.0.0-rc42: result screen fine tuning */

/* Statue / winner plaque */
#result #statue{
  position:relative!important;
  z-index:30!important;
  overflow:visible!important;
}
#result #statue .pedestal{
  position:relative!important;
  margin:-6px auto 0!important;
  min-width:112px!important;
  max-width:132px!important;
  padding:5px 12px 6px!important;
  background:linear-gradient(180deg,#f2f2f2 0%,#d9d9d9 58%,#bdbdbd 100%)!important;
  border:2px solid #666!important;
  border-radius:2px!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.78),0 2px 3px rgba(0,0,0,.18)!important;
  color:#222!important;
  text-shadow:none!important;
  font-weight:1000!important;
  letter-spacing:.04em!important;
  text-align:center!important;
  z-index:39!important;
}

/* Main result cast */
#result #winnerDance{z-index:29!important}
#result #loserReactions{z-index:29!important}

/* Keep decorative cast above the ranking panel */
#result #celebrationCrowd{
  top:39%!important;
  bottom:auto!important;
  height:28%!important;
  overflow:hidden!important;
  z-index:18!important;
}
#result #dailyRank{
  position:relative!important;
  z-index:40!important;
}
#result #resultButtons{
  position:relative!important;
  z-index:41!important;
}

@media(max-width:700px) and (orientation:portrait){
  #result #statue .pedestal{
    margin:-7px auto 0!important;
    min-width:108px!important;
    max-width:126px!important;
    padding:5px 11px 6px!important;
    font-size:12px!important;
  }

  #result #winnerDance{
    left:calc(50% - 190px)!important;
    top:43%!important;
    bottom:auto!important;
  }
  #result #winnerDance img{
    width:154px!important;
    height:154px!important;
  }

  #result #loserReactions{
    left:calc(50% + 68px)!important;
    right:auto!important;
    top:44%!important;
    bottom:auto!important;
    width:174px!important;
    display:flex!important;
    justify-content:flex-start!important;
    align-items:flex-end!important;
    gap:0!important;
    overflow:visible!important;
  }
  #result .loserUnit{
    flex:0 0 56px!important;
    width:56px!important;
    overflow:visible!important;
  }
  #result .loserUnit img{
    width:56px!important;
    height:56px!important;
  }
  #result .loserUnit:before{
    left:50%!important;
    right:auto!important;
    top:-16px!important;
    transform:translateX(-50%)!important;
    font-size:18px!important;
    line-height:1!important;
  }

  #result #celebrationCrowd .celebrateNpc{
    width:50px!important;
    height:50px!important;
  }
  #result #celebrationCrowd .celebrateNpc:nth-child(1){left:18%!important;top:12%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(2){left:28%!important;top:56%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(3){left:36%!important;top:78%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(4){left:64%!important;top:78%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(5){left:72%!important;top:56%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(6){left:82%!important;top:12%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(7){left:24%!important;top:86%!important}
  #result #celebrationCrowd .celebrateNpc:nth-child(8){left:76%!important;top:86%!important}
}


/* v1.0.0-rc43: result cast directional placement */
@media(max-width:700px) and (orientation:portrait){
  /* Winner remains left of statue. */
  #result #winnerDance{
    left:calc(50% - 196px)!important;
    top:44%!important;
    bottom:auto!important;
    z-index:29!important;
  }
  #result #winnerDance img{
    width:152px!important;
    height:152px!important;
  }

  /* Losers gather at statue lower-right and face inward (left). */
  #result #loserReactions{
    left:calc(50% + 72px)!important;
    right:auto!important;
    top:51%!important;
    bottom:auto!important;
    width:164px!important;
    display:flex!important;
    justify-content:flex-start!important;
    align-items:flex-end!important;
    gap:2px!important;
    overflow:visible!important;
    z-index:30!important;
  }
  #result .loserUnit{
    flex:0 0 52px!important;
    width:52px!important;
    position:relative!important;
    overflow:visible!important;
  }
  #result .loserUnit img{
    width:52px!important;
    height:52px!important;
    transform:scaleX(-1)!important;
    transform-origin:center center!important;
  }
  #result .loserUnit:before{
    left:50%!important;
    right:auto!important;
    top:-15px!important;
    transform:translateX(-50%)!important;
    font-size:18px!important;
    line-height:1!important;
  }

  /* Slightly tighter statue plaque. */
  #result #statue .pedestal{
    margin:-6px auto 0!important;
    min-width:108px!important;
    max-width:124px!important;
    padding:5px 10px 6px!important;
    font-size:12px!important;
  }

  /* Decorative cast stays between result panel and ranking. */
  #result #celebrationCrowd{
    top:39%!important;
    bottom:auto!important;
    height:30%!important;
    overflow:hidden!important;
    z-index:18!important;
  }
  #result #celebrationCrowd .celebrateNpc{
    width:48px!important;
    height:48px!important;
  }

  /* Madam supports the winner from the lower-left. */
  #result #celebrationCrowd .npc-madam{
    left:14%!important;
    top:66%!important;
  }

  /* Drunk + police form a pair at upper-right. */
  #result #celebrationCrowd .npc-drunk{
    left:76%!important;
    top:18%!important;
  }
  #result #celebrationCrowd .npc-police{
    left:85%!important;
    top:18%!important;
  }

  /* Keep the remaining festival cast spread without obscuring the main actors. */
  #result #celebrationCrowd .npc-carrier{
    top:66%!important;
  }
  #result #celebrationCrowd .npc-carrier:nth-child(1){left:22%!important}
  #result #celebrationCrowd .npc-carrier:nth-child(2){left:31%!important}
  #result #celebrationCrowd .npc-cat{
    left:34%!important;
    top:82%!important;
  }
  #result #celebrationCrowd .npc-delivery{
    left:65%!important;
    top:72%!important;
  }
  #result #celebrationCrowd .npc-komakame{
    left:72%!important;
    top:82%!important;
  }
}


/* v1.0.0-rc45: portrait / landscape result character placement */

/* =========================
   Portrait
========================= */
@media (max-width:700px) and (orientation:portrait){

  #result #winnerDance{
    left:calc(50% - 198px)!important;
    top:44%!important;
    bottom:auto!important;
    z-index:29!important;
  }
  #result #winnerDance img{
    width:150px!important;
    height:150px!important;
  }

  /* Losers: statue lower-right, facing inward */
  #result #loserReactions{
    left:calc(50% + 76px)!important;
    right:auto!important;
    top:53%!important;
    bottom:auto!important;
    width:158px!important;
    display:flex!important;
    justify-content:flex-start!important;
    align-items:flex-end!important;
    gap:2px!important;
    overflow:visible!important;
    z-index:30!important;
  }
  #result .loserUnit{
    flex:0 0 50px!important;
    width:50px!important;
    overflow:visible!important;
    position:relative!important;
  }
  #result .loserUnit img{
    width:50px!important;
    height:50px!important;
    transform:scaleX(-1)!important;
    transform-origin:center center!important;
  }
  #result .loserUnit:before{
    left:50%!important;
    right:auto!important;
    top:-15px!important;
    transform:translateX(-50%)!important;
    font-size:18px!important;
    line-height:1!important;
  }

  #result #statue .pedestal{
    margin:-6px auto 0!important;
    min-width:108px!important;
    max-width:124px!important;
    padding:5px 10px 6px!important;
    font-size:12px!important;
  }

  #result #celebrationCrowd{
    top:39%!important;
    bottom:auto!important;
    height:30%!important;
    overflow:hidden!important;
    z-index:18!important;
  }
  #result #celebrationCrowd .celebrateNpc{
    width:46px!important;
    height:46px!important;
  }

  /* Madam: lower-left near winner */
  #result #celebrationCrowd .npc-madam{
    left:17%!important;
    top:73%!important;
  }

  /* Drunk + police: upper-right */
  #result #celebrationCrowd .npc-drunk{
    left:77%!important;
    top:18%!important;
  }
  #result #celebrationCrowd .npc-police{
    left:86%!important;
    top:18%!important;
  }

  #result #celebrationCrowd .npc-carrier:nth-child(1){
    left:21%!important;
    top:22%!important;
  }
  #result #celebrationCrowd .npc-carrier:nth-child(2){
    left:31%!important;
    top:60%!important;
  }
  #result #celebrationCrowd .npc-cat{
    left:35%!important;
    top:82%!important;
  }
  #result #celebrationCrowd .npc-delivery{
    left:66%!important;
    top:74%!important;
  }
  #result #celebrationCrowd .npc-komakame{
    left:73%!important;
    top:82%!important;
  }
}

/* =========================
   Landscape
========================= */
@media (orientation:landscape) and (pointer:coarse){

  #result #winnerDance{
    left:20%!important;
    top:55%!important;
    bottom:auto!important;
    z-index:29!important;
  }
  #result #winnerDance img{
    width:118px!important;
    height:118px!important;
  }

  /* Losers: right-middle/lower, facing inward */
  #result #loserReactions{
    left:66%!important;
    right:auto!important;
    top:57%!important;
    bottom:auto!important;
    width:150px!important;
    display:flex!important;
    justify-content:flex-start!important;
    align-items:flex-end!important;
    gap:4px!important;
    overflow:visible!important;
    z-index:30!important;
  }
  #result .loserUnit{
    flex:0 0 46px!important;
    width:46px!important;
    overflow:visible!important;
    position:relative!important;
  }
  #result .loserUnit img{
    width:46px!important;
    height:46px!important;
    transform:scaleX(-1)!important;
    transform-origin:center center!important;
  }
  #result .loserUnit:before{
    left:50%!important;
    right:auto!important;
    top:-14px!important;
    transform:translateX(-50%)!important;
    font-size:16px!important;
    line-height:1!important;
  }

  #result #statue .pedestal{
    margin:-4px auto 0!important;
    min-width:112px!important;
    max-width:128px!important;
    padding:5px 10px 6px!important;
    font-size:12px!important;
  }

  #result #celebrationCrowd{
    top:46%!important;
    bottom:auto!important;
    height:24%!important;
    overflow:hidden!important;
    z-index:18!important;
  }
  #result #celebrationCrowd .celebrateNpc{
    width:42px!important;
    height:42px!important;
  }

  /* Madam: lower-left */
  #result #celebrationCrowd .npc-madam{
    left:29%!important;
    top:74%!important;
  }

  /* Drunk + police: upper-right */
  #result #celebrationCrowd .npc-drunk{
    left:73%!important;
    top:10%!important;
  }
  #result #celebrationCrowd .npc-police{
    left:84%!important;
    top:10%!important;
  }

  #result #celebrationCrowd .npc-carrier:nth-child(1){
    left:18%!important;
    top:26%!important;
  }
  #result #celebrationCrowd .npc-carrier:nth-child(2){
    left:24%!important;
    top:58%!important;
  }
  #result #celebrationCrowd .npc-cat{
    left:33%!important;
    top:80%!important;
  }
  #result #celebrationCrowd .npc-delivery{
    left:68%!important;
    top:70%!important;
  }
  #result #celebrationCrowd .npc-komakame{
    left:76%!important;
    top:82%!important;
  }
}


/* v1.0.0-rc47: portrait result UI fine tuning */
@media (max-width:700px) and (orientation:portrait){

  /* Winner: closer to statue on the left */
  #result #winnerDance{
    left:calc(50% - 168px)!important;
    top:47%!important;
    bottom:auto!important;
    z-index:29!important;
  }
  #result #winnerDance img{
    width:138px!important;
    height:138px!important;
  }

  /* Losers: move left and slightly upward */
  #result #loserReactions{
    left:calc(50% + 42px)!important;
    right:auto!important;
    top:50%!important;
    bottom:auto!important;
    width:150px!important;
    display:flex!important;
    justify-content:flex-start!important;
    align-items:flex-end!important;
    gap:2px!important;
    overflow:visible!important;
    z-index:30!important;
  }
  #result .loserUnit{
    flex:0 0 48px!important;
    width:48px!important;
    overflow:visible!important;
    position:relative!important;
  }
  #result .loserUnit img{
    width:48px!important;
    height:48px!important;
    transform:scaleX(-1)!important;
    transform-origin:center center!important;
  }
  #result .loserUnit:before{
    left:50%!important;
    right:auto!important;
    top:-14px!important;
    transform:translateX(-50%)!important;
    font-size:17px!important;
    line-height:1!important;
  }

  /* Move decorative cast band up so nobody hides behind ranking */
  #result #celebrationCrowd{
    top:36%!important;
    bottom:auto!important;
    height:27%!important;
    overflow:hidden!important;
    z-index:18!important;
  }
  #result #celebrationCrowd .celebrateNpc{
    width:44px!important;
    height:44px!important;
  }

  #result #celebrationCrowd .npc-madam{
    left:20%!important;
    top:69%!important;
  }
  #result #celebrationCrowd .npc-drunk{
    left:75%!important;
    top:16%!important;
  }
  #result #celebrationCrowd .npc-police{
    left:84%!important;
    top:16%!important;
  }
  #result #celebrationCrowd .npc-carrier:nth-child(1){
    left:22%!important;
    top:20%!important;
  }
  #result #celebrationCrowd .npc-carrier:nth-child(2){
    left:30%!important;
    top:52%!important;
  }
  #result #celebrationCrowd .npc-cat{
    left:36%!important;
    top:71%!important;
  }
  #result #celebrationCrowd .npc-delivery{
    left:64%!important;
    top:64%!important;
  }
  #result #celebrationCrowd .npc-komakame{
    left:71%!important;
    top:73%!important;
  }

  #result #statue .pedestal{
    margin:-8px auto 0!important;
    min-width:108px!important;
    max-width:124px!important;
    padding:5px 10px 6px!important;
    font-size:12px!important;
  }
}


/* v1.0.0-rc48: restore DRAW layout and enlarge portrait result cast */

/* ---------- Portrait WIN / LOSE ---------- */
@media(max-width:700px) and (orientation:portrait){
  /* Main winning town character */
  #result:not(.draw-mode) #winnerDance{
    left:calc(50% - 182px)!important;
    top:43.5%!important;
    bottom:auto!important;
    z-index:30!important;
  }
  #result:not(.draw-mode) #winnerDance img{
    width:166px!important;
    height:166px!important;
  }

  /* Three losing town characters: larger and closer to statue */
  #result:not(.draw-mode) #loserReactions{
    left:calc(50% + 34px)!important;
    top:49%!important;
    width:184px!important;
    gap:2px!important;
    z-index:31!important;
  }
  #result:not(.draw-mode) .loserUnit{
    flex:0 0 58px!important;
    width:58px!important;
  }
  #result:not(.draw-mode) .loserUnit img{
    width:58px!important;
    height:58px!important;
    transform:scaleX(-1)!important;
  }
  #result:not(.draw-mode) .loserUnit:before{
    top:-16px!important;
    font-size:19px!important;
  }

  /* Festival cast: larger, but kept above daily ranking */
  #result:not(.draw-mode) #celebrationCrowd{
    top:35%!important;
    height:29%!important;
    overflow:hidden!important;
  }
  #result:not(.draw-mode) #celebrationCrowd .celebrateNpc{
    width:52px!important;
    height:52px!important;
  }

  #result:not(.draw-mode) #celebrationCrowd .npc-madam{
    left:18%!important;
    top:66%!important;
  }
  #result:not(.draw-mode) #celebrationCrowd .npc-drunk{
    left:74%!important;
    top:14%!important;
  }
  #result:not(.draw-mode) #celebrationCrowd .npc-police{
    left:84%!important;
    top:14%!important;
  }
  #result:not(.draw-mode) #celebrationCrowd .npc-carrier:nth-child(1){
    left:21%!important;
    top:18%!important;
  }
  #result:not(.draw-mode) #celebrationCrowd .npc-carrier:nth-child(2){
    left:29%!important;
    top:52%!important;
  }
  #result:not(.draw-mode) #celebrationCrowd .npc-cat{
    left:35%!important;
    top:70%!important;
  }
  #result:not(.draw-mode) #celebrationCrowd .npc-delivery{
    left:64%!important;
    top:61%!important;
  }
  #result:not(.draw-mode) #celebrationCrowd .npc-komakame{
    left:71%!important;
    top:70%!important;
  }
}

/* ---------- DRAW: completely separate composition ---------- */
#result.draw-mode #winnerDance,
#result.draw-mode #loserReactions{
  display:none!important;
}

#result.draw-mode #celebrationCrowd{
  position:absolute!important;
  inset:0!important;
  top:0!important;
  right:0!important;
  bottom:0!important;
  left:0!important;
  width:100%!important;
  height:100%!important;
  overflow:visible!important;
  z-index:26!important;
}

#result.draw-mode .drawCat{
  position:absolute!important;
  left:50%!important;
  top:31%!important;
  width:180px!important;
  height:180px!important;
  transform:translate(-50%,-50%)!important;
  z-index:32!important;
}

#result.draw-mode .drawTown{
  position:absolute!important;
  z-index:30!important;
}

#result.draw-mode .drawTown img{
  width:82px!important;
  height:82px!important;
}
#result.draw-mode .drawTown.drawTie img{
  width:112px!important;
  height:112px!important;
}
#result.draw-mode .drawTown small{
  margin-top:-8px!important;
  padding:3px 9px!important;
  font-size:11px!important;
}

/* draw result speech: place between cast and daily ranking */
#result.draw-mode #statueScene{
  display:block!important;
  position:absolute!important;
  inset:0!important;
  filter:none!important;
  pointer-events:none!important;
  z-index:29!important;
}
#result.draw-mode #statue{
  display:none!important;
}
#result.draw-mode #statueScene:after{
  content:'にゃ〜ん…勝負はおあずけ！'!important;
  position:absolute!important;
  left:50%!important;
  bottom:35%!important;
  transform:translateX(-50%)!important;
  z-index:33!important;
  white-space:nowrap!important;
  font-size:13px!important;
  padding:7px 14px!important;
}

/* Portrait DRAW positions */
@media(max-width:700px) and (orientation:portrait){
  #result.draw-mode #celebrationCrowd{
    inset:0!important;
    height:100%!important;
    overflow:visible!important;
  }

  #result.draw-mode .drawCat{
    top:25.5%!important;
    width:158px!important;
    height:158px!important;
  }

  /* setupDrawCelebration order is 東・西・南・北 */
  #result.draw-mode .drawTown:nth-of-type(2){
    left:27%!important;
    top:26%!important;
  }
  #result.draw-mode .drawTown:nth-of-type(3){
    left:73%!important;
    top:26%!important;
  }
  #result.draw-mode .drawTown:nth-of-type(4){
    left:31%!important;
    top:35.5%!important;
  }
  #result.draw-mode .drawTown:nth-of-type(5){
    left:69%!important;
    top:35.5%!important;
  }

  #result.draw-mode .drawTown img{
    width:76px!important;
    height:76px!important;
  }
  #result.draw-mode .drawTown.drawTie img{
    width:104px!important;
    height:104px!important;
  }
  #result.draw-mode .drawTown small{
    font-size:10px!important;
    padding:2px 7px!important;
    margin-top:-9px!important;
  }

  #result.draw-mode #statueScene:after{
    bottom:36.5%!important;
    font-size:13px!important;
  }
}

/* Landscape DRAW positions */
@media(orientation:landscape) and (pointer:coarse){
  #result.draw-mode .drawCat{
    left:50%!important;
    top:43%!important;
    width:170px!important;
    height:170px!important;
  }
  #result.draw-mode .drawTown:nth-of-type(2){
    left:29%!important;
    top:45%!important;
  }
  #result.draw-mode .drawTown:nth-of-type(3){
    left:71%!important;
    top:45%!important;
  }
  #result.draw-mode .drawTown:nth-of-type(4){
    left:35%!important;
    top:61%!important;
  }
  #result.draw-mode .drawTown:nth-of-type(5){
    left:65%!important;
    top:61%!important;
  }
  #result.draw-mode #statueScene:after{
    bottom:16%!important;
  }
}


/* v1.0.0-rc49: two-device versus lobby */
#versusInfo{
  width:min(94vw,680px);
  margin:0 auto;
  text-align:center;
}
#versusRoom{
  background:#17131dcc;
  border:3px solid #fff;
  border-radius:18px;
  padding:12px;
  box-shadow:0 6px 0 #0006;
}
#versusSeats{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin:10px 0;
}
#versusSeats span{
  display:block;
  background:#292130;
  border:2px solid #fff;
  border-radius:12px;
  padding:10px 6px;
}
#versusSeats span.joined{
  background:#176b2a;
  border-color:#8dff9d;
}
#versusSeats b,#versusSeats small{
  display:block;
}
#versusQR{
  width:180px;
  height:180px;
  margin:10px auto;
  padding:6px;
  background:#fff;
  border:4px solid #111;
  border-radius:10px;
}
#versusQR img{
  width:100%;
  height:100%;
  display:block;
}
#versusRoomCode{
  margin:8px 0;
  color:#ffd23f;
  font-size:22px;
  font-weight:1000;
  letter-spacing:3px;
}
#versusNick{
  width:min(86%,360px);
  padding:10px 12px;
  border:3px solid #111;
  border-radius:12px;
  font-size:16px;
  font-weight:900;
}
#versusJoin,#versusReadyStart,#versusBack{
  margin:5px;
}
#versusReadyStart:disabled{
  opacity:.55;
}
@media(max-width:700px){
  #versusInfo h2{margin:8px 0}
  #versusInfo p{margin:6px 0}
  #versusQR{
    width:156px;
    height:156px;
  }
  #versusSeats span{
    padding:8px 4px;
    font-size:13px;
  }
}


/* v1.0.0-rc63: result WIN/LOSE composition fine tuning */
@media(max-width:700px) and (orientation:portrait){
  /* Winner: raise until head almost touches/overlaps the upper panel */
  #result:not(.draw-mode) #winnerDance{
    left:calc(50% - 176px)!important;
    top:34.5%!important;
    bottom:auto!important;
    z-index:32!important;
  }

  /* Losers: line up directly to the right of the statue */
  #result:not(.draw-mode) #loserReactions{
    left:calc(50% + 58px)!important;
    top:43.5%!important;
    width:190px!important;
    gap:3px!important;
    justify-content:flex-start!important;
    align-items:flex-end!important;
    z-index:32!important;
  }

  /* Allow festival cast to overlap the upper result panel */
  #result:not(.draw-mode) #celebrationCrowd{
    overflow:visible!important;
  }

  /* Madam: upper-left of the winner */
  #result:not(.draw-mode) #celebrationCrowd .npc-madam{
    left:8%!important;
    top:4%!important;
    z-index:34!important;
  }

  /* Cat: centered immediately below the statue */
  #result:not(.draw-mode) #celebrationCrowd .npc-cat{
    left:50%!important;
    top:78%!important;
    transform:translateX(-50%)!important;
    z-index:33!important;
  }

  /* Drunk + police: align around the statue head height */
  #result:not(.draw-mode) #celebrationCrowd .npc-drunk{
    left:72%!important;
    top:12%!important;
    z-index:35!important;
  }
  #result:not(.draw-mode) #celebrationCrowd .npc-police{
    left:84%!important;
    top:12%!important;
    z-index:35!important;
  }
}

@media(orientation:landscape) and (pointer:coarse){
  #result:not(.draw-mode) #winnerDance{
    left:18%!important;
    top:39%!important;
    bottom:auto!important;
    z-index:32!important;
  }

  #result:not(.draw-mode) #loserReactions{
    left:calc(50% + 76px)!important;
    top:44%!important;
    width:190px!important;
    gap:4px!important;
    justify-content:flex-start!important;
    z-index:32!important;
  }

  #result:not(.draw-mode) #celebrationCrowd{
    overflow:visible!important;
  }

  #result:not(.draw-mode) #celebrationCrowd .npc-madam{
    left:10%!important;
    top:2%!important;
    z-index:34!important;
  }

  #result:not(.draw-mode) #celebrationCrowd .npc-cat{
    left:50%!important;
    top:82%!important;
    transform:translateX(-50%)!important;
    z-index:33!important;
  }

  #result:not(.draw-mode) #celebrationCrowd .npc-drunk{
    left:73%!important;
    top:-10%!important;
    z-index:35!important;
  }
  #result:not(.draw-mode) #celebrationCrowd .npc-police{
    left:84%!important;
    top:-10%!important;
    z-index:35!important;
  }
}
