:root{font-family:ui-rounded,'Hiragino Maru Gothic ProN',-apple-system,BlinkMacSystemFont,sans-serif;color:#514466;background:#eee6fc;font-synthesis:none}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at top,#fff 0,#f5efff 65%);min-height:100svh}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;color:inherit;border:0;background:#f0e9fa;border-radius:18px;padding:14px 20px;cursor:pointer;touch-action:manipulation;min-height:48px;font-weight:700}button:focus-visible,a:focus-visible{outline:3px solid #9670c8;outline-offset:3px}button:disabled{opacity:.5;cursor:wait}.primary{background:#9271ba;color:white;box-shadow:0 5px 0 #755597;width:100%;margin:10px 0 14px}.small{font-size:12px;padding:10px 12px}#app{max-width:620px;margin:auto;min-height:100svh;padding: max(14px,env(safe-area-inset-top)) 20px max(12px,env(safe-area-inset-bottom));display:flex;flex-direction:column}header{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.brand{font-weight:900;font-size:23px;letter-spacing:-1px;color:inherit;text-decoration:none}.brand span{font-size:12px;display:block;letter-spacing:1px}.stats{display:flex;justify-content:space-around;text-align:center;font-size:10px;letter-spacing:2px}.stats strong{display:block;font-size:30px;letter-spacing:-1px;margin-top:3px}.clock strong{color:#9271ba}.timer{height:6px;background:#e8def3;border-radius:8px;margin-top:12px;overflow:hidden}.timer i{display:block;height:100%;width:100%;background:#b69ad8;border-radius:8px}.stageLine{height:43px;display:flex;align-items:center;justify-content:space-between;font-size:11px;color:#907fa6}#combo{color:#9c648c;font-size:14px}#board{position:relative;height:clamp(240px,43svh,430px);border:1px solid #eee7f5;border-radius:28px;background:#ffffffb8;overflow:hidden;box-shadow:0 10px 40px #8b6eb009 inset}.item{position:absolute;padding:5px;width:30%;height:43%;background:transparent;display:flex;align-items:center;justify-content:center;will-change:transform;animation:appear .3s ease-out}.item img{width:100%;height:100%;object-fit:contain;pointer-events:none;filter:drop-shadow(0 5px 3px #78618b12)}.host{height:145px;position:relative;display:flex;justify-content:center;align-items:center}.host>img{width:142px;height:142px;object-fit:contain;position:relative;animation:breathe 3s ease-in-out infinite}.halo{position:absolute;width:125px;height:25px;bottom:5px;border-radius:50%;background:#e7dcef}.host #reaction{position:absolute;left:calc(50% + 58px);top:40px;font-size:13px;white-space:nowrap;background:white;padding:10px 12px;border-radius:16px 16px 16px 2px;max-width:135px}footer{text-align:center;color:#9483a6;font-size:10px;letter-spacing:.5px}dialog{border:0;border-radius:28px;padding:28px;width:calc(100% - 32px);max-width:430px;color:#514466;background:#fff;box-shadow:0 25px 100px #66507b33;text-align:center;max-height:90svh;overflow:auto}dialog::backdrop{background:#65557942;backdrop-filter:blur(7px)}h1{font-size:48px;letter-spacing:-2px;line-height:.95;margin:26px 0}h1 span{font-size:34px;color:#a186c3}h2{font-size:23px;margin:14px 0}p{font-size:13px;line-height:1.8}.eyebrow{font-size:9px;letter-spacing:2px;color:#a18eb6;font-weight:800}.muted{font-size:11px;color:#91849f}.rules{display:flex;gap:12px;margin:24px 0}.rules>div{flex:1;background:#f8f4fc;border-radius:18px;padding:9px}.rules img{width:100%;height:67px;object-fit:contain}.rules b{display:block;font-size:16px}.resultStats{display:flex;justify-content:space-evenly;font-size:10px;letter-spacing:2px}.resultStats strong{display:block;font-size:38px;letter-spacing:0;margin:8px}.rewardArt{display:block;background:#f7f1fc;border-radius:50%;width:180px;height:180px;margin:14px auto;padding:6px}.rewardArt img{width:100%;height:100%;object-fit:contain}#rewardLabel{font-size:13px;color:#aa719c}#result>button:not(.primary){width:100%}#collection{max-width:650px}.dialogHead{display:flex;align-items:center;justify-content:space-between;text-align:left}.dialogHead button,#closeDetail{font-size:24px;padding:7px 15px}small{font-size:12px}#collectionGrid{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin:20px 0}.card{position:relative;padding:6px;background:#f6f1fa;min-width:0;border-radius:13px}.card img{width:100%;height:95px;object-fit:contain}.card .unknown{height:95px;display:grid;place-items:center;font-size:30px;color:#c7bad7}.card span{font-size:10px;display:block}.card b{position:absolute;right:4px;top:3px;background:white;border-radius:8px;padding:3px;font-size:10px}#closeDetail{position:absolute;right:12px;top:12px}#detailImage{width:100%;height:55svh;object-fit:contain}.flight{position:fixed;pointer-events:none;z-index:3;object-fit:contain}.pop{position:fixed;z-index:4;pointer-events:none;font-weight:900;font-size:23px;color:#b575a0;animation:pop .85s ease-out forwards}.last #board{background:#fff8fc;border-color:#eacfe1}.last #time{color:#c377a0}#saveWarning{position:fixed;bottom:0;background:#fff0ca;padding:10px;font-size:11px;width:100%;z-index:20;text-align:center}@keyframes breathe{50%{transform:translateY(2px)}}@keyframes appear{from{opacity:0;scale:.8}to{opacity:1;scale:1}}@keyframes pop{to{transform:translateY(-55px);opacity:0}}@media(max-height:700px){header{margin-bottom:10px}.host{height:112px}.host>img{height:112px;width:112px}#board{height:36svh;min-height:210px}dialog{padding:20px}h1{margin:18px 0}.rules{margin:16px 0}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important}.pop{opacity:1}}
/* v2: keep the familiar palette and roomy two-row playfield. */
.brand{background:none;padding:0;text-align:left;min-height:44px;line-height:1.15}header{margin-bottom:12px}.homeLinks{display:flex;gap:8px}.homeLinks button{flex:1;font-size:12px;padding:12px 8px}.mode{display:grid;width:100%;text-align:left;grid-template-columns:1fr auto;margin:12px 0;padding:18px;background:#f2ebfa}.mode b{font-size:20px}.mode span{grid-column:1;font-size:12px;margin-top:7px}.mode small{grid-column:2;grid-row:1/3;align-self:center;color:#987db4}.setting{display:flex;align-items:center;justify-content:space-between;text-align:left;margin:22px 0;font-size:14px;gap:12px}.setting input[type=checkbox]{width:28px;height:28px;accent-color:#9471ba}.setting input[type=range]{width:130px;accent-color:#9471ba}.setting select{max-width:190px;padding:10px;color:inherit;border:1px solid #dacbea;border-radius:10px;background:white}#missions{display:flex;gap:7px;margin:0 0 10px}.mission{flex:1;min-width:0;display:flex;align-items:center;justify-content:center;gap:4px;background:#fff;border:1px solid #e4d8f1;border-radius:13px;padding:5px 3px;font-size:10px}.mission img{width:27px;height:27px;object-fit:contain}.mission b{font-size:12px}.mission.done{background:#eaf4e9;border-color:#c9dfc7}.stageLine{height:33px}#board{height:clamp(238px,37svh,390px)}.item{padding:3px;animation:appear .25s ease-out;display:block;min-height:0;max-width:none;touch-action:manipulation}.item .art{position:relative;display:block;width:100%;height:100%;pointer-events:none}.item img{width:100%;height:100%;object-fit:contain}.aurora{position:absolute;inset:0;pointer-events:none;background:linear-gradient(120deg,transparent 12%,#8ff3eaaa 28%,#efa5ffaa 40%,#fff9c3bb 50%,#a8c8ffaa 60%,transparent 75%);background-size:250% 250%;-webkit-mask-image:var(--asset);mask-image:var(--asset);-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;mix-blend-mode:screen;animation:aurora 2.8s ease-in-out infinite;opacity:.8}.rare img{filter:drop-shadow(0 0 3px #a8eced) drop-shadow(0 0 4px #d5b2ee)}.rareBadge{position:absolute;right:0;bottom:0;background:#f9f0ff;border:1px solid #c9a4e8;color:#8b60ab;border-radius:12px;padding:2px 6px;font-size:11px;pointer-events:none}.rareExample{background:linear-gradient(120deg,#e1fbf8,#f5e4ff,#fff7d9)!important}.host{height:175px}.host>img{width:174px;height:174px}.host #reaction{font-family:ui-rounded,'Hiragino Maru Gothic ProN','Hiragino Sans','Yu Gothic',sans-serif;left:calc(50% + 63px);top:52px;font-size:19px;font-weight:900;letter-spacing:-.5px;background:#ffffffdf;padding:9px 10px;max-width:145px;text-shadow:0 2px 0 white,1px 0 white,-1px 0 white}.host #reaction.special{font-size:24px;color:#a06aa6}.pop{text-shadow:2px 2px white,-2px -2px white,2px -2px white,-2px 2px white;animation:pop 1.1s ease-out forwards;white-space:nowrap}.pop.big{font-size:30px}.lucky #board{background:linear-gradient(135deg,#f0fffc,#fff5fc,#f8f1ff);border-color:#c6b0e7}.lucky #phase{font-weight:900;color:#a46ab0}#heroStatus{font-size:12px;color:#9675b4}#result>button{width:100%;margin-bottom:8px}#result #showCollection{background:white;color:#977cae}#defaultHero{width:100%}#collectionGrid .card:disabled{opacity:1;cursor:default}@keyframes aurora{0%,100%{background-position:0% 50%}50%{background-position:100% 50%}}@media(max-width:380px){#app{padding-left:12px;padding-right:12px}.host #reaction{font-size:17px;left:calc(50% + 55px);padding:8px}.host #reaction.special{font-size:21px}.mission{gap:2px;font-size:9px}.mission img{width:23px}.mission b{font-size:11px}}@media(max-height:740px){#board{height:34svh;min-height:220px}.host{height:140px}.host>img{width:140px;height:140px}.host #reaction{top:38px}.stats strong{font-size:26px}.stageLine{height:28px}#missions{margin-bottom:7px}}@media(prefers-reduced-motion:reduce){.aurora{animation:none!important}}
@media(max-width:380px){.host #reaction{left:auto;right:0;max-width:120px;font-size:16px}.host #reaction.special{font-size:21px}}
@media(max-height:650px){#app{padding-top:8px;padding-bottom:8px}header{margin-bottom:5px}.stats strong{font-size:23px}.timer{margin-top:7px}.stageLine{height:24px}#missions{margin-bottom:5px}.mission img{height:22px;width:22px}#board{height:32svh;min-height:180px}.host{height:108px}.host>img{height:108px;width:108px}.host #reaction{top:30px;font-size:16px}footer{font-size:9px}}
/* v3 unified playfield. dvh follows Safari's browser bars, with a stable svh fallback. */
body.game-page{overflow:hidden;min-height:0}body.game-page #app{height:100svh;height:100dvh;min-height:0;max-width:760px;padding:max(8px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));overflow:hidden}
.game-page header{flex:none;margin:0 3px 5px;height:40px}.game-page .brand{font-size:21px}.game-page .brand span{font-size:10px}.game-page .small{min-height:40px;padding:8px 12px}.game-page .stats{flex:none;align-items:center;font-size:9px;letter-spacing:1px}.game-page .stats strong{display:inline-block;font-size:26px;margin:0 0 0 7px;vertical-align:middle}.game-page .timer{flex:none;margin-top:7px;height:4px}.game-page .stageLine{flex:none;height:25px;padding:0 4px}.game-page #missions{flex:none;margin-bottom:3px}.game-page .mission{background:#ffffff70;padding:4px;font-size:10px}.game-page .mission img{width:24px;height:24px}
#playfield{position:relative;flex:1;min-height:0;isolation:isolate}body.game-page #board{position:absolute;inset:0 0 19px;height:auto;min-height:0;border:0;border-radius:0;box-shadow:none;background:transparent;overflow:hidden;z-index:2}.game-page .last #board,.game-page .lucky #board{background:transparent;border:0}.game-page .lucky #playfield{background:radial-gradient(ellipse at 50% 80%,#f4d8f54d,transparent 65%)}
body.game-page .host{position:absolute;bottom:19px;left:50%;transform:translateX(-50%);width:var(--hero-width,200px);height:var(--hero-height,240px);z-index:1;pointer-events:none}.game-page .host>img{width:100%;height:100%;object-fit:contain;object-position:center bottom;animation:breathe 3.6s ease-in-out infinite}.game-page .halo{width:80%;height:18px;bottom:2px;background:#d9c5ed80}.game-page .host #reaction{position:absolute;left:50%;right:auto;top:15%;transform:translateX(-50%);width:max-content;max-width:240px;padding:0;border-radius:0;background:none;font-size:29px;font-weight:900;line-height:1.2;text-align:center;white-space:nowrap;opacity:0;pointer-events:none;color:#785883;-webkit-text-stroke:5px white;paint-order:stroke fill;text-shadow:0 3px 5px #72518035}.game-page .host #reaction.special{font-size:34px;color:#a264ad}.game-page footer{position:absolute;bottom:1px;width:100%;font-size:9px;pointer-events:none}.game-page .item{z-index:2}.game-page .flight{z-index:5}.pop{pointer-events:none!important;z-index:8}.game-page .host #reaction{translate:-50% 0;transform:none}
@media(max-width:360px){.game-page .stats{font-size:8px}.game-page .stats strong{font-size:23px;margin-left:4px}.game-page .host #reaction{font-size:25px}.game-page .host #reaction.special{font-size:29px}.game-page .mission{font-size:9px;gap:3px}}
@media(max-height:650px){.game-page header{height:35px}.game-page .stageLine{height:22px}.game-page .mission{padding:2px}.game-page .mission img{height:22px;width:22px}.game-page .stats strong{font-size:22px}}

/* Title identity: the approved default hero, independent of the selected game hero. */
#home .titleIdentity{display:flex;align-items:center;justify-content:center;gap:4px;margin:12px 0 4px}
#home .titleIdentity h1{flex:1;min-width:0;margin:0;font-size:44px;text-align:left;letter-spacing:-1.5px;line-height:1.03}
#home .titleIdentity h1 span{font-size:29px;white-space:nowrap}
#home .titleHero{width:120px;height:145px;object-fit:contain;flex:none;animation:breathe 3.8s ease-in-out infinite}
#home .rules{margin:12px 0}#home .rules .art{display:block;position:relative;height:67px;width:100%}
#home .rules .art img{display:block;width:100%;height:100%;object-fit:contain}
#home .rareExample{background:#f8f4fc!important}#home #loadStatus:empty{display:none}
@media(max-width:360px){#home .titleIdentity h1{font-size:37px}#home .titleIdentity h1 span{font-size:24px}#home .titleHero{width:100px;height:145px}#home{padding:20px}}
@media(max-height:650px){#home{padding:18px 20px}#home .titleIdentity{margin:7px 0 0}#home .titleHero{height:120px;width:95px}#home .titleIdentity h1{font-size:36px}#home .titleIdentity h1 span{font-size:24px}#home .rules{margin:10px 0}#home>p{margin:8px 0}#home .rules img,#home .rules .art{height:54px}#home .primary{margin:8px 0 12px}}

#home #legacy{margin:8px 0 0;font-size:10px}#home .titleIdentity+p{margin:8px 0}
@media(max-height:600px){#home .titleHero{height:103px;width:90px}#home .rules{margin:7px 0}#home .homeLinks button{padding:10px 6px}#home #legacy{margin-top:5px}}
#home .rules b{white-space:nowrap;font-size:14px}

/* One renewing, icon-led mission replaces the three one-shot cards. */
#missions{display:flex;justify-content:center}.mission{min-width:170px;max-width:100%;gap:8px}

/* v4: clearer selection, mission, timer, and touch behavior. */
@font-face{font-family:'M PLUS Rounded 1c';src:url('assets/fonts/MPLUSRounded1c-Bold.ttf') format('truetype');font-weight:700;font-display:swap}
:root,button,select,input{font-family:'M PLUS Rounded 1c','Hiragino Maru Gothic ProN',-apple-system,BlinkMacSystemFont,sans-serif}
.brand,#home .titleIdentity h1,#home .titleIdentity h1 span{font-family:ui-rounded,-apple-system,BlinkMacSystemFont,sans-serif}
body.game-page{overscroll-behavior:none}
#playfield,#board,.game-page .item{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.game-page .timer{height:12px;margin:7px 3px 0;border-radius:12px;border:2px solid #fff;background:#dfd2ef;box-shadow:0 2px 8px #80649a24}
.game-page .timer i{background:linear-gradient(90deg,#c291ce,#9d7ac6);transition:background .2s}
.clock span{white-space:nowrap}.last .timer i{background:linear-gradient(90deg,#ff9dae,#e76f94);animation:timer-pulse .7s ease-in-out infinite alternate}.last .timer{background:#f7dce5}
@keyframes timer-pulse{to{filter:brightness(1.13);box-shadow:0 0 8px #ec83a0}}
#modeSelect{position:relative;padding-top:28px}.backHome{background:transparent;min-height:38px;padding:7px 8px;color:#80659d;font-size:12px;box-shadow:none}
#modeSelect .backHome{position:absolute;left:15px;top:12px}.mode{border:3px solid transparent;transition:transform .15s,border-color .15s,background .15s}.mode.selected{border-color:#9a75c1;background:#eee3fa;box-shadow:0 5px 14px #83649e22;transform:scale(1.015)}.mode.selected::after{content:'✓';grid-column:2;grid-row:1/3;align-self:start;justify-self:end;background:#9975bd;color:#fff;border-radius:50%;width:25px;height:25px;display:grid;place-items:center}.mode.selected small{margin-right:32px}.modeStart{min-height:60px;font-size:21px;margin-top:5px}
.game-page #missions{margin:0 3px 5px}.game-page .mission{width:min(100%,390px);min-width:0;min-height:53px;padding:5px 10px;border:2px solid #d9c8eb;border-radius:18px;background:#ffffffd9;box-shadow:0 4px 12px #78618d19;justify-content:flex-start;gap:9px}.missionIcon{width:42px;height:42px;display:grid;place-items:center;border-radius:13px;background:#f5effb;flex:none}.game-page .mission .missionIcon img{width:37px;height:37px}.missionWords{min-width:0;flex:1;text-align:left}.missionWords small{display:block;font-size:8px;letter-spacing:1.5px;color:#a18ab6}.missionWords strong{display:block;font-size:15px;line-height:1.2}.missionWords i{display:block;height:6px;background:#ece2f5;border-radius:8px;overflow:hidden;margin-top:4px}.missionWords em{display:block;height:100%;background:linear-gradient(90deg,#c69bd2,#8f75bf);border-radius:8px;transition:width .2s}.game-page .mission>b{font-size:17px;white-space:nowrap}.game-page .mission>b span{font-size:25px;color:#916caf}.game-page .mission.done{background:#fff6fc;border-color:#e7b8d8}.game-page .mission.done .missionWords strong{color:#b06f9f}
.collectionTop{position:sticky;z-index:4;top:-28px;margin:-28px -28px 5px;padding:18px 20px 9px;background:#fff;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;border-radius:28px 28px 0 0;box-shadow:0 5px 10px #735d8512}.collectionTop .backHome{justify-self:start}.collectionTop .eyebrow{grid-column:2}.dialogHead{justify-content:center;text-align:center}.dialogHead h2{margin-top:4px}
#home .titleHero{width:138px;height:165px}#home .titleIdentity{gap:0}
@media(max-width:360px){#home .titleHero{width:118px;height:150px}.game-page .mission{min-height:48px}.missionIcon{width:37px;height:37px}.game-page .mission .missionIcon img{width:33px;height:33px}.missionWords strong{font-size:13px}.game-page .mission>b{font-size:14px}.game-page .mission>b span{font-size:22px}}
@media(max-height:650px){.game-page .timer{height:9px}.game-page .mission{min-height:43px}.missionIcon{width:34px;height:34px}.game-page .mission .missionIcon img{width:30px;height:30px}#home .titleHero{width:105px;height:125px}}
@media(prefers-reduced-motion:reduce){.last .timer i{animation:none}}

.trackSetting{margin:22px 0;text-align:left}.trackSetting>span{display:block;margin-bottom:9px;font-size:14px}.trackSetting div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.trackChoice{min-height:42px;padding:9px 7px;border:1px solid #ddcfec;border-radius:12px;background:#fbf9fd;color:#735687;font-size:12px;line-height:1.2}.trackChoice.selected{border-color:#a576c1;background:#eee4f8;color:#684788;box-shadow:inset 0 0 0 1px #a576c1}.trackChoice:first-child{grid-column:1/-1}

/* Game text uses the same rounded Japanese face as the title. */
.game-page #reaction,.game-page .pop,.game-page .mission,.game-page #phase,.game-page footer{font-family:'M PLUS Rounded 1c','Hiragino Maru Gothic ProN',-apple-system,BlinkMacSystemFont,sans-serif!important}.game-page #reaction{-webkit-text-stroke:4px #fff;text-shadow:0 2px 4px #72518030}.game-page .pop{text-shadow:1px 2px 0 #fff,-1px 0 #fff,1px 0 #fff,0 -1px #fff,0 3px 5px #72518028}

.trackSetting #trackChoices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.trackChoice{display:block;min-height:0;padding:10px;border:1px solid #ddcfec;border-radius:12px;background:#fbf9fd;color:#735687;text-align:left}.trackChoice.random{grid-column:1/-1;text-align:center}.trackChoice.selected{border-color:#a576c1;background:#eee4f8;box-shadow:inset 0 0 0 1px #a576c1}.trackChoice b{display:block;margin-bottom:8px;font-size:13px}.trackChoice div{display:flex;gap:6px}.trackChoice div button{min-height:35px;padding:7px 5px;border-radius:9px;font-size:11px;flex:1}.trackPreview{background:#fff;color:#725397;border:1px solid #d9caea}.trackPick{background:#9b77bd;color:#fff}@media(max-width:380px){.trackSetting #trackChoices{grid-template-columns:1fr}}

/* Collapsed BGM picker: tapping a song both selects and previews it. */
details.trackSetting{margin:22px 0;text-align:left;border:1px solid #ddcfec;border-radius:13px;background:#fbf9fd;overflow:hidden}details.trackSetting summary{display:flex;justify-content:space-between;align-items:center;padding:13px;cursor:pointer;font-size:14px;list-style:none}details.trackSetting summary::-webkit-details-marker{display:none}details.trackSetting summary::after{content:'⌄';margin-left:8px;color:#81609e}details.trackSetting[open] summary{border-bottom:1px solid #e8def2}details.trackSetting #trackChoices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:10px}.trackChoice{min-height:42px;padding:9px;border:1px solid #ddcfec;border-radius:10px;background:#fff;color:#735687;font-size:12px;text-align:center}.trackChoice.random{grid-column:1/-1}.trackChoice.selected{border-color:#a576c1;background:#eee4f8;box-shadow:inset 0 0 0 1px #a576c1}@media(max-width:380px){details.trackSetting #trackChoices{grid-template-columns:1fr}}

/* Compact native pull-down picker for BGM. */
.setting.trackSetting{display:flex;margin:22px 0}.setting.trackSetting select{width:min(210px,58vw);max-width:210px;padding:11px 32px 11px 12px;border:2px solid #d8c5e9;border-radius:12px;background:#eee4f8;color:#684788;font-family:'M PLUS Rounded 1c',sans-serif;font-weight:700}.setting.trackSetting select:focus{outline:2px solid #9b77bd;outline-offset:2px}

/* One calm vertical list: tap a title to select and preview it. */
.trackSetting{margin:20px 0;text-align:left}.trackSetting>span{display:block;margin-bottom:8px;font-size:14px}.trackSetting #trackChoices{display:flex;flex-direction:column;gap:6px}.trackChoice{display:block;width:100%;min-height:40px;padding:9px 13px;border:1px solid #ded0ec;border-radius:10px;background:#fbf9fd;color:#735687;font-family:'M PLUS Rounded 1c',sans-serif;font-size:13px;font-weight:700;text-align:left}.trackChoice.selected{border-color:#a576c1;background:#eee4f8;color:#684788;box-shadow:inset 0 0 0 1px #a576c1}

/* Compact BGM toggle: selected title stays visible, options open only on demand. */
details.trackSetting{margin:20px 0 8px;text-align:left;border:1px solid #ddcfec;border-radius:12px;background:#fbf9fd;overflow:hidden}details.trackSetting summary{display:flex;align-items:center;justify-content:space-between;padding:11px 12px;cursor:pointer;list-style:none;font-size:14px}details.trackSetting summary::-webkit-details-marker{display:none}details.trackSetting summary::after{content:'⌄';margin-left:8px;color:#81609e}details.trackSetting summary b{margin-left:auto;margin-right:7px;padding:5px 8px;border-radius:8px;background:#eee4f8;color:#684788;font-size:12px;font-weight:700}details.trackSetting[open] summary{border-bottom:1px solid #e7dcef}details.trackSetting #trackChoices{display:flex;flex-direction:column;gap:5px;padding:8px}.trackChoice{display:block;width:100%;min-height:38px;padding:8px 11px;border:1px solid #ded0ec;border-radius:9px;background:#fff;color:#735687;font-family:'M PLUS Rounded 1c',sans-serif;font-size:13px;font-weight:700;text-align:left}.trackChoice.selected{border-color:#a576c1;background:#eee4f8;color:#684788;box-shadow:inset 0 0 0 1px #a576c1}.stopPreview{width:100%;min-height:42px;margin:0 0 12px;padding:9px;border-radius:10px;background:#f3edf9;color:#725397;font-size:13px}

/* Aligned BGM menu: the option list opens under the selected title only. */
.trackSetting{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:14px;margin:20px 0 8px;text-align:left}.trackSetting>span{font-size:14px}.trackSetting #trackMenu{position:relative;min-width:0}.trackSetting #trackToggle{display:flex;width:100%;min-height:48px;padding:8px 11px;align-items:center;justify-content:space-between;gap:8px;border:2px solid #d8c5e9;border-radius:12px;background:#eee4f8;color:#684788;text-align:left}.trackSetting #trackToggle b{min-width:0;overflow:hidden;font-family:'M PLUS Rounded 1c',sans-serif;font-size:17px;font-weight:700;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}.trackSetting #trackToggle i{font-size:18px;font-style:normal}.trackSetting #trackChoices{position:absolute;z-index:20;top:calc(100% + 6px);right:0;left:0;display:flex;max-height:280px;overflow:auto;flex-direction:column;gap:4px;padding:5px;border:1px solid #d8c5e9;border-radius:12px;background:#fff;box-shadow:0 12px 25px #71517b25}.trackSetting #trackChoices[hidden]{display:none}.trackChoice{display:block;width:100%;min-height:44px;padding:9px 11px;border:1px solid transparent;border-radius:8px;background:#fff;color:#735687;font-family:'M PLUS Rounded 1c',sans-serif;font-size:17px;font-weight:700;text-align:left}.trackChoice.selected{border-color:#a576c1;background:#eee4f8;color:#684788}.stopPreview{width:100%;min-height:42px;margin:0 0 12px;padding:9px;border-radius:10px;background:#f3edf9;color:#725397;font-size:13px}
/* BGM selector: keep the settings panel still; only the short song menu may scroll. */
#settings{width:min(calc(100% - 28px),560px);max-width:560px;max-height:none;overflow:visible}
#settings h2{margin:8px 0 16px}
#settings .setting{margin:12px 0}
.trackSetting{grid-template-columns:48px minmax(0,1fr);gap:10px;margin:16px 0 8px}
.trackSetting #trackToggle{min-height:50px;padding:9px 13px}
.trackSetting #trackToggle b{overflow:visible;font-size:16px;text-overflow:clip;white-space:nowrap}
.trackSetting #trackChoices{max-height:min(300px,34svh)}
.trackChoice{font-size:16px}
#settings .primary{margin-top:8px;margin-bottom:0}
@media(max-height:700px){#settings{padding:18px 22px}#settings h2{margin:4px 0 10px}#settings .setting{margin:8px 0}.trackSetting{margin:10px 0 6px}.stopPreview{min-height:36px;margin-bottom:6px}#settings .primary{min-height:44px}}
@media(max-height:780px){.trackSetting #trackChoices{top:auto;bottom:calc(100% + 6px);max-height:42svh}}
/* Settings: place the controls directly over the existing game background. */
#settings{width:min(calc(100% - 28px),560px);max-width:560px;max-height:90svh;overflow-y:auto;border-radius:0;padding:clamp(18px,4svh,30px);background:transparent;box-shadow:none;scrollbar-color:#aa91c7 transparent}
#settings h2{margin:4px 0 18px}
#settings .setting{margin:14px 0}
.trackSetting{display:grid;grid-template-columns:48px minmax(0,1fr);align-items:start;gap:10px;margin:18px 0 6px}
.trackSetting>span{padding-top:14px;margin:0;font-size:15px}
.trackSetting #trackMenu{min-width:0}
.trackSetting .trackRow{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:8px;align-items:stretch}
.trackSetting #trackToggle{display:flex;width:100%;min-height:50px;padding:10px 13px;align-items:center;justify-content:space-between;gap:8px;border:2px solid #d8c5e9;border-radius:12px;background:#eee4f8;color:#684788;text-align:left}
.trackSetting #trackToggle b{min-width:0;overflow:visible;font-family:'M PLUS Rounded 1c',sans-serif;font-size:16px;font-weight:700;line-height:1.2;text-overflow:clip;white-space:nowrap}
.trackSetting #trackToggle i{font-size:18px;font-style:normal}
.trackSetting .stopPreview{display:grid;width:44px;min-height:44px;margin:0;padding:0;place-items:center;border:1px solid #d8c5e9;border-radius:10px;background:#f3edf9;color:#725397;font-size:20px;line-height:1}
.trackSetting .stopPreview[hidden]{display:none}
.trackSetting #trackChoices{position:static;z-index:auto;display:flex;max-height:none;overflow:visible;flex-direction:column;gap:5px;margin-top:8px;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}
.trackSetting #trackChoices[hidden]{display:none}
.trackChoice{display:block;width:100%;min-height:42px;padding:8px 12px;border:1px solid #ded0ec;border-radius:10px;background:#ffffffb8;color:#735687;font-family:'M PLUS Rounded 1c',sans-serif;font-size:16px;font-weight:700;text-align:left}
.trackChoice.selected{border-color:#a576c1;background:#eee4f8;color:#684788;box-shadow:none}
#settings #musicStatus{min-height:0;margin:4px 0 12px;text-align:right}
#settings .primary{margin:10px 0 0}
@media(max-height:700px){#settings{padding:16px 20px}#settings h2{margin:2px 0 10px}#settings .setting{margin:9px 0}.trackSetting{margin:11px 0 4px}.trackChoice{min-height:38px;padding:7px 11px;font-size:15px}}
/* Final BGM picker layout: a full-width control followed by a vertical list. */
#settings{width:min(calc(100% - 28px),560px);max-width:560px;max-height:90svh;overflow-y:auto;border-radius:28px;padding:28px;background:#fff;box-shadow:0 25px 100px #66507b33}
#settings .trackSetting{display:block!important;margin:18px 0 8px;text-align:left}
#settings .trackSetting>span{display:block;padding:0;margin:0 0 8px;font-size:15px}
#settings .trackSetting #trackMenu{display:block!important;width:100%;min-width:0}
#settings .trackSetting .trackRow{display:grid!important;width:100%;grid-template-columns:minmax(0,1fr) 44px!important;gap:8px;align-items:center}
#settings .trackSetting #trackToggle{display:flex!important;width:100%;min-height:52px;height:auto;align-items:center;justify-content:space-between}
#settings .trackSetting #trackChoices{position:static!important;display:flex!important;width:100%;max-height:none!important;overflow:visible!important;flex-direction:column!important;gap:5px;margin:8px 0 0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}
#settings .trackSetting #trackChoices[hidden]{display:none!important}
#settings .trackSetting .trackChoice{display:block!important;width:100%;min-height:44px;height:auto;margin:0;padding:10px 13px;text-align:left}
#settings .trackSetting .stopPreview{width:44px;height:44px;min-height:44px}
#settings #musicStatus{margin:5px 0 12px;min-height:0;text-align:left}
@media(max-height:700px){#settings{padding:20px}#settings .trackSetting .trackChoice{min-height:40px;padding:8px 12px}}
/* Compact audio controls: the two settings use the same three-column grid. */
#settings .audioRows{display:grid;gap:12px;margin:18px 0}
#settings .audioControl{display:grid;grid-template-columns:112px 44px minmax(0,1fr);align-items:center;gap:10px;margin:0;text-align:left;font-size:14px}
#settings .audioControl>span:first-child{white-space:nowrap}
#settings .audioControl input[type=range]{width:100%;margin:0;accent-color:#9471ba}
#settings .audioSwitch{position:relative;display:block;width:42px;height:24px}
#settings .audioSwitch input{position:absolute;inset:0;width:42px!important;height:24px!important;margin:0;appearance:none;-webkit-appearance:none;border:0;border-radius:999px;background:#d4d1d8;cursor:pointer;transition:background .18s ease}
#settings .audioSwitch i{position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #51446644;pointer-events:none;transition:transform .18s ease}
#settings .audioSwitch input:checked{background:#9871bf}
#settings .audioSwitch input:checked+i{transform:translateX(18px)}
#settings .audioSwitch input:focus-visible{outline:3px solid #9670c8;outline-offset:2px}
/* Keep the expanded choices as one light list rather than a stack of cards. */
#settings .trackSetting #trackChoices{gap:0;margin-top:7px;padding:5px 0;border-top:1px solid #e7dcef;border-bottom:1px solid #e7dcef}
#settings .trackSetting .trackChoice{min-height:39px;padding:8px 13px;border:0;border-radius:0;background:transparent;color:#735687}
#settings .trackSetting .trackChoice+.trackChoice{border-top:1px solid #efe8f5}
#settings .trackSetting .trackChoice.selected{background:#eee4f8;color:#684788}
@media(max-width:380px){#settings .audioControl{grid-template-columns:98px 42px minmax(0,1fr);gap:8px}#settings .audioSwitch{width:40px}#settings .audioSwitch input{width:40px!important}}
/* Keep the top of sound settings fixed. Expanding songs only grows below the picker. */
#settings{position:fixed;top:max(24px,env(safe-area-inset-top));left:50%;right:auto;bottom:auto;transform:translateX(-50%);margin:0;max-height:calc(100svh - 48px)}
/* Compact capsule volume sliders. */
#settings .audioControl input[type=range]{-webkit-appearance:none;appearance:none;justify-self:start;width:78%;min-width:112px;height:28px;margin:0;background:transparent;accent-color:initial;touch-action:manipulation}
#settings .audioControl input[type=range]::-webkit-slider-runnable-track{height:12px;border-radius:999px;background:linear-gradient(90deg,#9b76bf 0 var(--level,50%),#e9e2ef var(--level,50%) 100%);box-shadow:inset 0 1px 2px #71517b24}
#settings .audioControl input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:22px;height:22px;margin-top:-5px;border:1px solid #e6dfeb;border-radius:50%;background:#fff;box-shadow:0 2px 5px #60436a38}
#settings .audioControl input[type=range]::-moz-range-track{height:12px;border-radius:999px;background:#e9e2ef;box-shadow:inset 0 1px 2px #71517b24}
#settings .audioControl input[type=range]::-moz-range-progress{height:12px;border-radius:999px;background:#9b76bf}
#settings .audioControl input[type=range]::-moz-range-thumb{width:20px;height:20px;border:1px solid #e6dfeb;border-radius:50%;background:#fff;box-shadow:0 2px 5px #60436a38}
@media(max-width:380px){#settings .audioControl input[type=range]{min-width:104px;width:78%}}
/* C: capsule volume control — the full pill stays visible behind the fill. */
#settings .audioControl input[type=range]{height:32px}
#settings .audioControl input[type=range]::-webkit-slider-runnable-track{height:28px;border:0;border-radius:999px;background:linear-gradient(90deg,#9972bd 0 var(--level,50%),#ece6f0 var(--level,50%) 100%);box-shadow:inset 0 1px 2px #71517b1c}
#settings .audioControl input[type=range]::-webkit-slider-thumb{width:28px;height:28px;margin-top:0;border:1px solid #e7e0eb;border-radius:50%;background:#fff;box-shadow:0 2px 6px #60436a3d}
#settings .audioControl input[type=range]::-moz-range-track{height:28px;border:0;border-radius:999px;background:#ece6f0}
#settings .audioControl input[type=range]::-moz-range-progress{height:28px;border-radius:999px;background:#9972bd}
#settings .audioControl input[type=range]::-moz-range-thumb{width:26px;height:26px;border:1px solid #e7e0eb;border-radius:50%;background:#fff;box-shadow:0 2px 6px #60436a3d}
/* C palette: soft lavender capsule with a brighter purple fill. */
#settings .audioControl input[type=range]::-webkit-slider-runnable-track{background:linear-gradient(90deg,#a56fd0 0 var(--level,50%),#e9dff1 var(--level,50%) 100%);box-shadow:inset 0 1px 2px #8e64ac20}
#settings .audioControl input[type=range]::-moz-range-track{background:#e9dff1}
#settings .audioControl input[type=range]::-moz-range-progress{background:#a56fd0}
/* Smaller, softer capsule controls: generous touch area with compact visuals. */
#settings .audioControl{grid-template-columns:112px 38px minmax(0,1fr)}
#settings .audioSwitch{width:36px;height:20px}
#settings .audioSwitch input{width:36px!important;height:20px!important}
#settings .audioSwitch i{top:3px;left:3px;width:14px;height:14px;box-shadow:0 1px 2px #51446632}
#settings .audioSwitch input:checked+i{transform:translateX(16px)}
#settings .audioControl input[type=range]{height:28px}
#settings .audioControl input[type=range]::-webkit-slider-runnable-track{height:20px;border-radius:999px}
#settings .audioControl input[type=range]::-webkit-slider-thumb{width:20px;height:20px;margin-top:0;box-shadow:0 1px 4px #60436a30}
#settings .audioControl input[type=range]::-moz-range-track{height:20px}
#settings .audioControl input[type=range]::-moz-range-progress{height:20px}
#settings .audioControl input[type=range]::-moz-range-thumb{width:18px;height:18px;box-shadow:0 1px 4px #60436a30}
@media(max-width:380px){#settings .audioControl{grid-template-columns:98px 36px minmax(0,1fr)}#settings .audioSwitch,#settings .audioSwitch input{width:34px!important}.audioSwitch input:checked+i{transform:translateX(14px)}}
/* Soft resin-like depth for the compact C capsule. */
#settings .audioControl input[type=range]::-webkit-slider-runnable-track{background:linear-gradient(180deg,#ffffff72 0%,#ffffff14 42%,#6f4b8b12 100%),linear-gradient(90deg,#a56fd0 0 var(--level,50%),#e9dff1 var(--level,50%) 100%);box-shadow:inset 0 1px 1px #fff9,inset 0 -1px 2px #76528024}
#settings .audioControl input[type=range]::-webkit-slider-thumb{width:18px;height:18px;margin-top:1px;border:1px solid #e4ddea;border-radius:50%;background:linear-gradient(145deg,#fff 0%,#faf8fc 48%,#eee8f1 100%);box-shadow:0 2px 4px #60436a30,inset 0 1px 1px #fff}
#settings .audioControl input[type=range]::-moz-range-track{background:linear-gradient(180deg,#ffffff72 0%,#ffffff14 42%,#6f4b8b12 100%),#e9dff1;box-shadow:inset 0 1px 1px #fff9,inset 0 -1px 2px #76528024}
#settings .audioControl input[type=range]::-moz-range-progress{background:linear-gradient(180deg,#bc94df 0%,#a56fd0 58%,#9765bd 100%)}
#settings .audioControl input[type=range]::-moz-range-thumb{width:18px;height:18px;background:linear-gradient(145deg,#fff 0%,#faf8fc 48%,#eee8f1 100%);box-shadow:0 2px 4px #60436a30,inset 0 1px 1px #fff}
/* Reference capsule: pale outer pill, narrower purple inner fill, floating white knob. */
#settings .audioControl input[type=range]{height:34px}
#settings .audioControl input[type=range]::-webkit-slider-runnable-track{height:28px;border-radius:999px;background:linear-gradient(180deg,#b994dc 0%,#a46dcd 100%) left center/var(--level,50%) 16px no-repeat,linear-gradient(180deg,#f2eef5 0%,#e9e3ee 100%) center/100% 28px no-repeat;box-shadow:inset 0 1px 2px #fff9,inset 0 -1px 2px #7652801c}
#settings .audioControl input[type=range]::-webkit-slider-thumb{width:28px;height:28px;margin-top:0;border:1px solid #e9e3ee;border-radius:50%;background:linear-gradient(145deg,#fff 0%,#fcfbfd 50%,#f0ebf2 100%);box-shadow:0 2px 6px #60436a32,inset 0 1px 1px #fff}
#settings .audioControl input[type=range]::-moz-range-track{height:28px;border-radius:999px;background:linear-gradient(180deg,#f2eef5,#e9e3ee)}
#settings .audioControl input[type=range]::-moz-range-progress{height:16px;border-radius:999px;background:linear-gradient(180deg,#b994dc,#a46dcd)}
#settings .audioControl input[type=range]::-moz-range-thumb{width:26px;height:26px;background:linear-gradient(145deg,#fff,#f0ebf2);box-shadow:0 2px 6px #60436a32}
/* Reference capsule proportions: a clear pale shell, inset fill, and softly raised knob. */
#settings .audioControl input[type=range]{height:34px}
#settings .audioControl input[type=range]::-webkit-slider-runnable-track{height:24px;border-radius:999px;background:linear-gradient(180deg,#be9bdd 0%,#a56fcf 100%) left 7px center/calc(var(--level,50%) - 7px) 14px no-repeat,linear-gradient(180deg,#f3eff7 0%,#e7e0ef 100%) center/100% 24px no-repeat;box-shadow:inset 0 1px 2px #fff,inset 0 -1px 2px #8d6aa51a}
#settings .audioControl input[type=range]::-webkit-slider-thumb{width:30px;height:30px;margin-top:-3px;border:1px solid #ebe6ef;border-radius:50%;background:linear-gradient(145deg,#fff 0%,#fdfcff 55%,#f0ebf3 100%);box-shadow:0 3px 7px #60436a34,inset 0 1px 1px #fff}
#settings .audioControl input[type=range]::-moz-range-track{height:24px;border-radius:999px;background:linear-gradient(180deg,#f3eff7,#e7e0ef)}
#settings .audioControl input[type=range]::-moz-range-progress{height:14px;border-radius:999px;background:linear-gradient(180deg,#be9bdd,#a56fcf)}
#settings .audioControl input[type=range]::-moz-range-thumb{width:28px;height:28px;background:linear-gradient(145deg,#fff,#f0ebf3);box-shadow:0 3px 7px #60436a34}
/* Make the pale outer shell visible, as in the supplied capsule reference. */
#settings .audioControl input[type=range]::-webkit-slider-runnable-track{background:linear-gradient(180deg,#be9bdd 0%,#a56fcf 100%) left 7px center/calc(var(--level,50%) - 7px) 14px no-repeat,linear-gradient(180deg,#f0e9f7 0%,#e6ddef 100%) center/100% 24px no-repeat;box-shadow:inset 0 1px 2px #fff,inset 0 -1px 2px #8d6aa526,0 1px 3px #9675ad18}
#settings .audioControl input[type=range]::-moz-range-track{background:linear-gradient(180deg,#f0e9f7,#e6ddef)}
/* Round the purple inner fill itself; the knob hides the matching right end. */
#settings .audioControl input[type=range]::-webkit-slider-runnable-track{background:radial-gradient(ellipse 7px 7px at 7px 50%,#bd9add 0%,#a56fcf 100%,transparent 101%) left center/var(--level,50%) 14px no-repeat,linear-gradient(180deg,#be9bdd 0%,#a56fcf 100%) left 7px center/calc(var(--level,50%) - 7px) 14px no-repeat,linear-gradient(180deg,#f0e9f7 0%,#e6ddef 100%) center/100% 24px no-repeat}
/* Uniform 5px shell around the inner capsule on every side. */
#settings .audioControl input[type=range]::-webkit-slider-runnable-track{background:radial-gradient(ellipse 7px 7px at 12px 50%,#bd9add 0%,#a56fcf 100%,transparent 101%) left center/var(--level,50%) 14px no-repeat,linear-gradient(180deg,#be9bdd 0%,#a56fcf 100%) left 12px center/calc(var(--level,50%) - 12px) 14px no-repeat,linear-gradient(180deg,#f5f0f8 0%,#ede7f2 100%) left 5px center/calc(100% - 10px) 14px no-repeat,linear-gradient(180deg,#f0e9f7 0%,#e6ddef 100%) center/100% 24px no-repeat}
/* Structural capsule control: each rounded layer is a real element, never a clipped gradient. */
#settings .audioControl .volumeCapsule{--level:50%;position:relative;display:block;justify-self:start;width:78%;min-width:112px;height:34px}
#settings .audioControl .volumeCapsule::before{content:"";position:absolute;inset:3px 0;border-radius:999px;background:linear-gradient(180deg,#f0e9f7,#e4dcee);box-shadow:inset 0 1px 2px #fff,inset 0 -1px 2px #8d6aa526,0 1px 3px #9675ad18}
#settings .audioControl .volumeCapsule::after{content:"";position:absolute;inset:8px 5px;border-radius:999px;background:linear-gradient(180deg,#f8f5fa,#eee8f2)}
#settings .audioControl .volumeCapsule>i{position:absolute;z-index:1;top:10px;left:5px;width:max(0px,calc(var(--level) - 5px));height:14px;border-radius:999px;background:linear-gradient(180deg,#bf9bde,#a46dce);box-shadow:inset 0 1px 1px #d7bde9}
#settings .audioControl .volumeCapsule input[type=range]{position:absolute;z-index:2;inset:0;width:100%;min-width:0;height:34px;margin:0;background:transparent}
#settings .audioControl .volumeCapsule input[type=range]::-webkit-slider-runnable-track{height:28px;border:0;border-radius:999px;background:transparent;box-shadow:none}
#settings .audioControl .volumeCapsule input[type=range]::-webkit-slider-thumb{width:30px;height:30px;margin-top:-1px;border:1px solid #e9e3ee;border-radius:50%;background:linear-gradient(145deg,#fff 0%,#fdfcff 55%,#f0ebf3 100%);box-shadow:0 3px 7px #60436a34,inset 0 1px 1px #fff}
#settings .audioControl .volumeCapsule input[type=range]::-moz-range-track{height:28px;border:0;background:transparent;box-shadow:none}
#settings .audioControl .volumeCapsule input[type=range]::-moz-range-progress{height:28px;background:transparent}
#settings .audioControl .volumeCapsule input[type=range]::-moz-range-thumb{width:28px;height:28px;border:1px solid #e9e3ee;border-radius:50%;background:linear-gradient(145deg,#fff,#f0ebf3);box-shadow:0 3px 7px #60436a34}
@media(max-width:380px){#settings .audioControl .volumeCapsule{min-width:104px;width:78%}}
#settings .audioControl .volumeCapsule::before,#settings .audioControl .volumeCapsule::after,#settings .audioControl .volumeCapsule>i{pointer-events:none}
#settings .audioControl .volumeCapsule input[type=range]{pointer-events:auto}

/* Result: keep the complete reward card inside the visible iPhone Safari area. */
#result{
  width:min(calc(100% - 28px),430px);
  max-height:calc(100dvh - max(30px, env(safe-area-inset-top)) - max(30px, env(safe-area-inset-bottom)));
  padding:20px 26px 18px;
  overflow-y:auto;
  overscroll-behavior:contain;
}
#result .eyebrow{font-size:8px;letter-spacing:2px}
#result h2{margin:9px 0 13px;font-size:23px}
#result .resultStats{margin:0 0 8px}
#result .resultStats strong{margin:4px 8px 0;font-size:36px;line-height:1.1}
#result #missionResult{margin:10px 0 8px;line-height:1.35}
#result #reward{margin:0}
#result #rewardLabel{display:block;line-height:1.25}
#result .rewardArt{width:clamp(132px,20dvh,160px);height:clamp(132px,20dvh,160px);margin:7px auto 5px;padding:5px}
#result #rewardCount{margin:3px 0 8px;line-height:1.25}
#result .primary{min-height:52px;margin:6px 0 7px}
#result #resultHome{min-height:46px;padding:10px 18px}
#result[open]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:8px}
#result>.eyebrow,#result>h2,#result>.resultStats,#result>#missionResult,#result>#reward,#result>#again{grid-column:1/-1}
#result #resultHome,#result #showCollection{display:grid;width:100%;min-width:0;min-height:44px;margin:0;padding:9px 7px;place-items:center;font-size:13px}
#result #resultHome{grid-column:1}
#result #showCollection{grid-column:2;background:#f7f1fc;color:#7d6099}
@media (max-height:700px){
  #result{padding:16px 22px 14px}
  #result h2{margin:7px 0 9px;font-size:21px}
  #result .resultStats strong{font-size:33px}
  #result #missionResult{margin:7px 0 5px}
  #result .rewardArt{width:clamp(120px,18dvh,142px);height:clamp(120px,18dvh,142px);margin:5px auto 3px}
  #result #rewardCount{margin:2px 0 6px}
  #result .primary{min-height:48px;margin:5px 0 6px}
  #result #resultHome{min-height:42px}
}

/* Keep game reactions clear of mopee's face. */
.game-page .host #reaction,
.game-page .host #reaction.special{
  left:50%;
  right:auto;
  top:-30px;
  translate:-50% 0;
  max-width:min(240px,80vw);
}
@media(max-height:700px){
  .game-page .host #reaction,
  .game-page .host #reaction.special{top:-24px}
}

/* Fit the expanded seven-item BGM list and Home button in an iPhone Safari viewport. */
@media(max-height:760px){
  #settings{padding:16px 20px 14px}
  #settings h2{margin:0 0 10px;font-size:22px}
  #settings .audioRows{gap:7px;margin:10px 0 12px}
  #settings .trackSetting{margin:10px 0 4px}
  #settings .trackSetting>span{margin-bottom:5px;font-size:14px}
  #settings .trackSetting #trackToggle{min-height:44px;padding:7px 12px}
  #settings .trackSetting #trackChoices{margin-top:5px;padding:2px 0}
  #settings .trackSetting .trackChoice{min-height:32px;padding:5px 12px;font-size:15px;line-height:1.2}
  #settings #musicStatus{margin:4px 0 7px;font-size:10px;line-height:1.3}
  #settings .primary{min-height:46px;margin:6px 0 0;padding:9px 18px}
}
