:root{color-scheme:dark;--gold:#d7b977;--ivory:#f6ebcf;--muted:#bac4c8;--edge:#a48959}*{box-sizing:border-box}body{margin:0;background:#08151d;color:var(--ivory);font-family:'Yu Gothic UI','Meiryo',system-ui,sans-serif}button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation}button:focus-visible{outline:3px solid #ffe8a3;outline-offset:4px}button:disabled{cursor:default}#game{height:100svh;min-height:560px;width:100%;position:relative;overflow:hidden;background:#102a32}canvas,.vignette,.frame{position:absolute;inset:0;width:100%;height:100%}.vignette{pointer-events:none;background:linear-gradient(#04111b9a,transparent 19%,transparent 76%,#05121ccd)}.frame{inset:14px;width:auto;height:auto;border:1px solid #bea16333;pointer-events:none}.battle .frame{display:none}header{position:absolute;top:30px;left:4%;right:4%;display:flex;justify-content:space-between;pointer-events:none;z-index:3}.brand h1{font-family:'Yu Mincho','Hiragino Mincho ProN',serif;letter-spacing:5px;font-size:25px;margin:6px 0;font-weight:600}.eyebrow{font:600 11px system-ui;letter-spacing:2px;color:var(--gold)}.brand .eyebrow{font-size:9px}.chapter{font-size:11px;color:#9bafb7}.battle .brand{display:none}.wave{display:none}.battle .wave{display:flex;position:absolute;left:50%;transform:translateX(-50%);align-items:center;gap:12px;white-space:nowrap;background:linear-gradient(90deg,transparent,#061a23a8,transparent);padding:0 25px}.wave>span{font:500 10px system-ui;letter-spacing:1px;color:#b8c4c8}.wave>strong{font-size:14px;letter-spacing:1px}#waveDots{display:flex;gap:6px}#waveDots i{width:4px;height:4px;border:1px solid #a0a9a3;transform:rotate(45deg)}#waveDots i.on{background:#efdb9a;border-color:#efdb9a}.controls{display:flex;gap:9px;margin-left:auto;pointer-events:auto}.controls button{background:#0c222bc9;border:1px solid #bda47177;border-radius:50%;height:32px;min-width:33px;font-size:12px}.controls button:first-child{border-radius:20px;padding:0 10px;font-size:10px}.left-info{position:absolute;bottom:144px;left:50%;width:170px;transform:translateX(-50%);pointer-events:none}.left-info>.eyebrow,.stats,#hint{display:none}.ward{display:flex;justify-content:space-between;align-items:center;font-size:10px;text-shadow:0 1px 5px #000;margin-bottom:7px;color:#bfd3ce}.ward b{font:600 11px system-ui}.bar{height:4px;background:#04131de6;border:1px solid #74898066}.bar i{height:100%;width:100%;display:block;background:#a2e7d5;box-shadow:0 0 9px #80edce55;transition:width .18s}.xp{height:2px;margin-top:5px;border:0;background:#1d2c38}.xp i{background:#d8b666;width:0;box-shadow:none}.toast{position:absolute;top:16%;width:100%;text-align:center;font-size:16px;font-weight:700;letter-spacing:2px;color:#ffe6ad;text-shadow:0 2px 9px #000;opacity:0;transition:opacity .3s;pointer-events:none}.toast.show{opacity:1}.target-hint{position:absolute;bottom:120px;left:0;width:100%;text-align:center;font-size:10px;color:#b6c6cf;opacity:.72;pointer-events:none}footer{position:absolute;bottom:24px;left:4%;right:4%;display:flex;align-items:flex-end;justify-content:space-between;gap:15px}.spellbook>.eyebrow{font-size:9px;letter-spacing:1px;color:#c8c6b0}.spellbook #spells{display:flex;gap:7px;margin-top:8px}.spell{width:55px;height:63px;position:relative;text-align:center}.spell small{font-size:9px;text-shadow:0 2px 6px #000}.spell .pip{position:absolute;right:2px;top:1px;background:#17242f;border:1px solid #907e55;border-radius:50%;width:16px;height:16px;font:bold 10px system-ui}.spell-art{display:block;width:140px;height:140px;background-image:url('spells.png');background-size:300% 200%;background-repeat:no-repeat;filter:drop-shadow(0 6px 9px #0007)}.spell .spell-art{width:50px;height:50px}.active-spells{display:flex;gap:12px}.active-spells button{position:relative;border:1px solid #ae9658a8;background:linear-gradient(145deg,#24393fed,#0b1d2aed);border-radius:32px 9px 9px 32px;display:flex;align-items:center;gap:8px;text-align:left;padding:3px 13px 3px 2px;box-shadow:inset 0 0 0 3px #08151b66}.active-spells button:disabled{filter:saturate(.4);opacity:.52}.active-spells button:hover:not(:disabled){border-color:#ffe3a4;background:#2c444e}.active-spells .spell-art{width:53px;height:53px}.active-spells button>span:nth-child(2){font-size:13px;font-weight:700;white-space:nowrap}.active-spells small{display:block;font-size:9px;font-weight:400;color:#b4c3c8;margin-top:3px}.active-spells button>b,.active-spells button>#novaTime{font:bold 10px system-ui;color:#f3d695;margin-left:3px}#freeze{border-color:#8bcfe094}#bossbar{position:absolute;top:62px;left:50%;transform:translateX(-50%);width:min(330px,65vw);text-align:center;z-index:2}#bossbar span{font-size:12px;font-weight:700;letter-spacing:2px;color:#f9c5ad;text-shadow:0 2px 6px #000}#bossbar>div{height:5px;background:#1f1727;border:1px solid #ac7760;margin-top:7px}#bossfill{display:block;height:100%;width:100%;background:linear-gradient(90deg,#ba485f,#fba878)}.hidden{display:none!important}#combo{position:absolute;right:7%;top:34%;text-align:center;pointer-events:none;transform:rotate(-6deg);text-shadow:0 3px 14px #000}#combo b{font:italic 800 43px system-ui;color:#ffe4a8}#combo span{font:800 11px system-ui;letter-spacing:3px;display:block;color:#ffbb75}#loot{display:none}.danger .vignette{box-shadow:inset 0 0 90px #b82e394f;animation:danger 1.2s infinite alternate}@keyframes danger{to{box-shadow:inset 0 0 120px #b82e3988}}
/* A tangible folio: dark leather, warm metal, legible inset paper. */
.overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#04101b6b;backdrop-filter:blur(2px);z-index:5}.modal{position:relative;text-align:center;width:min(650px,94vw);padding:25px 35px}.modal h2{font-family:'Yu Mincho','Hiragino Mincho ProN',serif;font-size:34px;font-weight:700;letter-spacing:3px;margin:16px 0;color:#f9e9bf;text-shadow:0 3px 15px #000}.modal>p{font-size:14px;line-height:1.9;color:#c4cfd3;margin:8px 0}.modal>small{font-size:11px;line-height:1.8;color:#bac8ce}.intro{background:radial-gradient(ellipse,#081b28ed 20%,#081b2880 52%,transparent 75%)}.intro-moon{width:105px;height:105px;margin:auto;background:url('spells.png') 100% 100%/300% 200%;filter:drop-shadow(0 0 20px #ffe6a044)}.primary{display:block;width:min(340px,100%);margin:22px auto 15px;border:1px solid #c9a86d;color:#fff0c9;background:linear-gradient(#69583c,#3f372b);padding:14px 20px;font-size:15px;font-weight:700;letter-spacing:2px;border-radius:3px;box-shadow:inset 0 0 0 3px #1c202766,0 4px 16px #0004}.primary:hover{background:linear-gradient(#8c7348,#5e4a2d);border-color:#f7d791}.primary span{float:right}.preparation{display:flex;justify-content:center;gap:48px;margin:5px 0}.world-object{background:transparent;border:0;text-align:center;color:var(--ivory);display:flex;flex-direction:column;align-items:center;padding:0;transition:transform .2s}.world-object:hover{transform:translateY(-5px)}.world-object>span:not(.item-art){font-size:14px;font-weight:600;letter-spacing:1px}.world-object small{font-size:10px;color:#b3c6ca;margin-top:4px}.item-art{display:block;width:120px;height:120px;background-image:url('relics.png');background-size:300% 200%;filter:drop-shadow(0 5px 12px #0006)}.art-moonstaff{background-position:0 0}.art-firestaff{background-position:50% 0}.art-froststaff{background-position:100% 0}.art-book{background-position:0 100%}.art-flower{background-position:50% 100%}.art-amulet{background-position:100% 100%}#progress{font-size:12px;color:#e9c988;margin:14px 0 3px}#progress b{font-size:20px}#progress span{display:block;color:#9bacb8;font-size:10px;margin-top:3px}
.choices{width:min(940px,96vw);padding:25px}.choices>p{font-size:13px}.cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:19px;margin:26px 0 18px}.card{position:relative;overflow:hidden;padding:23px 20px 19px;min-height:340px;border:1px solid #a28c63;border-radius:65px 65px 5px 5px;background:radial-gradient(ellipse at 50% 30%,#33424a,#142735 58%,#101d2b);box-shadow:inset 0 0 0 5px #091622,inset 0 0 0 6px #9f87554d,0 10px 28px #0006;text-align:center;transition:transform .18s,border-color .18s,box-shadow .18s}.card:before{content:'';display:block;font-size:11px;color:#a38c61;position:absolute;top:10px;left:calc(50% - 6px)}.card:after{content:'';position:absolute;inset:14px 11px 10px;border:1px solid #99845935;border-radius:53px 53px 0 0;pointer-events:none}.card:hover{transform:translateY(-7px);border-color:#ffe6ad;box-shadow:inset 0 0 0 5px #091622,inset 0 0 0 6px #cdb67d88,0 0 26px #d4ae4522}.card .tag{display:block;font-size:10px;font-weight:600;letter-spacing:1px;color:#c9b58b;margin-top:11px;min-height:15px}.card .spell-art{width:155px;height:155px;margin:8px auto 1px;filter:drop-shadow(0 0 16px #b6a16733)}.card h3{font-size:20px;letter-spacing:1px;margin:7px 0 12px;color:#ffe9bc;font-weight:700}.card p{font-size:13px;line-height:1.8;color:#d6dce0;margin:0;min-height:70px;text-align:left}.pick-key{display:block;margin-top:18px;color:#c3ac7b;font-size:10px;font-weight:700;letter-spacing:2px}.card.rare{border-color:#cba666}.card.rare .tag{color:#f4c77c}.relic-menu{width:min(870px,96vw)}.relic-menu .item-art{width:160px;height:160px;margin:auto}.relic-menu .card{min-height:300px;padding-top:25px}.relic-menu .card p{text-align:center;min-height:48px}.relic-menu .card.active{border-color:#ffe9aa;box-shadow:inset 0 0 0 5px #091622,inset 0 0 0 6px #cdb67daa,0 0 22px #bdab5229}.relic-menu .card.active:before{color:#ffe2a0}.locked .item-art{filter:grayscale(.65) brightness(.65)}.unlock{display:block;font-size:11px;color:#e6c680;margin-top:10px}.relic-notice{font-size:12px!important;min-height:22px}.result>.spell-art{margin:auto;width:120px;height:120px}.result{background:radial-gradient(ellipse,#102330f5 10%,#0c1e2ae0 55%,transparent 78%)}.result-loot{margin:22px 0}.result-loot strong{display:block;font:800 58px system-ui;color:#f8d58b;text-shadow:0 0 25px #d8b26555}.result-loot span{font-size:14px;color:#e6d0a5}.next-goal{font-weight:700;color:#f3d294!important}.seal{font-size:50px;color:#ead08f}#photoHint{display:none;position:absolute;bottom:12px;right:15px;font-size:10px;color:#d3d7cdaa}.photo header,.photo footer,.photo aside,.photo .target-hint,.photo .toast,.photo .frame,.photo #combo,.photo #bossbar{display:none}.photo .overlay{visibility:hidden}.photo #photoHint{display:block}#game:has(.overlay:not(.hidden)) .left-info,#game:has(.overlay:not(.hidden)) footer,#game:has(.overlay:not(.hidden)) .target-hint,#game:has(.overlay:not(.hidden)) .toast,#game:has(.overlay:not(.hidden)) #combo{opacity:0;pointer-events:none}
@media(max-width:760px){header{top:20px;left:5%;right:5%}.brand h1{font-size:21px}.brand .eyebrow{font-size:8px}.chapter{display:none}.battle .wave{left:0;transform:none;padding:5px 0;gap:8px}.wave>span{display:none}.wave>strong{font-size:13px}#waveDots{gap:5px}.controls button{height:29px;min-width:29px}.modal{padding:20px 15px}.modal h2{font-size:26px;letter-spacing:2px}.modal>p{font-size:12px}.intro-moon{width:80px;height:80px}.preparation{gap:32px}.item-art{width:100px;height:100px}.modal>small{font-size:10px}.primary{font-size:14px;padding:13px}.choices{padding:16px 10px}.cards{gap:8px;margin:20px 0 15px}.card{padding:20px 10px 15px;min-height:315px;border-radius:40px 40px 4px 4px}.card:after{inset:10px 7px 7px;border-radius:32px 32px 0 0}.card .tag{font-size:9px;letter-spacing:0;min-height:24px}.card .spell-art{width:90px;height:90px;margin:10px auto}.card h3{font-size:15px;letter-spacing:0;min-height:36px;margin:5px 0 10px}.card p{font-size:11px;line-height:1.8;min-height:98px}.pick-key{font-size:9px;letter-spacing:0;margin-top:9px}.relic-menu .item-art{width:94px;height:120px}.relic-menu .card{min-height:270px}.relic-menu .card h3{font-size:14px;min-height:auto}.relic-menu .card p{font-size:11px;min-height:62px}.unlock{font-size:10px}.relic-notice{font-size:11px!important}footer{bottom:19px;left:5%;right:5%;flex-direction:column;align-items:stretch;gap:10px}.spellbook{align-self:center}.spellbook>.eyebrow{display:none}.spellbook #spells{gap:6px}.spell{width:36px;height:40px}.spell .spell-art{width:36px;height:36px}.spell small{display:none}.spell .pip{font-size:8px;width:13px;height:13px}.active-spells{justify-content:space-between;gap:10px}.active-spells button{flex:1;padding-right:10px;gap:4px;justify-content:center}.active-spells .spell-art{width:44px;height:44px}.active-spells button>span:nth-child(2){font-size:12px}.active-spells small{font-size:8px}.active-spells button>b,.active-spells button>#novaTime{font-size:9px}.left-info{bottom:146px;width:135px}.ward{font-size:9px}.target-hint{display:none}#combo{right:5%;top:28%}#combo b{font-size:31px}#combo span{font-size:9px}.toast{top:15%;font-size:12px;padding:0 15px;letter-spacing:1px}#bossbar{top:58px}.result-loot strong{font-size:48px}.result>.spell-art{width:95px;height:95px}}
@media(max-height:730px) and (min-width:761px){.intro-moon{width:65px;height:65px}.intro h2{margin:10px 0;font-size:29px}.intro p{font-size:12px}.intro .item-art{width:90px;height:90px}#progress{margin:8px 0}.intro .primary{margin:14px auto 10px}.choices h2{margin:10px}.cards{margin:15px 0 12px}.card{min-height:290px;padding:18px 17px}.card .spell-art{width:110px;height:110px}.card h3{font-size:18px}.card p{font-size:12px;min-height:64px}.relic-menu .item-art{width:115px;height:115px}.relic-menu .card{min-height:240px}.modal>p{margin:5px 0}.result>.spell-art{width:85px;height:85px}.result-loot{margin:12px 0}}
@media(prefers-reduced-motion:reduce){.danger .vignette{animation:none}.card{transition:none}}
/* Quiet typography: art leads, type supports it. */
body{font-family:'Hiragino Kaku Gothic ProN','Yu Gothic',Meiryo,sans-serif;font-weight:400;-webkit-font-smoothing:antialiased}.modal h2{font-family:'Yu Mincho','Hiragino Mincho ProN',serif;font-weight:500;font-size:29px;letter-spacing:3px}.card h3{font-family:'Yu Mincho','Hiragino Mincho ProN',serif;font-size:18px;font-weight:600;letter-spacing:1px;min-height:auto}.card p{font-size:12px;min-height:22px;text-align:center;letter-spacing:0;line-height:1.7}.card{min-height:310px}.card .tag{font-size:9px;letter-spacing:2px}.pick-key{font:500 11px Georgia,serif;margin:17px auto 0;border:1px solid #a9906155;width:24px;height:24px;line-height:22px;border-radius:50%}#progress{font:400 12px 'Yu Gothic',Meiryo,sans-serif;letter-spacing:1px;margin:12px 0;color:#d9c490}#progress .seed-mark{font-size:12px;display:inline;color:#ecd295}#progress .seed-label{font-size:10px;display:inline;color:#9faeb8;margin-left:5px}.details-toggle{border:0;border-bottom:1px solid #c4ae6d66;padding:3px 1px;background:transparent;color:#bbc5ca;font-size:11px}.choice-detail{text-align:left;max-width:700px;margin:0 auto 10px;border-left:1px solid #a18a59;padding:0 12px}.choice-detail p{font-size:11px;line-height:1.7;margin:4px 0;color:#c3cdd3}.choice-detail b{color:#e8d2a6;font-weight:500}.result-loot strong{font:500 46px Georgia,serif}.result-loot span{font-size:12px}
@media(max-width:760px){.modal h2{font-size:24px}.card{min-height:253px;padding:19px 7px 12px}.card h3{font-size:13px;min-height:32px;line-height:1.6;margin:5px 0 6px}.card p{font-size:10px;min-height:34px}.card .spell-art{width:92px;height:92px}.pick-key{font-size:10px;margin-top:11px;width:21px;height:21px;line-height:19px}.choice-detail p{font-size:10px}.card .tag{min-height:15px;font-size:9px}.relic-menu .card p{min-height:56px}}
.card,.card:after{border-radius:3px}.card{background:linear-gradient(110deg,#1f3340,#112432 50%,#1a2c38);border:1px solid #b69962;box-shadow:inset 0 0 0 4px #0a141e,inset 0 0 0 5px #9b835350,0 8px 22px #0008}.card:before{content:'';top:10px}.card:after{inset:10px;border:1px solid #a28b5940}.card .spell-art{width:180px;height:180px}.choices .card{min-height:344px;padding-top:22px}.choices .card p{margin-top:8px}.choices h2{font-size:26px}.intro,.result{background:linear-gradient(140deg,#10212fea,#0a1b29eb);border:1px solid #9e875757;box-shadow:inset 0 0 0 5px #07131c77,inset 0 0 0 6px #9e87572b,0 12px 35px #0005;border-radius:3px}.overlay{background:#04101b80;backdrop-filter:none}.choices{background:transparent}.intro-moon{width:90px;height:90px}
@media(max-width:760px){.choices .card{min-height:255px;padding-top:19px}.card .spell-art{width:92px;height:105px;background-size:300% 200%}.choices h2{font-size:23px}.card:after{inset:6px}.intro{max-width:340px}.intro-moon{width:70px;height:70px}.intro .preparation .item-art{width:90px;height:90px}}
/* The garden remains visible on arrival; readable folios are reserved for choices. */
.overlay:has(.intro){background:#04101b25}.intro{background:linear-gradient(90deg,transparent,#06182170 18%,#061821a0 50%,#06182170 82%,transparent);border:0;box-shadow:none;width:min(600px,92vw)}.intro h2{font-size:32px;letter-spacing:5px;text-shadow:0 2px 15px #000}.intro p,.intro small{text-shadow:0 2px 7px #000}.intro>.eyebrow{font-size:9px;letter-spacing:2px}.intro-moon{width:85px;height:85px}.intro .primary{background:linear-gradient(90deg,#483d2760,#89734bc9,#483d2760);border-left:0;border-right:0;border-radius:45% / 10%;max-width:270px;box-shadow:none;font-size:14px;padding:12px}.intro .primary:hover{background:linear-gradient(90deg,#483d2760,#ae905bc9,#483d2760)}.intro .world-object>span:not(.item-art){font-weight:500;font-size:13px}.intro .preparation{gap:55px}.card{border-radius:54px 54px 4px 4px}.card:after{border-radius:44px 44px 0 0}.battle .overlay:has(.choices){background:#04101b75}
@media(max-width:760px){.intro{max-width:350px}.intro h2{font-size:26px}.intro-moon{width:65px;height:65px}.intro .preparation{gap:30px}.card{border-radius:34px 34px 3px 3px}.card:after{border-radius:27px 27px 0 0}}
.card{background-image:linear-gradient(#0b1d2b25,#0b1d2b55),url('folio.webp');background-size:cover;background-position:center}.card:hover{background-image:linear-gradient(#2a344615,#0b1d2b33),url('folio.webp')}.target-hint{display:none}@media(min-width:761px){.left-info{bottom:35px;width:158px}.ward{font-size:9px}.ward b{font-size:10px}}
/* Arrival window: tangible grimoire cover, matching the spell folios. */
.overlay:has(.intro){background:#04101b55}
.intro{width:min(600px,92vw);background:linear-gradient(#08182618,#08182635),url('folio.webp') center/cover;border:1px solid #b69962;border-radius:5px;box-shadow:inset 0 0 0 5px #07131c88,inset 0 0 0 6px #b69b6255,0 12px 32px #0007;padding:27px 35px}
.intro:before{content:'';position:absolute;inset:12px;border:1px solid #b69b6255;border-radius:2px;pointer-events:none}
.intro .primary{border:1px solid #c9a86d;border-radius:3px;background:linear-gradient(#796543,#493c2b);box-shadow:inset 0 0 0 3px #1c202744}
.intro .primary:hover{background:linear-gradient(#967c4e,#655032)}
@media(max-width:760px){.intro{width:min(350px,92vw);padding:24px 18px}.intro:before{inset:9px}}
@media(max-height:730px) and (min-width:761px){.intro{padding:18px 32px}}
/* Suppress fine grain in the reading area while retaining engraved edges. */
.card{background-image:linear-gradient(90deg,#101e2c55,#101e2ca8 18%,#101e2cba 50%,#101e2ca8 82%,#101e2c55),url('folio.webp')}
.card:hover{background-image:linear-gradient(90deg,#15233244,#15233299 18%,#152332ad 50%,#15233299 82%,#15233244),url('folio.webp')}
.intro{background-image:linear-gradient(90deg,#101e2c44,#101e2c9a 18%,#101e2ca8 50%,#101e2c9a 82%,#101e2c44),url('folio.webp')}
.primary,.intro .primary{position:relative;background:linear-gradient(180deg,#d2b47b33 0%,#c1a16a12 12%,#0b111c33 48%,#050b164f 100%),linear-gradient(90deg,#463723ad,#85704baa 48%,#463723ad),url('folio.webp') center/cover;border:1px solid #a99160;border-top-color:#e2c791;border-bottom-color:#5b472b;border-radius:4px;box-shadow:inset 0 1px 0 #f6db9b66,inset 0 -3px 5px #080b1599,inset 3px 0 8px #10152155,inset -3px 0 8px #10152155,0 3px 0 #081018bb,0 6px 13px #0006;text-shadow:0 2px 2px #1c160ecc;color:#f2e2bb}
.primary:before{content:'';position:absolute;inset:5px;border:1px solid #d5b57544;pointer-events:none;border-radius:1px}
.primary:hover,.intro .primary:hover{background:linear-gradient(180deg,#e4c18d44,#ae8c5522 30%,#080f1a44),linear-gradient(90deg,#57432aa6,#92784fa6,#57432aa6),url('folio.webp') center/cover;border-top-color:#ffe3ac}
.primary:active,.intro .primary:active{transform:translateY(2px);box-shadow:inset 0 2px 5px #080d1899,0 1px 0 #081018}
#game:has(.intro) header .brand{visibility:hidden}.intro #progress[hidden]{display:none}.intro h2{margin:14px 0 20px}.intro .primary{margin-bottom:8px}.intro .preparation{margin-top:12px;margin-bottom:20px}
/* Equipment and grimoire are tangible, separate selection tiles. */
.intro .preparation{gap:20px;margin:12px auto 17px;justify-content:center}.intro .world-object{width:160px;padding:13px 12px 15px;border:1px solid #a88d5a80;border-radius:27px 27px 4px 4px;background:linear-gradient(#10213060,#071724bb),url('folio.webp') center/cover;box-shadow:inset 0 0 0 4px #06131b88,inset 0 0 0 5px #b99c5a22,0 4px 12px #0004;transition:transform .2s,border-color .2s}.intro .world-object:before{content:'';position:absolute;top:7px;left:calc(50% - 4px);font-size:8px;color:#b79a61}.intro .world-object{position:relative}.intro .world-object:hover{border-color:#e9ca85;transform:translateY(-3px);box-shadow:inset 0 0 0 4px #06131b88,inset 0 0 0 5px #d9bb7455,0 0 16px #c6a76426}.intro .world-object .item-art{width:115px;height:115px}.intro .world-object>span:not(.item-art){font-family:'Yu Mincho',serif;font-size:14px;letter-spacing:2px}.intro .world-object small{font-size:10px;margin-top:6px;color:#b6c2c6}
/* Departure is an engraved seal rather than a full-width control strip. */
.intro #start{width:185px;min-height:64px;margin:13px auto 0;padding:13px 32px;border:0;border-radius:0;background:transparent;box-shadow:none;text-shadow:0 2px 5px #000;font-family:'Yu Mincho',serif;font-weight:600;font-size:15px;letter-spacing:3px;color:#f2dfac;isolation:isolate}.intro #start:before{inset:4px 6px;border:1px solid #bba06b99;border-radius:50%;background:linear-gradient(#d2b87918,#101d2744),url('folio.webp') center/cover;box-shadow:inset 0 0 0 4px #06131b99,inset 0 0 0 5px #b99c5a33,0 2px 10px #0005;z-index:-1;transform:scaleY(.8)}.intro #start:after{content:'';position:absolute;left:calc(50% - 5px);top:-3px;font-size:11px;line-height:12px;color:#e0c484;text-shadow:0 0 12px #c5a35a66}.intro #start>span{display:none}.intro #start:hover{background:transparent;box-shadow:none;color:#fff0c4}.intro #start:hover:before{border-color:#ffe6a9;box-shadow:inset 0 0 0 4px #06131b88,inset 0 0 0 5px #b99c5a55,0 0 17px #d3b36535}.intro #start:active{transform:translateY(1px)}
@media(max-width:760px){.intro .world-object{width:132px;padding:13px 8px}.intro .preparation{gap:13px}.intro .world-object .item-art{width:96px;height:96px}.intro .world-object>span:not(.item-art){font-size:12px}.intro #start{font-size:14px;min-height:60px}.intro h2{margin-bottom:15px}}
@media(max-height:730px) and (min-width:761px){.intro .world-object .item-art{width:85px;height:85px}.intro .preparation{margin-bottom:10px}.intro #start{margin-top:8px;min-height:56px}}
/* Compact abilities: artwork and cooldown ring, details on demand. */
.active-spells{gap:12px}.active-spells button,.active-spells #freeze,.active-spells #nova{width:58px;height:58px;min-height:0;min-width:58px;flex:none;padding:4px;border:1px solid #bda66f99;border-radius:50%;background:#0b1e2b;box-shadow:inset 0 0 0 3px #06131c,0 3px 10px #0007;display:block;position:relative;isolation:isolate;overflow:visible;-webkit-touch-callout:none;user-select:none}.active-spells button>.spell-art{width:48px;height:48px;border-radius:50%;position:relative;z-index:1}.active-spells button>span:nth-child(2),.active-spells #freezeTime,.active-spells #novaTime{display:none}.active-spells button:before{content:'';position:absolute;inset:0;border-radius:50%;background:conic-gradient(#536777 calc(var(--cool,0)*1turn),#e9d49a 0);mask:radial-gradient(farthest-side,transparent calc(100% - 3px),#000 0);pointer-events:none;z-index:2}.active-spells button[aria-disabled=true]>.spell-art{filter:saturate(.45) brightness(.65)}.active-spells button[aria-disabled=true]{cursor:default}.ability-tip{display:none;position:absolute;bottom:calc(100% + 14px);right:0;width:205px;padding:12px 14px;background:linear-gradient(#101e2c99,#101e2ccc),url('folio.webp') center/cover;border:1px solid #ab925e;border-radius:4px;box-shadow:0 5px 18px #0008;text-align:left;pointer-events:none;z-index:20;color:#e8dfc7}.ability-tip strong{display:block;font-size:13px;font-weight:500;margin-bottom:6px}.ability-tip span{display:block;font-size:11px;line-height:1.7;color:#c5cdd1}.active-spells button:focus-visible .ability-tip,.active-spells button.show-tip .ability-tip{display:block}@media(hover:hover){.active-spells button:hover .ability-tip{display:block}}@media(max-width:760px){.active-spells{justify-content:flex-end;gap:11px}.active-spells button,.active-spells #freeze,.active-spells #nova{width:51px;height:51px;min-width:51px;padding:3px}.active-spells button>.spell-art{width:43px;height:43px}.ability-tip{width:190px}}
@font-face{font-family:GardenDisplay;src:url('font-display.woff2') format('woff2');font-weight:500;font-display:swap}@font-face{font-family:GardenText;src:url('font-body.woff2') format('woff2');font-weight:400;font-display:swap}
body,button{font-family:GardenText,serif;font-weight:400}.modal h2,.intro h2,.choices h2,.brand h1,.card h3,.intro .world-object>span:not(.item-art),.intro #start,.primary{font-family:GardenDisplay,serif;font-weight:500}.card h3{font-size:19px;letter-spacing:.055em}.card p,.modal>p{font-family:GardenText,serif;font-weight:400}.eyebrow,.tag,.pick-key{font-family:GardenText,serif!important;font-weight:400!important}.intro #progress{font-family:GardenText,serif}.primary{font-weight:500}.card:before,.intro .world-object:before{width:7px;height:7px;background:linear-gradient(135deg,#ffe7a0,#96723d);border:1px solid #ead09877;transform:rotate(45deg);left:calc(50% - 4px)}.intro #start:after{width:23px;height:23px;left:calc(50% - 11px);top:-8px;background:url('relics.png') 100% 100%/300% 200%;filter:drop-shadow(0 1px 3px #000)}#progress .seed-mark{display:inline-block;width:20px;height:20px;vertical-align:middle;background:url('relics.png') 50% 100%/300% 200%}.pause-mark{display:block;width:11px;height:13px;margin:auto;border-left:3px solid #ddcda5;border-right:3px solid #ddcda5}.play-mark{display:block;width:0;height:0;margin:auto;border-top:7px solid transparent;border-bottom:7px solid transparent;border-left:10px solid #ddcda5}.ability-tip strong,.ability-tip span{font-family:GardenText,serif;font-weight:400}@media(max-width:760px){.card h3{font-size:14px}}
.result{width:min(590px,92vw);background:linear-gradient(90deg,#101e2c44,#101e2c99 20%,#101e2ca8 50%,#101e2c99 80%,#101e2c44),url('folio.webp') center/cover;border:1px solid #b69962;box-shadow:inset 0 0 0 5px #07131c88,inset 0 0 0 6px #b69b6255,0 12px 32px #0007;padding:28px 35px}.result>.spell-art{width:90px;height:90px}.result h2{margin:10px 0 20px;font-size:29px}.reward-objects{display:flex;justify-content:center;align-items:stretch;gap:35px;margin:12px 0 22px}.reward-seeds,.reward-relic{width:160px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative}.reward-seeds .item-art,.reward-relic .item-art{width:140px;height:140px}.reward-seeds strong{font:500 30px GardenDisplay,serif;color:#f0d194;margin-top:-4px}.reward-seeds small{font-size:11px;color:#c7c6b6;margin-top:4px}.reward-relic{border:1px solid #b49b5e66;border-radius:30px 30px 4px 4px;background:linear-gradient(#1b303444,#06151b88);padding:10px 8px 14px;font-family:GardenText,serif;box-shadow:inset 0 0 0 4px #06131b66}.reward-relic.ready{border-color:#d8bc75;box-shadow:inset 0 0 0 4px #06131b66,0 0 20px #c7a95f22}.reward-relic:hover{background:#24373b66}.reward-relic>span:not(.item-art){font-size:13px;color:#e9d9b1;margin:4px 0 9px}.reward-relic small{font-size:10px;color:#d9c48e}.relic-progress{width:95px;height:3px;background:#061018;margin-bottom:8px}.relic-progress i{display:block;height:100%;background:#d3b975;box-shadow:0 0 7px #bfa35455}.reward-relic.complete{border:0;background:transparent;box-shadow:none}.result .primary{width:235px;margin:16px auto}.result #resultRecord p{font-size:11px;color:#b6c3c8;margin:12px 0 0}.result .details-toggle{font-family:GardenText,serif;font-size:10px}@media(max-width:760px){.result{padding:22px 17px}.result h2{font-size:25px}.reward-objects{gap:13px}.reward-seeds,.reward-relic{width:130px}.reward-seeds .item-art,.reward-relic .item-art{width:110px;height:110px}.reward-seeds strong{font-size:26px}.reward-relic>span:not(.item-art){font-size:12px}}
#buildBadge{position:absolute;right:12px;bottom:5px;font:9px Georgia,serif;letter-spacing:.7px;color:#c0c8c2;opacity:.55;z-index:30;pointer-events:none}.photo #buildBadge{display:none}
/* Opening choices sit within the folio rather than repeating its cover. */
.intro .world-object{border-radius:25px;background:linear-gradient(145deg,#b5c0b010,#071a2466 45%,#0a172ab0);border:1px solid #a68b554f;box-shadow:inset 0 1px 0 #dfc58b22,inset 0 -2px 9px #020b1544,0 3px 8px #0003}.intro .world-object:before,.card:before{display:none}.intro .world-object:hover{border-color:#d8bd7d9c;background:linear-gradient(145deg,#d6bd7a18,#0d233477 65%,#0a172aaa);box-shadow:inset 0 1px 0 #ead29c44,0 0 14px #bfa25a1a}.intro .world-object small{display:none}.intro .world-object .item-art{margin-bottom:7px}.intro .world-object{padding-bottom:18px}.intro #start:before{background:linear-gradient(180deg,#e1c18933,#9b784215 40%,#382c2055),linear-gradient(90deg,#645031bb,#a3864bdf 50%,#645031bb),url('folio.webp') center/cover;border-color:#d3b473;box-shadow:inset 0 1px 0 #ffe1a366,inset 0 -2px 5px #241b1980,0 3px 10px #0006}.intro #start{color:#fff0c7}.intro #start:hover:before{background:linear-gradient(180deg,#edcf9540,#bc985322,#35291c44),linear-gradient(90deg,#7c6037cc,#b99a59ee 50%,#7c6037cc),url('folio.webp') center/cover}
.intro #grimoire .prepared-art{position:absolute;right:10px;top:83px;width:46px;height:46px;padding:2px;border:1px solid #c0a66c99;border-radius:50%;background:radial-gradient(circle,#23383fed,#071824f5);box-shadow:0 3px 9px #0009,inset 0 0 0 2px #07131b;pointer-events:none}.intro #grimoire .prepared-art>.spell-art{width:40px;height:40px;filter:drop-shadow(0 0 4px #9ee2fb44)}@media(max-width:760px){.intro #grimoire .prepared-art{top:68px;right:7px;width:40px;height:40px}.intro #grimoire .prepared-art>.spell-art{width:34px;height:34px}}@media(max-height:730px) and (min-width:761px){.intro #grimoire .prepared-art{top:59px}}
/* Aged metal edging with an inset channel, not a single outline. */
.intro .world-object{border:1px solid #aa8c50;border-top-color:#d2b775;border-bottom-color:#54432c;box-shadow:inset 0 1px 0 #f2d8a266,inset 0 -2px 4px #020914aa,inset 2px 0 3px #e4c07b15,inset -2px 0 4px #0007,0 2px 0 #071019,0 4px 9px #0005}.intro .world-object:after{content:'';position:absolute;inset:4px;border-radius:20px;border:1px solid #c4a76955;border-top-color:#09141dc9;border-bottom-color:#d6b77744;box-shadow:inset 0 0 0 1px #07121e88;pointer-events:none}.intro .world-object:hover{border-top-color:#f4d89b;border-bottom-color:#8a6c3e;box-shadow:inset 0 1px 0 #ffe7b477,inset 0 -2px 4px #020914aa,0 2px 0 #071019,0 0 15px #b7964229}
.intro #start:before{background-image:linear-gradient(180deg,#fff0be70 0%,#d4ad6422 13%,#130e0811 34%,#120b0766 67%,#dfb76628 85%,#120b0777 100%),linear-gradient(100deg,#35291966,#b4955044 38%,#9b753e22 65%,#35291977),url('folio.webp');background-size:cover;border:2px solid #c2a060;border-top-color:#efd09a;border-bottom-color:#493520;box-shadow:inset 0 2px 1px #ffdfa188,inset 0 -3px 3px #171008cc,inset 3px 0 5px #2b1e1788,inset -3px 0 5px #2b1e1799,0 2px 0 #100d10,0 5px 9px #0007}.intro #start{filter:drop-shadow(0 1px 0 #dfbc6344)}.intro #start:hover:before{background-image:linear-gradient(180deg,#fff1bf80,#c3a46520 22%,#38251444 65%,#e8be7133 87%,#281b0f77),linear-gradient(100deg,#6c4c2966,#bda05e66,#6c4c2977),url('folio.webp');border-top-color:#ffe5b1;box-shadow:inset 0 2px 1px #fff1c2aa,inset 0 -3px 3px #171008bb,0 2px 0 #100d10,0 5px 12px #0008}
.seed-mark{display:inline-block;width:20px;height:20px;vertical-align:middle;background:url('relics.png') 50% 100%/300% 200%}.relic-menu>.eyebrow:empty,.relic-notice:empty{display:none}.relic-menu>.eyebrow{letter-spacing:1px}.wave>span{display:none}.reward-seeds strong{margin-top:4px}.relic-menu .unlock .seed-mark{width:18px;height:18px}
/* Let the moonlit garden remain present behind every screen. */
.vignette{background:linear-gradient(#04111b55,transparent 20%,transparent 74%,#05121caa)}.overlay{background:#04101b42}.overlay:has(.intro){background:#04101b18}.battle .overlay:has(.choices){background:#04101b48}.intro{border-top-color:#cfb982}.card{border-top-color:#cfb982}.brand,.modal h2{ text-shadow:0 2px 12px #06131bb0}
.active-spells button:before{background:conic-gradient(#344753 calc(var(--cool,0)*1turn),#93866a 0);mask:radial-gradient(farthest-side,transparent calc(100% - 1.5px),#000 0)}.active-spells button,.active-spells #freeze,.active-spells #nova{border-color:#8a816a88;box-shadow:inset 0 1px 0 #d5cba733,inset 0 0 0 3px #06131c,0 3px 9px #0006}.active-spells button:hover:not(:disabled){border-color:#b2a78a;background:#142a35}
.choices .pick-key{display:grid;place-items:center;line-height:1;padding:0;font-family:Georgia,serif!important;font-weight:400!important;font-size:11px;font-variant-numeric:lining-nums;width:24px;height:24px;letter-spacing:0;text-indent:0;box-sizing:border-box}.choices .card>.spell-art{margin-top:9px}.choices .card{min-height:320px}@media(max-width:760px){.choices .pick-key{width:22px;height:22px;font-size:10px}.choices .card{min-height:235px}}
.choices>.cards{margin-top:0}

.intro #start{display:grid;place-items:center;padding:0 28px 4px;line-height:1}
.ability-key{position:absolute;bottom:-5px;left:50%;transform:translateX(-50%);z-index:4;padding:2px 4px;min-width:16px;border:1px solid #857a605e;border-radius:3px;background:#0c1d28e8;color:#c8c5b3;font:8px Georgia,serif;line-height:1;letter-spacing:.35px;text-align:center;pointer-events:none}.active-spells button[aria-disabled=true] .ability-key{color:#8f9b9f}@media(hover:none) and (pointer:coarse){.ability-key{display:none}}
.spellbook{position:relative;padding-left:54px}#fieldBook{position:absolute;left:0;bottom:0;width:47px;height:63px;border:0;background:transparent;padding:0}#fieldBook .item-art{width:47px;height:47px}#fieldBook kbd{font:9px Georgia;color:#bfb9a2;border:1px solid #97866755;border-radius:3px;padding:1px 4px}.spellbook .spell{background:transparent;border:0;padding:0;color:inherit;cursor:pointer}.spellbook .spell:hover .spell-art{filter:drop-shadow(0 0 6px #d3c27b66)}.field-book{width:min(760px,94vw);background:linear-gradient(90deg,#0c1d2999,#0c1d2966),url('folio.webp') center/cover;border:1px solid #b39965;box-shadow:inset 0 0 0 6px #07131b77,0 10px 30px #0007;border-radius:5px;padding:35px}.book-spread{display:grid;grid-template-columns:1fr 1.2fr;gap:25px;align-items:center;min-height:310px}#learnedDetail{padding-right:20px;border-right:1px solid #a1884f55}#learnedDetail>.spell-art{width:165px;height:165px;margin:auto}#learnedDetail h3{font:500 20px GardenDisplay,serif;margin:12px 0 6px}#learnedDetail small{font:11px Georgia;color:#c1b994}#learnedDetail p{font:12px/1.9 GardenText,serif;color:#c4d1d5;margin:10px 0}.learned-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.learned-spell{position:relative;background:#09192588;border:1px solid #7c796355;border-radius:12px;padding:4px}.learned-spell.selected{border-color:#d3b377;background:#2b3534aa}.learned-spell .spell-art{width:100%;height:auto;aspect-ratio:1}.learned-spell small{position:absolute;bottom:2px;right:4px;font:10px Georgia;color:#ddd0ac}.field-book .primary{margin-top:24px;margin-bottom:0;width:220px}@media(max-width:760px){.spellbook{padding-left:40px}#fieldBook{width:35px;height:42px}#fieldBook .item-art{width:35px;height:35px}#fieldBook kbd{display:none}.field-book{padding:20px 16px}.book-spread{grid-template-columns:1fr;gap:16px;min-height:0}#learnedDetail{padding:0 0 14px;border-right:0;border-bottom:1px solid #a1884f55}#learnedDetail>.spell-art{width:95px;height:95px}#learnedDetail h3{font-size:17px;margin:7px 0}#learnedDetail p{font-size:11px;margin:6px 0}.learned-grid{grid-template-columns:repeat(5,1fr);gap:7px}}
.spellbook>.eyebrow{display:none}
.damage-book{width:min(560px,92vw);padding:28px 30px;background:linear-gradient(#0d1d2b88,#0d1d2bbb),url('folio.webp') center/cover;border:1px solid #a58c59;box-shadow:inset 0 0 0 5px #08131c77}.damage-book h3{font:500 19px GardenDisplay,serif;letter-spacing:2px;margin:0 0 18px}.damage-rows{max-height:60vh;overflow-y:auto;padding-right:5px}.damage-row{display:grid;grid-template-columns:43px 1fr 65px;align-items:center;gap:12px;margin:8px 0}.damage-row>.spell-art{width:43px;height:43px}.damage-track{height:5px;background:#06111b;border-radius:3px;overflow:hidden}.damage-track>i{display:block;height:100%;opacity:.8}.damage-row>span{font:14px Georgia,serif;color:#e4d9b9;text-align:right}.damage-book .primary{margin-bottom:0}.no-damage{font:12px GardenText,serif;color:#bbc5c9}.result .details-toggle{margin:0 10px}.field-book>#bookDamage{margin-top:20px}.field-book>.primary{margin-top:12px}@media(max-width:760px){.damage-book{padding:24px 20px}.damage-row{gap:8px;grid-template-columns:38px 1fr 55px}.damage-row>.spell-art{width:38px;height:38px}.damage-row>span{font-size:12px}}

/* Quiet HUD: artwork is the persistent label. */
.spellbook .spell small{display:none}

/* Shared engraved frame, restored to the approved reference. */
.modal .primary,.intro #start{position:relative;isolation:isolate;display:grid;place-items:center;box-sizing:border-box;width:min(340px,90%);min-height:58px;padding:0 24px 2px;line-height:1.3;margin:20px auto 12px;border:1px solid #a99160;border-top-color:#e2c791;border-bottom-color:#5b472b;border-radius:4px;background:linear-gradient(180deg,#d2b47b33 0%,#c1a16a12 12%,#0b111c33 48%,#050b164f 100%),linear-gradient(90deg,#463723ad,#85704baa 48%,#463723ad),url('folio.webp') center/cover;box-shadow:inset 0 1px 0 #f6db9b66,inset 0 -3px 5px #080b1599,inset 3px 0 8px #10152155,inset -3px 0 8px #10152155,0 3px 0 #081018bb,0 6px 13px #0006;color:#f2e2bb;font:500 16px GardenDisplay,serif;letter-spacing:.12em;filter:none;text-shadow:0 2px 2px #1c160ecc}
.modal .primary:before,.intro #start:before{content:'';position:absolute;inset:5px;border:1px solid #d5b57544;border-radius:1px;transform:none;background:none;box-shadow:none;pointer-events:none;z-index:-1}
.modal .primary:after,.intro #start:after{display:none}
.modal .primary:hover,.intro #start:hover{background:linear-gradient(180deg,#e4c18d44,#ae8c5522 30%,#080f1a44),linear-gradient(90deg,#57432aa6,#92784fa6,#57432aa6),url('folio.webp') center/cover;border-top-color:#ffe3ac;color:#fff0c9}
.modal .primary:hover:before,.intro #start:hover:before{background:none;border-color:#d5b57566;box-shadow:none}
.modal .primary:active,.intro #start:active{transform:translateY(2px);box-shadow:inset 0 2px 5px #080d1899,0 1px 0 #081018}
.modal .primary:focus-visible{outline:2px solid #dec697;outline-offset:3px}
.card .mutation-art{background-size:300% 300%}

/* Soften all four corners without losing the framed silhouette. */
.modal .primary,.intro #start{border-radius:13px}
.modal .primary:before,.intro #start:before{border-radius:8px}

/* Local emission: light falls off from each relic's luminous head. */
.relic-menu .art-moonstaff,.relic-menu .art-firestaff,.relic-menu .art-froststaff{position:relative;isolation:isolate;--light:244,221,151;--lx:70%;--ly:14%;--breathe:4.8s}
.relic-menu .art-firestaff{--light:255,165,65;--lx:68%;--ly:16%;--breathe:1.7s}
.relic-menu .art-froststaff{--light:155,221,248;--lx:71%;--ly:16%;--breathe:6.2s}
.relic-menu .item-art:before{content:'';position:absolute;inset:-25%;pointer-events:none;background:radial-gradient(ellipse at calc(50% + (var(--lx) - 50%)*.6667) calc(50% + (var(--ly) - 50%)*.6667),rgba(var(--light),.3),rgba(var(--light),.10) 15%,rgba(var(--light),.035) 28%,transparent 45%);mix-blend-mode:screen;animation:relic-emission var(--breathe) ease-in-out infinite alternate}
.relic-menu .item-art:after{content:'';position:absolute;inset:0;pointer-events:none;background-image:inherit;background-size:inherit;background-position:inherit;filter:brightness(1.75) saturate(.85);mask-image:radial-gradient(ellipse at var(--lx) var(--ly),#000 2%,#000b 15%,#0004 29%,transparent 48%);mix-blend-mode:screen;opacity:.34;animation:relic-reflection var(--breathe) ease-in-out infinite alternate}
.relic-menu .locked .item-art:before,.relic-menu .locked .item-art:after{opacity:.12;animation:none}
@keyframes relic-emission{from{opacity:.48}to{opacity:.85}}
@keyframes relic-reflection{from{opacity:.20}to{opacity:.38}}
@media(prefers-reduced-motion:reduce){.relic-menu .item-art:before,.relic-menu .item-art:after{animation:none}}

/* Keep both HUD groups in view when the play window is resized. */
#game.battle{min-height:0}
@media(max-width:760px){
.battle footer{flex-direction:row;align-items:flex-end;left:4%;right:4%;bottom:22px;gap:12px}
.battle .spellbook{display:block;align-self:flex-end;max-width:calc(100% - 126px);padding-left:38px;flex:1;min-width:0}
.battle .spellbook #spells{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:4px;margin-top:0}
.battle .spellbook .spell{width:32px;height:35px;flex:0 0 32px}
.battle .spellbook .spell-art{width:32px;height:32px}
.battle .active-spells{flex:0 0 auto}
.battle .active-spells button{flex:none}
}

.spell-art.single-skill,.card .spell-art.single-skill{background-size:contain;background-position:center;background-repeat:no-repeat}

/* One primary-action footprint across every screen. */
.modal .primary,.intro #start{width:min(270px,calc(100vw - 88px));max-width:100%;height:54px;min-height:54px;flex:none;padding:0 20px 2px}

/* Match visible art size, rather than the source canvas size. */
.spell-art.single-skill.skill-shatter,.card .spell-art.single-skill.skill-shatter{background-size:145% auto}
.controls #sound{width:33px;height:32px;padding:6px;min-width:33px;border-radius:50%;display:grid;place-items:center}
.sound-icon{width:19px;height:19px;fill:none;stroke:#d9c9a2;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.sound-slash{display:none}.controls #sound[aria-pressed=true] .sound-slash{display:block}.controls #sound[aria-pressed=true] .sound-waves{display:none}

.armory{width:min(740px,94vw);max-height:90svh;overflow:auto;background:linear-gradient(90deg,#0b1c2870,#0b1c28a0 48%,#0b1c2870),url('folio.webp') center/cover;border:1px solid #ae9463;border-radius:8px;box-shadow:inset 0 0 0 5px #09162288,0 10px 30px #0006;padding:24px 30px}
.armory-balance{font:13px GardenText,serif;color:#dfcca2;text-align:right;margin-bottom:8px}.armory-spread{display:grid;grid-template-columns:1fr 1fr;gap:28px;align-items:center}
#relicDetail{min-height:315px;display:flex;flex-direction:column;align-items:center}.relic-hero{position:relative;width:170px;height:175px}.relic-hero>.item-art{width:170px;height:175px}#relicDetail h3{font:500 19px GardenDisplay,serif;margin:12px 0 8px}#relicDetail .relic-base{font:11px GardenText,serif;color:#bdcbd0;margin:0 0 12px}.relic-traits{width:100%;max-width:250px}.relic-traits>div{display:flex;align-items:center;gap:8px;text-align:left;font:11px/1.7 GardenText,serif;margin:4px 0;color:#d8d2b9}.relic-traits .spell-art{width:32px;height:32px;flex:0 0 32px}.relic-trait-badge{position:absolute;bottom:3px;right:4px;width:26px;height:26px;border:1px solid #aa956288;border-radius:50%;background:#102531}.relic-trait-badge .spell-art{width:100%;height:100%}.relic-hero .relic-trait-badge{width:44px;height:44px;bottom:7px;right:2px}
.inventory-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;max-height:330px;overflow:auto;padding:5px}.inventory-item,.found-relic{position:relative;border:1px solid #887b5655;border-radius:22px;background:linear-gradient(145deg,#54616a22,#07162088);padding:4px;box-shadow:inset 0 1px 0 #f7d9a211}.inventory-item .item-art{width:100%;height:auto;aspect-ratio:1}.inventory-item.selected{border-color:#d3b97d;background:linear-gradient(145deg,#d2c0991b,#152332aa);box-shadow:inset 0 0 0 2px #ddc49622}.inventory-item.grade-2,.found-relic.grade-2{border-color:#84b2b780}.inventory-item.grade-3,.found-relic.grade-3{border-color:#d1b577aa;box-shadow:inset 0 1px 0 #efd8a444,0 0 9px #bf964a1a}.relic-lock{position:absolute;right:7px;bottom:7px;width:13px;height:17px;fill:#14242ac9;stroke:#c7bb98;stroke-width:1.3}.unlock-price{font:13px GardenText,serif;color:#e5c68e;margin-top:12px}.armory .primary:disabled{opacity:.6;cursor:default}.armory .details-toggle{margin:5px 0}.found-relics{display:flex;justify-content:center;gap:12px;margin:10px 0}.found-relic{width:90px;height:95px}.found-relic>.item-art{width:80px;height:85px}
@media(max-width:760px){.armory{padding:20px 16px;width:min(350px,94vw);max-height:90svh}.armory-spread{grid-template-columns:1fr;gap:12px}#relicDetail{min-height:0}.relic-hero,.relic-hero>.item-art{width:130px;height:140px}#relicDetail h3{font-size:17px;margin:8px 0}#relicDetail .relic-base{margin-bottom:7px}.relic-traits>div{font-size:10px}.relic-traits .spell-art{width:27px;height:27px;flex-basis:27px}.inventory-grid{grid-template-columns:repeat(4,1fr);max-height:145px;gap:7px;padding:3px}.inventory-item{border-radius:17px}.armory .primary{margin-top:15px;margin-bottom:9px}.found-relic{width:75px;height:80px}.found-relic>.item-art{width:65px;height:70px}.result:has(.found-relics)>.spell-art{width:60px;height:60px}.result:has(.found-relics){max-height:92svh;overflow:auto}.result:has(.found-relics) .reward-seeds .item-art,.result:has(.found-relics) .reward-relic .item-art{width:95px;height:95px}}

/* Local emission: light falls off from each relic's luminous head. */
.armory .relic-hero>.art-moonstaff,.armory .relic-hero>.art-firestaff,.armory .relic-hero>.art-froststaff{position:relative;isolation:isolate;--light:244,221,151;--lx:70%;--ly:14%;--breathe:4.8s}
.armory .relic-hero>.art-firestaff{--light:255,165,65;--lx:68%;--ly:16%;--breathe:1.7s}
.armory .relic-hero>.art-froststaff{--light:155,221,248;--lx:71%;--ly:16%;--breathe:6.2s}
.armory .relic-hero>.item-art:before{content:'';position:absolute;inset:-25%;pointer-events:none;background:radial-gradient(ellipse at calc(50% + (var(--lx) - 50%)*.6667) calc(50% + (var(--ly) - 50%)*.6667),rgba(var(--light),.3),rgba(var(--light),.10) 15%,rgba(var(--light),.035) 28%,transparent 45%);mix-blend-mode:screen;animation:relic-emission var(--breathe) ease-in-out infinite alternate}
.armory .relic-hero>.item-art:after{content:'';position:absolute;inset:0;pointer-events:none;background-image:inherit;background-size:inherit;background-position:inherit;filter:brightness(1.75) saturate(.85);mask-image:radial-gradient(ellipse at var(--lx) var(--ly),#000 2%,#000b 15%,#0004 29%,transparent 48%);mix-blend-mode:screen;opacity:.34;animation:relic-reflection var(--breathe) ease-in-out infinite alternate}
.armory .locked .item-art:before,.armory .locked .item-art:after{opacity:.12;animation:none}
@media(prefers-reduced-motion:reduce){.armory .relic-hero>.item-art:before,.armory .relic-hero>.item-art:after{animation:none}}

.fusion-source{position:relative;display:flex;justify-content:center;align-items:center;gap:15px;height:28px;margin:-5px auto 8px;width:76px}.fusion-source:before{content:"";position:absolute;left:22px;right:22px;top:13px;height:1px;background:linear-gradient(90deg,transparent,#baa477,transparent)}.card .fusion-source .spell-art{position:relative;width:26px;height:26px;margin:0;filter:none}
.choices .card{display:flex;flex-direction:column;align-items:center}.choices .card>.spell-art,.choices .card>h3,.choices .fusion-source{flex:none}.choices .card>p{width:100%;min-height:0;margin-bottom:16px}.choices .card>.pick-key{margin-top:auto;flex:none}

.night-selector{display:flex;justify-content:center;gap:18px;margin:12px auto}.night-option{display:flex;flex-direction:column;align-items:center;gap:4px;border:0;background:none;color:#c6b78d;padding:5px;cursor:pointer}.night-option>span:first-child{display:grid;place-items:center;width:30px;height:30px;border:1px solid #786c50;border-radius:50%;line-height:1}.night-option.selected>span:first-child{border-color:#d6c99e;box-shadow:inset 0 0 12px #d6c99e26;color:#f0e6c6}.night-option:disabled:not(.selected){opacity:.3;cursor:default}.stage-marks{display:inline-flex;gap:3px;justify-content:center}.stage-marks svg{width:10px;height:10px;fill:none;stroke:#736d5e;stroke-width:1}.stage-marks svg.achieved{fill:#c6b78d;stroke:#e1d4ad}.result>.stage-marks{display:flex;margin:8px auto 14px}

.elite-chest{max-width:490px}.chest-book{display:block;width:95px;height:95px;margin:0 auto 12px;filter:drop-shadow(0 0 12px #d7bc7250)}.chest-rewards{display:flex;justify-content:center;gap:24px;margin:12px 0 24px}.chest-reward{flex:1;min-width:0;animation:chest-reveal .6s ease-out both}.chest-reward:nth-child(2){animation-delay:.18s}.chest-reward>.spell-art{width:95px;height:95px;display:block;margin:auto}.chest-reward h3{font-size:16px;margin:8px 0}.chest-reward>span:last-child{font-size:18px;color:#cabd98}.chest-reward strong{color:#f0e1b5}@keyframes chest-reveal{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.chest-reward{animation:none}}

.night-option small{font:11px Georgia,serif;color:#bfb797}.elite-chest{background:linear-gradient(#0d1d2b88,#0d1d2bbb),url('folio.webp') center/cover;border:1px solid #a58c59;box-shadow:inset 0 0 0 5px #08131c77;border-radius:8px}.chest-reward h3{color:#e6dcc2}

.night-portal,.night-entry{display:flex;align-items:center;gap:14px;padding:8px 10px;text-align:left;background:#091923aa;border:1px solid #8e805947;border-radius:8px;color:#ddd1ac}.night-portal{width:270px;margin:14px auto 0;min-height:76px}.night-thumb{position:relative;flex:none;display:block;width:66px;height:58px;background:url('garden-portrait-v5.webp') center 12%/cover;border-radius:5px;border:1px solid #b2a16b44;overflow:hidden}.night-thumb img{position:absolute;right:-4px;bottom:-4px;width:47px;height:47px;object-fit:contain;filter:drop-shadow(0 0 3px #07121e)}.night-caption{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}.night-caption>small{font:10px GardenText,serif;color:#aba68e}.night-caption>strong{font:500 15px GardenDisplay,serif;letter-spacing:1px}.night-record{display:flex;align-items:center;gap:10px;min-height:11px}.night-record small{font:11px Georgia,serif;color:#c4bea6}.night-chevron,.night-lock{flex:none;width:16px;height:16px;fill:none;stroke:#b8a979;stroke-width:1.3}.night-menu{width:min(420px,94vw);padding:25px;background:linear-gradient(#0d1d2b88,#0d1d2bbb),url('folio.webp') center/cover;border:1px solid #a58c59;border-radius:8px;box-shadow:inset 0 0 0 5px #08131c77}.night-menu>h3{font:500 21px GardenDisplay,serif;margin:0 0 20px}.night-list{display:grid;gap:10px}.night-entry{width:100%;min-height:86px}.night-entry.selected{border-color:#cab786;background:#243332aa}.night-entry:disabled{opacity:.48}.night-entry:disabled .night-thumb{filter:saturate(.3)}.night-menu>.primary{margin-bottom:0}.night-menu>.details-toggle{margin-top:15px}#nightGoalDetails{font-size:11px;line-height:1.8}.night-portal:disabled{cursor:default}.night-portal:disabled .night-chevron{visibility:hidden}@media(max-width:360px){.night-portal{width:232px}.night-menu{padding:22px 15px}}

.home-nav{display:none}.home-ui .home-nav{display:flex;position:absolute;z-index:8;bottom:0;left:0;right:0;justify-content:center;padding:5px 14px max(7px,env(safe-area-inset-bottom));gap:6px;background:linear-gradient(#11242cef,#07141cf7),url('folio.webp') center/cover;border-top:1px solid #ac99614d}.home-nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;width:105px;max-width:30%;height:66px;padding:0;border:0;border-radius:8px;background:none;color:#aea78f;font:11px GardenText,serif}.home-nav .item-art,.home-nav .spell-art{width:44px;height:44px}.home-nav [aria-pressed=true]{background:radial-gradient(ellipse,#a8955438,transparent 72%);color:#f0dfb4}.home-ui header .brand,.home-ui #pause{display:none}.home-ui header{top:20px}.home-ui #overlay{padding:60px 0 88px}.home-ui .modal{max-height:calc(100svh - 160px);overflow-y:auto}.home-ui #overlay:has(.home-screen){padding:0 0 84px;align-items:stretch;background:linear-gradient(#071722bd,#0819245c 35%,#08131dc9);backdrop-filter:none}.home-screen{display:flex;flex-direction:column;width:min(520px,100%);height:100%;margin:auto;padding:18px 22px 12px}.home-profile{display:flex;align-items:center;gap:10px;padding-right:50px;height:58px;flex:none;margin-bottom:20px;font:500 15px GardenDisplay,serif}.home-avatar{width:44px;height:48px;flex:none;background:url('creatures.webp') 50% 100%/300% 200%;border:1px solid #ad96623d;border-radius:9px}.home-currency{display:flex;align-items:center;gap:5px;margin-left:auto;font:16px Georgia,serif}.home-currency .seed-mark{width:22px;height:22px}.stage-centre{margin:auto 0 8px;border:1px solid #ad986480;border-radius:10px;padding:12px;background:linear-gradient(#0d1b2480,#0a1b25db),url('folio.webp') center/cover;box-shadow:inset 0 0 0 4px #08141c77}.stage-heading{display:flex;justify-content:space-between;align-items:center;padding:0 4px 10px;font:13px GardenText,serif;color:#c7bea2}.stage-heading small{font:13px Georgia,serif}.stage-picture{position:relative;display:flex;align-items:center;justify-content:center;min-height:170px;height:clamp(170px,30vh,280px);background:linear-gradient(transparent 20%,#06141a77),url('garden.webp') center/cover;border-radius:5px;touch-action:pan-y;overflow:hidden}.stage-picture h2{font:500 clamp(24px,5vw,32px) GardenDisplay,serif;color:#fff0c7;text-shadow:0 2px 6px #000,0 0 15px #001018;margin:0;padding:12px 32px;text-align:center;letter-spacing:3px}.stage-arrow{position:absolute;top:0;bottom:0;width:30px;background:#06192355;border:0;padding:5px;color:#dfcd9e}.stage-arrow.previous{left:0}.stage-arrow.next{right:0}.stage-arrow svg{width:20px;fill:none;stroke:currentColor;stroke-width:1.3}.stage-arrow:disabled{opacity:.15}.stage-locked{position:absolute;bottom:9px;font:10px GardenText,serif;color:#eee0c4}.stage-rewards{display:flex;justify-content:space-around;padding:14px 0 0}.stage-reward{position:relative;display:flex;flex-direction:column;align-items:center;background:none;border:0;padding:0 8px;color:#d8c89f;gap:3px;font:10px GardenText,serif}.stage-reward>.item-art{width:43px;height:43px}.stage-reward>strong{font:15px Georgia,serif}.stage-reward.claimed{opacity:.6}.reward-check{position:absolute;right:4px;top:2px;width:18px;fill:none;stroke:#a9d2b9;stroke-width:1.5}.stage-reward-detail{min-height:26px;font:10px/1.5 GardenText,serif;color:#c3c3ad;text-align:center;margin:9px 0 0}.home-depart{margin:auto 0 0;flex:none;text-align:center}.home-loadout{display:flex;justify-content:center;gap:15px;margin:2px 0}.home-loadout>button{position:relative;background:none;border:0;padding:0}.home-loadout .item-art{width:51px;height:51px}.home-loadout .prepared-art{position:absolute;width:27px;height:27px;bottom:0;right:-5px}.home-loadout .prepared-art>.spell-art{width:27px;height:27px}.home-depart>.primary{margin:7px auto 0}.home-depart>.details-toggle{margin:8px 0 0}.home-ui #buildBadge{display:none}@media(max-height:700px){.home-screen{padding-top:8px}.home-profile{height:43px;margin-bottom:8px}.home-avatar{height:38px;width:35px}.stage-picture{height:170px;min-height:140px}.stage-centre{padding:8px}.stage-rewards{padding-top:6px}.stage-reward>.item-art{width:31px;height:31px}.stage-reward-detail{margin-top:4px;min-height:15px}.home-loadout .item-art{width:40px;height:40px}.home-nav button{height:55px}.home-ui #overlay:has(.home-screen){padding-bottom:70px}.home-depart>.primary{height:48px}.home-profile{font-size:13px}.home-screen{padding-left:16px;padding-right:16px}}@media(min-width:761px){.home-ui .home-nav{left:50%;right:auto;transform:translateX(-50%);width:520px;border-radius:14px 14px 0 0}.home-profile{padding-right:0}}

.home-screen .primary{width:270px;height:54px;padding:0 18px}@media(max-width:360px){.home-screen .primary{width:232px}}

.magic-library{width:min(540px,94vw);padding:22px;background:linear-gradient(#0d1d2b77,#0d1d2bbb),url('folio.webp') center/cover;border:1px solid #aa9565;border-radius:8px;box-shadow:inset 0 0 0 5px #08141c77}.mastery-detail>.spell-art{width:88px;height:88px;margin:auto}.mastery-detail h3{font:500 20px GardenDisplay,serif;margin:7px 0 5px}.mastery-level{font:13px Georgia,serif;color:#bfb89d}.mastery-detail>p{font:12px GardenText,serif;color:#d0c4a2;margin:7px 0}.mastery-costs{display:flex;justify-content:center;gap:24px;margin:10px 0}.mastery-costs>span{display:flex;align-items:center;gap:8px}.mastery-costs b{font:14px Georgia,serif;color:#d8cfb2}.mastery-costs .short b{color:#aba69b}.mastery-costs .seed-mark{width:34px;height:34px}.fragment-art{position:relative;display:inline-block;width:35px;height:42px;background:linear-gradient(#b8a97877,#826e4555),url('folio.webp') center/cover;clip-path:polygon(4% 0,95% 2%,100% 78%,78% 100%,0 95%);border:1px solid #a69665;transform:rotate(-5deg)}.fragment-art>.spell-art{position:absolute;width:31px;height:31px;left:1px;top:5px}.mastery-detail>.primary{width:270px;height:54px;margin:8px auto;padding:0 18px}.mastery-detail>.mastery-note{font-size:10px;color:#aeb8b3;line-height:1.5;margin:8px 0 12px}.mastery-shelf{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;border-top:1px solid #a18a573b;padding-top:14px}.mastery-book{position:relative;background:linear-gradient(90deg,#a9955740 0 5%,transparent 8%),url('folio.webp') center/cover;border:1px solid #6f705859;border-radius:3px 9px 9px 3px;padding:10px 6px 18px;box-shadow:2px 3px 0 #08111c}.mastery-book>.spell-art{width:65px;height:65px;margin:auto}.mastery-book.selected{border-color:#d0b982;box-shadow:inset 0 0 14px #c2ab5d16,2px 3px 0 #08111c}.mastery-book small{position:absolute;right:8px;bottom:4px;font:12px Georgia,serif;color:#d1c69f}.mastery-ready{position:absolute;right:5px;top:5px;width:5px;height:5px;border-radius:50%;background:#b7d1a9;box-shadow:0 0 4px #b7d1a94d}.magic-library>#prepareMagic{margin-top:15px}.fragment-loot{display:flex;justify-content:center;gap:14px;margin:12px 0}.fragment-loot>span{display:flex;flex-direction:column;align-items:center;gap:4px}.fragment-loot strong{font:13px Georgia,serif;color:#d5c99f}@media(max-width:360px){.magic-library{padding:16px}.mastery-detail>.primary{width:232px}.mastery-shelf{gap:8px}.mastery-book>.spell-art{width:53px;height:53px}.mastery-costs{gap:18px}}

.stage-arrow{width:44px;background:transparent;padding:0;overflow:hidden}.stage-arrow .stage-peek{position:absolute;top:12%;bottom:12%;width:35px;background:linear-gradient(#07172120,#07172177),url('garden.webp') center/cover;border:1px solid #a5946477;border-radius:7px;box-shadow:0 3px 12px #020a10bb}.stage-arrow.next .stage-peek{left:24px;transform:rotate(3deg)}.stage-arrow.previous .stage-peek{right:24px;transform:rotate(-3deg)}.stage-arrow:disabled{visibility:hidden}

.relic-menu:has([data-pick=bolt]) .card{min-height:190px;padding:14px 9px;border-radius:24px 24px 6px 6px}.relic-menu:has([data-pick=bolt]) .card:after{border-radius:18px 18px 2px 2px}.relic-menu:has([data-pick=bolt]) .card>.spell-art{width:82px;height:82px;margin:4px auto 8px}.relic-menu:has([data-pick=bolt]) .card h3{font-size:15px;margin:5px 0 8px}.relic-menu:has([data-pick=bolt]) .card p{font-size:11px;min-height:0;line-height:1.6}@media(max-width:360px){.relic-menu:has([data-pick=bolt]) .card{min-height:165px;padding:12px 6px}.relic-menu:has([data-pick=bolt]) .card>.spell-art{width:65px;height:65px}.relic-menu:has([data-pick=bolt]) .card h3{font-size:13px}}

/* Elite spoils: arrival, deliberate opening, staggered acquisition. */
.chest-seal{position:relative;display:block;width:150px;height:135px;margin:0 auto 8px;border:0;background:transparent;padding:0;isolation:isolate;cursor:pointer}.chest-seal:disabled{opacity:1;cursor:default}.chest-seal .chest-book{position:relative;z-index:2;display:block;width:140px;height:120px;margin:0 auto;filter:drop-shadow(0 0 10px #dfbb6755)}.chest-halo{position:absolute;inset:15px;border-radius:50%;background:radial-gradient(ellipse,#eed89a66, #d4af4830 35%,transparent 70%);filter:blur(8px)}.sealed .chest-seal{animation:spoils-arrive .7s cubic-bezier(.2,.8,.3,1) both}.sealed .chest-book{animation:spoils-breathe 2.6s ease-in-out .7s infinite}.sealed .chest-rewards{visibility:hidden}.sealed #closeChest{visibility:hidden}.sealed .chest-seal{transform:translateY(85px) scale(1.2)}.chest-sparks{position:absolute;inset:0;background:radial-gradient(circle at 20% 30%,#ffedb9 0 1px,transparent 3px),radial-gradient(circle at 80% 60%,#ffedb9 0 1px,transparent 3px),radial-gradient(circle at 65% 15%,#fff9db 0 1px,transparent 2px);animation:spoils-breathe 2s ease-in-out infinite}.revealed .chest-halo{animation:spoils-open .8s ease-out both}.revealed .chest-reward{animation:spoils-reveal .65s ease-out var(--reveal-delay) both}.revealed #closeChest{animation:spoils-reveal .4s ease-out .8s both}
@keyframes spoils-arrive{from{opacity:0;transform:translateY(140px) scale(.35)}to{opacity:1;transform:translateY(85px) scale(1.2)}}@keyframes spoils-breathe{50%{filter:drop-shadow(0 0 15px #f8d88799);opacity:.8}}@keyframes spoils-open{0%{transform:scale(.7);opacity:.5}35%{transform:scale(2.5);opacity:1}100%{transform:scale(1);opacity:.4}}@keyframes spoils-reveal{from{opacity:0;transform:translateY(15px);filter:brightness(1.8)}to{opacity:1;transform:translateY(0);filter:brightness(1)}}@media(prefers-reduced-motion:reduce){.chest-seal,.chest-book,.chest-halo,.chest-sparks,.chest-reward,.elite-chest #closeChest{animation:none!important}}

/* Ward gauge follows the wizard's lower body in portrait. */
@media(max-width:760px){.battle .left-info{bottom:calc(58px + env(safe-area-inset-bottom,0px));width:135px}}

.gem-slots{display:flex;gap:12px;justify-content:center;margin:10px}.gem-slot{width:48px;height:48px;border:1px solid #ab9465;border-radius:12px;background:#0a1b25}.gem-slot .spell-art{width:40px;height:40px}.empty-socket{display:block;width:20px;height:25px;margin:auto;border:1px solid #a18c6155;border-radius:45%;box-shadow:inset 0 2px 8px #000}.inventory-item>.spell-art{width:54px;height:54px;margin:auto}

.protect-relic{width:40px;height:40px;display:block;margin:10px auto;background:#0b202b;border:1px solid #a18c6155;border-radius:10px;color:#a6afb0}.protect-relic svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.5}.protect-relic[aria-pressed=true]{color:#efd598;border-color:#cfb87a;background:#453b2544}.protect-relic[hidden]{display:none}

.equipment-slots{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.equipment-slots .inventory-item{height:80px}.equipment-art{object-fit:contain;width:64px;height:64px}.equipment-slots .item-art{width:64px;height:64px}.equipment-detail>.equipment-art,.equipment-detail>.item-art{width:140px;height:140px;margin:14px auto}.equipment-detail{text-align:center}.equipment-rewards{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.equipment-rewards>div{display:grid;justify-items:center}.equipment-rewards .equipment-art,.equipment-rewards .item-art{width:40px;height:40px}

.stardrop-mark{display:inline-block;width:16px;height:23px;flex-shrink:0;clip-path:polygon(50% 0,95% 40%,75% 85%,50% 100%,25% 85%,5% 40%);background:conic-gradient(from 35deg,#f7ffff,#6fc6d5,#335e9c,#b1effa,#f7ffff);filter:drop-shadow(0 0 5px #80dff7);vertical-align:middle}.stardrop-reward{display:flex;align-items:center;justify-content:center;gap:10px;margin:8px}.home-profile{gap:8px}.home-currency{gap:5px;font-size:13px}.fragment-loot{flex-wrap:wrap}

.equipment-collection-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;max-height:220px;overflow-y:auto}.equipment-collection-grid .inventory-item{min-height:96px}.equipment-collection-grid .equipment-art,.equipment-collection-grid .item-art{width:72px;height:72px;margin:auto}.equipment-collection-grid small{font-size:10px}.found-equipment{display:block;width:76px;height:88px;margin:6px auto}.found-equipment .equipment-art,.found-equipment .item-art{width:64px;height:64px;margin:auto}.found-equipment small{font-size:10px}.equipment-collection .equipment-detail{margin-top:14px}
.gem-slot-label{font-size:11px;color:#c8c5b4;margin-top:10px}.gem-slot-label+.gem-slots{margin-top:5px}.gem-slot .empty-socket{width:30px;height:34px;border:0;border-radius:0;box-shadow:none;fill:none;stroke:#a8c9ca;stroke-width:1.2}.empty-socket .socket-add{stroke:#f3ddb2;stroke-width:2.2;paint-order:stroke;filter:drop-shadow(0 1px 2px #071722)}

/* The navigation sits on the scene, without a floating rounded panel. */
.home-ui .home-nav{border:0;border-radius:0;box-shadow:none;background:linear-gradient(transparent,#07151ccc 35%,#06121af5);padding-top:18px;gap:12px}
.home-ui .home-nav button{position:relative;border-radius:0;background:none;opacity:.7}
.home-ui .home-nav [aria-pressed=true]{background:none;opacity:1;color:#f1deb0}
.home-ui .home-nav [aria-pressed=true]:after{content:"";position:absolute;bottom:0;width:26px;height:1px;background:#e1c483;box-shadow:0 0 7px #e6cd8d66}
.gem-empty p{font-size:13px;line-height:1.9}.gem-empty p+p{color:#aebdbb;font-size:12px}
.gem-slot .empty-socket{display:block;width:20px;height:25px;border:1px solid #a18c6155;border-radius:45%;box-shadow:inset 0 2px 8px #000;margin:auto}
.stage-arrow{width:38px;background:linear-gradient(90deg,#06151a99,transparent);display:grid;place-items:center;opacity:1}.stage-arrow.next{background:linear-gradient(270deg,#06151a99,transparent)}.stage-arrow .stage-direction{width:24px;height:40px;stroke:#e5ca8d;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 2px 3px #000)}.stage-arrow .arrow-glint{stroke:#fff2cb;stroke-width:.6;opacity:.65}.stage-arrow.previous .stage-direction{transform:rotate(180deg)}.stage-arrow:disabled{visibility:hidden}.stage-arrow:hover .stage-direction{stroke:#fff0b6}
.reward-chest{display:block;width:52px;height:52px;background:url("reward-chest.png") center/contain no-repeat;filter:drop-shadow(0 3px 5px #0006)}

.prepared-magic-slot{display:flex;align-items:center;gap:9px;margin:0 auto 10px;padding:6px 15px;border:1px solid #9b895977;border-radius:9px;background:#091b25b0;color:#ddcba5;font-size:12px}.prepared-magic-slot .spell-art{width:36px;height:36px}
/* Shared action button: approved warm finish, rounded rectangular corners. */
#game .primary{width:min(270px,calc(100vw - 88px));max-width:100%;height:54px;min-height:54px;padding:0 18px 2px;border-radius:13px;background:linear-gradient(180deg,#d2b47b33 0%,#c1a16a12 12%,#0b111c33 48%,#050b164f 100%),linear-gradient(90deg,#463723ad,#85704baa 48%,#463723ad),url('folio.webp') center/cover;border:1px solid #a99160;border-top-color:#e2c791;border-bottom-color:#5b472b;color:#f2e2bb;opacity:1;font:500 16px GardenDisplay,serif;letter-spacing:.12em}
#game .primary:before{border-radius:8px}
#game .primary:disabled{opacity:1;color:#b9af95;cursor:default}
#game .primary:not(:disabled):hover{background:linear-gradient(180deg,#e4c18d44,#ae8c5522 30%,#080f1a44),linear-gradient(90deg,#57432aa6,#92784fa6,#57432aa6),url('folio.webp') center/cover;border-top-color:#ffe3ac;color:#fff0c9}

.loadout-overview{width:min(470px,94vw);padding:16px 20px;background:linear-gradient(#081b2470,#091921e6),url('folio.webp') center/cover;border:1px solid #9e895657;border-radius:10px}.loadout-overview>h3{font:500 22px GardenDisplay,serif;margin:0 0 10px}
.loadout-figure{position:relative;height:300px;margin:0 auto 12px;max-width:370px}.loadout-character{position:absolute;left:50%;top:8px;transform:translateX(-50%);width:235px;height:280px;background:url('creatures.webp') 50% 100%/300% 200%;filter:drop-shadow(0 0 14px #bad9c323)}
.loadout-slot{position:absolute;top:calc(var(--row)*99px);width:78px;height:86px;border-radius:12px;background:linear-gradient(#183039de,#081824ed);border-color:#b29c6b88}.loadout-slot.left{left:0}.loadout-slot.right{right:0}.loadout-slot .equipment-art,.loadout-slot .item-art{width:65px;height:65px;aspect-ratio:1;margin:auto}.loadout-slot small{position:absolute;bottom:3px;right:7px;color:#e1d5b0;font:11px Georgia,serif}.loadout-sockets{position:absolute;bottom:-7px;left:3px;display:flex}.loadout-sockets .spell-art{width:18px;height:18px}
.loadout-total{display:flex;justify-content:center;gap:12px;padding:10px 0;border-top:1px solid #a18a573b;font:12px GardenText,serif;color:#d5cba9}.loadout-total strong{font-weight:400}.loadout-overview .prepared-magic-slot{margin:8px auto 4px;min-width:200px;text-align:left}.loadout-overview .prepared-magic-slot strong{font-weight:400;color:#eee0bb;line-height:1.8}.loadout-note{font-size:11px!important}.loadout-overview>.primary{margin-top:12px}@media(max-width:360px){.loadout-overview{padding:14px 12px}.loadout-slot{width:67px}.loadout-slot .item-art,.loadout-slot .equipment-art{width:57px;height:60px}.loadout-character{width:215px}.loadout-total{gap:8px;font-size:11px}}

.library-overview{align-self:center}.library-heading{display:flex;align-items:center;justify-content:center;gap:12px;margin:0 0 24px}.library-heading>.item-art{width:66px;height:66px}.library-heading h3{font:500 20px GardenDisplay,serif}.library-overview .mastery-shelf{border:0;padding:0;gap:14px}.library-overview .mastery-book{min-height:115px}.library-overview .mastery-book>.spell-art{width:76px;height:76px}.library-overview .mastery-book small{font-size:12px}
.magic-detail-dialog{width:min(430px,calc(100vw - 32px));max-height:calc(100svh - 48px);overflow-y:auto;padding:0 18px 12px;color:#e7d9b7;border:1px solid #b49b67;border-radius:12px;background:linear-gradient(#122a36d9,#091923ef),url('folio.webp') center/cover;box-shadow:inset 0 0 0 4px #07131a77,0 18px 60px #0009}.magic-detail-dialog::backdrop{background:#020a13aa;backdrop-filter:blur(1px)}.magic-detail-header{display:flex;align-items:center;gap:10px;border-bottom:1px solid #b29a6644;padding:14px 0}.magic-detail-header>.spell-art{width:43px;height:43px;flex:none}.magic-detail-header h3{font:500 17px GardenDisplay,serif;margin:0;flex:1}.magic-detail-header>span{font:13px Georgia,serif}.magic-detail-header button{width:36px;height:36px;padding:8px;border:0;background:transparent;color:#e4d2ab}.magic-detail-header svg{fill:none;stroke:currentColor;stroke-width:1.5}.magic-detail-body{padding:12px 0}.magic-detail-body>p{font:13px/1.8 GardenText,serif;margin:8px 0}.magic-power{display:flex;gap:14px;align-items:center;padding:12px;background:#07172066;border:1px solid #af976333;border-radius:6px;font-size:13px}.magic-power-next{color:#b6d6be}.magic-detail-body .mastery-costs{margin:22px 0 12px}.magic-detail-body .mastery-note{font-size:11px;color:#abbdbb}.magic-detail-dialog>.primary{margin:4px auto 8px}

.loadout-bag{border-top:1px solid #9d885944;margin-top:14px;padding-top:10px}.loadout-bag h4{font:12px GardenText,serif;text-align:left;margin:0 0 8px;color:#cfc4a7}.loadout-bag-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;max-height:190px;overflow-y:auto}.loadout-bag-grid .inventory-item{height:72px;border-radius:9px}.loadout-bag-grid .item-art,.loadout-bag-grid .equipment-art{width:58px;height:58px;margin:auto}.loadout-bag-grid small{font-size:9px;position:absolute;bottom:2px;right:3px}.gear-detail-summary{display:flex;gap:18px;align-items:center;margin:16px 0}.gear-detail-summary>.item-art,.gear-detail-summary>.equipment-art{width:95px;height:105px;flex:none}.gear-detail-summary p{font:12px/1.8 GardenText,serif;margin:3px 0}.gear-gem-list{display:grid;gap:8px;margin:14px 0;max-height:280px;overflow-y:auto}.gear-gem-list button{display:flex;align-items:center;gap:10px;padding:7px;border:1px solid #99855b77;border-radius:6px;background:#10232cc7;color:#decfae;text-align:left;font:12px/1.5 GardenText,serif}.gear-gem-list .spell-art{width:32px;height:32px;flex:none}.gear-detail-cost,.gear-dialog>p{font:12px/1.8 GardenText,serif;text-align:center;color:#c3c9ba}.gear-dialog>.details-toggle{display:block;margin:12px auto}.loadout-figure{height:276px}.loadout-slot{top:calc(var(--row)*91px);height:80px}.loadout-character{height:260px;width:218px}

/* Selection art and levels take priority over headings. */
.loadout-overview>h3,.library-heading h3{font-size:16px;letter-spacing:.04em}.library-heading{margin-bottom:14px}.loadout-overview .inventory-item,.library-overview .mastery-book{background:linear-gradient(145deg,#233c46,#09151e 72%);border-color:#9c8b648c;box-shadow:inset 0 1px 0 #e8d5a529,0 2px 5px #0005}.loadout-overview .inventory-item .item-art,.loadout-overview .equipment-art,.library-overview .spell-art{filter:brightness(1.12) drop-shadow(0 2px 3px #000)}
.loadout-slot{height:84px}.loadout-slot small,.loadout-bag-grid small,.library-overview .mastery-book small{right:0;bottom:0;left:0;background:#05111eed;color:#f1e6c6;padding:3px 4px;border-top:1px solid #9b8b6355;font:13px/1.2 Georgia,serif;text-align:right;border-radius:0 0 8px 8px;z-index:2}.loadout-bag-grid .inventory-item{height:87px;padding-bottom:22px}.loadout-bag-grid .equipped-badge{position:absolute;top:2px;left:2px;font:10px/1.4 GardenText,serif;color:#f1e2b7;background:#152e2ef0;padding:1px 4px;border-radius:3px;z-index:2}.library-overview .mastery-book{padding-bottom:26px}.library-overview .mastery-book>.spell-art{width:76px;height:76px}.loadout-total{font-size:12px}.loadout-sockets{bottom:22px;left:1px;z-index:3}
.stage-heading>span{font:500 22px/1.4 GardenDisplay,serif;letter-spacing:.06em;color:#f1e3bd}.stage-heading{padding:2px 4px 12px}.stage-heading small{font-size:13px}

.gear-management{display:flex;justify-content:center;align-items:center;gap:20px;margin:12px}.gear-management>button:first-child{width:40px;height:40px;background:#10242e;border:1px solid #8e815d88;border-radius:8px;color:#b0b8ad;padding:8px}.gear-management svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.5}.gear-management>button[aria-pressed=true]{color:#ffe1a1;border-color:#dbc186;background:#493f2c}
#game .details-toggle{display:inline-flex;align-items:center;justify-content:center;min-height:40px;min-width:116px;max-width:100%;padding:8px 14px;margin:7px 6px;border:1px solid #a28c5c88;border-radius:9px;background:linear-gradient(#1b3039e6,#0b1a24ed);color:#dfd2b1;font:12px/1.4 GardenText,serif;text-decoration:none;box-sizing:border-box;vertical-align:middle;cursor:pointer}
#game .details-toggle:hover{border-color:#d5bc84;background:#263b42}
#game .details-toggle:focus-visible{outline:2px solid #e1c588;outline-offset:3px}

.starting-badge{position:absolute;top:4px;left:4px;font:10px/1.4 GardenText,serif;color:#efe0b1;background:#15302df2;padding:2px 5px;border:1px solid #b49b6566;border-radius:3px}#game #selectStartingMagic{display:flex;margin:10px auto}#game #selectStartingMagic:disabled{color:#a8b3a8;cursor:default}

.locked-staff>.item-art{opacity:.45}.locked-staff .relic-lock{bottom:26px;right:6px;width:15px;height:19px}.locked-staff small{color:#c8bfa4}
.loadout-bag-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.loadout-bag-grid .inventory-item{min-width:0;overflow:hidden}.loadout-bag-grid .item-art,.loadout-bag-grid .equipment-art{max-width:100%}

#spells .spell-cooldown{position:absolute;left:0;top:0;width:100%;aspect-ratio:1;border-radius:50%;pointer-events:none;z-index:2;background:conic-gradient(#344753 calc(var(--spell-cool,0)*1turn),#d6bf81 0);mask:radial-gradient(farthest-side,transparent calc(100% - 2px),#000 0)}
#spells .spell-cooldown-time{position:absolute;left:50%;top:19px;transform:translateX(-50%);padding:0 3px;border-radius:3px;background:#06141de8;color:#f5e6bd;font:10px/13px Georgia,serif;z-index:3;pointer-events:none;min-width:19px}
#spells .spell-cooldown-time:empty{display:none}#spells .spell .pip{z-index:4}

/* Keep the ward clear of wrapped spell icons on narrow screens. */
.battle .left-info{bottom:calc(var(--combat-hud-height,51px) + 34px + env(safe-area-inset-bottom,0px))}

.choices .choice-growth{display:table;margin:0 auto 6px;padding:3px 8px;border:1px solid #b19c685c;border-radius:5px;background:#071822e8;color:#f3e2b5;font:12px/1.3 Georgia,serif;letter-spacing:.02em}

.gear-comparison{display:flex;justify-content:center;gap:20px;margin:10px 0 14px;padding:9px;border:1px solid #9d8e6544;border-radius:6px;background:#061824b0;font:12px/1.5 GardenText,serif}.gear-comparison .increase{color:#b4dfbc}.gear-comparison .decrease{color:#f0aaa0}.gear-comparison .unchanged{color:#bdc7c4}

.gear-comparison{flex-wrap:wrap;row-gap:4px}.gear-comparison>small{flex-basis:100%;text-align:center;color:#bdc7c4;font-size:10px}

.loadout-bag-grid .protected-mark,.gem-picker-grid .protected-mark{position:absolute;right:3px;top:3px;width:20px;height:23px;padding:3px;background:#061521eb;border:1px solid #a08e6255;border-radius:4px;fill:none;stroke:#e5d4a9;stroke-width:1.6;z-index:4;pointer-events:none}

.unlocked-magic{display:flex;align-items:center;justify-content:center;gap:12px;margin:16px auto;padding:10px 20px;background:linear-gradient(135deg,#193c47,#091924);border:1px solid #c3ad71;border-radius:12px;box-shadow:inset 0 0 0 3px #061724,0 0 18px #94dbec22}.unlocked-magic .spell-art{width:68px;height:68px}.unlocked-magic>span:last-child{font:16px GardenDisplay,serif;text-align:left}.unlocked-magic small{display:block;font:11px GardenText,serif;color:#b6dadb;margin-bottom:5px}

.magic-profile{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0;padding:10px;border:1px solid #9d8e6544;border-radius:6px;background:#061824b0;font:12px/1.5 GardenText,serif}.magic-profile>span{display:flex;justify-content:space-between;gap:6px}.magic-profile>small{grid-column:1/-1;color:#adbdc3;font-size:10px;line-height:1.6}

.evolution-progress{display:grid;gap:8px;margin-top:12px;max-height:180px;overflow-y:auto}.evolution-route{display:flex;align-items:center;gap:9px;padding:8px;border:1px solid #ad98634a;border-radius:7px;background:#081923c4;text-align:left}.evolution-route>.spell-art{width:38px;height:38px;flex:none}.evolution-route>div>span{font:12px GardenText,serif}.evolution-requirements{display:flex;gap:10px;margin-top:5px}.evolution-requirements>span{display:flex;align-items:center;gap:3px;color:#c7bca5}.evolution-requirements .spell-art{width:23px;height:23px}.evolution-requirements small{font:11px Georgia,serif}.evolution-requirements .met{color:#b3dfbd}

.evolution-heading{font:12px GardenText,serif;color:#d3c49e;text-align:left}#learnedDetail .evolution-requirements small{font:13px Georgia,serif;color:inherit}.evolution-requirements{flex-wrap:wrap}

.next-magic{display:flex;align-items:center;gap:12px;margin-top:18px;padding:12px 4px;border-top:1px solid #ac956450;text-align:left}.next-magic>.spell-art{width:55px;height:55px;flex:none}.next-magic>div{flex:1;min-width:0}.next-magic small{display:block;font:11px GardenText,serif;color:#c3ba9d}.next-magic span{font:14px GardenText,serif;color:#eee0b8}.next-magic p{margin:4px 0 0;font:12px GardenText,serif;color:#c7d4d3}.next-magic svg{width:19px;height:19px;fill:none;stroke:#b6a77b;stroke-width:1.5;flex:none}

.library-overview .mastery-shelf{grid-template-columns:repeat(3,minmax(0,1fr))}.library-overview .mastery-book{min-width:0}.library-overview .mastery-book>.spell-art{width:min(76px,100%);height:auto;aspect-ratio:1}


.bag-filters{display:flex;gap:5px;overflow-x:auto;padding:2px 1px 8px;margin-bottom:5px}.bag-filters button{width:44px;height:44px;flex:0 0 44px;border:1px solid #92836880;border-radius:9px;background:#10232b;padding:4px}.bag-filters button[aria-pressed="true"]{border-color:#e1c583;background:linear-gradient(#6b5a36,#2b2a23);box-shadow:inset 0 0 0 2px #d7b77435}.bag-filters .equipment-art,.bag-filters .item-art{width:34px;height:34px}.bag-filters svg{width:24px;height:24px;fill:none;stroke:#d6c399;stroke-width:1.5}.bag-empty{grid-column:1/-1;font:12px GardenText,serif;color:#c7c3ad;text-align:center;padding:16px 0}

/* Full-height preparation panels; only their item lists scroll. */
.home-ui #overlay:has(.loadout-overview),.home-ui #overlay:has(.library-overview){padding:48px 0 calc(88px + env(safe-area-inset-bottom,0px));align-items:stretch;overflow:hidden}
.home-ui .modal.loadout-overview,.home-ui .modal.library-overview{height:100%;max-height:none;min-height:0;overflow:hidden;display:flex;flex-direction:column;align-self:stretch;margin:0 auto;box-sizing:border-box;padding:12px 18px}
.loadout-overview>h3,.loadout-total,.loadout-note,.library-heading{flex:none}
.loadout-overview .loadout-figure{flex:none;height:clamp(180px,32svh,276px);width:100%;margin-bottom:8px}
.loadout-overview .loadout-character{height:94%;width:auto;aspect-ratio:218/260;top:3%}
.loadout-overview .loadout-slot{top:calc(var(--row)*33.333%);height:31%;max-height:84px}
.loadout-overview .loadout-slot .equipment-art,.loadout-overview .loadout-slot .item-art{height:calc(100% - 19px);width:auto;aspect-ratio:1}
.loadout-overview .loadout-bag{display:flex;flex-direction:column;flex:1;min-height:0;margin-top:6px;padding-top:8px}
.loadout-overview .loadout-bag h4,.loadout-overview .bag-filters{flex:none}
.loadout-overview .loadout-bag-grid{flex:1;min-height:0;max-height:none;overflow-y:auto;align-content:start;overscroll-behavior:contain;touch-action:pan-y}
.loadout-overview #loadoutDone{display:none}
.library-overview .library-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;padding:2px 3px 10px}
.library-overview .library-heading{margin-bottom:10px}
.loadout-overview .loadout-slot.empty-equipment{background:linear-gradient(145deg,#0b1a22,#061018);border-color:#68797588;box-shadow:inset 0 2px 8px #0009}
.loadout-overview .empty-equipment .equipment-art,.loadout-overview .empty-equipment .item-art{filter:brightness(0) invert(.65);opacity:.22}
.loadout-overview .empty-equipment small{color:#a1b1af;font:11px/1.2 GardenText,serif}
@media(max-height:620px){.loadout-overview .loadout-figure{height:150px}.loadout-overview .loadout-slot small{font-size:10px;padding:1px 3px}.loadout-overview .loadout-total{padding:5px 0}.loadout-overview .bag-filters button{width:36px;height:36px}.home-ui .modal.loadout-overview{padding:8px 12px}}

.bag-filters svg{width:28px;height:28px;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.bag-filters button{display:grid;place-items:center}

.starting-magic-button{display:flex;align-items:center;gap:10px;flex:none;text-align:left;border:1px solid #9e8956;border-radius:10px;background:#10232b;color:#e5d6ad;padding:7px 10px;margin:0 0 12px;font:12px GardenText,serif}.starting-magic-button>.spell-art{width:38px;height:38px;flex:none}.starting-magic-button strong{display:block;font-weight:400;font-size:14px}.starting-magic-button>span:last-child{margin-left:auto}

.ability-control{display:flex;flex-direction:column;align-items:center;gap:5px}.active-spells .ability-auto{width:58px;min-width:58px;height:28px;min-height:28px;padding:3px;border-radius:9px;font-size:10px;letter-spacing:.5px;background:#14232b;color:#b8c4c8}.active-spells .ability-auto:before{display:none}.active-spells .ability-auto[aria-pressed=true]{color:#ffe6ad;border-color:#c5aa6d;background:#403b2a}

.gold-mark{display:inline-block;width:38px;height:38px;border-radius:50%;border:3px solid #b69248;background:radial-gradient(circle at 35% 30%,#ffe7a3,#bb8736 70%);box-shadow:inset 0 0 0 3px #e5bd69,0 3px 7px #0006}.reward-gold{display:flex;align-items:center;gap:12px;justify-content:center}

/* 0.149: keep preparation panels inside short landscape viewports. */
@media (orientation:landscape) and (max-height:560px){
 #game.home-ui{min-height:0;height:100svh}
 .home-ui #overlay:has(.loadout-overview),.home-ui #overlay:has(.library-overview){padding:8px 0 calc(66px + env(safe-area-inset-bottom,0px))}
 .home-ui .modal.loadout-overview{width:min(740px,calc(100vw - 24px));max-width:none;display:grid;grid-template-columns:minmax(220px,1fr) minmax(240px,1fr);grid-template-rows:24px minmax(0,1fr) auto;gap:4px 16px}
 .loadout-overview>h3{grid-column:1;grid-row:1;margin:0}
 .loadout-overview .loadout-figure{grid-column:1;grid-row:2;height:100%;min-height:0;margin:0}
 .loadout-overview .loadout-total{grid-column:1;grid-row:3;margin:0;padding:3px 0;font-size:11px}
 .loadout-overview .loadout-bag{grid-column:2;grid-row:1 / 4;margin:0;padding:0}
 .loadout-overview .loadout-note{grid-column:1 / -1;grid-row:4;margin:0;font-size:10px}
 .loadout-overview .loadout-bag h4{margin:0 0 4px}
 .loadout-overview .loadout-slot{max-height:none}
}

#summonResult .summon-reveal{width:150px;margin:12px auto 18px;padding:10px;display:flex;flex-direction:column;align-items:center;background:linear-gradient(145deg,#203b45,#071620);border-radius:14px}
.summon-reveal>.item-art,.summon-reveal>.equipment-art,.summon-reveal>.spell-art{width:96px!important;height:96px!important;flex:none}
.summon-reveal>span:not(.item-art):not(.equipment-art):not(.spell-art){font:13px/1.5 GardenText,serif;margin-top:6px}
.summon-reveal>small{font:11px/1.5 GardenText,serif;color:#d2c6a4}

.art-loading progress{display:block;width:min(240px,100%);height:8px;margin:16px auto;accent-color:#d7b977}.art-loading small{display:block;font-size:12px}.art-loading p{font-size:16px}

.chest-level{font-size:16px;color:#cabd98}.chest-upgrades{list-style:none;padding:8px 6px;margin:10px 0 0;border-radius:8px;background:#071822d9;color:#eee5cd;font:14px/1.6 Georgia,serif;text-align:center}
.summon-shop{height:calc(100svh - 90px);max-height:900px;max-width:640px;display:flex;flex-direction:column;padding:18px!important;overflow:hidden!important}.summon-wallet{display:flex;align-items:center;gap:16px;flex:none;border-bottom:1px solid #a58c5966;padding-bottom:14px}.summon-wallet h3{margin:0 auto 0 0;font-size:18px}.summon-wallet>span,.summon-buy{display:flex;align-items:center;justify-content:center;gap:8px}.summon-wallet .seed-mark,.summon-buy .seed-mark{display:inline-block;width:23px;height:23px;border-radius:0;background:url('relics.png') 50% 100%/300% 200%;filter:drop-shadow(0 1px 2px #0008)}.summon-shelf{overflow-y:auto;min-height:0;padding:16px 0;display:grid;gap:18px}.summon-banner{position:relative;border:1px solid #9d875a;border-radius:16px;background:radial-gradient(ellipse at 50% 45%,#69897540,transparent 65%),linear-gradient(135deg,#102c35,#081920);padding:16px;text-align:center;box-shadow:inset 0 0 0 4px #08141b99}.summon-banner.premium{border-color:#ccae72;background:radial-gradient(ellipse at 50% 45%,#a490d65c,transparent 68%),linear-gradient(135deg,#25283e,#0e1c2a)}.summon-banner h3{font-size:18px;margin:0 0 6px}.summon-chest-preview{position:relative;background:none;border:0;display:block;margin:auto;padding:0;width:180px;height:130px}.summon-chest-preview .reward-chest{width:180px;height:130px;filter:drop-shadow(0 0 15px #d3bc7955)}.premium .reward-chest{filter:brightness(1.25) drop-shadow(0 0 18px #ba9bff99)}.summon-info-mark{position:absolute;right:0;bottom:0;font-size:22px;color:#e5d6aa}.summon-preview-items{display:flex;justify-content:center;gap:12px;margin:4px 0}.summon-preview-items>*{width:35px!important;height:35px!important;object-fit:contain}.summon-banner>small{display:block;font-size:13px;margin:8px}.summon-buy{margin:12px auto 0!important;width:100%;min-height:52px!important}.summon-buy>span:last-child{margin-left:8px}.summon-info{text-align:center}.summon-info>.reward-chest{width:140px;height:120px;margin:auto}.summon-rates p{display:flex;justify-content:space-between;font-size:14px}.summon-stage{position:relative;isolation:isolate;overflow:hidden;min-height:440px;display:flex;flex-direction:column;align-items:center;justify-content:center;--summon-glow:#90c7dd}.summon-stage.grade-2{--summon-glow:#c6a1ff}.summon-stage.grade-3{--summon-glow:#ffcc65}.summon-open{border:0;background:transparent;z-index:1;padding:20px;cursor:pointer}.summon-open .reward-chest{width:230px;height:200px;animation:summon-hover 1.7s ease-in-out infinite;filter:drop-shadow(0 0 18px var(--summon-glow))}.summon-orbit{position:absolute;width:250px;height:250px;border-radius:50%;border:1px solid var(--summon-glow);box-shadow:0 0 25px var(--summon-glow),inset 0 0 30px #b7d7d522;transform:rotateX(60deg);top:42%;z-index:-1}.summon-rays{position:absolute;inset:0;opacity:.25;background:repeating-conic-gradient(from 0deg at 50% 46%,transparent 0deg 20deg,var(--summon-glow) 23deg 25deg,transparent 28deg 45deg);mask-image:radial-gradient(ellipse,black,transparent 65%);z-index:-1}.opened .summon-rays{animation:summon-flare 1s ease-out both}.opened .summon-open{display:none}.summon-prize{text-align:center;animation:spoils-reveal .65s ease-out both}.summon-prize .summon-reveal{width:180px;min-height:180px;margin:0 auto 18px;box-shadow:0 0 35px var(--summon-glow)}.summon-prize h3{font-size:20px}.summon-prize>strong{display:block;color:var(--summon-glow);margin-bottom:24px}.summon-stage [hidden]{display:none!important}@keyframes summon-hover{50%{transform:translateY(-10px) scale(1.025)}}@keyframes summon-flare{0%{opacity:1;transform:scale(.7)}50%{opacity:.8}100%{opacity:.3;transform:scale(1.4)}}@media(prefers-reduced-motion:reduce){.summon-stage *{animation:none!important}}
.summon-shop .summon-wallet{position:static;pointer-events:auto;inset:auto}.summon-shop .summon-buy{display:flex!important;flex-direction:row!important;height:54px;line-height:1;align-items:center;justify-content:center}.summon-prize .summon-reveal{display:flex;align-items:center;justify-content:center;background:radial-gradient(ellipse,#315062,#081922);border:1px solid var(--summon-glow);border-radius:14px}.summon-prize .summon-reveal>*{width:135px!important;height:135px!important;object-fit:contain}.summon-grade-rates{display:grid;grid-template-columns:1fr;gap:2px}.summon-grade-rates h4{margin:12px 0 2px}.summon-grade-rates p{margin:2px;font-size:13px}

/* Chest anticipation precedes the already-saved reward reveal. */
.charging .summon-open .reward-chest{animation:summon-charge 1.1s ease-in both}
.charging .summon-orbit{animation:summon-gather 1.1s ease-in both}
.charging .summon-rays{animation:summon-gather-rays 1.1s ease-in both}
@keyframes summon-charge{0%{transform:translateY(0) rotate(0)}35%{transform:translateY(-8px) rotate(-3deg)}55%{transform:translateY(-8px) rotate(3deg)}70%{transform:translateY(-8px) rotate(-4deg)}85%{transform:translateY(-8px) rotate(4deg);filter:brightness(1.2) drop-shadow(0 0 22px var(--summon-glow))}100%{transform:translateY(-12px) scale(1.12);filter:brightness(1.7) drop-shadow(0 0 36px var(--summon-glow))}}
@keyframes summon-gather{from{transform:rotateX(60deg) scale(1.3);opacity:.4}to{transform:rotateX(60deg) scale(.8);opacity:1}}
@keyframes summon-gather-rays{from{opacity:.15;transform:rotate(-12deg) scale(1.1)}to{opacity:.65;transform:rotate(12deg) scale(.9)}}

.gem-picker-dialog[open]{display:flex;flex-direction:column;height:calc(100svh - 32px);max-height:860px;overflow:hidden;box-sizing:border-box}
.gem-picker-dialog .magic-detail-header,.gem-picker-target,.gem-picker-dialog>#backGearDetail{flex:none}
.gem-picker-target{font-size:14px;margin:10px 0 16px;color:#cfcaad}
.gem-picker-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;align-content:start;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:4px;flex:1}
.gem-picker-grid .inventory-item{position:relative;min-width:0;width:100%;height:105px;margin:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
.gem-picker-grid .inventory-item>.icon{width:68px;height:68px;flex:none}
.gem-picker-grid .inventory-item>small{position:static;font-size:12px;line-height:1.2;width:100%;background:#071822e6}
.gem-owner-mark{position:absolute;top:1px;right:1px;font-size:10px;background:#203338ee;color:#e5d995;padding:2px 4px;border-radius:4px}
.gem-picker-empty{grid-column:1/-1;font-size:14px;line-height:1.8}
.gem-picker-dialog>#backGearDetail{margin-top:16px}

.gear-detail-summary>.spell-art{width:96px;height:96px;flex:0 0 96px;margin:0}
.gear-detail-summary>div{min-width:0}

.loadout-bag-grid [data-bag-gem]>.spell-art{width:56px;height:56px;display:block;margin:auto}
.gem-destinations{max-height:60svh;overflow-y:auto;overscroll-behavior:contain}.gem-destinations h4{display:flex;align-items:center;gap:10px;font-size:13px;margin:12px 0}.gem-destinations h4>.item-art,.gem-destinations h4>.equipment-art{width:44px;height:48px;flex:none}.gem-destinations section>div{display:grid;grid-template-columns:1fr 1fr;gap:8px}.gem-destinations button{background:#102a32;border:1px solid #9f895866;border-radius:10px;min-height:76px;font-size:12px;padding:6px}.gem-destinations button>.spell-art{width:36px;height:36px;display:block;margin:0 auto 4px}.gem-destinations button:disabled{opacity:.45}

.gem-destination-dialog[open]{display:flex;flex-direction:column;max-height:calc(100svh - 32px);overflow:hidden}.gem-destination-selected{display:flex;align-items:center;gap:12px;font-size:13px;line-height:1.6;margin:12px 0;flex:none}.gem-destination-selected>.spell-art{width:52px;height:52px;flex:0 0 52px}.gem-destination-dialog>.gem-destinations{flex:1;min-height:0;max-height:none}.gem-destination-dialog>.magic-detail-header,.gem-destination-dialog>#gemDestinationBack{flex:none}.gem-destinations button>span:last-child{display:block;line-height:1.5}

/* Keep the exit visible while reading long equipment or magic details. */
.magic-detail-dialog>.magic-detail-header{position:sticky;top:0;z-index:2;margin:0 -18px;padding:14px 18px;background:#102732}

.gear-detail-summary>.relic-trait-badge,.gem-destinations h4>.relic-trait-badge{display:none}

.battle #saveBackup{display:none}#backupPreview p{font-size:13px;line-height:1.8}#backupPreview>.primary{display:block;margin:12px auto}

.home-profile #saveBackup{flex:none;width:36px;height:36px;padding:7px;border:1px solid #a4895988;border-radius:50%;background:#102732;color:#e4d2ab}

/* Equipment rarity remains visible after the summon reveal. */
.inventory-item.grade-1{--rarity-edge:#90c7dd;--rarity-tint:#163847}
.inventory-item.grade-2{--rarity-edge:#c6a1ff;--rarity-tint:#302342}
.inventory-item.grade-3{--rarity-edge:#ffcc65;--rarity-tint:#44351b}
.inventory-item:is(.grade-1,.grade-2,.grade-3):not(.locked){border:2px solid var(--rarity-edge);background:linear-gradient(145deg,var(--rarity-tint),#081824 80%);box-shadow:inset 0 0 0 1px #07151e,inset 0 0 12px var(--rarity-tint)}
.inventory-item:is(.grade-1,.grade-2,.grade-3).selected{outline:2px solid #fff3ce;outline-offset:2px}

.summon-multiple{width:min(560px,96vw);max-height:94svh;padding:22px 16px}
.summon-multiple .summon-prize{width:100%;min-height:0;overflow-y:auto}
.summon-results{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:4px}
.summon-result{min-height:84px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-direction:column;animation:spoils-reveal .35s both;animation-delay:var(--reveal-delay)}
.summon-result>.item-art,.summon-result>.equipment-art,.summon-result>.spell-art{width:58px;height:58px;aspect-ratio:1;object-fit:contain;margin:0}
.summon-result>small{font-size:11px;line-height:1.3;color:#f0e6d1}
.summon-multiple #summonReceive{flex:none;margin:12px auto 0}
@media(min-width:600px){.summon-results{grid-template-columns:repeat(5,minmax(0,1fr))}}

.fusion-entry{float:right;border:1px solid #cbb37c;border-radius:6px;background:#203640;color:#f2dfac;padding:5px 18px;min-height:34px}.loadout-bag h4:has(.fusion-entry){min-height:36px}
.fusion-list{display:grid;gap:10px}.fusion-row{display:flex;align-items:center;justify-content:center;gap:20px;background:#10242d;border:1px solid #8a794f;border-radius:10px;padding:8px;color:#e9d6a2}.fusion-row:disabled{opacity:1}.fusion-row .inventory-item{width:80px;display:flex;flex-direction:column;align-items:center;border-radius:8px}.fusion-row .item-art,.fusion-row .spell-art,.fusion-row .equipment-art{width:60px;height:60px;object-fit:contain}.fusion-row small{font-size:13px}

/* Reserve the bottom strip for the ward gauge, below the character. */
.battle .left-info{bottom:calc(7px + env(safe-area-inset-bottom,0px));width:135px;z-index:2}
.battle footer{bottom:calc(40px + env(safe-area-inset-bottom,0px))}

:root{--ward-safe-bottom:env(safe-area-inset-bottom,0px)}

button.damage-row{width:100%;border:0;border-radius:8px;background:#0d26324d;padding:5px;text-align:left;min-height:48px}.damage-row[aria-expanded="true"]{outline:1px solid #cdb780}.damage-explanation{font:12px/1.6 GardenText,serif;color:#e8dfc8;background:linear-gradient(#081b244d,#081b2477),url('folio.webp') center/cover;padding:10px;border:1px solid #baa36e55;border-left:2px solid #baa36e;box-shadow:inset 0 1px 0 #f0d79818;margin:0 0 12px}.damage-explanation[hidden]{display:none}

.starting-magic-entry{display:flex;align-items:center;gap:12px;flex:none;border:1px solid #b69d69;border-radius:10px;background:#102c37;padding:8px 12px;text-align:left;margin:4px 0 12px;width:100%}.starting-magic-entry>.spell-art{width:44px;height:44px}.starting-magic-entry>span{font-size:12px;line-height:1.7}.starting-magic-entry>span:last-child{margin-left:auto;font-size:24px}

/* Visible offered/owned combinations only; never reveal locked recipes. */
.fusion-source{display:flex;align-items:center;justify-content:center;gap:4px;margin:4px auto 8px;width:max-content;padding:3px 7px;border:1px solid #c8b77e;border-radius:20px;background:#10252e}.fusion-source .spell-art{width:27px!important;height:27px!important;margin:0!important;flex:none}.fusion-source>span:not(.spell-art){font-size:13px;color:#eadba5}

/* Keep battle controls inside short landscape viewports. */
#game.battle{min-height:0;height:100svh}
@media(orientation:landscape) and (max-height:560px){.battle header{top:max(10px,env(safe-area-inset-top));left:max(16px,env(safe-area-inset-left));right:max(16px,env(safe-area-inset-right))}.battle footer{left:max(16px,env(safe-area-inset-left));right:max(16px,env(safe-area-inset-right));flex-direction:row;align-items:flex-end}.battle #bossbar{top:48px}}

@media(orientation:landscape){#game.battle{background:linear-gradient(#061820c9,#061820e8),url('garden.webp') center/cover}}

/* Compact summon odds: the same rarity colors as owned equipment. */
.summon-probability{width:100%;border-collapse:collapse;table-layout:fixed;font-size:13px;margin:10px 0}.summon-probability caption{font-size:12px;margin-bottom:8px}.summon-probability th,.summon-probability td{padding:9px 2px;border-bottom:1px solid #bda56b35;text-align:center;font-weight:normal}.summon-probability th:first-child{width:28%;font-size:12px}.summon-probability .rate-art{display:flex;justify-content:center;margin-bottom:5px}.rate-art>*{display:block;width:42px!important;height:42px!important;object-fit:contain}.rate-grade-1{color:#90c7dd}.rate-grade-2{color:#c6a1ff}.rate-grade-3{color:#ffcc65}.summon-probability th i{display:inline-block;width:7px;height:7px;border:1px solid currentColor;background:currentColor;transform:rotate(45deg);margin-right:4px}.summon-info>small{display:block;font-size:11px;margin:10px 0}.summon-info>.primary{margin-top:12px}

/* HUD overlays the garden; it never reduces the rendered battlefield height. */
.battle footer{bottom:calc(35px + env(safe-area-inset-bottom,0px));gap:10px}
.battle .active-spells{gap:7px}.battle .active-spells #freeze,.battle .active-spells #nova{width:38px;height:38px;min-width:38px;min-height:38px;padding:0}.battle .active-spells #freeze>.spell-art,.battle .active-spells #nova>.spell-art{width:34px;height:34px}.battle .active-spells .ability-auto{width:40px;min-width:40px;height:24px;min-height:24px;font-size:9px}.battle .ability-control{gap:4px}
@media(max-width:760px){.battle .spellbook{max-width:calc(100% - 94px);padding-left:34px}.battle .spellbook #spells{display:grid;grid-template-columns:repeat(4,32px);gap:5px 4px;overflow:visible}.battle .spellbook .spell{height:35px}.battle footer{left:10px;right:10px}.battle .active-spells{gap:5px}}


.gem-organizer{flex:none;min-width:0}.gem-effect-filters{display:flex;gap:5px;overflow-x:auto;padding:4px 0}.gem-effect-filters button{flex:0 0 34px;width:34px;height:34px;padding:2px;border:1px solid #758e90;border-radius:7px;background:#102a32}.gem-effect-filters .spell-art{display:block;width:28px;height:28px}.gem-effect-filters button[aria-pressed=true]{border-color:#f5d68a;background:#65532d;box-shadow:inset 0 0 0 1px #f5d68a}.gem-sort-controls{display:flex;gap:6px;align-items:center;padding:3px 0 6px}.gem-sort-controls select{max-width:40%;min-width:0;background:#102a32;color:#f0e3bf;border:1px solid #758e90;border-radius:6px;padding:5px;font-size:12px}.gem-sort-controls span{font-size:11px;color:#c6d8d4;margin-left:auto}

@media(max-width:760px) and (min-height:621px){.loadout-overview:has(.gem-organizer) .loadout-figure{height:155px;min-height:155px}.loadout-overview:has(.gem-organizer) .loadout-total{padding:5px 0;margin:4px 0}.loadout-overview:has(.gem-organizer) .loadout-bag h4{margin:4px 0}}

.loadout-overview:has(.gem-organizer) .bag-filters button{width:32px;height:32px;min-width:32px;padding:3px}.loadout-overview:has(.gem-organizer) .bag-filters{gap:4px;margin:3px 0;padding:2px 0}.loadout-overview:has(.gem-organizer) .fusion-entry{min-height:28px;padding:4px 10px}.loadout-overview:has(.gem-organizer) .loadout-bag h4{margin:2px 0}

#saveText{box-sizing:border-box;width:100%;min-height:100px;max-height:160px;font-size:16px;color:#f0eadb;background:#102732;border:1px solid #a48959;padding:10px}#storageStatus{font-size:13px;line-height:1.5}

/* Compact portrait: retain fixed slots while leaving usable inventory rows. */
@media(max-width:760px) and (min-height:621px) and (max-height:720px){
 .home-ui #overlay:has(.loadout-overview){padding-top:24px;padding-bottom:calc(78px + env(safe-area-inset-bottom,0px))}
 .loadout-overview .loadout-figure{height:165px;min-height:165px;margin-bottom:4px}
 .loadout-overview .loadout-total{margin:4px 0;padding:5px 0}
 .loadout-overview .loadout-bag{margin-top:4px;padding-top:4px}
 .loadout-overview .loadout-bag h4{margin:4px 0}
}

/* Result fragments lead to permanent magic growth. */
.fragment-reward{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;min-width:48px;min-height:62px;padding:6px;background:#10252a;border:1px solid #69716a;border-radius:7px}.fragment-reward.upgrade-ready{border-color:#c6dca0;box-shadow:inset 0 0 12px #b6d67c24}.upgrade-arrow{position:absolute;right:-3px;top:-7px;width:20px;height:20px;border-radius:50%;background:#bed49b;color:#152d20;font:bold 17px Georgia,serif}.fragment-reward:focus-visible{outline:2px solid #f1d98a;outline-offset:3px}

.fusion-results{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0}.fusion-results .inventory-item{width:100%;min-width:0;height:90px}.fusion-results .inventory-item>.item-art,.fusion-results .inventory-item>.spell-art{width:68px;height:68px}

.gear-detail-summary>.gear-detail-art{width:100px;height:112px;flex:0 0 100px;display:flex;align-items:center;justify-content:center;padding:4px}.gear-detail-art>.item-art,.gear-detail-art>.equipment-art{width:88px;height:100px;margin:0}.gear-detail-art>.relic-trait-badge{display:none}

.gear-detail-art>.spell-art{width:88px;height:96px;margin:0;flex:none}

.result .found-relic.inventory-item{position:relative;width:80px;height:90px;padding:5px;display:flex;flex-direction:column;align-items:center;justify-content:center}.result .found-relic.inventory-item>.spell-art,.result .found-relic.inventory-item>.item-art{width:60px;height:60px;margin:0;flex:none}.found-relic[data-found-gem]>small{font-size:11px;line-height:16px;position:static}

.found-relics{flex-wrap:wrap}.result .found-relic.inventory-item>.relic-trait-badge{display:none}

/* Starting gems: spell silhouette plus a consistent diamond/start emblem. */
.starting-gem-art{position:relative;display:inline-block;width:64px;height:64px;flex-shrink:0}.starting-gem-art>.spell-art{width:100%!important;height:100%!important}.starting-gem-art>svg{position:absolute;right:0;bottom:0;width:24px;height:24px;fill:#102c37;stroke:#eadb98;stroke-width:1.5}.starting-gem-art>svg path+path{fill:#eadb98;stroke:none}.gear-detail-art>.starting-gem-art{width:88px;height:96px}

/* A high-grade ten-pull reward receives a visual moment before the collection. */
.summon-feature{position:relative;isolation:isolate;display:flex;align-items:center;justify-content:center;gap:14px;width:100%;min-height:126px;margin:0 0 12px;padding:10px 14px;border:0;background:transparent;color:var(--summon-glow);overflow:hidden;border-radius:16px;animation:summon-feature-in .7s ease-out both}
.summon-feature>.item-art,.summon-feature>.equipment-art,.summon-feature>.spell-art,.summon-feature>.starting-gem-art{position:relative;z-index:1;width:96px!important;height:104px!important;flex:none;filter:drop-shadow(0 0 12px var(--summon-glow))}
.summon-feature-aura{position:absolute;inset:0;z-index:-1;background:radial-gradient(ellipse at 32% 50%,var(--summon-glow),transparent 65%);opacity:.27}
.summon-feature-caption{display:flex;flex-direction:column;align-items:flex-start;gap:7px;text-align:left}.summon-feature-caption strong{font-size:21px;letter-spacing:.08em;text-shadow:0 0 14px var(--summon-glow)}.summon-feature-caption small{font-size:12px;color:#f3ead7}
.summon-result{position:relative;overflow:hidden}.summon-result.grade-2:after,.summon-result.grade-3:after{content:'';pointer-events:none;position:absolute;inset:-40%;background:linear-gradient(110deg,transparent 40%,#ffffff99 50%,transparent 60%);transform:translateX(-130%);animation:summon-card-glint .75s ease-out both;animation-delay:calc(var(--reveal-delay) + .2s)}
.summon-result>.starting-gem-art{width:58px;height:58px;margin:0}
@keyframes summon-feature-in{from{opacity:0;transform:scale(.82);filter:brightness(1.8)}to{opacity:1;transform:scale(1);filter:brightness(1)}}
@keyframes summon-card-glint{to{transform:translateX(130%)}}
@media(prefers-reduced-motion:reduce){.summon-feature,.summon-result:after{animation:none!important}.summon-result:after{display:none}}

.gem-status-filters{display:flex;gap:8px;margin:8px 0}.gem-status-filters button{width:44px;height:44px;display:grid;place-items:center;border:1px solid #677e86;border-radius:8px;background:#102a34;color:#b8cbd0}.gem-status-filters button[aria-pressed=true]{border-color:#edcf86;background:#51452a;color:#fff0bd}.gem-status-filters svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7}
.gem-effect-filters .starting-gem-art{display:block;width:28px;height:28px}.gem-effect-filters .starting-gem-art>svg{width:12px;height:12px}

.gem-sort-controls .gem-filter-reset{flex:none;width:44px;height:44px;padding:8px;border:1px solid #bba26b;border-radius:7px;color:#f0db9e;background:#20353c}.gem-filter-reset svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7}

/* Destination previews retain inventory rarity cues. */
.gem-destination-selected>.inventory-item,.gem-destinations h4>.inventory-item,.gem-destinations button>.inventory-item{width:54px;height:58px;min-width:54px;flex:0 0 54px;display:block;position:relative;padding:3px;margin:0;overflow:hidden}.gem-destinations button>.inventory-item{margin:0 auto 5px}.gem-destination-selected>.inventory-item .spell-art,.gem-destinations .inventory-item .spell-art,.gem-destinations .inventory-item .item-art,.gem-destinations .inventory-item .equipment-art{width:100%;height:100%}.gem-destinations .inventory-item>.relic-trait-badge{display:none}

/* Preserve the wizard lighting beneath the battle HUD. */
.battle .vignette{background:linear-gradient(#04111b55,transparent 20%,transparent 74%,#05121c44)}

/* Keep socketed gem rarity visible in equipment details. */
.gear-gem-list .socket-gem-art{display:block;position:relative;width:54px;height:58px;min-width:54px;flex:0 0 54px;padding:3px;margin:0;overflow:hidden}.gear-gem-list .socket-gem-art .spell-art{width:100%;height:100%}

/* Keep every equipment category visible without horizontal scrolling. */
.loadout-overview .bag-filters{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));overflow:visible;gap:4px}
.loadout-overview .bag-filters button,.loadout-overview:has(.gem-organizer) .bag-filters button{width:100%;min-width:0;height:44px;padding:3px}
@media(max-width:360px){.loadout-overview .bag-filters{grid-template-columns:repeat(4,minmax(0,1fr))}}

@media(max-width:760px) and (max-height:720px){
 .loadout-overview:has(.gem-organizer) .loadout-figure{height:155px;min-height:155px;margin-bottom:0}
 .loadout-overview:has(.gem-organizer) .loadout-total{display:none}
 .loadout-overview:has(.gem-organizer) .loadout-bag{margin-top:2px;padding-top:2px}
}

@media(max-width:360px) and (max-height:720px){
 .loadout-overview:has(.gem-organizer) .bag-filters{grid-template-columns:repeat(8,minmax(0,1fr));gap:2px}
 .loadout-overview:has(.gem-organizer) .bag-filters svg{width:24px;height:24px}
}

.gem-status-filters .gem-filter-reset{margin-left:auto;border-color:#bba26b;color:#f0db9e;background:#20353c}

@media(max-width:760px) and (max-height:720px){.loadout-overview .gem-status-filters{margin:4px 0}}

.summon-stage.skipped *,.summon-stage.skipped *::after{animation:none!important}.summon-stage.skipped .summon-result::after{display:none}

/* Show the actual consumed pieces only on the fusion confirmation. */
.fusion-materials{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin:-4px 0 8px}.fusion-materials .inventory-item{width:calc(20% - 6px);min-width:44px;max-width:72px;display:flex;flex-direction:column;align-items:center;padding:3px;border-radius:6px}.fusion-materials .item-art,.fusion-materials .spell-art{width:38px;height:38px;flex:none}.fusion-materials small{font-size:10px;line-height:1.3;text-align:center;overflow-wrap:anywhere}

.armor-fusion-choices .inventory-item[aria-pressed="true"]{outline:3px solid #ffe39a;outline-offset:2px;background-color:#655333}.armor-fusion-choices{max-height:45vh;overflow-y:auto;padding:5px}

.fusion-materials .equipment-art{width:38px;height:38px;flex:none;object-fit:contain}.armor-fusion-dialog[open]{display:flex;flex-direction:column;height:min(700px,calc(100dvh - 40px));overflow:hidden}.armor-fusion-dialog>.armor-fusion-choices{flex:1;min-height:0;max-height:none;overflow-y:auto;align-content:flex-start}.armor-fusion-dialog>:not(.armor-fusion-choices){flex-shrink:0}.armor-fusion-dialog>.primary{margin:10px auto}.armor-fusion-dialog>.details-toggle{margin:4px auto 0}

/* Upgrade availability should remain legible on a phone without extra copy. */
.mastery-ready{width:19px;height:19px;right:5px;top:5px;background:#bed49b;border:1px solid #deedbd;box-shadow:0 1px 4px #06150f99;display:grid;place-items:center}.mastery-ready::before{content:"";width:11px;height:12px;background:#193d2c;clip-path:polygon(50% 0,100% 45%,70% 45%,70% 100%,30% 100%,30% 45%,0 45%)}
.gem-destinations .gem-value-label{position:absolute;bottom:0;left:0;right:0;background:rgba(5,18,23,.9);color:#fff2c9;font:700 12px/17px system-ui;text-align:center;white-space:nowrap;text-shadow:none}

/* 0.304: lift menu surfaces without brightening text, art or combat. */
.loadout-overview,.magic-library{background-image:linear-gradient(145deg,#25434e99,#19333e99),url('folio.webp');border-color:#b4a07499}
.loadout-overview .inventory-item,.library-overview .mastery-book{background:linear-gradient(145deg,#355360,#182c38 85%)}
.loadout-overview .loadout-slot.empty-equipment{background:linear-gradient(145deg,#213640,#12232e);box-shadow:inset 0 2px 6px #0005}
.loadout-overview .empty-equipment .equipment-art,.loadout-overview .empty-equipment .item-art{opacity:.35}

/* Non-combat surfaces: retain the engraved artwork and lift its dark overlay. */
.home-ui .intro,.summon-shop,.result{background-image:linear-gradient(145deg,#25434e99,#19333e99),url('folio.webp')}
.home-ui .stage-centre{background-image:linear-gradient(#27465199,#1b3540aa),url('folio.webp')}
.summon-banner{background:radial-gradient(ellipse at 50% 45%,#8eaf8455,transparent 65%),linear-gradient(135deg,#294650,#172e38)}
.summon-banner.premium{background:radial-gradient(ellipse at 50% 45%,#b59cdd66,transparent 68%),linear-gradient(135deg,#3a3c55,#233443)}

.magic-detail-dialog{background-image:linear-gradient(145deg,#25434ecc,#19333ecc),url('folio.webp')}
.magic-detail-dialog>.magic-detail-header{background-color:#24414c;background-image:linear-gradient(135deg,#47636466,#18333f88),url('folio.webp');background-position:center 12%;background-size:cover;border-bottom-color:#d8bd7c88;box-shadow:0 3px 8px #061b2422,inset 0 1px 0 #f3dfaa22}

/* 0.307: moonlit highlights, teal depth, and warmer engraved edges. */
.loadout-overview,.magic-library{background-image:radial-gradient(ellipse at 22% 0%,#e1c97825,transparent 48%),radial-gradient(ellipse at 95% 72%,#36b6a526,transparent 62%),linear-gradient(135deg,#183d4899,#142935b0),url('folio.webp');border-color:#d7ba7eaa;box-shadow:inset 0 1px 0 #ffe4aa55,inset 0 0 24px #52a99d12,0 8px 24px #0005}
.loadout-overview .inventory-item,.library-overview .mastery-book{background:radial-gradient(ellipse at 50% 32%,#48786b66,transparent 78%),linear-gradient(145deg,#294956,#122632 85%)}
.loadout-overview .inventory-item .item-art,.loadout-overview .equipment-art,.library-overview .spell-art{filter:brightness(1.12) saturate(1.2) drop-shadow(0 2px 3px #000)}
.loadout-overview .empty-equipment .equipment-art,.loadout-overview .empty-equipment .item-art{filter:brightness(0) invert(.65)}

/* Starting spell choices retain the actual item's rarity and visual identity. */
.starting-magic-list .starting-item-art{width:48px;height:52px;flex:0 0 48px;display:flex;align-items:center;justify-content:center;overflow:hidden;border-radius:8px}
.starting-magic-list .starting-item-art .item-art,.starting-magic-list .starting-item-art .gem-art{width:42px;height:46px;margin:0;flex:none}
.starting-magic-list button[aria-pressed="true"]{outline:2px solid #edd493;outline-offset:-2px;background:#284844}
.starting-magic-list button>span:last-child{min-width:0;overflow-wrap:anywhere}

@media(max-width:760px){.battle .spellbook #spells.many-spells{grid-template-columns:repeat(2,32px)}}

/* Added explosions share an identity in choices, details, and damage results. */
.spell-art.effect-parent{position:relative;overflow:visible}.spell-art.effect-parent>.effect-overlay{position:absolute;display:block;right:-3%;bottom:-3%;width:48%;height:48%;border:1px solid #e5b879;border-radius:50%;background:#143139;box-shadow:0 1px 4px #051118}.spell-art.effect-parent>.effect-overlay>.spell-art{display:block;width:100%;height:100%;margin:0}
@media(max-width:760px){.choices .card>.spell-art{width:100%;height:auto;aspect-ratio:1}.choices .card>.fusion-source{max-width:100%;box-sizing:border-box;gap:2px;padding:2px}.choices .card>.fusion-source>.spell-art{width:28px;height:28px;flex-shrink:1}}

/* Short phones keep all ten rewards readable; only the duplicate feature shrinks. */
@media(max-width:599px) and (max-height:650px){
 .summon-stage.summon-multiple.opened{height:calc(100svh - 16px - var(--safe-top,env(safe-area-inset-top,0px)) - var(--safe-bottom,env(safe-area-inset-bottom,0px)));max-height:calc(100svh - 16px - var(--safe-top,env(safe-area-inset-top,0px)) - var(--safe-bottom,env(safe-area-inset-bottom,0px)));min-height:0;padding:8px 12px!important}
 .summon-multiple .summon-feature{min-height:60px;height:60px;margin-bottom:4px;padding:0 8px;gap:10px}
 .summon-multiple .summon-feature>.item-art,.summon-multiple .summon-feature>.equipment-art,.summon-multiple .summon-feature>.spell-art,.summon-multiple .summon-feature>.starting-gem-art{width:52px!important;height:56px!important}
 .summon-multiple #summonReceive{margin-top:6px;min-height:48px}
}

#game:has(.summon-stage)>.home-nav{visibility:hidden;pointer-events:none}

.home-ui #overlay:has(.summon-stage){padding:calc(8px + var(--safe-top,env(safe-area-inset-top,0px))) 0 calc(8px + var(--safe-bottom,env(safe-area-inset-bottom,0px)));box-sizing:border-box}

/* Shared visual costs: identical resource art across upgrade screens. */
.upgrade-costs{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin:16px 0}.upgrade-resource{display:flex;align-items:center;justify-content:center;gap:6px;padding:7px 9px;border:1px solid #bca57866;border-radius:8px;background:#163844;font-variant-numeric:tabular-nums}.upgrade-resource-art{display:flex;width:34px;height:36px;align-items:center;justify-content:center;flex:none}.upgrade-resource-art>.item-art,.upgrade-resource-art>.equipment-art{width:34px!important;height:36px!important;object-fit:contain}.upgrade-resource .seed-mark{display:block;width:30px;height:30px;background:url('relics.png') 50% 100%/300% 200%;border-radius:0}.upgrade-resource b{font-size:16px;color:#d3edcf}.upgrade-resource small{font-size:13px;color:#e6dbbd;white-space:nowrap}.upgrade-resource.insufficient b{color:#ffb7a2}.upgrade-resource.insufficient{border-color:#c4856c88}

/* Keep the two draw choices together without shrinking the chest illustration. */
.summon-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
.summon-shop .summon-actions .summon-buy{flex-direction:column!important;gap:5px;height:70px;margin:0!important;padding:7px 4px;min-width:0}
.summon-actions .summon-count{font-size:15px;line-height:1.1}
.summon-actions .summon-price{display:flex;align-items:center;justify-content:center;gap:5px;margin-left:0!important;font-size:17px;line-height:1.1;white-space:nowrap}
.summon-actions .seed-mark,.summon-actions .drop-mark{flex-shrink:0}

/* Keep the upgrade cue away from the staff head and bottom Lv band. */
.loadout-slot>.mastery-ready{left:5px;right:auto;z-index:2}
.loadout-overview .loadout-slot>.item-art,.loadout-overview .loadout-slot>.equipment-art{position:absolute;top:2px;left:50%;transform:translateX(-50%);height:calc(100% - 25px);max-width:calc(100% - 6px);margin:0}

.equipment-rewards>button{display:grid;justify-items:center;gap:3px;min-width:48px;min-height:62px;padding:6px;border:1px solid #69716a;border-radius:7px;background:#10252a;color:#e8dfc8}.equipment-rewards>button:focus-visible{outline:2px solid #f1d98a;outline-offset:3px}

#overlay:has(.result){box-sizing:border-box;padding:calc(8px + var(--safe-top,env(safe-area-inset-top,0px))) 0 calc(8px + var(--safe-bottom,env(safe-area-inset-bottom,0px)))}
#overlay>.result{max-height:100%;overflow-y:auto;overscroll-behavior:contain;box-sizing:border-box}

/* Equipment enhancement plans: visibly separate from the equipment itself. */
.equipment-material-art{display:inline-flex;position:relative;align-items:center;justify-content:center;width:38px;height:44px;flex-shrink:0;box-sizing:border-box;border:1px solid #b49b61;border-radius:4px 4px 7px 3px;background:linear-gradient(90deg,#ac8b50 0%,#f0ddb0 13%,#d8bf87 82%,#a9894b 100%);box-shadow:inset 0 3px 0 #f5e4bb,inset 0 -4px 0 #9a7d49,1px 2px 3px #020b1680;transform:rotate(-4deg)}
.equipment-material-art>.equipment-art,.equipment-material-art>.item-art{display:block;position:static;width:30px;height:33px;margin:0;filter:drop-shadow(0 1px 1px #fff1c4);transform:none}

.field-book{max-height:calc(100dvh - 24px);display:flex;flex-direction:column;box-sizing:border-box}.field-book .book-spread{min-height:0;flex:1;overflow:hidden;align-items:stretch}.field-book .learned-grid{overflow-y:auto;min-height:0;align-content:start;overscroll-behavior:contain}.field-book #learnedDetail{overflow-y:auto;min-height:0}.field-book>button{flex-shrink:0}
@media(max-width:760px){.field-book .book-spread{grid-template-rows:auto minmax(70px,1fr)}.field-book #learnedDetail{max-height:250px}}

.choices{max-height:calc(100dvh - 24px);box-sizing:border-box;display:flex;flex-direction:column}.choices>.cards{flex-shrink:0}.choices>.choice-detail{min-height:0;overflow-y:auto;overscroll-behavior:contain}.choices>#details{flex-shrink:0}

@media(max-height:700px){.summon-info{padding:14px 18px}.summon-info>h3{font-size:18px;margin:0 0 6px}.summon-info>.reward-chest{width:94px;height:72px}.summon-info>p{margin:6px 0}.summon-info .summon-probability{margin:6px 0}.summon-info .summon-probability th,.summon-info .summon-probability td{padding:6px 2px}.summon-info .summon-probability th:first-child{width:34%;white-space:nowrap}.summon-info>small{margin:6px 0}.summon-info>.primary{margin-top:6px}}

@media(max-height:700px){
 #overlay>.result{padding:18px 20px}
 .result>.spell-art{width:60px;height:60px}
 .result>h2{font-size:24px;margin:8px 0}
 .result .reward-objects{margin:8px 0}
 .result .reward-seeds{width:auto;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:12px}
 .result .reward-seeds .item-art{flex:none;width:80px;height:80px;margin:0}
 .result .reward-seeds strong{font-size:28px;margin:0}
}

/* Dedicated summon destinations. */
.summon-pool-tabs{display:flex;gap:12px;margin:12px 0}.summon-pool-tabs button{flex:1;display:flex;align-items:center;justify-content:center;gap:12px;background:#254652;border:1px solid #80978c;border-radius:14px;padding:10px}.summon-pool-tabs button[aria-pressed="true"]{background:#526252;border-color:#edcc79;box-shadow:inset 0 0 18px #f9dc7433}.summon-pool-tabs button>*:first-child{width:42px!important;height:42px!important}.summon-pool-tabs button span:last-child{font-size:17px}

/* Distinct summoning rituals: reliquary ascent / crystal resonance. */
.summon-stage{isolation:isolate;overflow:hidden}
.summon-reliquary{background:radial-gradient(ellipse at 50% 62%,#a9814566,transparent 60%),linear-gradient(150deg,#344f53,#1e303a 70%)}
.summon-crystal{background:radial-gradient(ellipse at 50% 38%,#5688b788,transparent 65%),linear-gradient(150deg,#304b64,#42365d)}
.summon-dais{position:absolute;pointer-events:none;z-index:-1;left:15%;right:15%;top:63%;height:80px;border:2px solid #e0c58999;border-radius:50%;background:radial-gradient(ellipse,#efd49a44,transparent 65%);box-shadow:0 0 25px #ebce6655,inset 0 0 25px #edd38744;transform:perspective(220px) rotateX(45deg)}
.summon-crystal .summon-dais{top:28%;height:230px;left:18%;right:18%;border-color:#b9f7fa88;background:none;transform:rotate(-30deg);box-shadow:0 0 35px #9fdcff66,inset 0 0 25px #afcfff44;animation:crystal-halo 8s linear infinite}
.summon-crystal .summon-open{background:none;border:0;position:relative;overflow:visible}
.summon-crystal .summon-open>.gem-art{display:block;width:170px!important;height:170px!important;margin:auto;filter:drop-shadow(0 0 18px #c1efffcc);animation:crystal-breathe 2.8s ease-in-out infinite}
.summon-crystal-rings{position:absolute;inset:0;border:1px solid #c6fcffa0;border-radius:50%;transform:rotateX(65deg) rotate(-25deg);box-shadow:0 0 18px #b9e7ff88}
.summon-motes{position:absolute;inset:0;pointer-events:none;z-index:-1}
.summon-motes i{position:absolute;left:50%;top:48%;width:4px;height:4px;border-radius:50%;background:#fff8cf;box-shadow:0 0 8px 2px #f1ce7b;transform:rotate(var(--a)) translateY(130px);animation:summon-mote 2.8s ease-in-out infinite;animation-delay:calc(var(--i)*-.17s)}
.summon-crystal .summon-motes i{background:#e6fdff;box-shadow:0 0 10px 3px #b6d6ff}
.summon-reliquary.charging .summon-open{animation:reliquary-charge 1.35s ease-in both}
.summon-crystal.charging .summon-open>.gem-art{animation:crystal-charge 1.6s ease-in both}
.summon-crystal.charging .summon-dais{animation:crystal-halo .7s linear infinite}
.summon-stage.opened .summon-motes{animation:summon-flare 1s ease-out both}
.summon-crystal .summon-rays{background:conic-gradient(from 0deg,transparent,#bff9ff33,transparent 15%,#e5d5ff66,transparent 35%,#bff9ff33,transparent 55%,#e5d5ff66,transparent 75%)}
.summon-reliquary.opened .summon-reveal,.summon-reliquary.opened .summon-feature{animation:reliquary-rise .7s ease-out both}
.summon-crystal.opened .summon-reveal,.summon-crystal.opened .summon-feature{animation:crystal-reveal .8s ease-out both}
@keyframes crystal-halo{to{transform:rotate(330deg)}}
@keyframes crystal-breathe{50%{transform:translateY(-14px) rotate(6deg);filter:drop-shadow(0 0 30px #d8faff)}}
@keyframes summon-mote{50%{opacity:.3;transform:rotate(var(--a)) translateY(155px) scale(.5)}}
@keyframes reliquary-charge{35%{transform:translateY(-5px) rotate(-3deg)}65%{transform:translateY(-8px) rotate(3deg);filter:brightness(1.3)}100%{transform:translateY(-22px) scale(1.12);filter:brightness(2)}}
@keyframes crystal-charge{40%{transform:scale(.85) rotate(-12deg)}100%{transform:scale(1.35) rotate(18deg);filter:brightness(2.5) drop-shadow(0 0 45px #fff)}}
@keyframes reliquary-rise{from{opacity:0;transform:translateY(80px) scale(.75)}to{opacity:1;transform:none}}
@keyframes crystal-reveal{from{opacity:0;transform:scale(.35) rotate(-15deg);filter:brightness(2)}to{opacity:1;transform:none;filter:none}}
@media(prefers-reduced-motion:reduce){.summon-stage *{animation:none!important}}

/* Equipment gallery and jewel constellation have separate reward compositions. */
.summon-reliquary .summon-results{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px;padding:8px 4px}
.summon-reliquary .summon-result{min-height:72px;border-radius:8px 8px 18px 18px;border-bottom:3px solid #ceb784;background:linear-gradient(160deg,#e3d1a322,#243b43 70%);box-shadow:0 8px 10px #081a2444;flex-direction:row;gap:6px;padding:5px}
.summon-reliquary .summon-result small{font-size:11px;max-width:70px}
.summon-crystal.summon-multiple .summon-prize{position:relative;width:100%;padding:0}
.summon-crystal .summon-results{position:relative;display:block;width:min(100%,390px);aspect-ratio:1;margin:14px auto 22px;padding:0;background:radial-gradient(circle,transparent 49%,#c4eaff55 49.5%,transparent 50.5%,transparent 68%,#c4eaff33 69%,transparent 70%)}
.summon-crystal .summon-result{position:absolute;left:var(--gem-x);top:var(--gem-y);width:60px;height:60px;min-height:60px;padding:5px;border-radius:50%;transform:translate(-50%,-50%);background:radial-gradient(circle,#c6c8f044,#33405f);box-shadow:0 0 16px #bcddff33;animation:gem-constellation-in .55s both;animation-delay:var(--reveal-delay)}
.summon-crystal .summon-result small{display:none}
.summon-crystal .summon-result>.spell-art,.summon-crystal .summon-result>.starting-gem-art{width:48px!important;height:48px!important;flex-shrink:0}
.summon-crystal.summon-multiple .summon-feature{position:absolute;z-index:2;left:50%;top:50%;transform:translate(-50%,-50%);width:136px;height:160px;min-height:0;flex-direction:column;gap:0;padding:5px;margin:0;animation:none;background:radial-gradient(ellipse,#e3ddff22,transparent 70%)}
.summon-crystal .summon-feature-caption{align-items:center;text-align:center;gap:3px}
.summon-crystal .summon-feature-caption strong{font-size:16px}
.summon-crystal .summon-feature-caption small{font-size:10px;max-width:124px}
.summon-crystal.summon-multiple .summon-feature>.spell-art,.summon-crystal.summon-multiple .summon-feature>.starting-gem-art{width:84px!important;height:84px!important}
.summon-crystal.opened .summon-dais{opacity:.3}
@keyframes gem-constellation-in{from{opacity:0;transform:translate(-50%,-50%) scale(.2);filter:brightness(2.3)}to{opacity:1;transform:translate(-50%,-50%) scale(1);filter:none}}
@media(max-width:599px) and (max-height:700px){.summon-reliquary .summon-results{gap:5px 10px}.summon-reliquary .summon-result{min-height:58px}.summon-reliquary .summon-result>.item-art,.summon-reliquary .summon-result>.equipment-art{height:44px!important;width:44px!important}.summon-crystal .summon-results{max-width:310px;margin:6px auto}.summon-crystal .summon-result{width:54px;height:54px;min-height:54px}}
@media(prefers-reduced-motion:reduce){.summon-crystal .summon-result{animation:none}}

/* User-approved bright workshop reference, reused with permission. */
.summon-shop{background-image:linear-gradient(145deg,#55757535,#223d4655),url('summon-workshop.webp');background-size:cover;background-position:42% center;border:1px solid #eedab277}
.summon-shop .summon-wallet{padding:10px;border-radius:14px;background:#25434dc9;box-shadow:0 4px 18px #12292f33}
.summon-shop .summon-banner{background:linear-gradient(145deg,#547276d9,#284851e8);border-color:#edd698;box-shadow:inset 0 0 26px #ffe3a71a,0 8px 20px #12282a44}
.summon-shop .summon-banner.premium{background:linear-gradient(145deg,#68628bdd,#38445dea);border-color:#e5cd97}
.summon-reliquary{background-image:linear-gradient(180deg,#46626788,#28424cb8),url('summon-workshop.webp');background-size:cover;background-position:28% center;border:1px solid #eed39a99;border-radius:20px;box-shadow:0 0 40px #d7b77a22}
.summon-crystal{background-image:radial-gradient(ellipse at center,#345b78a8,#443c6999),url('summon-workshop.webp');background-size:cover;background-position:65% center;border:1px solid #b9e5faaa;border-radius:32px 32px 90px 90px;box-shadow:0 0 40px #a9e5ff33}
.summon-stage .summon-prize{isolation:isolate}
.summon-reliquary .summon-result{background:linear-gradient(150deg,#527174ed,#203c48f5)}
.summon-crystal .summon-result{background:radial-gradient(circle,#929abbdd,#314d66ee)}
.summon-stage .summon-feature-caption{color:#fff8e7;text-shadow:0 2px 5px #152c3c}
.summon-stage.opened .summon-dais{opacity:.15}.summon-stage.opened .summon-rays{opacity:.22}

/* 2026-09-20 correction: workshop is the main menu environment, not box wallpaper. */
#game.home-ui{background:#b8a27f url('summon-workshop.webp') center center/cover no-repeat}
#game.home-ui>canvas{visibility:hidden}
#game.home-ui>.vignette{background:linear-gradient(#16313e18,transparent 25%,transparent 80%,#17313e44)}
.summon-shop{background-image:linear-gradient(145deg,#355762c9,#203e49d9)}
.summon-reliquary{background-image:radial-gradient(ellipse at 50% 62%,#a9814566,transparent 60%),linear-gradient(150deg,#344f53dd,#1e303aee 70%)}
.summon-crystal{background-image:radial-gradient(ellipse at 50% 38%,#5688b788,transparent 65%),linear-gradient(150deg,#304b64dd,#42365dee)}

/* Material surfaces: woven folio texture, layered trim, never flat fills. */
.summon-shop,.summon-reliquary,.summon-crystal{background-image:linear-gradient(135deg,#47656f55,#142f3b77),url('folio.webp');background-size:cover;background-position:center;border:1px solid #e5cf99;box-shadow:inset 0 0 0 4px #17374588,inset 0 0 0 5px #dfc69066,0 12px 35px #152e3e55}
.summon-crystal{background-image:radial-gradient(ellipse at 50% 38%,#a0c9ed44,transparent 65%),linear-gradient(145deg,#4c588c44,#34345066),url('folio.webp');border-color:#c5dded}
.summon-reliquary{background-image:radial-gradient(ellipse at 50% 65%,#e6c58644,transparent 70%),linear-gradient(145deg,#52676133,#30444855),url('folio.webp')}
.summon-shop .summon-banner,.summon-shop .summon-banner.premium{background-image:linear-gradient(145deg,#52727666,#19374899),url('folio.webp');background-size:cover;box-shadow:inset 0 0 0 3px #15333c88,inset 0 0 0 4px #dac79766,0 8px 20px #12282a44}
.summon-shop .summon-banner.premium{background-image:linear-gradient(145deg,#77729a66,#303e5c88),url('folio.webp')}

/* Shared menu frame: invariant wallet, content rectangle and navigation. */
#game{--menu-width:680px;--menu-top:78px;--menu-bottom:88px}
#homeWallet{display:none}
#game.home-ui #homeWallet{display:flex;position:absolute;z-index:9;top:max(12px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);width:min(var(--menu-width),calc(100% - 24px));height:52px;padding:5px 62px 5px 14px;align-items:center;gap:20px;background:linear-gradient(135deg,#52687344,#15324066),url('folio.webp') center/cover;border:1px solid #d9c38c88;border-radius:12px;box-shadow:inset 0 0 0 3px #243f4655}
#homeWallet .home-currency{margin:0;gap:7px;font-size:15px}#homeWallet .home-currency b{font-weight:500}
#homeWallet #saveBackup{position:static;margin-left:auto;flex:none;width:34px;height:34px;padding:6px}
#game.home-ui>header{z-index:10;top:max(18px,calc(env(safe-area-inset-top) + 6px));left:50%;right:auto;transform:translateX(-50%);width:min(var(--menu-width),calc(100% - 24px));padding-right:10px}
#game.home-ui #overlay,#game.home-ui #overlay:has(.home-screen),#game.home-ui #overlay:has(.loadout-overview),#game.home-ui #overlay:has(.library-overview){padding:var(--menu-top) 12px var(--menu-bottom);align-items:stretch;background:transparent;backdrop-filter:none;overflow:hidden}
#game.home-ui #overlay>.home-screen,#game.home-ui #overlay>.loadout-overview,#game.home-ui #overlay>.library-overview,#game.home-ui #overlay>.summon-shop{width:min(var(--menu-width),100%);height:100%;max-height:none;min-height:0;align-self:stretch;margin:0 auto;padding:14px 18px;box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;border:1px solid #d7bf89aa;border-radius:14px;background-image:linear-gradient(135deg,#36565d44,#19354166),url('folio.webp');background-size:cover}
#game.home-ui .home-nav{left:50%;right:auto;transform:translateX(-50%);width:min(var(--menu-width),calc(100% - 24px));height:78px;padding:5px 10px max(7px,env(safe-area-inset-bottom));border-radius:14px 14px 0 0}
#game.home-ui .home-nav button{flex:1;max-width:none;width:auto;height:60px}
.home-screen .stage-centre{margin:0;flex:1;min-height:0;display:flex;flex-direction:column;background:none;border:0;box-shadow:none;padding:0}
.home-screen .stage-picture{flex:1;min-height:100px;height:auto;max-height:420px}
.home-screen .home-depart{flex:none;margin:14px 0 0;padding:0}
.home-screen .stage-rewards{flex:none}.home-screen .stage-reward-detail:empty{display:none}
.summon-shop .menu-title{flex:none;text-align:center;margin:0 0 10px;font-size:18px}.summon-shop .summon-pool-tabs{flex:none;margin:0 0 12px}.summon-shop .summon-shelf{flex:1;min-height:0;overflow-y:auto}
#game.home-ui:has(.summon-stage) #homeWallet{visibility:hidden;pointer-events:none}
@media(max-height:650px){#game{--menu-top:70px;--menu-bottom:72px}#game.home-ui .home-nav{height:64px}#game.home-ui .home-nav button{height:50px}#game.home-ui #overlay>.home-screen,#game.home-ui #overlay>.loadout-overview,#game.home-ui #overlay>.library-overview,#game.home-ui #overlay>.summon-shop{padding:10px 12px}#game.home-ui #homeWallet{height:46px}.home-screen .stage-reward .reward-chest{width:45px;height:42px}.home-screen .home-depart{margin-top:8px}}

#homeWallet #saveBackup{border:1px solid #d3be8288;border-radius:50%;background:radial-gradient(circle,#b4a86d33,transparent 70%),url('folio.webp') center/cover;color:#f4e7c5;box-shadow:inset 0 0 8px #e5d29122}
#game.home-ui #overlay>.home-screen,#game.home-ui #overlay>.loadout-overview,#game.home-ui #overlay>.library-overview,#game.home-ui #overlay>.summon-shop{max-width:var(--menu-width)}
@media(max-height:650px){#game.home-ui .loadout-overview .loadout-figure{height:122px;min-height:122px;margin-bottom:3px}#game.home-ui .loadout-overview .loadout-total{padding:4px 0;margin:0}#game.home-ui .loadout-overview .loadout-note{display:none}#game.home-ui .loadout-overview .loadout-bag{margin-top:3px;padding-top:3px}#game.home-ui .loadout-overview .loadout-bag h4{margin:3px 0}#game.home-ui .loadout-overview .bag-filters{margin:4px 0;gap:4px}#game.home-ui .loadout-overview .bag-filters button{height:44px;min-height:44px}#game.home-ui .loadout-overview .loadout-bag-grid{min-height:76px}}

/* Safe-area-aware shared frame, including standalone iPhone display. */
#game{--menu-safe-top:env(safe-area-inset-top,0px);--menu-safe-bottom:env(safe-area-inset-bottom,0px);--menu-top:max(78px,calc(var(--menu-safe-top) + 66px));--menu-bottom:calc(88px + var(--menu-safe-bottom))}
#game.home-ui #homeWallet{top:max(12px,var(--menu-safe-top))}
#game.home-ui>header{top:max(18px,calc(var(--menu-safe-top) + 6px))}
#game.home-ui .home-nav{height:calc(78px + var(--menu-safe-bottom));padding-bottom:calc(7px + var(--menu-safe-bottom))}
@media(max-height:650px){#game{--menu-top:max(70px,calc(var(--menu-safe-top) + 60px));--menu-bottom:calc(72px + var(--menu-safe-bottom))}#game.home-ui .home-nav{height:calc(64px + var(--menu-safe-bottom))}}

/* Equipment header stays compact across every inventory category. */
#game.home-ui .loadout-overview .loadout-figure{height:155px;min-height:155px;margin-bottom:0}
#game.home-ui .loadout-overview .loadout-total{display:flex;padding:5px 0;margin:4px 0}
#game.home-ui .loadout-overview .loadout-bag{margin-top:2px;padding-top:2px}
#game.home-ui .loadout-overview .loadout-bag h4{margin:4px 0}
#game.home-ui .loadout-overview .fusion-entry{min-height:36px;padding:4px 10px}
#game.home-ui .loadout-overview .bag-filters{gap:4px;margin:4px 0;padding:2px 0}
#game.home-ui .loadout-overview .bag-filters button{width:40px;min-width:40px;height:44px;min-height:44px;padding:3px}
@media(max-height:650px){#game.home-ui .loadout-overview .loadout-figure{height:122px;min-height:122px}#game.home-ui .loadout-overview .loadout-total{padding:4px 0;margin:0}}
#game.home-ui .loadout-overview .bag-filters{flex-wrap:nowrap;overflow-x:auto;flex:none}#game.home-ui .loadout-overview .bag-filters button{flex:0 0 40px}
#game.home-ui .loadout-overview .bag-filters{display:flex}

/* Compact equipment slots keep the artwork beside the level, not under a tall label. */
#game.home-ui .loadout-overview .loadout-slot>.item-art,#game.home-ui .loadout-overview .loadout-slot>.equipment-art{top:3px;left:3px;transform:none;height:calc(100% - 6px);width:auto;max-width:48%;margin:0}
#game.home-ui .loadout-overview .loadout-slot>small{left:auto;right:2px;bottom:50%;transform:translateY(50%);padding:2px 0;border:0;background:none;font-size:10px;border-radius:0}
#game.home-ui .loadout-overview .loadout-slot .loadout-sockets{left:auto;right:2px;bottom:1px}
.loadout-sockets>.starting-gem-art{width:18px;height:18px}
.loadout-sockets>.starting-gem-art>svg{width:8px;height:8px}
#game.home-ui .loadout-overview .loadout-slot .loadout-sockets>.spell-art,#game.home-ui .loadout-overview .loadout-slot .loadout-sockets>.starting-gem-art{width:10px;height:10px}
#game.home-ui .loadout-overview .loadout-slot .loadout-sockets>.starting-gem-art>svg{width:6px;height:6px}

/* 0.401: approved A + brighter gold paper; shared menu surfaces. */
#game.home-ui{isolation:isolate}
#game.home-ui:before{content:'';position:absolute;inset:0;z-index:0;pointer-events:none;background:#061c287a}
#game.home-ui>.frame{display:none}
#game.home-ui #homeWallet,#game.home-ui .home-nav{background:none;border:0;border-radius:0;box-shadow:none;backdrop-filter:none}
#game.home-ui #overlay>:is(.home-screen,.loadout-overview,.library-overview,.summon-shop){position:relative;isolation:isolate;background:none}
#game.home-ui #overlay>:is(.home-screen,.loadout-overview,.library-overview,.summon-shop):before{content:'';position:absolute;inset:0;z-index:-2;border-radius:inherit;background:url('folio.webp') center/cover;pointer-events:none}
#game.home-ui #overlay>:is(.home-screen,.loadout-overview,.library-overview,.summon-shop):after{content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;background:url('folio.webp') center/cover;filter:brightness(1.8) contrast(1.4) saturate(1.5);mix-blend-mode:screen;opacity:.25;pointer-events:none}

/* 0.403 approved outlined navigation artwork, without a backing panel. */
#game.home-ui .home-nav button{opacity:1;color:#fff0c8;height:68px}
#game.home-ui .home-nav .nav-design{display:block;width:54px;height:54px;flex-shrink:0;overflow:hidden;margin:0 auto;filter:drop-shadow(1px 0 0 #211b15) drop-shadow(-1px 0 0 #211b15) drop-shadow(0 1px 0 #211b15) drop-shadow(0 -1px 0 #211b15) drop-shadow(0 2px 1px #140f12a0)}
#game.home-ui .home-nav button>span{font-size:12px;text-shadow:0 1px 2px #102a32}
@media(max-height:650px){#game.home-ui .home-nav .nav-design{width:44px;height:44px}#game.home-ui .home-nav button{height:56px}}

/* 0.407: owned gem effects, finger-sized controls. */
.gem-effect-filters button{flex-basis:44px;width:44px;height:44px;padding:4px}
.gem-effect-filters button>svg{width:28px;height:28px;fill:none;stroke:#edd28c;stroke-width:1.5}
.gem-effect-filters .spell-art,.gem-effect-filters .starting-gem-art{width:34px;height:34px}

/* Acquired upgrades share the actual spell art; no hidden future branches. */
.acquired-magic{display:flex;flex-wrap:wrap;justify-content:center;gap:7px;margin-top:12px}
.acquired-magic>button,.acquired-basic{display:block;position:relative;width:44px;height:44px;padding:2px;border:1px solid #c7aa6266;border-radius:8px;background:transparent;box-sizing:border-box}
.acquired-magic .spell-art{width:38px;height:38px}
#learnedDetail .acquired-basic small{position:absolute;right:2px;bottom:0;color:#fff0ca;text-shadow:0 1px 3px #000;font-size:12px}

/* 0.414: stage photo has its own gilded rim; clear status is independent of reward claims. */
.home-screen .stage-picture{border:5px solid #c6a464;box-shadow:0 0 0 2px #30291e,inset 0 0 0 2px #fff0baaa,0 4px 12px #0007;border-radius:8px;box-sizing:border-box}
.stage-clear-stamp{position:absolute;right:36px;bottom:14px;width:clamp(125px,30vw,185px);aspect-ratio:200/90;display:grid;place-items:center;transform:rotate(-9deg);color:#ffdc80;filter:drop-shadow(0 2px 2px #20170d);pointer-events:none}
.stage-clear-stamp svg{position:absolute;inset:0;width:100%;height:100%;fill:#18362a99;stroke:currentColor;stroke-width:3}
.stage-clear-stamp strong{position:relative;font:bold clamp(24px,6vw,36px)/1 Georgia,serif;letter-spacing:3px;text-shadow:0 1px 1px #372e1a}
/* 0.418: persistent battle choice automation, next to sound. */
#battleAutoChoice{display:none}
#game.battle #battleAutoChoice{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;min-width:44px;min-height:44px;padding:3px 6px;font-size:10px;line-height:1.15;border:1px solid #a29370;border-radius:12px;background:linear-gradient(140deg,#344344e8,#152e34e8);color:#e3dac1}
#battleAutoChoice span{font-size:9px;opacity:.8}
#game.battle #battleAutoChoice[aria-pressed=true]{color:#fff0b3;border-color:#ebcc72;background:linear-gradient(140deg,#766237e8,#344538e8);box-shadow:inset 0 0 5px #efcf7355}

/* Fusion result: reserve a separate value row below the artwork. */
.fusion-results .inventory-item{height:108px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:6px;gap:3px}.fusion-results .inventory-item>small{position:static;display:block;line-height:18px;font-size:13px;flex:none}


/* Keep long gem abilities readable on narrow screens without shrinking their art. */
@media(max-width:380px){
 .gem-detail-summary{display:grid;grid-template-columns:100px minmax(0,1fr);gap:6px 14px}
 .gem-detail-summary>div:last-child{display:contents}
 .gem-detail-summary>.gear-detail-art{grid-column:1;grid-row:1 / 3}
 .gem-detail-summary>div:last-child>p:first-child{grid-column:2;grid-row:1;align-self:end}
 .gem-detail-summary .gem-summary-owner{grid-column:2;grid-row:2;align-self:start}
 .gem-detail-summary .gem-summary-effect{grid-column:1 / -1;grid-row:3;margin-top:8px}
 .gem-detail-summary>div:last-child>p:not(:first-child):not(.gem-summary-owner):not(.gem-summary-effect){grid-column:1 / -1}
}

/* Keep inventory space until the player needs sorting controls. */
.gem-organizer>summary{display:flex;align-items:center;gap:8px;min-height:44px;cursor:pointer;list-style:none;color:#f4df9c;border-bottom:1px solid #c7ab6c66;background:linear-gradient(100deg,#c7ab6c18,transparent);padding:0 4px;font-size:12px}.gem-organizer>summary::-webkit-details-marker{display:none}.gem-organizer>summary svg{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7}.gem-organizer>summary small{margin-left:auto;white-space:nowrap;color:#d7e5df}.gem-organizer[open]>summary .organizer-chevron{transform:rotate(180deg)}.gem-organizer>summary:focus-visible{outline:2px solid #ffe1a0;outline-offset:-2px}.gem-organizer-content{padding-top:3px}

@media(max-height:650px){.loadout-overview .gem-organizer{position:relative}.loadout-overview .gem-organizer-content{position:absolute;bottom:100%;left:0;right:0;z-index:20;max-height:48vh;overflow-y:auto;padding:9px;border:1px solid #d7bf89;border-radius:10px;background:linear-gradient(135deg,#36565d44,#19354166),url("folio.webp") center/cover;box-shadow:0 6px 18px #0009}}

/* Filled category silhouettes remain legible at the fixed 44px touch height. */

/* Opening replaces the menu: its hidden wallet/navigation must not reserve space. */
#game.home-ui #overlay:has(.summon-stage){padding:calc(52px + var(--menu-safe-top,0px)) 12px calc(8px + var(--menu-safe-bottom,0px));align-items:center}
#game.home-ui #overlay>.summon-stage{height:100%;max-height:720px;min-height:0;box-sizing:border-box;margin:0 auto;width:min(560px,100%);overflow:hidden;padding:12px!important}
#game.home-ui #overlay>.summon-stage .summon-prize{min-height:0;max-height:100%;overflow-y:auto;flex-shrink:1}
#game.home-ui #overlay>.summon-stage #summonReceive,#game.home-ui #overlay>.summon-stage #summonSkip{flex-shrink:0}
/* Achieved chests await an explicit claim; rewards stay over the garden. */
.stage-reward.claimable .reward-chest{filter:drop-shadow(0 0 9px #ffe8a9);animation:stage-chest-breathe 2s ease-in-out infinite}
@keyframes stage-chest-breathe{50%{filter:drop-shadow(0 0 15px #fff0b9);transform:translateY(-2px)}}
.stage-chest-reveal{position:fixed;inset:0;z-index:30;display:grid;place-items:center;background:#031b2788;padding:18px}
.stage-chest-prize{position:relative;width:min(420px,92vw);max-height:86svh;overflow:auto;text-align:center;padding:24px;background:url('folio.webp') center/100% 100%;border:1px solid #dbbf79;border-radius:12px;box-shadow:0 15px 50px #0008;animation:stage-prize-in .65s ease-out}
.stage-chest-prize>.reward-chest{display:block;width:90px;height:80px;margin:auto;animation:stage-chest-open .65s ease-out}
.stage-prize-resources{display:grid;gap:12px;margin:20px 0;color:#ffedbd}.stage-chest-prize details{margin:14px 0}.stage-chest-prize details span{display:inline-flex;align-items:center;margin:4px;font-size:12px}.stage-chest-prize details img{width:26px;height:26px;object-fit:contain}
.prize-coin{position:absolute;left:50%;top:40%;width:22px;height:22px;pointer-events:none;opacity:0;animation:stage-coin-pop .85s ease-out}
@keyframes stage-coin-pop{10%{opacity:1}100%{opacity:0;transform:translate(var(--dx),var(--dy)) rotate(160deg)}}
@keyframes stage-prize-in{from{opacity:0;transform:translateY(20px) scale(.95)}to{opacity:1;transform:none}}
@keyframes stage-chest-open{0%{transform:scale(.8) rotate(-5deg)}45%{transform:scale(1.13) rotate(4deg)}100%{transform:none}}
@media(prefers-reduced-motion:reduce){.stage-reward.claimable .reward-chest,.stage-chest-prize,.stage-chest-prize>.reward-chest,.prize-coin{animation:none}}
.stage-opening-chest{display:block;width:112px;height:112px;margin:0 auto;background:url('stage-chest-opening-v1.png') 100% 0/300% 100% no-repeat;filter:drop-shadow(0 3px 7px #e5c87a66);animation:stage-lid-open .65s steps(1,end) both}
@keyframes stage-lid-open{0%{background-position:0 0}35%{background-position:50% 0}70%,100%{background-position:100% 0}}
.stage-chest-reveal .prize-coin{animation-delay:calc(.28s + var(--coin-delay,0s));top:35%}
.stage-chest-prize .stage-prize-resources{animation:stage-prize-in .45s .35s both}
@media(prefers-reduced-motion:reduce){.stage-opening-chest,.stage-chest-prize .stage-prize-resources{animation:none}}

/* Backup controls appear only after choosing the relevant workflow. */
#gearDialog #reviewSaveText[hidden],#gearDialog #saveText[hidden],#gearDialog #saveFile[hidden]{display:none!important}
/* The sealed chest never signals the rolled rarity; color arrives with the prize. */
.summon-stage:not(.opened){--summon-glow:#bde5ce}

.result .reward-objects{align-items:center;gap:24px}.result .reward-objects .stardrop-reward{flex-direction:column;gap:10px;width:110px;margin:0}.result .reward-objects .stardrop-mark{width:46px;height:62px}.result .reward-objects .stardrop-reward strong{font:500 26px GardenDisplay,serif;color:#b8eef4}

/* Brief victory flourish; navigation remains immediately available. */
.result-win h2{position:relative;isolation:isolate;color:#ffe5a7;text-shadow:0 0 18px #e7c77766}
.result-win h2:before{content:'';position:absolute;z-index:-1;pointer-events:none;inset:-28px -10px;background:radial-gradient(ellipse at center,#e6c76b55,transparent 65%);animation:result-dawn 1.2s ease-out both}
.result-win .reward-objects,.result-win .fragment-loot,.result-win .equipment-rewards,.result-win .found-relics{animation:result-gift .5s ease-out both}
.result-win .fragment-loot{animation-delay:.1s}.result-win .equipment-rewards{animation-delay:.2s}
@keyframes result-dawn{from{opacity:0;transform:scaleX(.35)}45%{opacity:1}to{opacity:.6;transform:scaleX(1)}}
@keyframes result-gift{from{opacity:.25;transform:translateY(9px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.result-win h2:before,.result-win .reward-objects,.result-win .fragment-loot,.result-win .equipment-rewards,.result-win .found-relics{animation:none}}
/* Compact reward layout keeps the return action reachable on short phones. */
@media(max-width:480px) and (max-height:650px){
 .result{padding:12px 14px}.result h2{margin:3px 0 7px;font-size:23px}
 .result .reward-objects{margin:6px 0 10px;gap:14px}
 .result .reward-seeds{width:115px;flex-direction:row;gap:5px}
 .result .reward-seeds .item-art{width:50px;height:50px}
 .result .reward-seeds strong,.result .reward-objects .stardrop-reward strong{font-size:21px}
 .result .reward-objects .stardrop-reward{width:95px;flex-direction:row;gap:8px}
 .result .reward-objects .stardrop-mark{width:25px;height:36px}
 .result .fragment-loot,.result .equipment-rewards{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;margin:8px 0}
 .result .fragment-reward,.result .equipment-rewards>button{min-width:0;min-height:50px;padding:3px;gap:1px}
 .result .fragment-art{width:27px;height:31px}
 .result .equipment-rewards .equipment-art,.result .equipment-rewards .item-art{width:30px;height:30px}
 .result .primary{margin:8px auto}
}
@media(max-width:480px) and (max-height:650px){.result #resultDamage,.result #resultDetails{display:inline-block;width:46%;min-width:0;margin:4px 1%;padding:8px 4px;vertical-align:top}}

/* Botanical achievement seals: result only, not collected chest state. */
.result-achievements{display:flex;justify-content:center;gap:20px;margin:4px auto 9px}
.result-achievement{display:flex;flex-direction:column;align-items:center;gap:2px;color:#8d9c97;opacity:.42}
.result-achievement svg{width:35px;height:30px;overflow:visible}
.result-achievement small{font-size:10px;line-height:1.1;white-space:nowrap}
.seal-branch,.seal-light{fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
.seal-leaves{fill:#536c62;stroke:currentColor;stroke-width:.6}
.seal-shield{fill:#233f41;stroke:currentColor;stroke-width:1.6}
.result-achievement.achieved{color:#f2d993;opacity:1;animation:result-seal-arrive .55s both;animation-delay:var(--seal-delay)}
.achieved .seal-leaves{fill:#9d974e}.achieved .seal-shield{fill:#416c61}.achieved .seal-light{stroke:#fff4c2}
@keyframes result-seal-arrive{from{opacity:0;transform:translateY(5px) scale(.86)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.result-achievement.achieved{animation:none}}
@media(max-width:480px) and (max-height:650px){.result-achievements{margin:2px auto 5px;gap:17px}.result-achievement svg{width:28px;height:24px}.result-achievement small{font-size:9px}}

/* Keep regional landmarks in the stage card at the same orientation as battle. */
#stagePicture{background-image:linear-gradient(transparent 20%,#06141a77),var(--stage-landscape)}
@media(max-aspect-ratio:18/25){#stagePicture{background-image:linear-gradient(transparent 20%,#06141a77),var(--stage-portrait)}}

/* One material shelf: preserve distinct art and each item's upgrade destination. */
.result .fragment-loot{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;margin:12px 0}
.result .fragment-loot>button{min-width:0}
.result-equipment-material{display:grid;justify-items:center;align-content:center;gap:3px;min-height:62px;padding:6px;border:1px solid #a99765;border-radius:7px;background:linear-gradient(#25474b44,#132e3655),url('folio.webp') center/cover;color:#e8dfc8}
.result-equipment-material .equipment-art,.result-equipment-material .item-art{width:40px;height:40px}
.result-equipment-material:focus-visible{outline:2px solid #f1d98a;outline-offset:3px}
@media(max-width:480px) and (max-height:650px){.result .fragment-loot{gap:5px;margin:8px 0}.result-equipment-material{min-height:50px;padding:3px;gap:1px}.result-equipment-material .equipment-art,.result-equipment-material .item-art{width:30px;height:30px}}

/* 0.509: stage chest rewards use the same material art as battle results. */
.stage-chest-prize .stage-prize-resources{display:flex;justify-content:center;gap:32px;margin:18px 0 22px}
.stage-prize-icon{position:relative;display:inline-flex;align-items:center;justify-content:center;width:58px;height:62px}
.stage-prize-icon>b{position:absolute;right:-7px;top:-5px;z-index:1;font:600 18px Georgia,serif;color:#fff0c6;text-shadow:0 2px 3px #000,1px 0 2px #000,-1px 0 2px #000}
.stage-prize-icon>.seed-mark{width:48px;height:48px}
.stage-prize-icon>.stardrop-mark{width:33px;height:48px}
.stage-prize-fragments{display:grid;grid-template-columns:repeat(5,1fr);gap:12px 8px;margin:0 0 22px;justify-items:center}
.stage-prize-fragments .stage-prize-icon{width:44px;height:52px}
.stage-prize-fragments .fragment-art{width:39px;height:47px}
.stage-prize-fragments .fragment-art>.spell-art{width:36px;height:36px;left:0;top:5px}
.stage-chest-prize>.primary{width:100%;margin:0}
@media(max-width:360px),(max-height:650px){.stage-chest-prize{padding:18px}.stage-chest-prize .stage-opening-chest{width:86px;height:86px}.stage-prize-fragments{gap:8px 4px}.stage-prize-fragments .stage-prize-icon{width:36px;height:46px}.stage-prize-icon>b{font-size:16px;right:-4px}}

/* Keep reward acknowledgement modal, including keyboard navigation. */
dialog.stage-chest-reveal{width:100%;height:100%;max-width:none;max-height:none;margin:0;border:0;box-sizing:border-box;color:inherit}
dialog.stage-chest-reveal::backdrop{background:transparent}

/* Reward arrival: short, finite, graphical; no layout space or interaction delay. */
.result-win .reward-objects>div{position:relative;isolation:isolate}
.result-gather{position:absolute;inset:0;pointer-events:none;z-index:2;animation:result-gather-life 1.5s linear both}
.result-gather i{position:absolute;left:50%;top:35%;width:7px;height:11px;border-radius:85% 15% 85% 15%;background:linear-gradient(135deg,#fffde5,#f6d77e 55%,#bc8b38);box-shadow:0 0 7px #ffe5a9;opacity:0;animation:result-gather-mote .95s var(--gd) cubic-bezier(.18,.65,.35,1) both}
.result-win .result-lit{animation:result-loot-light .85s var(--gift-delay) ease-out both}
@keyframes result-gather-life{to{opacity:1}}
@keyframes result-gather-mote{0%{opacity:0;transform:translate(var(--gx),var(--gy)) rotate(-35deg) scale(.4)}22%{opacity:.9}80%{opacity:.7}100%{opacity:0;transform:translate(0,0) rotate(90deg) scale(.15)}}
@keyframes result-loot-light{0%{filter:brightness(1)}35%{filter:brightness(1.2);box-shadow:0 0 12px #e9cf7d70,inset 0 0 12px #edd79640}100%{filter:brightness(1)}}
@media(prefers-reduced-motion:reduce){.result-gather{display:none}.result-win .result-lit{animation:none}}

/* Unavailable spells stay discoverable; only their artwork is dimmed. */
.mastery-book.magic-locked>.spell-art{filter:grayscale(.65) brightness(.38);opacity:.7}
.mastery-book.magic-locked{border-color:#66736b}
.locked-magic-art{text-align:center}.locked-magic-art>.spell-art{width:100px;height:100px;filter:brightness(.65)}
.locked-fragment{display:flex;align-items:center;gap:12px;margin:auto}.locked-fragment>.spell-art{width:48px;height:48px}
.locked-magic-art>.spell-art{margin:0 auto}
.result-unlocks{display:flex;justify-content:center;gap:8px;flex-wrap:wrap}.result-unlocks:empty{display:none}.result-unlocks .unlocked-magic{flex:1;min-width:120px;max-width:220px;margin:6px 0;padding:8px;gap:6px}.result-unlocks .spell-art{width:46px;height:46px;flex-shrink:0}.result-unlocks .unlocked-magic>span:last-child{font-size:13px}

.feedback-links{margin-top:18px;padding-top:12px;border-top:1px solid #c8b37855;text-align:left}.feedback-links summary{cursor:pointer;min-height:44px;display:list-item;align-content:center;color:#ecd6a0}.feedback-links a{display:flex;align-items:center;min-height:44px;color:#f3dca3;text-underline-offset:4px}.feedback-links p{font-size:13px;line-height:1.6}

.save-transfer-help ol{padding-left:1.6em;font-size:13px;line-height:1.8}.save-transfer-help li{margin:8px 0}

/* Match both material types on compact result screens; keep their distinct artwork. */
@media(max-width:480px) and (max-height:650px){
 .result .result-equipment-material .equipment-material-art{width:27px;height:31px}
 .result .result-equipment-material .equipment-material-art>.equipment-art,
 .result .result-equipment-material .equipment-material-art>.item-art{width:25px;height:27px}
 .result .result-equipment-material small{font:13px Georgia,serif}
}
/* Dense rewards keep currency on one line so the actual drops remain the focus. */
@media(max-width:480px){
 .result:has(.fragment-loot>button:nth-child(16)) .reward-objects{margin:6px 0 10px;gap:14px}
 .result:has(.fragment-loot>button:nth-child(16)) .reward-seeds{width:115px;flex-direction:row;gap:5px}
 .result:has(.fragment-loot>button:nth-child(16)) .reward-seeds .item-art{width:50px;height:50px}
 .result:has(.fragment-loot>button:nth-child(16)) .reward-seeds strong,
 .result:has(.fragment-loot>button:nth-child(16)) .stardrop-reward strong{font-size:21px}
 .result:has(.fragment-loot>button:nth-child(16)) .stardrop-reward{width:95px;flex-direction:row;gap:8px}
 .result:has(.fragment-loot>button:nth-child(16)) .stardrop-mark{width:25px;height:36px}
}

/* Keep rare equipment and gems together without changing their hit targets. */
.result .found-relics{align-items:center}
.result .found-relics>.found-equipment{margin:0}

/* Keep the return action reachable when a rich reward shelf exceeds the screen. */
.result #restart{position:sticky;bottom:0;z-index:3;box-shadow:0 6px 18px #0008,inset 0 0 0 3px #d7bb7533}

/* Show simultaneous magic unlocks together; preserve material icon hit areas. */
@media(max-width:480px){
 .result .result-unlocks:has(.unlocked-magic:nth-child(2)){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:8px 0}
 .result .result-unlocks:has(.unlocked-magic:nth-child(2)) .unlocked-magic{min-width:0;max-width:none;width:100%;margin:0;padding:6px;flex-direction:column;gap:2px}
 .result .result-unlocks:has(.unlocked-magic:nth-child(2)) .unlocked-magic>span:last-child{font-size:12px}
}

#game.home-ui .home-nav:has(#backToResult){display:flex;justify-content:center}#game.home-ui .home-nav #backToResult{width:min(320px,90%);font-size:18px}


.promo-dialog{width:min(90vw,520px);text-align:center}.promo-dialog img{display:block;width:100%;border-radius:8px;margin:12px 0}.promo-dialog button,.promo-dialog a{display:block;margin:12px auto}.promo-entry{flex-shrink:0;margin:8px auto}

/* Combat streaks belong to the battlefield, never the garden menus. */
#game.home-ui #combo{display:none}

/* Daily free chest: fixed-size controls, no layout shift. */
.daily-ad-available{position:relative}.daily-ad-available>.daily-ad-dot{display:block;z-index:3;position:absolute;right:7px;top:6px;width:10px;height:10px;border-radius:50%;background:#ef4948;border:1px solid #ffd9a1;box-shadow:0 1px 3px #301511b3;pointer-events:none}.home-nav .daily-ad-available>.daily-ad-dot{right:18%;top:4px}

/* Daily free chest: fixed-size controls, no layout shift. */
.daily-ad-available{position:relative}.daily-ad-available>.daily-ad-dot{display:block;z-index:3;position:absolute;right:7px;top:6px;width:10px;height:10px;border-radius:50%;background:#ef4948;border:1px solid #ffd9a1;box-shadow:0 1px 3px #301511b3;pointer-events:none}.home-nav .daily-ad-available>.daily-ad-dot{right:18%;top:4px}
