@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@500;700;800;900&display=swap');
:root{font-family:'M PLUS Rounded 1c',system-ui,sans-serif;color:#103647;background:#0b3042;font-synthesis:none}*{box-sizing:border-box}body{margin:0;min-height:100dvh;background:radial-gradient(ellipse at 25% 20%,#185c6c 0,transparent 50%),#0b3042}button{font:inherit;cursor:pointer;color:inherit;border:0}button:focus-visible{outline:3px solid #ff5c66;outline-offset:3px}button:disabled{cursor:default}h1,h2,p{margin:0}.app{max-width:460px;margin:0 auto;min-height:100dvh;background:#f5fcfc;padding:18px 20px 12px;box-shadow:0 0 100px #00192550}header{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.brand>span{font:800 10px/1.4 system-ui;letter-spacing:2.5px}.brand h1{font-size:27px;letter-spacing:-1.7px;font-weight:900;line-height:1.4}.brand h1>span{color:#058b90}.brand i{color:#f86c50;padding-left:2px}.icon{background:#e2f0f1;border-radius:50%;width:44px;height:44px;font-size:23px;line-height:1}.icon span{display:block;font:800 9px system-ui;margin-top:2px}nav{display:flex;border-bottom:2px solid #daeaec;gap:8px;margin-bottom:12px}nav button{background:none;flex:1;padding:8px 0 12px;font-size:14px;position:relative;color:#65818b}nav button.active{color:#103647;font-weight:900}nav button.active:after{content:'';position:absolute;bottom:-2px;left:10%;width:80%;height:4px;background:#079e9a;border-radius:3px}nav small{font:700 11px system-ui;background:#dceced;padding:3px 5px;border-radius:6px}.hud{display:flex;align-items:center;justify-content:space-between;padding:2px 5px 10px}.hud>div>span{font:800 11px system-ui;letter-spacing:1px;display:block;color:#6c8490}.hud strong{display:block;font:900 32px/1.2 system-ui}.hud .combo{text-align:right;margin-left:auto;margin-right:18px}.combo strong{font-size:17px;color:#078e8c;margin-top:7px}.timer{background:#ffda53;border-radius:17px;min-width:61px;padding:4px 8px}.timer strong{font-size:27px}.timer span{font-size:10px;display:block}.fever-track{position:relative;background:#dcebed;height:18px;border-radius:20px;overflow:hidden;margin:0 0 9px}.fever-track>div{height:100%;width:0;background:linear-gradient(90deg,#08b5ad,#ffcd4b);transition:width .2s}.fever-track>span{position:absolute;left:0;right:0;top:0;text-align:center;font:900 10px/18px system-ui;letter-spacing:2px}.board-wrap{position:relative;width:min(100%,calc((100dvh - 300px)*.857));min-width:240px;margin:auto;aspect-ratio:6/7;border-radius:26px;overflow:hidden;background:#d8f4f0;box-shadow:inset 0 0 0 2px #b9e6e3}canvas{width:100%;height:100%;display:block;touch-action:none;user-select:none}.overlay{position:absolute;inset:0;background:#e9faf4cc;backdrop-filter:blur(5px);display:flex;align-items:center;justify-content:center;padding:14px}.welcome{text-align:center;width:100%}.eyebrow{font:800 11px/1.5 system-ui;letter-spacing:1.2px;color:#058b90}.welcome h2{font-size:clamp(24px,6vw,33px);font-weight:900;line-height:1.4;letter-spacing:-1px;margin:7px 0 10px}.welcome p{font-size:14px;line-height:1.9;margin-bottom:20px}.welcome small{display:block;font-size:10px;margin-top:12px;color:#5c7980}.primary{background:#103c4b;color:#fff;padding:15px 20px;border-radius:16px;width:100%;font-size:16px;font-weight:800;box-shadow:0 4px 0 #072833;transition:transform .15s}.primary:active{transform:translateY(3px);box-shadow:0 1px 0 #072833}.cat-hero{display:flex;justify-content:center;margin-bottom:6px;height:82px}.cat-art{display:inline-block;background-image:url('cats-v5.png');background-size:300% 200%;background-position:var(--x,0%) var(--y,0%);background-repeat:no-repeat;width:82px;height:82px}.cat-hero .cat-art:first-child{transform:rotate(-13deg);margin-right:-7px}.cat-hero .cat-art:last-child{transform:rotate(12deg)}.bottom-controls{display:flex;gap:9px;margin-top:13px}.skill{display:flex;align-items:center;text-align:left;background:#123e4b;color:white;border-radius:18px;padding:5px 10px 5px 3px;flex:1;min-height:60px;position:relative;overflow:hidden}.skill.ready{background:#ffc940;color:#11394b;animation:pulse 1s infinite}.leader{width:47px;height:47px;flex-shrink:0}.skill b{display:block;font-size:13px}.skill small{display:block;font-size:10px;opacity:.8;margin-top:3px}.charge{font:800 13px system-ui;margin-left:auto;padding-left:4px}.shuffle{background:#deeff0;border-radius:17px;width:65px;font:700 29px system-ui;line-height:1.1}.shuffle small{display:block;font:700 10px system-ui}.play-hint{text-align:center;font-size:10px;color:#5f7e85;margin-top:12px;line-height:1.6}.hidden{display:none!important}footer{display:flex;align-items:center;justify-content:space-between;border-top:1px solid #dce9eb;margin-top:15px;padding-top:13px;color:#6f858b;font-size:10px}footer button{background:none;font-size:10px;color:#6f858b}.section-head{padding:24px 0 20px}.section-head h2{font-size:23px;margin:8px 0 12px}.section-head p{font-size:14px;line-height:1.9;color:#627d87}#totalLabel{display:inline-block;background:#dff2ec;color:#087d79;padding:7px 12px;margin-top:15px;border-radius:10px;font-size:13px}#catGrid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:22px}.cat-card{background:white;border:2px solid #dcebed;border-radius:20px;padding:12px 8px;text-align:center;position:relative}.cat-card.selected{border-color:#0b9c96;background:#e7f9f3}.cat-card .cat-art{display:block;margin:auto;width:85px;height:85px}.cat-card.locked .cat-art{filter:grayscale(1);opacity:.35}.cat-card b{display:block;font-size:16px;margin:4px 0}.cat-card p{font-size:11px;line-height:1.7;color:#55737e;min-height:38px}.cat-card small{display:block;font-size:11px;margin-top:7px;color:#078780}.cat-card.locked small{color:#799099}.record{display:flex;align-items:center;padding:17px 5px;border-bottom:1px solid #dcebed;gap:14px}.record .rank{font:900 22px system-ui;color:#07948f;width:28px}.record strong{font:800 25px system-ui;margin-left:auto}.record small{font-size:11px;color:#6b848c}.notice{background:#e5f0f0;border-radius:16px;padding:17px;margin:20px 0;font-size:14px}.notice p{font-size:12px;line-height:1.8;margin-top:7px}.text-button{display:block;background:none;text-decoration:underline;font-size:13px;margin:17px auto 3px}.results h2{font:900 45px system-ui}.results p{margin-bottom:15px}#unlockMessage{color:#078d86;font-size:13px;margin-bottom:17px}#callout{position:absolute;top:15%;width:100%;text-align:center;pointer-events:none;font-size:25px;font-weight:900;color:#103d4b;text-shadow:0 2px white,2px 0 white,-2px 0 white;transition:opacity .3s;opacity:0;z-index:2}dialog{border:0;border-radius:25px;padding:32px;max-width:390px;width:90%;color:#103647;box-shadow:0 15px 60px #0004}dialog::backdrop{background:#062634aa}dialog h2{font-size:24px;margin:10px 0 16px}dialog p{font-size:14px;line-height:1.9;margin:15px 0}.close{position:absolute;right:12px;top:8px;background:none;font-size:28px}@keyframes pulse{50%{box-shadow:0 0 0 4px #ffda5380}}@media(min-width:700px){.app{margin:24px auto;border-radius:32px;min-height:0;padding:24px}.board-wrap{width:100%;max-height:460px;min-width:0}body{padding-bottom:24px}}@media(max-height:720px){.app{padding-top:10px}header{margin-bottom:8px}.cat-hero{height:55px}.cat-hero .cat-art{width:60px;height:60px}.welcome p{margin-bottom:12px}.welcome h2{font-size:24px;margin:3px 0 8px}.welcome small{margin-top:8px}.board-wrap{width:min(100%,calc((100dvh - 272px)*.857))}footer{margin-top:8px;padding-top:8px}}

.community{margin-top:20px;padding:17px;background:#e3f5ee;border-radius:20px;border:1px solid #c7e8dc}.community-title{display:flex;justify-content:space-between;align-items:center;font-size:14px}.community-title span{font-size:12px;color:#527e72}.community-numbers{display:flex;justify-content:space-between;gap:15px;margin:15px 0 10px}.community-numbers small{font-size:12px;display:block;color:#4b766b}.community-numbers strong{display:block;font:900 26px system-ui;color:#087d6d;margin-top:4px}.community-numbers em{font:700 14px system-ui;margin-left:4px}.community-meter{height:8px;border-radius:5px;background:#c8e5d9;overflow:hidden}.community-meter i{display:block;height:100%;width:0;background:#0aa584}.community p{font-size:12px;line-height:1.8;margin:6px 0}.community .donation-copy{font-size:12px;margin-top:12px;color:#46685e}.results .donation-result{font-size:11px;color:#097e72;margin:8px 0}.results h2{font-size:38px}.results .primary{padding:12px}.results #unlockMessage{margin-bottom:8px}

/* A slow glow and sweeping highlight signal skill readiness without rapid flashing. */
.skill.ready{animation:skill-ready-glow 1.25s ease-in-out infinite}
.skill.ready::after{content:'';position:absolute;inset:-60% -40%;background:linear-gradient(110deg,transparent 35%,#ffffffb3 49%,transparent 63%);transform:translateX(-100%);animation:skill-ready-shine 1.9s ease-in-out infinite;pointer-events:none}
.skill.ready .charge{color:#123e4b;text-shadow:0 0 9px white}
#combo{transform-origin:center;white-space:nowrap}.combo-pop{animation:combo-pop .38s cubic-bezier(.2,.8,.3,1)}
@keyframes skill-ready-glow{0%,100%{background:#ffc940;box-shadow:0 0 0 2px #ffe57b,0 0 10px #ffc94055}50%{background:#ffe98b;box-shadow:0 0 0 4px #ffd75899,0 0 24px #ffc94099}}
@keyframes skill-ready-shine{0%,20%{transform:translateX(-100%)}75%,100%{transform:translateX(100%)}}
@keyframes combo-pop{0%{transform:scale(.88)}40%{transform:scale(1.22);text-shadow:0 0 14px var(--combo-glow)}100%{transform:scale(1);text-shadow:none}}
@media(prefers-reduced-motion:reduce){.skill.ready,.skill.ready::after,.combo-pop{animation:none}.skill.ready{box-shadow:0 0 0 3px #ffe57b,0 0 18px #ffc94088}.skill.ready::after{display:none}}

.boss-overlay{background:#fff0d9ed}.boss-portrait{display:block;margin:auto;width:100px;height:100px;background:url('cat-oyabun.png') center/contain no-repeat}.boss-overlay h2{font-size:25px}.boss-overlay .welcome p{margin-bottom:12px}#bossOptions{display:flex;gap:14px}#bossOptions button{font-size:28px}#bossOptions small{font-size:13px;color:inherit;margin-top:2px}#bossDice{font-size:66px;line-height:1.2;color:#a73d32;margin:12px 0}#bossDice.rolling{animation:dice-roll .22s ease-in-out infinite alternate}@keyframes dice-roll{from{transform:translateY(-5px) rotate(-8deg)}to{transform:translateY(5px) rotate(8deg)}}@media(prefers-reduced-motion:reduce){#bossDice.rolling{animation:none}}

/* Keep controls above mobile browser / gesture bars, including edge-to-edge Android. */
:root{--game-bottom-space:max(32px,env(safe-area-inset-bottom,0px))}
.app{padding-bottom:calc(16px + var(--game-bottom-space));padding-top:max(10px,env(safe-area-inset-top,0px))}
.board-wrap{min-width:0;width:min(100%,calc(var(--board-available-height,calc(100svh - 340px))*6/7));max-height:none}
.bottom-controls{padding-bottom:0;scroll-margin-bottom:calc(16px + var(--game-bottom-space))}
.overlay{overflow-y:auto}.overlay .welcome{margin-block:auto}
.player-card{background:#e1f4ee;border:1px solid #c4e5dc;padding:16px;border-radius:20px}.player-card label{font-size:14px;font-weight:800}.name-row{display:flex;gap:8px;margin:10px 0}.name-row input{min-width:0;width:100%;font:inherit;font-size:16px;padding:11px;border:1px solid #96beb5;border-radius:12px;background:white;color:#103647}.name-row .primary{width:auto;flex-shrink:0;font-size:12px;padding:10px}.player-card p{font-size:11px;line-height:1.7}.player-card .text-button{font-size:11px;margin:12px 0}.my-ranking{white-space:pre-line;background:#123e4b;color:#fff;border-radius:16px;padding:16px;margin:18px 0;font-size:13px;line-height:1.9}.ranking-tabs{display:flex;gap:8px}.ranking-tabs button{flex:1;background:#e1eff0;padding:13px 4px;border-radius:12px;font-size:13px}.ranking-tabs .active{background:#ffc940;font-weight:900}.ranking-caption{font-size:11px;color:#607d85;margin:12px 0}.ranking-row{display:flex;gap:10px;align-items:center;min-height:62px;border-bottom:1px solid #d7e7e6;padding:9px 6px}.ranking-row .rank{width:30px;flex-shrink:0;text-align:center;font:900 20px system-ui;color:#078e8c}.ranking-row b{font-size:13px;overflow-wrap:anywhere}.ranking-row strong{margin-left:auto;white-space:nowrap;font:800 19px system-ui}.ranking-row.mine{background:#fff2bd;border-radius:10px}#records details{margin:20px 0}#playerStatus{color:#087b71;margin-top:10px}#introRanking{font-size:11px}
#leaveGame{display:none}.immersive{overflow:hidden;padding:0;background:#f5fcfc}.immersive .app{margin:0;padding:0;max-width:none;min-height:0;border-radius:0;box-shadow:none}.immersive header,.immersive nav,.immersive .community,.immersive footer,.immersive .play-hint{display:none}.immersive #play{position:fixed;inset:0;bottom:auto;height:var(--game-screen-height,100dvh);padding:max(6px,env(safe-area-inset-top,0px)) max(6px,env(safe-area-inset-right,0px)) max(16px,env(safe-area-inset-bottom,0px)) max(6px,env(safe-area-inset-left,0px));display:flex;flex-direction:column;align-items:center;background:#f5fcfc;z-index:10}.immersive .hud,.immersive .fever-track,.immersive .bottom-controls{width:100%;max-width:620px;flex-shrink:0}.immersive .hud{padding-bottom:5px}.immersive .hud strong{font-size:26px}.immersive .combo strong{font-size:16px}.immersive .board-wrap{flex-shrink:0;margin:0 auto;border-radius:20px}.immersive .bottom-controls{margin-top:auto;padding-top:6px;min-height:66px}.immersive .fever-track{margin-bottom:6px;height:16px}.immersive #leaveGame{display:block;width:32px;background:#e2f0f1;border-radius:10px;font-size:30px;margin-right:8px}.immersive .skill{min-height:60px}.immersive .timer{min-width:54px}.immersive .hud .combo{margin-right:10px}

/* Use only spare portrait space; the board and skill controls keep their size. */
.cheer-stage{display:none}.immersive .cheer-stage{display:flex;flex:1 1 0;min-height:0;width:100%;max-width:620px;overflow:hidden;align-items:center;justify-content:center;pointer-events:none}.immersive .bottom-controls{margin-top:0}.cheer-scene{position:relative;display:flex;align-items:center;justify-content:center;gap:10px;width:100%;max-width:380px;padding:18px 12px 30px}.cheer-cat{width:76px;height:76px;flex-shrink:0;transform-origin:50% 85%;animation:cheer-sway 2.6s ease-in-out infinite}.cheer-bubble{position:relative;background:white;border:1.5px solid #c8e6df;border-radius:20px 20px 20px 5px;padding:12px 14px;box-shadow:0 5px 0 #e3f1ed;max-width:240px}.cheer-bubble small{display:block;font-size:10px;color:#5b8b82}.cheer-bubble b{display:block;font-size:15px;color:#087c77;margin:4px 0;line-height:1.5}.cheer-bubble span{display:block;font-size:10px;color:#6b8985}.cheer-spark{position:absolute;color:#edc55c;font-size:22px;animation:cheer-twinkle 2.4s ease-in-out infinite}.spark-left{left:10%;top:8px}.spark-right{right:7%;bottom:16px;animation-delay:1s}.cheer-footprints{position:absolute;bottom:0;left:30%;font-size:14px;opacity:.14;letter-spacing:9px}.cheer-stage[data-mood="combo"] .cheer-cat,.cheer-stage[data-mood="fever"] .cheer-cat{animation:cheer-hop .65s ease-in-out infinite}.cheer-stage[data-mood="fever"] .cheer-bubble,.cheer-stage[data-mood="ready"] .cheer-bubble{background:#fff3c4;border-color:#f0ce63}.cheer-stage[data-mood="ready"] .cheer-cat{animation:cheer-hop .85s ease-in-out infinite}.cheer-stage[data-mood="rest"] .cheer-cat{animation-play-state:paused}.cheer-stage.compact .cheer-scene{display:none}@keyframes cheer-sway{0%,100%{transform:rotate(-5deg) translateY(1px)}50%{transform:rotate(5deg) translateY(-4px)}}@keyframes cheer-hop{0%,100%{transform:translateY(0) rotate(-5deg)}50%{transform:translateY(-9px) rotate(5deg)}}@keyframes cheer-twinkle{0%,100%{opacity:.35;transform:scale(.8)}50%{opacity:.9;transform:scale(1.1)}}@media(prefers-reduced-motion:reduce){.cheer-cat,.cheer-spark{animation:none!important}}

.board-wrap{aspect-ratio:9/13;width:min(100%,calc(var(--board-available-height,calc(100svh - 340px))*9/13))}.immersive .cheer-stage{flex:1 0 76px;min-height:76px}.cheer-scene{padding:7px 8px;max-width:440px;gap:6px}.cheer-cat{width:60px;height:60px}.cheer-bubble{padding:7px 10px;max-width:310px}.cheer-bubble b{font-size:12px;margin:2px 0}.cheer-bubble small,.cheer-bubble span{font-size:9px}.cheer-footprints{display:none}.spark-left{left:3%;top:2px}.spark-right{right:1%;bottom:2px}

.immersive .cheer-stage{flex-basis:112px;min-height:112px}.cheer-bubble{flex:1;min-width:0}.cheer-bubble b{font-size:16px;line-height:1.4;font-weight:900}.cheer-bubble small,.cheer-bubble span{font-size:11px;line-height:1.4}.cheer-bubble span{color:#466c65}.cheer-scene{gap:8px}@media(max-width:359px){.cheer-cat{width:46px;height:46px}.cheer-bubble b{font-size:14px}}

#bossOptions{gap:7px}#bossOptions button{padding:12px 5px;font-size:23px}#bossOptions small{font-size:10px}#bossDouble{background:#b44c38}.boss-win{background:radial-gradient(circle,#fff6ad,#ffdc79e8)}.boss-win .boss-portrait{animation:boss-celebrate .65s ease-out 2}.boss-win #bossTitle{color:#b85017;text-shadow:0 2px white}.jackpot #bossTitle{font-size:31px}.boss-win #bossDice{color:#b34c1e}@keyframes boss-celebrate{0%,100%{transform:scale(1)}45%{transform:scale(1.22) rotate(-9deg)}}@media(prefers-reduced-motion:reduce){.boss-win .boss-portrait{animation:none}}

.support-after{border-top:1px solid #bdded5;padding-top:12px;margin-top:16px;font-size:11px;line-height:1.7}.support-after>span{display:block;color:#648179}.support-after a{display:inline-block;padding:6px 4px;color:#24796c;text-underline-offset:4px;font-weight:700;font-size:12px}.welcome .support-after small{font-size:9px;margin:0;color:#6b827b}.support-story{display:flex;gap:10px;border-top:1px solid #c2dfd4;margin-top:16px;padding-top:16px}.support-paw{font-size:24px;opacity:.6}.support-story b{font-size:13px;color:#346b5e}.community .support-story p{font-size:11px;color:#59786e}.support-story a{display:inline-block;padding:8px 0;color:#24796c;font-size:12px;font-weight:700;text-underline-offset:4px}.support-story small{display:block;font-size:9px;color:#71877f}.support-after a:focus-visible,.support-story a:focus-visible{outline:2px solid #078b7d;outline-offset:3px}
