@font-face{font-family:Fallback;src:local("Trebuchet MS")}*{box-sizing:border-box} :root{--ink:#3d2a25;--paper:#fff6df;--cream:#efe0ba;--orange:#c85d33;--teal:#3b7771;--muted:#806d57;--line:#cfbc97;--shadow:4px 5px 0 #4a30252b;color:var(--ink);font-family:Fallback,"Trebuchet MS",system-ui,sans-serif;font-size:16px}body{margin:0;background:var(--cream);background-image:radial-gradient(#7e604510 .8px,transparent .8px);background-size:5px 5px}button,input,select{font:inherit}button{cursor:pointer;border:2px solid var(--ink);border-radius:9px 7px 10px 6px;padding:10px 18px;background:var(--paper);color:var(--ink);font-weight:800;box-shadow:2px 3px 0 var(--ink);transition:transform .12s,box-shadow .12s;min-height:44px}button:hover{transform:translateY(-2px)}button:active{transform:translate(1px,2px);box-shadow:0 0 0 var(--ink)}button:disabled{opacity:.4;cursor:not-allowed;transform:none}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #24a7ab;outline-offset:3px}.primary{background:var(--orange);color:#fff8e3}.secondary{background:var(--teal);color:#fff8e3}.quiet{box-shadow:none;border-color:#a99775;background:transparent}.small{font-size:.8rem;padding:5px 10px;min-height:34px}.icon-button{padding:8px;min-width:44px}h1,h2,h3,p{margin:0}h1,h2,h3{font-weight:900;line-height:1.05}p{line-height:1.45}small,.muted{color:var(--muted)}img{max-width:100%;user-select:none;-webkit-user-drag:none}.eyebrow{font-size:.72rem;letter-spacing:.15em;text-transform:uppercase;font-weight:900;color:var(--muted)}.tag{display:inline-block;border:1px solid var(--line);border-radius:50px;padding:5px 10px;font-size:.72rem;font-weight:800;background:#f4e8cc}.tag.orange{background:#efd1a6}.tag.green{background:#d5e3cb}.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 24px;border-bottom:2px solid var(--ink);background:#fff6dfd9;min-height:68px}.brand{font-size:1.1rem;font-weight:1000;letter-spacing:-.05em;white-space:nowrap}.brand em{font-style:normal;color:var(--orange)}.top-actions{display:flex;gap:10px;align-items:center}.money{display:inline-flex;gap:7px;align-items:center;font-weight:900;background:#f0ce7f;border:1px solid #a78746;padding:7px 12px;border-radius:30px}.coin{width:19px;height:19px;display:inline-grid;place-items:center;border:2px solid #9b6b25;border-radius:50%;font-size:11px}.page{max-width:1400px;margin:auto;padding:26px 30px 32px}.page-heading{display:flex;justify-content:space-between;align-items:end;gap:20px;margin-bottom:22px}.page-heading h1{font-size:clamp(24px,3vw,42px);margin-top:7px}.paper{background:var(--paper);border:2px solid var(--ink);box-shadow:var(--shadow);border-radius:5px 9px 6px 8px}.note{padding:14px 18px;background:#e7d6ae;border-left:4px solid var(--orange);font-size:.88rem}.row{display:flex;gap:12px;align-items:center}.wrap{flex-wrap:wrap}.space{justify-content:space-between}.grid{display:grid;gap:18px}.menu{min-height:calc(100dvh - 68px);display:grid;grid-template-columns:minmax(320px,1fr) 1.2fr;gap:30px;align-items:center;max-width:1400px;padding:35px 5vw;margin:auto}.menu-title{font-family:"Arial Black",system-ui;font-size:clamp(56px,7.5vw,112px);font-weight:1000;line-height:.87;letter-spacing:-.075em;transform:rotate(-2deg);margin:28px 0}.menu-title span{color:var(--orange);display:block}.menu-copy{max-width:360px;font-size:1rem;margin:26px 0}.menu-buttons{display:grid;grid-template-columns:1fr 1fr;gap:12px;max-width:390px}.menu-buttons .play{grid-column:1/-1;font-size:1.3rem;min-height:58px}.menu-hero{position:relative;aspect-ratio:1.12;background:url('./assets/arena/terrain-1.jpg') center/cover;border:3px solid var(--ink);border-radius:42% 50% 43% 47%;box-shadow:10px 13px 0 #b9a27c44;transform:rotate(2deg)}.menu-hero:before{content:"";position:absolute;inset:13%;border:3px solid #a85232aa;border-radius:50%;transform:rotate(-12deg)}.hero-panda{position:absolute;object-fit:contain;filter:drop-shadow(0 8px 1px #4b30252b)}.hero-panda.one{height:53%;left:17%;bottom:7%;z-index:4;transform:rotate(-2deg)}.hero-panda.two{height:41%;right:3%;bottom:15%;z-index:3}.hero-panda.three{height:33%;left:5%;top:4%;z-index:2}.hero-panda.four{height:37%;right:22%;top:3%;z-index:1}.hero-label{position:absolute;right:1%;bottom:0;background:var(--paper);border:2px solid var(--ink);padding:12px 18px;transform:rotate(-7deg);font-weight:900;z-index:5;box-shadow:var(--shadow)}.hero-label small{display:block;font-size:.65rem;letter-spacing:.1em;margin-bottom:4px}.menu-foot{margin-top:24px;font-size:.75rem;color:var(--muted)}.comic-intro{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin:24px 0}.comic-panel{min-height:280px;position:relative;overflow:hidden;padding:20px;display:flex;flex-direction:column;justify-content:space-between}.comic-panel:nth-child(2){transform:rotate(1deg);background:#dce4d1}.comic-panel:nth-child(3){transform:rotate(-1deg);background:#e9d3ac}.comic-panel .caption{background:var(--paper);border:2px solid var(--ink);padding:10px;z-index:2;font-weight:bold;align-self:start}.comic-panel img{height:170px;object-fit:contain;align-self:center;margin:10px}.comic-panel p{font-size:.86rem}.road{display:flex;gap:6px;overflow:auto;padding:6px 2px 14px;scrollbar-width:thin;margin-bottom:14px}.road-step{flex:0 0 47px;height:43px;border:1px solid #aa9874;display:grid;place-items:center;font-size:.8rem;border-radius:3px;position:relative;background:#e6d7b5}.road-step.done{background:#d7e2c8;color:#46704c}.road-step.current{background:var(--orange);color:white;border:2px solid var(--ink);box-shadow:2px 3px 0 var(--ink);transform:rotate(-4deg);font-weight:900}.road-step.boss{flex-basis:64px;background:#3f2c27;color:#fff5dd}.road-step small{font-size:10px;display:block;color:inherit}.camp-layout{display:grid;grid-template-columns:290px 1fr;gap:24px}.roster{padding:16px}.roster h2{font-size:1.2rem;margin-bottom:8px}.roster-row{display:flex;align-items:center;gap:7px;border-top:1px dashed #b4a17d;padding:7px 0}.roster-row img{height:53px;width:50px;object-fit:contain}.roster-row .details{flex:1;font-size:.8rem}.roster-row .details strong{display:block}.roster-row small{font-size:.7rem}.order-buttons{display:flex;flex-direction:column;gap:3px}.order-buttons button{font-size:.7rem;padding:0 5px;min-height:24px;border-width:1px;box-shadow:none}.roster footer{margin-top:12px;display:flex;gap:6px;flex-wrap:wrap}.encounters{grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch}.encounters.single{grid-template-columns:minmax(250px,530px);justify-content:center}.encounter{padding:17px;display:flex;flex-direction:column;position:relative}.encounter h3{font-size:1.4rem;margin:9px 0}.encounter .enemy-preview{display:flex;align-items:end;justify-content:center;min-height:140px;gap:0;background:radial-gradient(ellipse at bottom,#d9c9a788,transparent 70%);margin:12px 0}.enemy-preview img{width:48%;max-height:132px;object-fit:contain}.enemy-preview img:only-child{width:78%}.encounter .enemy-list{flex:1;font-size:.79rem;line-height:1.55;margin-bottom:18px}.encounter .reward{border-top:1px dashed var(--line);padding-top:12px;margin-bottom:13px;font-size:.8rem}.encounter.challenge{background:#f4ddbf;border-color:#9a5135}.inventory-strip{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}.item-button{position:relative;display:flex;gap:7px;align-items:center;padding:5px 10px;min-height:49px}.item-button img{width:32px;height:36px;object-fit:contain}.item-button b{background:var(--ink);color:white;border-radius:20px;min-width:20px;font-size:.75rem;padding:2px 4px}.machine-shelf{display:flex;gap:12px;align-items:end;overflow:auto;padding:12px 5px}.machine-small{position:relative;flex:0 0 105px;text-align:center}.machine-small .machine-art{height:135px}.machine-small small{display:block;font-size:.65rem;margin-top:3px}.machine-art{height:210px;position:relative;aspect-ratio:.72;margin:auto}.machine-body{height:100%;width:100%;object-fit:contain;filter:hue-rotate(var(--hue,0deg)) saturate(var(--sat,.85)) brightness(var(--brightness,1))}.machine-poster{position:absolute;left:23%;top:15%;width:54%;height:21%;background:#fff1d4;border-radius:3px;overflow:hidden;transform:rotate(-1deg)}.machine-poster img{position:absolute;width:100%;height:185%;object-fit:contain;object-position:top;top:0;left:0}.machine-choices{display:grid;grid-template-columns:repeat(3,minmax(200px,290px));gap:24px;justify-content:center}.machine-choices.two{grid-template-columns:repeat(2,minmax(220px,310px))}.choice-card{text-align:center;padding:18px;display:flex;flex-direction:column;align-items:center;gap:10px;position:relative}.choice-card h3{font-size:1.12rem}.choice-card p{font-size:.8rem;flex:1}.choice-card .role{font-size:.7rem;font-weight:900;color:var(--teal)}.choice-card button{width:100%;margin-top:9px}.relic-icon{height:112px;width:130px;object-fit:contain}.relic-choices{display:grid;grid-template-columns:repeat(3,minmax(190px,310px));gap:20px;justify-content:center}.collection-grid{grid-template-columns:repeat(auto-fill,minmax(170px,1fr))}.collection-grid .choice-card{padding:12px}.collection-grid .relic-icon{height:85px}.collection-grid p{font-size:.72rem}.empty{max-width:650px;margin:50px auto;text-align:center;padding:40px}.empty h2{margin:15px}.empty img{height:130px}.shop-layout{display:grid;grid-template-columns:1.4fr 1fr;gap:22px}.shop-items{grid-template-columns:repeat(4,1fr)}.shop-items .choice-card{padding:12px 8px}.shop-items img{height:78px;width:85px;object-fit:contain}.shop-items p{font-size:.7rem}.shop-items h3{font-size:.85rem}.shop-items button{padding:6px;font-size:.8rem}.options-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px}.options-box{padding:22px}.options-box h2{font-size:1.15rem;margin-bottom:18px}.option{display:grid;grid-template-columns:1fr 45%;align-items:center;gap:14px;margin:15px 0;font-size:.85rem}.option input[type=range]{width:100%;accent-color:var(--orange)}.option input[type=checkbox]{width:22px;height:22px;accent-color:var(--teal)}select{padding:7px;border:1px solid #a18d6a;border-radius:5px;background:var(--paper);max-width:100%}.option output{font-size:.72rem;color:var(--teal);font-weight:bold;margin-left:5px}.battle-view{height:100dvh;display:flex;flex-direction:column;overflow:hidden}.battle-top{min-height:56px;padding:8px 18px;flex-shrink:0}.battle-top h2{font-size:1.05rem}.battle-top .top-actions{gap:8px}.battle-stage{position:relative;flex:1;min-height:0}.battle-stage canvas{display:block;width:100%;height:100%;touch-action:none}.battle-bottom{background:var(--paper);border-top:2px solid var(--ink);min-height:69px;display:flex;justify-content:space-between;align-items:center;padding:8px 18px;gap:15px;flex-shrink:0}.battle-bottom .inventory-strip{margin:0;flex-wrap:nowrap}.battle-counts{display:flex;gap:18px;font-weight:900;font-size:.85rem}.battle-counts span{font-size:.7rem;font-weight:400;display:block}.battle-tip{position:absolute;top:12px;left:50%;transform:translateX(-50%);padding:8px 18px;background:#fff6dfe8;border:1px solid #ab9777;border-radius:30px;font-size:.78rem;pointer-events:none;text-align:center;max-width:80%}.battle-overlay{position:absolute;inset:0;display:grid;place-items:center;background:#392d2070;backdrop-filter:blur(3px);z-index:4}.battle-overlay .paper{padding:25px 38px;text-align:center;max-width:500px}.battle-overlay h2{font-size:2.2rem;margin-bottom:12px}.battle-overlay p{margin:12px 0}.result-board{max-width:860px;margin:20px auto;padding:30px;display:grid;grid-template-columns:1fr 1fr;gap:25px}.result-board>img{max-height:300px;object-fit:contain;align-self:center;justify-self:center}.result-copy h1{font-size:clamp(30px,4vw,54px);margin:12px 0}.result-copy p{margin:14px 0}.score{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:22px 0}.score div{padding:12px;background:#ebdfc2;border-radius:4px}.score strong{display:block;font-size:1.2rem}.score small{font-size:.68rem}.loading{height:100dvh;display:grid;align-content:center;justify-items:center;gap:22px;text-align:center}.stamp{border:4px solid var(--orange);color:var(--orange);font-weight:1000;font-size:2.2rem;padding:20px;transform:rotate(-7deg)}progress{accent-color:var(--orange);width:250px}#toast{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);z-index:30;background:var(--ink);color:var(--paper);padding:12px 20px;border-radius:8px;max-width:90%;text-align:center;display:none;font-size:.87rem}#toast.visible{display:block}dialog{border:2px solid var(--ink);border-radius:9px;background:var(--paper);color:var(--ink);padding:26px;max-width:min(540px,90vw);box-shadow:8px 10px 0 #0003}dialog::backdrop{background:#291f1da0;backdrop-filter:blur(4px)}dialog h2{margin-bottom:15px}dialog p{margin:15px 0}dialog .row{justify-content:flex-end;flex-wrap:wrap;margin-top:18px}#rotate{display:none;position:fixed;inset:0;z-index:100;background:var(--cream);align-content:center;justify-items:center;text-align:center;padding:35px;gap:20px}.turn-phone{font-size:100px;color:var(--orange);line-height:1}#rotate h2{font-size:28px}#rotate p{max-width:280px}.save-status{font-size:.65rem;color:var(--muted)}.battle-stage .pause-label{font-size:.8rem}.portrait-warning{display:none}.relic-bar{display:flex;gap:4px;flex-wrap:wrap}.relic-bar img{width:34px;height:34px;object-fit:contain}.no-margin{margin:0}.color-row{display:grid;grid-template-columns:1fr 60px;gap:10px;padding:6px 0;font-size:.8rem;align-items:center}.color-row input{width:55px;height:32px;border:1px solid var(--line);background:none;padding:1px}.footnote{font-size:.72rem;color:var(--muted);margin-top:14px}.kbd{border:1px solid #ab9670;border-radius:3px;padding:1px 5px;font-size:.7rem}
@media(max-width:1000px){:root{font-size:14px}.page{padding:20px}.camp-layout{grid-template-columns:225px 1fr;gap:15px}.encounters{gap:12px}.encounter{padding:12px}.encounter .enemy-preview{min-height:105px}.enemy-preview img{max-height:100px}.menu{padding:24px 5vw;gap:15px}.menu-title{font-size:75px}.machine-choices{gap:15px}.shop-layout{grid-template-columns:1fr}.shop-items{grid-template-columns:repeat(4,1fr)}}
@media(max-height:550px) and (orientation:landscape){:root{font-size:13px}.topbar{min-height:48px;padding:6px 16px}.topbar button{min-height:34px;padding:5px 10px}.menu{min-height:calc(100dvh - 48px);padding:15px 5vw;grid-template-columns:1fr 1fr;gap:5vw}.menu-title{font-size:clamp(44px,8vw,80px);margin:12px 0}.menu-copy{margin:15px 0;font-size:.9rem}.menu-hero{max-height:76dvh;aspect-ratio:1.2}.menu-buttons{gap:9px}.menu-buttons .play{min-height:44px;font-size:1.1rem}.menu-buttons button{padding:6px}.menu-foot{margin-top:13px}.page{padding:15px 20px}.page-heading{margin-bottom:14px}.page-heading h1{font-size:26px}.road{margin-bottom:5px;padding-bottom:10px}.road-step{height:33px;flex-basis:39px}.camp-layout{grid-template-columns:210px 1fr;gap:14px}.roster{padding:12px}.roster-row img{height:40px;width:40px}.encounter h3{font-size:1.2rem}.encounter .enemy-preview{min-height:80px;margin:6px 0}.enemy-preview img{max-height:85px}.encounter .enemy-list{font-size:.75rem;margin-bottom:9px}.encounter .reward{margin-bottom:8px;padding-top:8px}.machine-art{height:145px}.machine-choices{grid-template-columns:repeat(3,minmax(170px,260px));gap:15px}.choice-card{padding:12px;gap:7px}.choice-card button{min-height:38px;padding:7px}.relic-icon{height:85px}.comic-panel{min-height:210px;padding:12px}.comic-panel img{height:100px}.comic-intro{margin:15px 0}.battle-top{min-height:45px}.battle-bottom{min-height:55px;padding:5px 12px}.battle-bottom .item-button{min-height:40px;padding:3px 6px}.battle-bottom .item-button img{width:27px;height:28px}.battle-counts{gap:12px;font-size:.8rem}.battle-tip{top:7px;padding:5px 10px;font-size:.72rem}.battle-overlay h2{font-size:1.6rem}.result-board{padding:18px;max-width:760px;margin:5px auto}.result-board>img{height:200px}.score{margin:12px 0;gap:6px}.score div{padding:8px}.options-box{padding:16px}.option{margin:12px 0}.page-heading p{font-size:.8rem}}
@media(orientation:portrait) and (max-width:900px){#rotate{display:grid}#app{visibility:hidden}body{overflow:hidden}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
@supports(padding:max(0px)){.topbar,.battle-bottom{padding-left:max(18px,env(safe-area-inset-left));padding-right:max(18px,env(safe-area-inset-right))}.battle-bottom{padding-bottom:max(8px,env(safe-area-inset-bottom))}}

[hidden]{display:none!important}

/* Carnet de conquête: painted accents, cut-paper panels, fixed game stage. */
.battle-view{position:relative}.battle-view:after{content:'À LA BAGARRE !';position:absolute;inset:0;display:grid;place-items:center;background:#30251f80;color:#f4e6c8;font-family:Impact,'Arial Black',sans-serif;font-size:clamp(32px,7vw,90px);text-shadow:4px 4px #30251f;z-index:8;pointer-events:none;animation:battle-start .7s both}.battle-view:has(.battle-overlay:not([hidden])):after{display:none}@keyframes battle-start{0%,45%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(1.12)}}
#app[data-screen=menu] .menu-buttons .secondary{background:var(--teal)!important;color:var(--paper)}
:root{--ink:#30251f;--paper:#f4e6c8;--cream:#f4e6c8;--orange:#df5a23;--teal:#3d8f88;--raspberry:#c74954;--gold:#e7bd46}
html,body{height:100%;overflow:hidden}body{background:#30251f;font-family:'Trebuchet MS',Arial,sans-serif}#app{height:100dvh;overflow:hidden;background:var(--paper)}
button{border:2px solid var(--ink);border-radius:3px 8px 4px 7px;box-shadow:0 3px 0 var(--ink);transition:transform .12s,background .12s;touch-action:manipulation}button:active:not(:disabled){transform:translateY(3px);box-shadow:none}button:focus-visible{outline:3px solid var(--gold);outline-offset:3px}button.primary{background:var(--gold);color:var(--ink);font-weight:900}button.secondary{background:var(--teal);color:white}button:disabled{filter:grayscale(.8);opacity:.48;box-shadow:none}
.game-scene{height:100dvh;width:100%;display:grid;grid-template-columns:clamp(170px,23vw,300px) 1fr;background:var(--paper);overflow:hidden;font-size:clamp(11px,1.18vw,17px)}
.squad-panel{background:var(--teal);color:#fff5dc;border-right:4px solid var(--ink);display:flex;flex-direction:column;min-height:0;padding:12px 9px;gap:9px;z-index:2;box-shadow:5px 0 0 #30251f30}
.squad-title{display:flex;align-items:center;justify-content:space-between;font-weight:900;font-size:1.1em;border-bottom:3px dashed #f4e6c890;padding-bottom:12px}.squad-title b{font-size:1.7em;color:var(--gold)}.squad-list{display:grid;grid-template-rows:repeat(8,minmax(0,1fr));flex:1;gap:5px;min-height:0}.squad-unit{min-height:0;background:#205d59;border:2px solid var(--ink);border-radius:6px;display:flex;gap:7px;padding:4px;align-items:center}.squad-unit>img{width:22%;height:100%;object-fit:contain}.squad-unit>div:nth-child(2){flex:1;min-width:0}.squad-unit strong{display:block;font-size:.82em;line-height:1.1}.squad-unit small{font-size:.7em;display:block;color:#d6e2ce}.unit-stats{display:flex;gap:10px;font-size:.8em;font-weight:900;padding:4px 0}.squad-unit .order-buttons{display:flex;flex-direction:column;gap:2px}.squad-unit .order-buttons button{padding:0;min-height:19px;width:22px;font-size:12px;box-shadow:none;background:transparent;color:var(--gold);border:0}.scene-relics{display:flex;flex-wrap:wrap;gap:3px;max-height:70px;overflow:hidden}.scene-relics button{padding:0;background:var(--paper);width:30px;height:30px;min-height:0}.scene-relics img{width:100%;height:100%;object-fit:contain}
.field-scene{position:relative;min-width:0;min-height:0;overflow:hidden;background-image:var(--ground);background-size:cover}.scene-top{position:relative;z-index:5;height:58px;display:flex;align-items:center;gap:9px;padding:7px 12px;background:#f4e6ceeb;border-bottom:2px solid var(--ink)}.icon-button{width:42px;min-height:37px;padding:3px;font-size:22px;background:var(--gold)}.event-road{display:flex;flex:1;min-width:0;gap:3px;background:var(--raspberry);padding:5px;border:2px solid var(--ink);border-radius:6px}.event-road>span{flex:1;text-align:center;min-width:0;font-size:1.1em;color:#ffe9b0}.event-road .done{opacity:.4}.event-road .current{background:var(--gold);color:var(--ink);outline:2px solid var(--ink);border-radius:2px;transform:rotate(-5deg)}.scene-cash{white-space:nowrap;font-size:1.3em;font-weight:900}.scene-cash b{color:#c17a00}
.camp-stage{position:absolute;inset:58px 0 100px;overflow:hidden}.ground-ring{position:absolute;inset:8% 5% 6%;border:3px solid #a6523440;border-radius:50%;transform:rotate(-3deg)}.camp-panda{position:absolute;left:var(--x);top:var(--y);width:clamp(44px,7vw,105px);height:clamp(50px,9vw,130px);transform:translate(-50%,-50%);z-index:1}.camp-panda img{position:relative;width:100%;height:100%;object-fit:contain;object-position:bottom;z-index:1;animation:idle-breathe 2.4s var(--delay) ease-in-out infinite;transform-origin:bottom}.camp-panda.resting img{animation:none}.camp-shadow{position:absolute;bottom:-2px;left:10%;width:80%;height:10%;border-radius:50%;background:#30251f26}
.encounter-dock{position:absolute;bottom:45px;left:4%;right:4%;display:flex;gap:10px;align-items:stretch;z-index:3}.round-ticket{background:var(--raspberry);color:var(--paper);border:3px solid var(--ink);padding:10px;text-align:center;display:flex;flex-direction:column;justify-content:center;transform:rotate(-3deg);box-shadow:3px 4px 0 #30251f30}.round-ticket small{font-size:.7em;font-weight:900}.round-ticket b{font-size:2.5em}.route-choice{flex:1;min-width:0;background:var(--paper);border:3px solid var(--ink);border-radius:5px;box-shadow:3px 4px 0 #30251f30;padding:6px}.route-choice>div{display:flex;align-items:center;justify-content:space-between;gap:7px;background:var(--teal);color:var(--paper);padding:4px 7px}.route-choice.challenge>div{background:var(--raspberry)}.route-choice>div strong{font-size:1.2em}.route-choice button{min-width:75px;padding:4px 12px;min-height:32px}.route-choice ul{list-style:none;margin:4px 0 0;padding:0}.route-choice li{display:flex;align-items:center;gap:6px;font-size:.85em;font-weight:700}.route-choice li img{width:28px;height:24px;object-fit:contain}.scene-inventory{position:absolute;bottom:5px;left:12px;right:12px;height:35px;z-index:4}.scene-inventory .inventory-strip{margin:0;gap:5px}.scene-inventory .item-button{min-height:30px;padding:1px 5px}.scene-inventory .item-button img{height:24px;width:24px}.scene-inventory small{font-size:.7em}
.scene-curtain{position:absolute;inset:58px 0 0;background:#30251f42;display:flex;align-items:center;justify-content:center;padding:16px;z-index:6}.scene-modal{background:var(--paper);border:3px solid var(--ink);box-shadow:6px 7px 0 #30251f75;width:min(100%,950px);height:100%;max-height:620px;display:flex;flex-direction:column;gap:10px;padding:14px 16px;position:relative;border-radius:5px 12px 5px 8px;animation:panel-arrive .26s cubic-bezier(.2,.8,.3,1.15)}.scene-modal:before,.scene-modal:after{content:'';position:absolute;top:-9px;width:60px;height:22px;background:#e7bd46a0;transform:rotate(-12deg);left:22px;pointer-events:none}.scene-modal:after{left:auto;right:20px;transform:rotate(13deg)}.ribbon-title{text-align:center;font-family:Impact,'Arial Black',sans-serif;font-size:clamp(18px,2.4vw,32px);letter-spacing:.035em;color:var(--paper);background:var(--teal);padding:8px 10px;border:2px solid var(--ink);margin:0;flex-shrink:0;clip-path:polygon(1% 0,100% 2%,99% 100%,0 97%)}
.reward-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;min-height:0;flex:1}.reward-choices.count-1{grid-template-columns:minmax(0,340px);justify-content:center}.reward-choices.count-2{grid-template-columns:repeat(2,minmax(0,340px));justify-content:center}.reward-card{display:flex;flex-direction:column;align-items:center;min-height:0;padding:10px;border:2px solid var(--ink);background:#fff4d9;gap:5px;border-radius:4px}.reward-card h2{text-align:center;font-size:1.1em;margin:0;color:var(--ink)}.reward-visual{flex:1;min-height:40px;width:100%;display:flex;align-items:center;justify-content:center;background:radial-gradient(ellipse,#e7bd4660 0,transparent 68%)}.reward-visual>img{height:100%;max-height:160px;width:100%;object-fit:contain}.reward-visual .machine-art{height:100%;max-height:230px;min-height:40px;aspect-ratio:236/312}.reward-card p{font-size:.85em;line-height:1.3;text-align:center;margin:0;min-height:3.8em}.reward-card button{width:100%;min-height:34px;padding:6px;flex-shrink:0}.reward-footer{font-size:.7em;display:flex;justify-content:space-between;align-items:center;flex-shrink:0;gap:8px}.reward-footer .inventory-strip{margin:0}.reward-footer .item-button{min-height:26px;padding:2px}.reward-footer .item-button img{width:22px;height:22px}.choice-pager{display:flex;align-items:center;justify-content:center;gap:12px;font-size:.85em;flex-shrink:0}.choice-pager button{min-height:28px;width:40px;padding:2px}
.market-layout{display:grid;grid-template-columns:1fr 1fr;min-height:0;flex:1;gap:15px}.market-list{display:flex;flex-direction:column;gap:7px;min-height:0}.restock-line{display:flex;align-items:center;justify-content:space-between;gap:10px}.restock-line button{min-height:30px;padding:4px 10px}.market-offer{flex:1;min-height:0;display:flex;align-items:center;gap:8px;text-align:left;background:#e9d1a6;padding:5px;box-shadow:none}.market-offer.selected{background:var(--teal);color:var(--paper);outline:2px solid var(--gold);outline-offset:-5px}.market-offer.purchased{opacity:.5}.market-offer img{width:16%;height:100%;object-fit:contain}.market-offer>span{flex:1}.market-offer strong{display:block;font-size:.85em}.market-offer small{font-size:.7em}.market-offer>b{font-size:.85em;white-space:nowrap}.market-list>.primary{min-height:32px;padding:5px}.market-detail{display:flex;flex-direction:column;min-height:0;text-align:center;align-items:center;background:#fff4d9;border:2px solid var(--ink);padding:10px;gap:7px}.market-detail h2{font-size:1.2em;margin:0}.market-detail>img{flex:1;min-height:20px;height:30%;width:70%;object-fit:contain}.market-detail p{font-size:.9em;line-height:1.35;margin:0}.market-detail button{width:100%;min-height:35px;padding:6px}
.result-summary{display:flex;justify-content:space-between;gap:10px;font-size:1.1em}.battle-report{width:100%;border-collapse:collapse;flex:1;font-size:.85em}.battle-report th,.battle-report td{padding:6px;text-align:center}.battle-report thead{background:var(--teal);color:var(--paper)}.battle-report tbody tr{border-bottom:1px solid #30251f30}.battle-report tbody th{text-align:left;font-weight:700}.battle-report th img{height:28px;width:32px;object-fit:contain;vertical-align:middle;margin-right:5px}.battle-report .ko{color:#a2243a;font-weight:900}.modal-actions{display:flex;gap:10px;justify-content:center}.result-modal{height:auto;max-height:100%}
@keyframes panel-arrive{from{transform:translateY(18px) scale(.95);opacity:0}to{transform:none;opacity:1}}@keyframes idle-breathe{0%,100%{transform:scaleY(1) rotate(-1deg)}50%{transform:scaleY(1.025) rotate(1deg)}}
#app[data-screen=menu] .topbar{background:var(--teal);color:var(--paper)}#app[data-screen=menu] .menu{height:calc(100dvh - 68px);min-height:0;background:linear-gradient(100deg,#f4e6c8 0 49%,#3d8f88 49.3%);padding:3vh 6vw}#app[data-screen=menu] .menu-title{font-family:Impact,'Arial Black',sans-serif;font-weight:1000;letter-spacing:.015em;font-size:clamp(45px,6.5vw,100px);line-height:.95;background:#fff2d4;transform:rotate(-2deg);padding:10px 18px;clip-path:polygon(0 4%,98% 0,100% 95%,2% 100%);text-shadow:2px 2px #e7bd4680}#app[data-screen=menu] .menu-title>span{color:var(--orange)}.menu-hero{background:radial-gradient(ellipse,#e7bd4680,transparent 65%)}.hero-label{background:var(--gold)!important;border:3px solid var(--ink)!important}.menu-buttons button:not(.play){background:#f4e6c8}.menu-buttons .play{background:var(--orange);color:#fff5dc}.hero-panda{animation:idle-breathe 3s ease-in-out infinite}.hero-panda.two{animation-delay:.8s}.hero-panda.three{animation-delay:1.4s}
#app[data-screen=options],#app[data-screen=collection],#app[data-screen=intro]{display:flex;flex-direction:column;background:var(--teal)}#app[data-screen=options]>.topbar,#app[data-screen=collection]>.topbar,#app[data-screen=intro]>.topbar{flex-shrink:0;background:var(--paper)}#app[data-screen=options] .page,#app[data-screen=collection] .page,#app[data-screen=intro] .page{flex:1;min-height:0;width:100%;display:flex;flex-direction:column;padding:12px 25px;gap:10px;color:var(--paper)}.settings-tabs{display:flex;gap:10px;flex-shrink:0}.settings-tabs button{flex:1;min-height:34px;padding:5px;background:var(--paper)}.settings-tabs .selected{background:var(--gold)}#app[data-screen=options] .page-heading,#app[data-screen=collection] .page-heading,#app[data-screen=intro] .page-heading{margin:0}#app[data-screen=options] .page-heading p{display:none}#app[data-screen=options] .options-grid{display:block;min-height:0;flex:1}#app[data-screen=options] .options-box{height:100%;min-height:0;overflow:auto;color:var(--ink);padding:14px 24px}#app[data-screen=options] .options-box h2{margin-bottom:10px}#app[data-screen=options] .option{margin:8px 0}#app[data-screen=options] .options-box:nth-child(3){column-count:2;column-gap:25px}#app[data-screen=options] .options-box:nth-child(3)>*{break-inside:avoid}#app[data-screen=options] .options-box:nth-child(2){display:grid;grid-template-columns:1fr 1fr;gap:5px 25px;align-content:start}#app[data-screen=options] .options-box:nth-child(2)>h2,#app[data-screen=options] .options-box:nth-child(2)>p{grid-column:1/-1}#app[data-screen=options] #color-preview{grid-column:1/-1;display:flex;justify-content:center;max-height:110px}#app[data-screen=options] #color-preview .machine-art{height:95px}.color-row{padding:2px}.color-row input{height:26px}
#app[data-screen=collection] .collection-grid{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));flex:1;min-height:0;gap:10px}#app[data-screen=collection] .choice-card{min-height:0;color:var(--ink);padding:8px;gap:3px}#app[data-screen=collection] .relic-icon{min-height:20px;height:40%;width:80px}#app[data-screen=collection] .choice-card h3{font-size:.9rem}#app[data-screen=collection] .choice-card p{font-size:.75rem;margin:0}#app[data-screen=intro] .comic-intro{flex:1;min-height:0;margin:0}#app[data-screen=intro] .comic-panel{min-height:0;color:var(--ink)}#app[data-screen=intro] .comic-panel>img{min-height:40px;max-height:40%;object-fit:contain}.battle-top{background:var(--teal);color:var(--paper)}.battle-bottom{background:var(--paper)}
@media(max-height:550px) and (orientation:landscape){
 .game-scene{grid-template-columns:clamp(150px,22vw,190px) 1fr;font-size:11px}.squad-panel{padding:6px;gap:5px}.squad-title{padding-bottom:4px;font-size:.85em}.squad-title b{font-size:1.4em}.squad-unit{gap:4px;padding:2px;border-width:1px}.squad-unit strong{font-size:.83em}.squad-unit small{font-size:.75em}.squad-unit .unit-stats{font-size:.8em;padding:1px 0;gap:5px}.squad-list{gap:3px}.squad-unit .order-buttons button{min-height:14px;height:14px;width:16px}.scene-relics{max-height:24px}.scene-relics button{height:22px;width:22px}.scene-top{height:42px;padding:4px 7px;gap:5px}.scene-top .icon-button{min-height:30px;width:31px;font-size:18px}.event-road{padding:3px;gap:1px}.scene-cash{font-size:1.15em}.camp-stage{inset:42px 0 72px}.camp-panda{width:48px;height:65px}.scene-curtain{inset:42px 0 0;padding:9px 12px}.scene-modal{padding:9px;gap:6px;border-width:2px}.ribbon-title{font-size:18px;padding:4px}.reward-choices{gap:7px}.reward-card{padding:5px;gap:3px}.reward-card h2{font-size:12px}.reward-card p{font-size:10px;line-height:1.2;min-height:3.6em}.reward-card .unit-stats{padding:1px}.reward-card button{font-size:11px;min-height:29px;padding:3px}.reward-visual .machine-art{max-height:125px}.reward-visual>img{max-height:85px}.reward-footer{font-size:9px}.encounter-dock{bottom:36px;gap:6px;left:3%;right:3%}.round-ticket{padding:5px}.route-choice{padding:3px;border-width:2px}.route-choice li img{height:18px;width:21px}.route-choice li{font-size:10px}.route-choice button{min-height:28px;min-width:60px}.route-choice>div{padding:2px 4px}.scene-inventory{bottom:2px;height:29px}.market-layout{gap:8px}.market-list{gap:4px}.market-offer{padding:3px;gap:4px}.market-offer strong{font-size:11px}.market-offer small{font-size:9px}.market-detail{padding:6px;gap:4px}.market-detail p{font-size:11px}.market-detail button,.market-list>.primary{min-height:29px;padding:4px;font-size:12px}.restock-line button{min-height:26px;font-size:11px}.battle-report th,.battle-report td{padding:4px}.battle-report th img{height:22px;width:23px}.modal-actions button{min-height:30px;padding:5px 15px}.scene-modal:before,.scene-modal:after{width:40px;height:14px;top:-5px}
 #app[data-screen=menu] .menu{height:calc(100dvh - 48px);padding:8px 5vw}#app[data-screen=menu] .menu-title{font-size:clamp(36px,6.4vw,58px);margin:7px 0;padding:6px 12px}.menu .eyebrow{font-size:9px}.menu-copy{font-size:11px;margin:8px 0}.menu-buttons{gap:7px}.menu-buttons button{min-height:29px;font-size:12px}.menu-buttons .play{min-height:35px!important}.menu-foot{margin-top:8px;font-size:9px}.menu-hero{height:90%;max-height:260px}.menu-buttons{grid-template-columns:1fr 1fr}.menu-buttons .play{grid-column:1/-1}.hero-label{font-size:15px;padding:8px}.menu-foot br{display:none}
 #app[data-screen=options] .page,#app[data-screen=collection] .page,#app[data-screen=intro] .page{padding:8px 14px;gap:6px}.page-heading .eyebrow{display:none}.page-heading h1{font-size:21px}.page-heading p{font-size:10px}.settings-tabs{gap:6px}.settings-tabs button{font-size:11px;min-height:27px}.options-box{font-size:11px}.options-box h2{font-size:14px}#app[data-screen=options] .options-box{padding:8px 16px}#app[data-screen=options] .option{font-size:11px;margin:5px 0;gap:6px}.options-box .footnote{font-size:9px;margin-top:5px}.options-box .row button{min-height:27px;padding:4px;font-size:11px}#app[data-screen=options] .options-box:nth-child(2){gap:3px 20px;position:relative;padding-right:31%}#app[data-screen=options] #color-preview{position:absolute;right:5px;top:40px;width:28%;display:flex;flex-wrap:wrap;max-height:none}#app[data-screen=options] #color-preview .machine-art{height:73px}.color-row{font-size:10px;grid-template-columns:1fr 35px}.color-row input{width:32px;height:22px}#app[data-screen=collection] .choice-card h3{font-size:11px}#app[data-screen=collection] .choice-card p{font-size:9px}#app[data-screen=intro] .comic-panel{padding:8px}#app[data-screen=intro] .comic-panel p{font-size:11px}#app[data-screen=intro] .comic-panel .machine-art{height:90px}
}

.menu-title{font-size:clamp(52px,6.7vw,94px)}.menu-title .title-question{display:inline;color:var(--ink)}.menu-hero{max-height:72dvh;width:100%;height:auto}.menu-title>span{white-space:nowrap}.menu{grid-template-columns:minmax(320px,1fr) 1.15fr}.menu-title{letter-spacing:-.06em}.menu-buttons .play{min-height:50px}
@media(max-height:550px) and (orientation:landscape){.menu-title{font-size:clamp(40px,6.6vw,66px)}.menu-hero{max-height:72dvh;max-width:330px}.menu-foot{font-size:.65rem}}
@media(max-height:550px) and (orientation:landscape){
 #app[data-screen=options] .options-box:first-child{display:grid;grid-template-columns:1fr 1fr;gap:5px 20px;align-content:start}
 #app[data-screen=options] .options-box:first-child>h2,#app[data-screen=options] .options-box:first-child>.row,#app[data-screen=options] .options-box:first-child>.footnote{grid-column:1/-1}
 #app[data-screen=options] .options-box:first-child .option{grid-template-columns:1fr 45%;margin:3px 0}
 #app[data-screen=options] #color-preview{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px!important;top:auto;bottom:12px;right:10px;width:28%;height:95px;margin:0!important}
 #app[data-screen=options] #color-preview .machine-small{width:auto;min-width:0;padding:0;margin:0;height:100%}
 #app[data-screen=options] #color-preview .machine-art{height:100%;width:100%;min-width:0}
 #app[data-screen=options] .options-box{overflow-y:auto;overflow-x:hidden}
}
@media(prefers-reduced-motion:reduce){.battle-view:after{display:none}.hero-panda,.camp-panda img,.scene-modal{animation:none!important}}
@media(max-height:350px) and (orientation:landscape){#app[data-screen=options] .options-box:first-child>.footnote{display:none}#app[data-screen=options] .options-box:first-child{gap:3px 15px}#app[data-screen=options] .options-box:first-child h2{margin:0}}
.battle-groups{position:absolute;left:10px;top:10px;display:flex;flex-direction:column;gap:4px;pointer-events:none}.battle-group{display:flex;align-items:center;gap:4px;background:#f4e6c8df;border:1px solid #30251f;padding:2px 6px;border-radius:4px;min-width:65px;font-size:12px}.battle-group img{width:26px;height:28px;object-fit:contain}.battle-group>div{flex:1}.group-hp{display:block;width:35px;height:5px;background:#30251f;border:1px solid #30251f}.group-hp i{display:block;height:100%;background:#3d8f88}@media(max-height:550px){.battle-groups{top:5px;left:5px;gap:2px}.battle-group{font-size:10px;padding:1px 3px;min-width:52px}.battle-group img{width:18px;height:20px}.group-hp{width:26px;height:4px}}
/* Paper workshop: geometry stays legible even with the mobile browser bars. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
button{border-radius:13% 4% 12% 5% / 7% 18% 6% 16%;background-image:repeating-linear-gradient(173deg,transparent 0 7px,#30251f06 8px 9px);box-shadow:2px 3px 0 var(--ink),inset 0 0 0 2px #fff3;line-height:1.15}
.menu-buttons button:nth-child(2n){rotate:1deg}.menu-buttons button:nth-child(2n+1){rotate:-1deg}
.paper,.scene-modal{border-radius:2% 1% 3% 1% / 1% 4% 1% 3%;background-image:repeating-linear-gradient(14deg,transparent 0 11px,#8c684309 12px 13px)}
.squad-panel{background-image:repeating-linear-gradient(88deg,transparent 0 11px,#133c3510 12px 13px);border-right:5px dashed #30251f}
.squad-list{grid-template-rows:repeat(var(--rows,8),minmax(0,1fr));align-content:start;flex:0 1 auto;height:calc(var(--rows,8) * 68px)}
.squad-unit{border-radius:3% 2% 5% 2% / 9% 15% 7% 14%;background:#fff0cf;color:var(--ink);border-bottom:3px solid var(--ink)}
.squad-unit:nth-child(2n){background:#e5d3a7}.squad-unit small{color:#5b4c3e}.squad-unit .order-buttons button{color:var(--teal)}
.squad-unit strong{line-height:1.12}.scene-relics{margin-top:auto;flex-shrink:0}
.market-offer{flex:1 1 0;min-height:40px;line-height:1.1;border-radius:2% 4% 2% 5% / 12% 6% 15% 8%;border-bottom-width:3px}
.market-offer:nth-child(even){background-color:#edd4a2}.market-offer.selected{background-color:var(--teal)}
.market-offer>span{min-width:0}.market-offer strong,.market-offer small{line-height:1.12}.market-offer img{flex-shrink:0;max-height:55px}
.market-detail{border-style:dashed;border-radius:1% 3% 2% 1%;background-image:repeating-linear-gradient(0deg,transparent 0 23px,#9d7a3c12 24px 25px)}
.event-road{border-radius:2% 1% 2% 1% / 10% 15% 9% 12%;border-bottom-width:4px}.route-choice{border-radius:1% 3% 2% 1%;border-bottom-width:5px}.route-choice:nth-child(2){rotate:-.7deg}.route-choice:nth-child(3){rotate:.7deg}
.battle-view{display:block}.battle-stage{position:absolute;inset:0}.battle-top{position:absolute;z-index:6;left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));top:6px;min-height:0;padding:0;border:0;background:none;color:var(--ink);pointer-events:none;gap:8px}
.battle-top h2,.battle-counts{background:#fff0cfdf;border:2px solid var(--ink);padding:5px 9px;border-radius:4% 2% 5% 2%;font-size:12px}.battle-top .top-actions{pointer-events:auto;gap:5px}.battle-top button{font-size:11px;min-height:32px;padding:4px 8px;background:var(--paper)}.battle-counts{gap:10px}.battle-counts span{display:none}
.battle-bottom{position:absolute;z-index:5;bottom:max(6px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);min-height:0;border:0;padding:0;background:none;width:max-content;max-width:95%;gap:6px;pointer-events:none}.battle-bottom button{pointer-events:auto}.battle-bottom #battle-clock{display:none}.battle-bottom .item-button{background:#fff0cfed;min-height:40px}.battle-groups{display:none}.battle-tip{top:auto;bottom:60px}.battle-view:after{display:none}
@media(max-height:550px) and (orientation:landscape){.squad-list{height:calc(var(--rows,8) * 54px)}.squad-unit{font-size:12px}.market-offer{min-height:37px}.market-offer strong{font-size:12px}.market-offer small{font-size:10px}.market-offer>b{font-size:10px}.market-detail h2{font-size:13px}.market-detail p{font-size:11px}.scene-top .icon-button{min-width:30px}.scene-modal{gap:5px}.ribbon-title{font-size:17px}}
@media(max-height:300px) and (orientation:landscape){.squad-unit .unit-stats{display:none}.squad-list{height:calc(var(--rows,8) * 38px)}.squad-unit strong{font-size:10px}.market-offer small{display:none}.market-offer{min-height:30px}.market-detail p{font-size:10px}.market-detail>img{min-height:15px}.scene-curtain{padding:6px 10px}.scene-modal{padding:6px}.ribbon-title{font-size:15px;padding:3px}.market-list{gap:3px}.restock-line button,.market-list>.primary,.market-detail button{min-height:25px;font-size:10px}.scene-top{height:35px}.scene-curtain{top:35px}.battle-top h2{font-size:10px}.battle-top button{font-size:10px;min-height:29px}}
.battle-counts span{display:inline;font-size:10px;margin-left:4px}.battle-counts>div:first-child{color:#205d59}.battle-counts>div:last-child{color:#982c3c}
.menu-buttons button,.route-choice button,.modal-actions button,.market-list>.primary,.market-detail button{border-radius:3% 7% 4% 6% / 15% 6% 17% 8%;border-width:2px 3px 4px 2px;outline:1px dashed #fff4;outline-offset:-5px}
/* Source-style portrait health display; nothing floats above the sprites. */
.battle-groups{display:flex;position:absolute;top:48px;left:max(8px,env(safe-area-inset-left));gap:5px;max-width:18%;max-height:calc(100% - 110px);flex-direction:column;flex-wrap:wrap;align-content:flex-start;pointer-events:none}
.battle-group{border:0;background:none;padding:0;min-width:0;gap:5px;height:30px;max-width:130px}.battle-group img{width:30px;height:30px;filter:drop-shadow(0 1px 0 #fff7)}.battle-group>div{flex:initial}.health-ticks{display:flex;align-items:end;gap:2px;flex-wrap:wrap;max-width:94px;max-height:30px}.health-tick{display:block;width:5px;height:25px;background:#30251f40;position:relative;border:1px solid #30251f60}.health-tick i{position:absolute;bottom:0;left:0;right:0;background:#398f68}.enemy .health-tick i{background:#bb3d4d}.health-tick.depleted{height:3px}.battle-counts{display:none}
@media(max-height:350px){.battle-groups{gap:3px;top:40px}.battle-group,.battle-group img{height:23px}.battle-group img{width:23px}.health-tick{height:18px;width:4px}.health-ticks{max-height:23px;gap:1px}}

.health-ticks{flex-wrap:nowrap;gap:1px;max-width:none}.health-tick{width:4px;flex-shrink:0}
/* Live health order: fullest first, solid bars without empty containers. */
.health-ticks{gap:2px;align-items:flex-end}.health-tick{width:8px;border:0;background:none;flex-shrink:0}.health-tick i{width:100%;border:0}.health-tick.depleted{height:0}.battle-group{max-width:185px}.battle-groups{max-width:23%}
.relic-affiliation{position:absolute;top:5px;right:5px;display:flex;align-items:center;gap:4px;background:#f4e6cedf;border:1px dashed var(--ink);padding:3px 5px;font-size:10px;max-width:90%;color:var(--ink);z-index:2}.relic-affiliation img{width:25px;height:25px;object-fit:contain}.reward-card,.market-detail{position:relative}.reward-card:has(.relic-affiliation){padding-top:37px}.market-detail:has(.relic-affiliation){padding-top:38px}
@media(max-height:350px){.health-tick{width:8px}.relic-affiliation{font-size:9px;padding:1px 3px;top:2px}.relic-affiliation img{width:19px;height:19px}.reward-card:has(.relic-affiliation),.market-detail:has(.relic-affiliation){padding-top:27px}}

/* Portrait-only affiliation, shared by rewards and market detail. */
.relic-affiliation{left:6px;right:auto;top:6px;padding:0;border:0;background:none}.relic-affiliation img{width:36px;height:36px}.reward-card:has(.relic-affiliation),.market-detail:has(.relic-affiliation){padding-top:42px}@media(max-height:350px){.relic-affiliation{top:3px;left:4px}.relic-affiliation img{width:27px;height:27px}.reward-card:has(.relic-affiliation),.market-detail:has(.relic-affiliation){padding-top:31px}}

.health-tick{position:relative;overflow:hidden}.health-tick b{position:absolute;left:0;width:100%}.health-heal{background:#b7fa82;z-index:2}.health-shield{background:repeating-linear-gradient(135deg,#80e3ed 0 3px,#348dbe 3px 5px);z-index:3;border-top:1px solid #d1ffff}.health-ticks{padding-top:0}

/* Keep every faction in one left-hand column, shrinking rows to fit. */
.battle-groups{bottom:62px;max-height:none;flex-wrap:nowrap;gap:2px;width:185px;max-width:none}
.battle-group{flex:0 1 30px;min-height:0;max-width:185px}
.battle-group img{height:100%;width:auto;max-width:30px;flex-shrink:0}
.battle-group .health-ticks{height:83.333%;max-height:none;gap:1px}
.battle-group .health-tick{height:100%;width:8px}
.battle-group .health-tick.depleted{height:0}
.unit-portrait-button{border:0;background:none;box-shadow:none;padding:0;min-height:0;flex-shrink:0;width:38px;align-self:stretch}.unit-portrait-button img{width:100%;height:100%;object-fit:contain}.reward-card .unit-details-button{padding:2px 8px;min-height:22px;font-size:12px;box-shadow:none}.unit-sheet{width:min(720px,88vw)}.unit-sheet header{display:flex;align-items:center;gap:12px;position:sticky;top:0;background:var(--paper);z-index:1;padding-bottom:8px}.unit-sheet header img{width:55px;height:55px;object-fit:contain}.unit-sheet header>div{flex:1}.unit-sheet h2{font-size:22px}.unit-sheet small{font-size:12px}.unit-sheet p{font-size:13px;margin:8px 0}.unit-sheet dl{display:grid;grid-template-columns:1fr 1fr;gap:5px 18px;margin:12px 0}.unit-sheet dl>div{display:flex;justify-content:space-between;gap:8px;border-bottom:1px dashed #b9a67f;padding:5px 0;font-size:13px}.unit-sheet dd{margin:0;font-weight:900;white-space:nowrap}.unit-sheet .stat-note{color:var(--teal)}dialog:has(.unit-sheet){max-width:96vw;max-height:92dvh;overflow:auto;padding:16px}@media(max-width:600px){.unit-sheet dl{gap:4px 12px}.unit-sheet dl>div{font-size:11px}.unit-sheet header img{width:38px;height:38px}.unit-sheet h2{font-size:17px}}
.battle-group .unit-portrait-button{pointer-events:auto;width:30px;height:100%;min-height:0;padding:0;border:0;box-shadow:none}.battle-group .unit-portrait-button img{height:100%;width:100%;object-fit:contain}

.health-debt{background:repeating-linear-gradient(0deg,#aa72d2 0 4px,#834da9 4px 6px);z-index:4;box-shadow:inset 0 1px #e8c9ff}
.health-tick:has(.health-debt:not(.is-empty)) .health-shield{left:0;width:100%;z-index:5;background:repeating-linear-gradient(135deg,#80e3edcc 0 1px,transparent 1px 4px);border-top:0}

.health-tick:has(.health-debt:not(.is-empty)) .health-heal{display:none}

.enemy-single-health>b{white-space:nowrap;font-size:11px;line-height:1}
