/* V0.2: portrait battlefield and carved-panel presentation. */
.upgrade-card{margin-top:20px;border:1px solid #777650;background:linear-gradient(145deg,#343c2d,#1d291f);padding:18px 13px;color:#e2d6b0;box-shadow:inset 0 0 0 3px #151f1766}.upgrade-heading{display:flex;justify-content:space-between;align-items:center;gap:8px}.upgrade-heading h2{font-size:20px;font-family:serif;font-weight:400;letter-spacing:3px;margin:7px 0}.upgrade-scope{font-size:9px;padding:4px 5px;border:1px solid #72764f;color:#c3c394;white-space:nowrap}.upgrade-intro{font-size:10px;color:#b3bea0;line-height:1.8;margin:8px 0 15px}.damage-upgrades{display:grid;gap:10px}.damage-upgrade{display:grid;grid-template-columns:32px 1fr;gap:7px;align-items:center;padding:10px;background:#13211777;border:1px solid #58654a}.damage-upgrade .element{width:30px;height:32px}.damage-upgrade strong{font-size:11px;font-weight:500;display:block;line-height:1.8}.damage-upgrade strong span{color:#cbb575;font-size:9px;white-space:nowrap}.damage-upgrade small{font-size:10px;color:#afb99d}.upgrade-buy{border:1px solid #9d8d59;border-radius:3px;background:linear-gradient(#5c6242,#3b462f);color:#ecddab;padding:10px 6px;min-height:38px;font-size:11px;letter-spacing:.3px}.upgrade-buy:hover:not(:disabled){background:#657149}.upgrade-buy:disabled{opacity:.55}.damage-upgrade .upgrade-buy{grid-column:1/-1}.summon-upgrade{margin-top:18px;padding-top:17px;border-top:1px solid #687453}.summon-upgrade h3{font-size:13px;letter-spacing:1px;margin:0 0 8px}.summon-upgrade #chanceCurrent{font-size:10px;color:#c0caa9}.chance-track{height:5px;background:#101e15;margin:10px 0 12px;overflow:hidden}.chance-track span{display:block;height:100%;width:0;background:#c8b877;transition:width .2s}.summon-upgrade .upgrade-buy{width:100%}.summon-upgrade p,.upgrade-hint{font-size:9px;line-height:1.9;color:#a8b395;margin:10px 0 0}.upgrade-hint{border-top:1px dashed #63714a;padding-top:10px}.upgrade-status{font-size:10px;line-height:1.8;color:#ded1a4;margin-top:12px;padding:9px;background:#101d1499;min-height:50px}@media(max-width:620px){aside{display:flex!important;flex-direction:column}.upgrade-card{order:-1;margin:0 0 24px;padding:18px}.damage-upgrades{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.damage-upgrade{display:flex;flex-direction:column;text-align:center;gap:6px;padding:10px 5px}.damage-upgrade strong span{display:block}.damage-upgrade .upgrade-buy{width:100%;font-size:10px;padding-inline:2px}.damage-upgrade small{font-size:9px}.upgrade-intro{font-size:11px}.upgrade-status{font-size:11px}.summon-upgrade p,.upgrade-hint{font-size:10px}}
:root{--ink:#e9e1cc;--muted:#a6a79e;--green:#947842;--line:#494b44;--cream:#171c21;--gold:#d0b477;color-scheme:dark}
body{background:radial-gradient(ellipse at 48% 24%,#34433d55,transparent 57%),radial-gradient(ellipse at 10% 70%,#3c30232e,transparent 40%),#15191e;color:#e9e1cc;font-family:"Segoe UI","Microsoft JhengHei",sans-serif}
body:before{content:"";position:fixed;inset:0;pointer-events:none;opacity:.22;background-image:repeating-linear-gradient(115deg,transparent 0 90px,#b7caa005 90px 91px),radial-gradient(#aaa990 0.5px,transparent .5px);background-size:auto,7px 7px;z-index:-1}
.topbar{height:68px;background:#14191ee8;border-color:#b5a16b25;padding-inline:4%;position:relative;z-index:2}
.brand{color:#d6c89e;font-size:18px}.brand-mark{border:1px solid #9b8752;border-radius:2px;background:linear-gradient(135deg,#3c443e,#1b211f);color:#dbc797}.brand-en{font-size:9px}.brand small{color:#858c80;letter-spacing:1.4px}.prototype{background:#252b28;border:1px solid #535946;border-radius:3px;color:#c9c3aa;letter-spacing:1px;font-size:10px}.prototype i{background:#d2b87b}.prototype span{color:#8f997e}.help-button{color:#b7b7a5}.help-button span{border-color:#626956;border-radius:3px}
main{position:relative;max-width:1160px;padding:32px 26px 0;margin:auto}.page-heading{position:absolute;top:85px;left:26px;width:240px;display:block;margin:0;text-align:center}.eyebrow{font-size:8px;letter-spacing:2px;color:#9b9d83}.page-heading h1{font-family:"PMingLiU","Noto Serif TC",serif;font-size:53px;line-height:1.25;letter-spacing:9px;font-weight:500;margin:16px -9px 0 0;text-shadow:0 3px 25px #dfbd5940;color:#e2d5ad}.page-heading h1 span{display:block;font-family:Georgia,serif;font-size:10px;letter-spacing:5px;color:#9c936f;margin:15px 0 0}.intro-copy{font-size:12px;line-height:2.2;letter-spacing:2px;color:#a7ad9e;margin:26px 0}.island-crest{width:110px;height:110px;border:1px solid #ae9a594f;transform:rotate(45deg);margin:40px auto 30px;position:relative;background:radial-gradient(#b7ad6030,transparent 70%);box-shadow:0 0 60px #b0ab5710}.island-crest:before,.island-crest:after{content:"";position:absolute;inset:9px;border:1px solid #ad9d5760}.island-crest:after{inset:22px;border-radius:50%;border-style:dashed}.island-crest span{display:block;transform:rotate(-45deg);font-size:87px;line-height:110px;color:#c3b678}.chapter-caption{border-block:1px solid #aa955b2e;padding:18px 0;color:#b9b298;letter-spacing:2px;font-size:11px}.chapter-caption span{display:block;font-family:Georgia,serif;letter-spacing:3px;font-size:9px;color:#8b907f;margin-bottom:9px}.guest{justify-content:center;margin-top:30px;text-align:left;color:#d2cdbb}.guest small{color:#838d81}.avatar{background:#303930;border:1px solid #69765a;color:#b8c8a1}
.layout{margin-left:264px;display:grid;grid-template-columns:minmax(0,450px) minmax(205px,1fr);gap:25px;align-items:start}.game-card{position:relative;background:#222822;border:1px solid #8d8b68;border-radius:3px;box-shadow:0 0 0 4px #121716,0 0 0 5px #484f42,0 20px 90px #0009;overflow:visible}.game-card:before,.game-card:after{content:"◆";position:absolute;top:-10px;color:#c0ac71;font-size:16px;z-index:3;text-shadow:0 2px #000}.game-card:before{left:-9px}.game-card:after{right:-9px}
.stage-header{height:86px;padding:12px 18px 9px;justify-content:space-between;background:linear-gradient(#343c35,#202721);border-bottom:1px solid #81774e70;position:relative}.stage-header>div{display:block}.stage-flourish{font-size:32px;color:#bdae7c;text-shadow:0 0 12px #d9cf8540}.stage-plaque{width:175px;text-align:center;background:linear-gradient(#acae98,#747d6c);border:3px double #2c322c;box-shadow:0 3px 0 #101913;position:relative;padding:8px 0 6px;clip-path:polygon(9% 0,91% 0,100% 50%,91% 100%,9% 100%,0 50%)}.stage-header:before,.stage-header:after{content:"";position:absolute;top:0;width:5px;height:21px;border:1px solid #95977e;background:repeating-linear-gradient(#363e33 0 4px,#878b73 4px 5px);z-index:1;left:calc(50% - 55px)}.stage-header:after{left:calc(50% + 53px)}.level-tag{display:block;width:auto;height:auto;background:none;border:0;font-family:Georgia,serif;font-size:16px;letter-spacing:3px;font-weight:bold;color:#222d25;text-shadow:0 1px #c4c7aa;margin-top:1px}.stage-header h2{font-size:10px;margin:3px 0 0;letter-spacing:3px;color:#263229;font-weight:500}.difficulty{font-size:9px;line-height:1.7;letter-spacing:2px;color:#a5ad96;text-align:center;display:block}
.hud{margin:0;padding:10px 13px;gap:19px;background:#181f1b;border:0;border-bottom:2px solid #626f55;justify-content:space-between}.hud>div{gap:6px}.hud small{font-size:8px;color:#9ba790;letter-spacing:.5px}.hud strong{font-size:16px;color:#e0d5ad}.hud em{font-size:9px;color:#8e967e}.hud-icon{font-size:19px}.hud .timer{margin-left:0}.timer strong{font-size:14px;color:#c0c8b1}.coin{color:#d9b664}.heart{color:#ca8983}.wave{color:#88b5be}
.board-wrap{aspect-ratio:640/1000;border-radius:0;margin:0;background:#313b32;border-bottom:3px solid #66745a;overflow:hidden}canvas{width:100%;height:100%}.slot{width:12.5%;height:8%;border-radius:7px;border:1px solid #bfb18466;background:#d5c7920c;color:#c6c7a7;font-size:23px;text-shadow:0 0 10px #e2d996}.slot.empty:hover{background:#eadca231;border-color:#e9d591;box-shadow:0 0 15px #ffdd5e22}.slot.occupied:hover{border-color:#d4c68188}.slot.selected{border:2px solid #f1d88d;box-shadow:0 0 15px #f1d88d55}.slot.match{border:2px dashed #e0c479;box-shadow:0 0 14px #d7b76288}.slot .slot-level{font-size:8px;background:#1b271ee8;color:#e7d49e;border:1px solid #8a865a;border-radius:2px;bottom:-4px;padding:2px 5px}.map-label{font-size:9px;color:#ddd6bc;letter-spacing:2px;text-shadow:0 2px 3px #000}.entrance{top:1.5%;left:61%;right:auto}.core{top:95.7%;left:13%;right:auto}.map-caption{bottom:9px;font-size:9px;padding:5px 9px;background:#1b251eef;border:1px solid #94936566;border-radius:2px;color:#c2c8af;pointer-events:none;letter-spacing:.5px}.live-dot{background:#d7c27e}
.summon-bar{display:flex;gap:12px;padding:12px 13px 0;background:linear-gradient(#353c32,#252c24);align-items:stretch}.summon-button{flex:1;display:flex;align-items:center;gap:8px;text-align:left;border:1px solid #9b8d60;border-radius:3px;color:#e0d0a4;background:linear-gradient(135deg,#4e5340,#303a2d);padding:8px 10px;box-shadow:inset 0 0 0 2px #232b23;font-size:12px;white-space:nowrap}.summon-button:hover{background:#535d42}.summon-icon{font-size:27px;color:#d6c586}.summon-button small{display:block;margin-top:4px;font-size:8px;color:#aeb797}.summon-button b{margin-left:auto;font-size:19px;font-weight:400}.roster{display:flex;gap:5px}.roster>span{display:flex;flex-direction:column;align-items:center;justify-content:center;width:38px;border:1px solid #768061;background:linear-gradient(#566249,#303b2d);border-radius:3px;font-family:serif;font-size:18px;text-shadow:0 2px #000}.roster small{font-family:sans-serif;font-size:8px;color:#b3bba3;margin-top:3px}.roster-gold{color:#e4c673}.roster-wood{color:#a5c977}.roster-water{color:#91c5d0}
.game-controls{padding:10px 13px;gap:7px;background:#252c24}.primary{background:linear-gradient(#b79c5e,#806b3b);border:1px solid #dac48b;box-shadow:inset 0 0 0 2px #3b3b2788,0 3px 0 #11170f;color:#fff1c5;border-radius:3px;text-shadow:0 1px #564324;padding:12px 18px;letter-spacing:2px}.primary:hover{background:linear-gradient(#c6ac6c,#99814a)}.game-controls .primary{font-size:13px;justify-content:center;gap:16px;min-height:42px}.game-controls .primary:disabled{opacity:.6}.secondary{background:linear-gradient(#3c4737,#263123);border-color:#647455;color:#d0d8bf;border-radius:3px;padding:9px 12px;font-size:11px;min-height:40px}.secondary:hover{background:#45563b}.restart{border:1px solid #647455;background:#2c3728;border-radius:3px;color:#b7c1a7;font-size:20px;padding:6px 10px}.restart span{display:none}.tip{padding:0 12px 11px;background:#252c24;color:#b5bea7;line-height:1.7;font-size:10px;min-height:39px}
aside{padding-top:31px;gap:0;display:block;min-width:0}.field-guide-title{margin-bottom:18px}.field-guide-title>span{color:#838f7d;font-size:8px;letter-spacing:1.6px}.field-guide-title h2{font-family:serif;font-weight:400;letter-spacing:4px;color:#d0c6a3;font-size:21px;margin:8px 0 0}.guide-tabs{display:flex;padding:4px;background:#101713;border:1px solid #555e4a;gap:3px}.guide-tabs button{flex:1;padding:9px 4px;white-space:nowrap;background:#252d24;border:1px solid transparent;color:#8d9b85;font-size:10px;border-radius:0}.guide-tabs button[aria-selected=true]{background:#536950;border-color:#819374;color:#f2edd4;box-shadow:inset 0 0 0 2px #31442e}.guide-tabs button:hover{color:#eee7ce}.guide-card,.selection-card,.reward-card{border:1px solid #555e4a;border-top:0;border-radius:0;padding:22px 18px;background:linear-gradient(130deg,#2b342b,#1c251e);color:#d6d6bd;box-shadow:inset 0 0 0 4px #131c1566}.guide-card:before{display:none}.section-overline,.guide-card .section-overline{font-size:8px;color:#a7a889;letter-spacing:1.4px}.guide-card h2{font-size:18px;font-family:serif;color:#e3d6af;margin:13px 0 10px}.aside-intro{color:#a5b099;font-size:11px;margin-bottom:23px}.steps{gap:22px}.steps li{gap:10px}.steps li>span{border-radius:2px;border:1px solid #657452;background:#303d2b;color:#c4ccaf;width:24px;height:24px}.steps li.active>span{background:#927e4b;border-color:#c5b16d;color:#fff2c6}.steps li.done>span{background:#4b6440;color:#e4edd1}.steps strong{font-size:12px;line-height:1.6;color:#e1ddc2}.steps p{font-size:11px;color:#a7b59d;line-height:1.85}.guide-note{font-size:10px;line-height:1.8;color:#bdbb94;border-color:#64715366}.card-title h3{font-size:15px;color:#dfd7ba}.card-title>span{font-size:9px;color:#a7b393}.selection-description{font-size:11px;color:#b4bda3;line-height:1.9;margin:15px 0 20px}.elements{gap:17px}.element{border-radius:3px;border:1px solid #908b62!important;box-shadow:inset 0 0 0 2px #1f2c23}.element.gold{background:#635635;color:#f1d486}.element.wood{background:#3c5733;color:#c2d893}.element.water{background:#35565a;color:#b6d5db}.elements strong{font-size:12px;color:#dfdbc2}.elements small{font-size:10px;color:#9cae92}.elements em{color:#7f9677}.locked-elements{border-color:#5b6e4c;color:#b1b797;font-size:11px;margin-top:24px}.locked-elements span{font-size:10px;color:#84957a}.reward-card{display:flex;align-items:flex-start;gap:10px;padding-block:25px}.reward-symbol{font-size:35px;color:#d3bb77}.reward-card h3{font-size:13px;color:#e7d6a1;line-height:1.9}.reward-card p{font-size:12px;color:#b4baa1;line-height:2}.reward-card b{color:#e8cc86}.reward-card small{font-size:10px;color:#92a183;line-height:1.8}.reward-card .section-overline{color:#b5ae83}
footer{margin-top:25px;padding:23px 0;border-top:1px solid #65774a30;color:#7d8c79;font-size:9px;align-items:center}footer b{color:#b3bd9c}footer i{color:#5f7454}.paused-cover{background:#111c17bb;backdrop-filter:blur(4px);font-size:22px;color:#ede3bc}.paused-cover button{background:#69764d;border:1px solid #b4bc8f;color:#fcf7d7;border-radius:3px}.text-button{color:#b2bea1}dialog{background:linear-gradient(145deg,#303b2c,#17231b);border:3px double #a49764;border-radius:3px;color:#e7ddba;box-shadow:0 0 0 5px #172019,0 25px 100px #000a}dialog::backdrop{background:#090f11b0}dialog h2{color:#e1d2a6;font-family:serif}dialog p,dialog li{color:#b4c0a7;font-size:12px}.dialog-note{background:#132219;border:1px solid #586849}.close{color:#bbc3a5}.result-stats{border-color:#74845350}.result-stats strong{color:#e4d2a0}.result-reward{background:#3b422b;border:1px solid #7b8150;border-radius:2px;color:#d6d1a2;font-size:12px}.result-icon{color:#d7bd77}
@media(min-width:1500px){main{padding-inline:26px}.layout{grid-template-columns:minmax(0,450px) minmax(205px,1fr)}.topbar{padding-inline:4%}}
@media(max-width:1100px){main{max-width:960px;padding-inline:24px}.page-heading{width:180px;left:24px}.page-heading h1{font-size:43px}.page-heading h1 span{display:block;font-size:9px;letter-spacing:3px}.page-heading .eyebrow{font-size:7px;letter-spacing:1px}.layout{margin-left:207px;grid-template-columns:minmax(0,420px) minmax(195px,1fr);gap:20px}.island-crest{width:85px;height:85px}.island-crest span{font-size:65px;line-height:85px}.hud{margin:0;gap:10px}.hud strong{font-size:16px}.hud-icon{font-size:18px}.guide-card,.selection-card,.reward-card{padding-inline:14px}.steps p{font-size:10px}.stage-header{padding-inline:13px}.summon-bar{gap:8px}.roster>span{width:30px}.summon-button{font-size:11px;padding-inline:7px}.summon-button small{font-size:7px}}
@media(max-width:850px){main{max-width:690px;padding:24px 18px 0}.page-heading{position:static;width:auto;text-align:left;display:flex;align-items:center;justify-content:space-between;margin:0 0 22px}.page-heading h1{font-size:25px;letter-spacing:4px;margin:8px 0 0}.page-heading h1 br{display:none}.page-heading h1 span{display:none}.island-crest,.intro-copy,.chapter-caption{display:none}.guest{display:none}.layout{margin:0;grid-template-columns:minmax(0,420px) minmax(195px,1fr);gap:20px}.field-guide-title>span{font-size:7px;letter-spacing:1px}.field-guide-title h2{font-size:18px}.guide-card .steps{flex-direction:column}.steps li{gap:9px}.selection-card .elements{flex-direction:column;align-items:stretch}.elements em{display:block}.reward-card{justify-content:flex-start}.hud{padding:10px;gap:7px}.hud strong{font-size:15px}.hud small{font-size:7px}.hud em{font-size:8px}.hud-icon{font-size:17px}.game-controls{padding:9px 10px;gap:6px}.game-controls .primary{font-size:12px;padding:10px 8px}.secondary{padding:8px 10px}.tip{font-size:9px}.stage-plaque{width:155px}.summon-bar{padding-inline:10px}.summon-icon{font-size:22px}.roster>span{width:27px}.summon-button{gap:5px}.map-caption{font-size:8px}.stage-header{height:80px}.stage-header h2{font-size:9px}.level-tag{font-size:14px}.slot{font-size:20px}}
@media(max-width:620px){.topbar{height:54px;padding-inline:16px}.brand{font-size:15px;gap:9px}.brand-mark{width:29px;height:29px;font-size:20px}.brand small{font-size:7px}.prototype{font-size:8px;padding:6px 7px;letter-spacing:.2px}.prototype span{display:none}.help-button{font-size:0}.help-button span{font-size:12px}.topbar .brand-en{display:none}main{max-width:458px;padding:18px 14px 0}.page-heading{margin-bottom:20px}.page-heading h1{font-size:23px}.page-heading .eyebrow{font-size:7px;letter-spacing:1.6px}.layout{display:flex;flex-direction:column;gap:25px}.game-card{width:100%}.hud{gap:14px;padding:10px 12px}.hud small{font-size:8px}.hud strong{font-size:16px}.hud-icon{font-size:20px}.hud em{font-size:9px}.hud .timer{margin-left:auto}.stage-header{height:75px;padding-inline:20px}.stage-plaque{width:170px}.board-wrap{margin:0}.game-controls{padding:9px 12px}.game-controls .primary{font-size:13px;min-height:43px}.secondary{padding:8px 13px}.game-controls .restart{padding:6px 10px}.summon-bar{padding:11px 12px 0;gap:11px}.summon-button{font-size:12px;padding:8px 10px;gap:7px}.summon-button small{font-size:8px}.summon-icon{font-size:26px}.roster>span{width:33px}.slot{font-size:22px}.slot .slot-level{font-size:8px}.map-label{font-size:9px}.map-caption{font-size:8px;bottom:9px}.tip{font-size:10px;padding-bottom:10px;min-height:42px}aside{width:100%;padding:0}.field-guide-title{margin-bottom:13px}.field-guide-title h2{font-size:21px}.field-guide-title>span{font-size:8px}.guide-tabs button{font-size:12px;padding:11px 5px}.guide-card,.selection-card,.reward-card{padding:24px}.steps p{font-size:12px}.steps strong{font-size:13px}.steps li{gap:12px}.guide-card .steps br{display:none}.guide-note{font-size:11px}.guide-card h2{font-size:21px}.aside-intro{font-size:12px}.selection-card .elements{gap:20px}.elements>div{gap:12px}.selection-card .elements strong{font-size:13px}.elements small{font-size:11px}.element{width:38px;height:38px;font-size:20px}.selection-description{font-size:12px}.reward-card h3{font-size:14px}.reward-card p{font-size:13px}.reward-card small{font-size:11px}footer{font-size:9px;gap:10px;padding-top:19px;line-height:1.8}.map-caption{max-width:85%;white-space:normal;text-align:center}}
@media(prefers-reduced-motion:reduce){button{transition:none}.slot.match{animation:none}}

/* Gameplay blockout: flat shapes now, artwork can be added later. */
body{background:#20252c}body:before,.game-card:before,.game-card:after,.stage-header:before,.stage-header:after,.island-crest{display:none}
.game-card{border:1px solid #64748b;border-radius:0;box-shadow:none;background:#29313b}
.stage-header,.hud,.summon-bar,.game-controls,.tip{background:#29313b;border-color:#64748b}
.stage-plaque{clip-path:none;background:#e2e8f0;border:1px solid #94a3b8;box-shadow:none;border-radius:0}
.stage-flourish{display:none}.stage-header{justify-content:center}.difficulty{position:absolute;right:18px}
.board-wrap{background:#e5e7eb;border-color:#64748b}.slot{border-radius:0;background:transparent;border:1px solid transparent;color:#64748b;text-shadow:none;box-shadow:none}
.slot.empty:hover{background:#2563eb1a;border-color:#2563eb;box-shadow:none}.slot.selected{border:3px solid #2563eb;box-shadow:none}.slot.match{border:3px dashed #a16207;box-shadow:none;animation:none}
.slot .slot-level{background:#fff;color:#1e293b;border:1px solid #94a3b8;border-radius:0;bottom:-8px;font-size:10px}
.map-label{color:#334155;text-shadow:none}.entrance{left:58%;top:6%}.core{left:12%;top:98%}.map-caption{color:#334155;background:#fff;border:1px solid #94a3b8;border-radius:0}
.primary,.primary:hover{background:#64748b;border:1px solid #cbd5e1;box-shadow:none;text-shadow:none;color:white;border-radius:0}
.secondary,.secondary:hover,.restart,.summon-button,.summon-button:hover,.roster>span,.guide-card,.selection-card,.reward-card,.upgrade-card,.damage-upgrade,.upgrade-buy,.upgrade-buy:hover:not(:disabled){background:#303b47;border-color:#64748b;border-radius:0;box-shadow:none}
.roster>span{text-shadow:none}.guide-tabs,.guide-tabs button{background:#29313b;border-color:#64748b}.guide-tabs button[aria-selected=true]{background:#526578;box-shadow:none;border-color:#94a3b8}
.page-heading{top:95px}.page-heading h1{text-shadow:none;font-family:"Microsoft JhengHei",sans-serif;font-size:38px;letter-spacing:5px}.page-heading h1 span{letter-spacing:3px}
.element{border-radius:0!important;box-shadow:none}.summon-icon,.stage-flourish{font-family:sans-serif}.upgrade-status{background:#1e293b}
dialog{background:#29313b;border-color:#94a3b8;border-radius:0;box-shadow:0 10px 50px #0006}.dialog-note,.result-reward{background:#334155;border-color:#64748b;border-radius:0}
@media(max-width:850px){.page-heading h1{font-size:25px}}@media(max-width:620px){.slot .slot-level{font-size:9px;bottom:-6px}.map-label{font-size:8px}}

/* Shared 8 x 12 grid: 80-unit square cells and equally spaced tower centers. */
.board-wrap{aspect-ratio:640/960}.slot{width:11.25%;height:7.5%}.slot .slot-level{bottom:0;padding:1px 4px;font-size:9px}.entrance{left:3%;top:2%}.core{left:3%;top:94%}.map-caption{left:3%;transform:none;bottom:38px;max-width:58%}
@media(max-width:620px){.slot .slot-level{font-size:8px;bottom:0}.map-caption{font-size:8px;bottom:35px}.core{top:95%}}

/* V0.4: a single-screen battlefield with an always-visible command panel. */
html,body{height:100%;overflow:hidden}.topbar{height:48px;padding:0 20px}.brand small,.brand-en,.page-heading,main>footer,.stage-header{display:none!important}.brand-mark{width:28px;height:28px;font-size:18px}.brand{font-size:15px}.prototype{font-size:10px}.help-button{font-size:12px}main{max-width:1120px;height:calc(100dvh - 48px);padding:12px;margin:auto}.layout{display:block;margin:0;height:100%}.game-card{height:100%;display:grid;grid-template-columns:minmax(0,1fr) 340px;grid-template-rows:52px minmax(0,1fr) 40px;gap:0;overflow:hidden}.hud{grid-column:1/-1;grid-row:1;padding:8px 18px;justify-content:flex-start;gap:30px}.hud .timer{margin-left:auto}.hud small{font-size:10px}.hud strong{font-size:19px}.board-wrap{grid-column:1;grid-row:2;align-self:center;justify-self:center;height:100%;width:auto;max-width:100%;max-height:100%;aspect-ratio:640/960;margin:0;border:0;overflow:hidden}.battle-tools{grid-column:2;grid-row:2;display:flex;flex-direction:column;justify-content:center;gap:12px;padding:16px;border-left:1px solid #526174;min-height:0;background:#252e39}.summon-bar{padding:0;background:none;gap:0}.roster{display:none}.summon-button{width:100%;min-height:55px;font-size:15px;white-space:normal}.summon-button small{font-size:11px}.summon-icon{font-size:25px}.game-card .upgrade-card{margin:0;padding:0;border:0;box-shadow:none;background:none;order:0}.upgrade-heading{margin-top:4px}.upgrade-heading h2{font-family:inherit;font-size:14px;letter-spacing:0;margin:0}.upgrade-heading .section-overline{display:none}.upgrade-scope{font-size:10px}.upgrade-intro{font-size:11px;margin:7px 0 12px}.damage-upgrades{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.damage-upgrade{display:flex;flex-direction:column;padding:9px 4px;text-align:center;gap:6px}.damage-upgrade .element{width:28px;height:28px;font-size:18px}.damage-upgrade strong{font-size:11px;line-height:1.6}.damage-upgrade strong span{display:block;font-size:10px}.damage-upgrade small{font-size:10px}.damage-upgrade .upgrade-buy{width:100%;font-size:10px;padding:6px 2px;min-height:36px}.summon-upgrade{margin-top:14px;padding-top:14px}.summon-upgrade>div:first-child{display:flex;justify-content:space-between;align-items:center;gap:6px}.summon-upgrade h3{font-size:12px;margin:0}.summon-upgrade #chanceCurrent{font-size:9px}.chance-track{margin:9px 0}.summon-upgrade .upgrade-buy{min-height:38px;font-size:12px}.summon-upgrade p{font-size:10px;line-height:1.7}.upgrade-hint{display:none}.upgrade-status{display:none}.game-controls{padding:0;background:none;gap:6px}.game-controls .primary{padding:9px;font-size:12px;min-height:40px}.secondary{padding:8px 10px;min-height:40px}.restart{padding:6px 10px}.manual-button{border:0;background:none;color:#cbd5e1;text-decoration:underline;font-size:12px;padding:6px}.game-card>.tip{grid-column:1/-1;grid-row:3;padding:8px 12px;min-height:0;margin:0;border-top:1px solid #526174;color:#e2e8f0;font-size:11px;line-height:1.7;overflow:auto}.map-caption{display:none}#manualDialog{max-height:85dvh;overflow:auto}#manualDialog aside{display:block!important;padding:8px 0 0}#manualDialog .field-guide-title{margin-bottom:14px}.paused-cover{font-size:18px}.slot .slot-level{font-size:9px}.summon-button:disabled,.upgrade-buy:disabled{opacity:.45}
@media(max-width:700px){.topbar{height:40px;padding:0 10px}.brand{font-size:12px}.brand-mark{width:24px;height:24px;font-size:16px}.help-button{font-size:0}.help-button span{font-size:12px}.prototype{font-size:9px;padding:4px 7px}main{height:calc(100dvh - 40px);max-width:none;padding:0}.game-card{grid-template-columns:minmax(0,1fr);grid-template-rows:43px minmax(0,1fr) auto 34px;border:0}.hud{grid-column:1;grid-row:1;padding:5px 10px;gap:18px}.hud small{font-size:8px}.hud strong{font-size:15px}.hud-icon{font-size:17px}.hud .timer strong{font-size:13px}.board-wrap{grid-column:1;grid-row:2}.battle-tools{grid-column:1;grid-row:3;border-left:0;border-top:1px solid #64748b;padding:8px 10px;gap:7px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.summon-bar{grid-column:1;grid-row:1}.summon-button{min-height:42px;font-size:12px;padding:5px 8px}.summon-icon{display:none}.summon-button small{font-size:9px;margin-top:3px}.game-card .upgrade-card{grid-column:1/-1;grid-row:2}.upgrade-heading,.upgrade-intro,.damage-upgrade .element,.chance-track,.summon-upgrade p,.upgrade-scope{display:none}.damage-upgrades{gap:6px}.damage-upgrade{padding:5px 4px;gap:3px}.damage-upgrade strong{font-size:11px}.damage-upgrade strong span{display:inline;font-size:9px;margin-left:3px}.damage-upgrade small{font-size:9px}.damage-upgrade .upgrade-buy{min-height:31px;font-size:11px;padding:5px 2px}.summon-upgrade{border:0;padding:0;margin-top:6px;display:flex;justify-content:space-between;align-items:center;gap:8px}.summon-upgrade>div:first-child{display:block;flex:1}.summon-upgrade h3{font-size:11px;margin-bottom:3px}.summon-upgrade #chanceCurrent{font-size:9px}.summon-upgrade .upgrade-buy{width:auto;font-size:11px;min-height:34px;padding:5px 8px}.game-controls{grid-column:1/-1;grid-row:3;min-width:0}.game-controls .primary{min-height:34px;padding:6px 10px}.game-controls .secondary,.game-controls .restart{min-height:34px;padding:5px 13px}.manual-button{grid-column:2;grid-row:1;justify-self:end;font-size:11px;min-height:36px;padding:5px}.game-card>.tip{grid-column:1;grid-row:4;padding:4px 10px;font-size:10px;line-height:1.4}.slot{font-size:16px}.slot .slot-level{font-size:7px;padding:0 2px}.map-label{font-size:7px}.paused-cover{font-size:16px}.paused-cover button{font-size:11px;padding:8px}}
@media(max-height:650px) and (min-width:701px){.battle-tools{padding:8px 12px;gap:7px}.damage-upgrade .element,.upgrade-intro,.summon-upgrade p{display:none}.damage-upgrade{padding:5px 3px}.summon-upgrade{margin-top:8px;padding-top:8px}.summon-button{min-height:44px}.manual-button{padding:3px}}

/* V0.5: reference-inspired portrait cabinet and four bottom upgrade cards. */
body{background:#141514;color:#ece7d8}body:before{display:none}
.topbar{height:36px;background:#191a18;border-bottom:1px solid #44433b;padding:0 14px}.brand{font-size:12px}.brand-mark{width:23px;height:23px;font-size:15px}.prototype{font-size:9px;padding:3px 7px}.help-button{font-size:11px}
main{height:calc(100dvh - 36px);max-width:500px;padding:8px}
.game-card{grid-template-columns:minmax(0,1fr);grid-template-rows:44px 40px minmax(0,1fr) auto 28px;background:#484940;border:2px solid #6e6c60;border-radius:2px;box-shadow:0 0 0 3px #20211f,0 12px 50px #0008}
.stage-header{display:flex!important;grid-column:1;grid-row:1;height:44px;padding:4px 14px;background:#30312d;border-bottom:2px solid #79796b;justify-content:center}.stage-header:before,.stage-header:after{display:none}.stage-flourish,.difficulty{display:none}.stage-plaque{width:164px;padding:3px 12px;background:#cdcec3;border:3px double #373a36;box-shadow:none}.stage-header .stage-plaque{display:block}.level-tag{font-family:Georgia,serif;font-size:15px;letter-spacing:2px;color:#30342e}.stage-header h2{font-size:9px;letter-spacing:2px;margin:0;color:#43483c}
.hud{grid-column:1;grid-row:2;margin:0;padding:4px 12px;background:#282b26;border-bottom:1px solid #6a6b5b;gap:18px}.hud small{font-size:8px;letter-spacing:0;color:#b4b8a2}.hud strong{font-size:16px;color:#f1e3b7}.hud-icon{font-size:17px}.hud .timer strong{font-size:13px}
.board-wrap{grid-column:1;grid-row:3;height:100%;width:auto;max-width:100%;max-height:100%;aspect-ratio:2/3;background:#484940}.map-label{color:#e5ddc7;font-size:7px;text-shadow:none}.slot{border-radius:2px;background:#fff6dd08;color:#686555;text-shadow:none}.slot.empty:hover{background:#fff7d344}.slot.selected{border-color:#f7d375}.slot .slot-level{background:#303329;color:#fff0bf;border-color:#b6a57d;font-size:8px}
.battle-tools{grid-column:1;grid-row:4;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;padding:9px 10px 7px;border:0;border-top:3px double #888779;background:#30322d;min-height:0;justify-content:normal}
.game-card .upgrade-card,.damage-upgrades{display:contents}.upgrade-heading,.upgrade-intro,.upgrade-hint,.upgrade-status{display:none}
.damage-upgrade{grid-row:1;display:flex;flex-direction:column;gap:2px;padding:5px 3px;background:#494c43;border:2px solid #aaa99a;box-shadow:inset 0 0 0 1px #24271f;border-radius:4px;min-width:0}.damage-upgrade .element{display:grid;width:27px;height:27px;font-size:19px;border:1px solid #b5ab8d;background:#373d30}.damage-upgrade strong{font-size:10px;line-height:1.4}.damage-upgrade strong span{display:inline;font-size:8px;margin-left:2px}.damage-upgrade small{font-size:8px;color:#d6dac3;white-space:nowrap}.damage-upgrade .upgrade-buy{min-height:27px;font-size:10px;padding:3px 0;background:#292e24;color:#f2dd9d;border:1px solid #929174;letter-spacing:0;border-radius:2px}
.summon-upgrade{grid-column:4;grid-row:1;display:flex;flex-direction:column;justify-content:space-between;gap:2px;margin:0;padding:5px 3px;border:2px solid #aaa99a;border-radius:4px;background:#494c43;box-shadow:inset 0 0 0 1px #24271f;min-width:0}.summon-upgrade>div:first-child{display:block;text-align:center;flex:0}.summon-upgrade h3{font-size:10px;letter-spacing:0;margin:2px 0 3px;color:#f0dfad}.summon-upgrade h3:before{content:'Ⅱ';display:block;margin:0 auto 4px;border:1px solid #9d95b4;background:#423d50;color:#e3d7fb;font-size:19px;width:27px;height:27px}.summon-upgrade #chanceCurrent{font-size:8px;color:#d6dac3}.summon-upgrade .upgrade-buy{font-size:9px;letter-spacing:0;min-height:27px;width:100%;padding:3px 0;background:#292e24;color:#f2dd9d;border:1px solid #929174;border-radius:2px}.chance-track,.summon-upgrade p{display:none}
.summon-bar{grid-column:1/4;grid-row:2}.summon-button{min-height:40px;font-size:13px;padding:5px 12px;border:2px solid #b4aa83;border-radius:3px;background:#686a50;color:#fff0c7;box-shadow:inset 0 0 0 1px #33372a}.summon-button small{font-size:9px;margin-top:2px;color:#ece6ca}.summon-icon{display:none}.manual-button{grid-column:4;grid-row:2;justify-self:stretch;border:1px solid #797d6c;border-radius:3px;background:#3d4237;color:#dddacb;font-size:10px;padding:4px;text-decoration:none;min-height:40px}
.game-controls{grid-column:1/-1;grid-row:3;gap:6px;padding:0}.game-controls .primary{min-height:31px;padding:5px;font-size:12px;background:#5a6f6d;border:1px solid #92a29a;color:#f4f1dc;letter-spacing:1px}.game-controls .secondary,.game-controls .restart{min-height:31px;padding:4px 12px;background:#3d4237;border:1px solid #797d6c;color:#dddacb;border-radius:2px}.restart span{display:none}
.game-card>.tip{grid-column:1;grid-row:5;min-height:0;padding:3px 8px;font-size:9px;line-height:1.3;background:#252822;border-color:#646955;color:#dbddc9}.paused-cover{background:#20241ce8}
@media(max-width:520px){main{padding:0}.game-card{border-width:0}.topbar{padding:0 10px}.help-button{font-size:0}.help-button span{font-size:12px}.battle-tools{padding:7px 7px 6px;gap:5px}.damage-upgrade strong span{display:block}.damage-upgrade small{font-size:7px}.summon-upgrade .upgrade-buy{font-size:8px}.hud{gap:14px}}
@media(max-height:650px){.damage-upgrade .element,.summon-upgrade h3:before{display:none}.damage-upgrade strong span{display:inline}.game-card{grid-template-rows:35px 35px minmax(0,1fr) auto 26px}.stage-header{height:35px}.stage-header h2{display:none}.battle-tools{padding-block:5px;gap:4px}.summon-button,.manual-button{min-height:34px}}
/* Horde progression stays visible without adding a scrolling panel. */
.batch-progress{grid-column:1/-1;grid-row:1;text-align:center;color:#e9dfbc;font-size:10px;line-height:18px;min-height:18px;background:#23271f;border:1px solid #656e55}
.damage-upgrade,.summon-upgrade{grid-row:2}.summon-bar,.manual-button{grid-row:3}.game-controls{grid-row:4}.damage-upgrade strong{font-size:9px}.damage-upgrade strong span{display:block}.damage-upgrade small{font-size:8px}
@media(max-width:520px){.damage-upgrade strong{font-size:8px}.batch-progress{font-size:9px}}
/* Position-based scoring is separate from spendable coins. */
.hud{gap:10px;padding-inline:9px}.score-hud strong{color:#f7d581}.score-summary{padding:14px;margin:15px 0;border:1px solid #9d8d59;background:#20281f;color:#ddd2ab;text-align:center}.score-summary strong{display:block;font-size:38px;color:#f7d581;margin:5px 0}.score-summary small{font-size:10px}.hud .score-hud strong{font-size:15px}
@media(max-width:420px){.hud{gap:8px;padding-inline:7px}.hud-icon{display:none}.hud strong{font-size:14px}.hud em{font-size:8px}.hud small{font-size:8px}.hud .score-hud strong{font-size:14px}}
/* V0.9: stage heading, wave track, and lower resource bar. */
.game-card{grid-template-rows:44px 52px minmax(0,1fr) 44px auto 28px}
.stage-header{height:44px;position:relative}.stage-plaque{width:140px;padding:5px 10px}.level-tag{font-size:19px;font-weight:bold;letter-spacing:2px}
.stage-header .manual-button{position:absolute;right:9px;top:7px;min-height:29px;padding:4px 7px;font-size:10px;grid-area:auto}
.wave-progress{grid-column:1;grid-row:2;padding:5px 10px 7px;background:#242821;border-bottom:1px solid #666b59;min-width:0}
.wave-progress-heading{display:flex;justify-content:space-between;gap:6px;color:#d4d7c4;font-size:9px;line-height:14px;margin-bottom:4px;white-space:nowrap}
.wave-progress-heading>span:first-child{color:#eed391;flex-shrink:0}#batchProgress{font-size:8px;overflow:hidden;text-overflow:ellipsis}
.wave-segments{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}.wave-segment{height:20px;position:relative;overflow:hidden;background:#151b14;border:1px solid #5c6450;border-radius:2px;text-align:center}.wave-segment i{position:absolute;left:0;top:0;bottom:0;width:0;background:#637853;transition:width .15s linear}.wave-segment span{position:relative;z-index:1;display:block;line-height:18px;font-size:9px;color:#dee1ce;text-shadow:0 1px 2px #000}.wave-segment.active{border-color:#d5bd79}.wave-segment.active i{background:#84764a}.wave-segment.complete{border-color:#819b6b}
.board-wrap{grid-row:3}.hud{grid-row:4;grid-column:1;margin:0;padding:5px 12px;justify-content:space-between;gap:10px;background:#20281f;border-top:2px solid #777a65;border-bottom:1px solid #535b47}.hud .timer{margin-left:0}.hud .hud-icon{display:block;font-size:18px}.hud small{font-size:9px}.hud strong,.hud .score-hud strong{font-size:17px}.hud>div{gap:5px}
.battle-tools{grid-row:5;border-top:0;padding-top:7px}.damage-upgrade,.summon-upgrade{grid-row:1}.summon-bar{grid-row:2;grid-column:1/-1}.game-controls{grid-row:3}.game-card>.tip{grid-row:6}
@media(max-width:360px){.stage-header .manual-button{right:5px;font-size:9px;padding:4px}.stage-plaque{width:124px}.hud{padding-inline:7px;gap:7px}.hud .hud-icon{font-size:14px}.hud strong,.hud .score-hud strong{font-size:15px}.wave-progress{padding-inline:6px}#batchProgress{font-size:7px}}
@media(max-height:650px){.game-card{grid-template-rows:38px 48px minmax(0,1fr) 40px auto 26px}.stage-header{height:38px}.stage-header .manual-button{top:4px}.wave-progress{padding-top:3px;padding-bottom:5px}}
.tower-menu{position:absolute;z-index:8;bottom:5px;left:5px;right:5px;background:#1c271ff5;border:1px solid #ddc27d;border-radius:4px;padding:7px 9px;color:#f3e9ca;box-shadow:0 3px 12px #0008}.tower-menu strong{font-size:12px}.tower-menu p{font-size:10px;margin:3px 0 6px;line-height:1.4}.tower-menu>div{display:flex;gap:8px}.tower-menu button{flex:1;min-height:32px;border:1px solid #bba36b;border-radius:3px;background:#637149;color:#fff0c7;font-size:12px}.tower-menu #cancelTower{background:#374336}.tower-menu button:disabled{opacity:.45}
/* Keep every eligible tower clickable while choosing the merge destination. */
.tower-menu.choosing-merge{right:auto;width:92px;padding:4px;bottom:5px;left:5px}.tower-menu.choosing-merge>strong,.tower-menu.choosing-merge>p{display:none}.tower-menu.choosing-merge button{min-height:28px;font-size:11px}
/* Minimal upgrade cards: element, current level, purchase cost. */
.damage-upgrade{gap:4px;justify-content:space-between;padding:7px 4px}.damage-upgrade strong span{font-size:13px;display:block;margin:0;color:#f2e5b9;line-height:1.4}.damage-upgrade .upgrade-buy{font-size:11px}.summon-upgrade h3{font-size:11px}.summon-upgrade #chanceCurrent{display:block;font-size:13px;color:#f2e5b9}.summon-upgrade .upgrade-buy{font-size:11px}.summon-button #summonOdds{display:none}.summon-upgrade>div:first-child{flex:1}.summon-upgrade h3:before{margin-bottom:2px}

/* Construction happens only through battlefield slots. */
.battle-tools .game-controls{grid-row:2}

