/* Match the user's collage reference; preserve the artwork's own proportions. */
#app[data-screen=menu]{background-image:url('./menu-sharp-v4.webp');filter:none}
#app[data-screen=menu] .menu>section{left:5%;top:54%;bottom:5%;width:min(39vw,calc((41dvh - 18px)*1.2));max-width:520px;align-items:center;justify-content:center}
#app[data-screen=menu] .menu-buttons{width:100%;height:auto;gap:6px;justify-content:center}
#app[data-screen=menu] .menu-buttons button,#app[data-screen=menu] .menu-buttons .play{--sign-ratio:5;flex:none;width:100%;height:auto;max-height:none;aspect-ratio:var(--sign-ratio);min-height:0!important;padding:3px 15px;border:0;border-image:none;background-color:transparent;background-image:url('./sign-honey-v4.webp');background-size:contain;background-position:center;background-repeat:no-repeat;box-shadow:none;rotate:-1.4deg;font-family:PandaHand,sans-serif;font-weight:900;font-size:clamp(11px,1.7vw,25px);letter-spacing:0;text-transform:uppercase;line-height:1.05;color:#321b12}
#app[data-screen=menu] .menu-buttons .play{background-image:url('./sign-ivory-v4.webp');font-family:PandaDisplay,sans-serif;font-size:clamp(14px,2vw,28px);rotate:-.8deg}
#app[data-screen=menu] .menu-buttons [data-action=resume]{font-size:clamp(10px,1.4vw,20px)}
#app[data-screen=menu] .menu-buttons [data-action=collection]{background-image:url('./sign-teal-v4.webp');rotate:1.4deg}
#app[data-screen=menu] .menu-buttons [data-action=options]{background-image:url('./sign-tape-v4.webp');rotate:-1.1deg}
#app[data-screen=menu] .menu-buttons [data-action=install]{position:fixed;right:14px;bottom:12px;left:auto;top:auto;width:145px;height:32px;aspect-ratio:auto;background:transparent url('./button-utility.webp') center/contain no-repeat!important;font-size:12px;rotate:.7deg;padding:3px 12px;color:#321b12}
/* General-purpose controls use resize-safe paper corners, not squeezed planks. */
button,button.primary,button.secondary{background:none;border:6px solid transparent;border-image:url('./panel-paper-v4.webp') 72 fill / 6px / 1px stretch;box-shadow:0 2px 1px #3d25183d;color:#321b12}
button.primary{border-image-source:url('./panel-paper-v4.webp');background:none;color:#8f3522}
.reward-card button,.market-list>.primary,.market-detail button,.restock-line button,.settings-tabs button,.options-box .row button{background:none;border:6px solid transparent;border-image:url('./panel-paper-v4.webp') 72 fill / 6px / 1px stretch;box-shadow:0 2px #68432230;padding:5px 10px}
.settings-tabs button.selected{border:6px solid transparent;border-image:url('./panel-paper-v4.webp') 72 fill / 6px / 1px stretch;color:#b13924;outline:2px dashed #d99a38;outline-offset:-4px}
.unit-portrait-button,.unit-portrait-button:hover,.battle-group .unit-portrait-button,.squad-unit .order-buttons button,.reward-card .unit-details-button{border:0;border-image:none;background:none;box-shadow:none}
.scene-relics button,.item-button{border:2px solid #765432;border-image:none;background:#fff0d1;box-shadow:1px 2px #36261944}
/* No opaque striped column: separate paper cards over a continuous illustration. */
.game-scene{background:#d7bd80 url('./menu-garden.webp') center/cover no-repeat}
.squad-panel{background:none;background-image:none;border:0;box-shadow:none;padding:12px 9px 9px;gap:10px;color:#30251b}
.squad-title{border:0;box-shadow:none;background:none;padding:0;gap:5px;transform:none;font-family:PandaHand,sans-serif;font-weight:900;font-size:clamp(14px,1.6vw,23px);line-height:1.1}
.squad-title>span{flex:1;background:#eec383;border:5px solid transparent;border-image:url('./panel-paper-v4.webp') 72 fill / 5px / 1px stretch;padding:7px 3px;rotate:-2deg;white-space:nowrap;text-align:center;color:#43291a}
.squad-title>b{color:#fff0ce;text-shadow:1px 2px #3e4433;background:#278c87;padding:3px 4px;rotate:2deg;font-size:1.25em}
.squad-list{gap:9px;height:calc(var(--rows,8)*76px);flex:0 1 auto}
.squad-unit,.squad-unit:nth-child(2n),.squad-unit:nth-child(2n+1){background:none;background-image:none;border:6px solid transparent;border-image:url('./panel-paper-v4.webp') 72 fill / 6px / 1px stretch;box-shadow:1px 3px #38281755;gap:5px;padding:3px;color:#302218;rotate:-.7deg}
.squad-unit:nth-child(2n){rotate:1deg}
.squad-unit .unit-portrait-button{width:24%;max-width:64px;height:100%;flex-shrink:0;padding:0;align-self:stretch}
.squad-unit .unit-portrait-button img{width:100%;height:100%;object-fit:contain;max-width:none}
.squad-unit strong{font-family:PandaHand,sans-serif;font-weight:900;font-size:clamp(11px,1.2vw,17px);line-height:1.05}
.squad-unit small{color:#614a32;font-size:.8em}.squad-unit .unit-stats{font-family:PandaHand,sans-serif;font-size:.85em;padding:1px 0;gap:6px}
.squad-unit .order-buttons button{color:#218c89;font-weight:900;font-size:15px;min-height:19px;width:20px;padding:0}
.scene-relics{background:none;padding:4px 0;gap:5px;overflow:visible}
.scene-relics{display:grid;grid-template-columns:repeat(auto-fit,minmax(24px,1fr));max-height:none;gap:3px}
.scene-relics button{width:100%;height:27px}
.scene-reward .field-scene,.scene-result .field-scene{background:none}
.scene-curtain{background:#39261512;backdrop-filter:none}
.scene-modal{border:10px solid transparent;border-image:url('./panel-paper-v4.webp') 72 fill / 10px / 1px stretch;background:none;box-shadow:3px 5px #38281755;padding:10px 12px;gap:9px}
.scene-modal:before,.scene-modal:after{display:none}
.ribbon-title{position:relative;background:#2d918a;color:#fff2ce;clip-path:polygon(1% 4%,99% 0,100% 91%,98% 100%,1% 96%,0 12%);border:0;padding:10px 15px;rotate:-.5deg;transform:none;text-shadow:1px 2px #1b635f55;font-family:PandaDisplay,sans-serif;font-size:clamp(18px,2.4vw,31px)}
.reward-card,.market-detail,.paper.options-box,.choice-card,dialog{border:7px solid transparent;border-image:url('./panel-paper-v4.webp') 72 fill / 7px / 1px stretch;background:none;box-shadow:1px 3px #38281744}
.reward-card{gap:5px;padding:7px;rotate:-.3deg}.reward-card:nth-child(2){rotate:.5deg}.reward-card h2{font-family:PandaHand,sans-serif;font-weight:900;font-size:1.25em;letter-spacing:0;color:#302218}
.reward-card>p,.market-detail>p{color:#382719;font-family:PandaHand,sans-serif}.reward-visual{background:radial-gradient(ellipse,#e9b64930,transparent 70%)}
.market-offer,.market-offer:nth-child(even){background:#edd5a7;border:1px solid #674624;border-image:none;border-bottom-width:2px;box-shadow:1px 2px #3b291833;font-family:PandaHand,sans-serif}
.market-offer.selected{background:#fff2d2;border-color:#27918a;outline:2px dashed #27918a;outline-offset:-4px;color:#302218}.market-offer strong{font-family:PandaHand,sans-serif;font-weight:900}
.scene-top{background:#fff0d0;border:2px solid #684526;box-shadow:1px 3px #39271a55}.event-road{background:#c9444b;border:2px solid #5a3327}.event-road>span{color:#f6d699}.event-road .current{background:#f8ca46;color:#4b3020;outline-color:#50301e}
.battle-overlay,.scene-curtain,dialog::backdrop{backdrop-filter:none}
@media(max-height:550px) and (orientation:landscape){
 .squad-panel{padding:6px 7px;gap:5px}.squad-title{font-size:12px;gap:3px}.squad-title>span{padding:4px 0;border-width:4px;border-image-width:4px}.squad-title>b{font-size:15px;padding:2px}
 .squad-list{gap:5px;height:calc(var(--rows,8)*57px)}.squad-unit{border-width:4px;border-image-width:4px;padding:1px;gap:3px}.squad-unit strong{font-size:11px}.squad-unit small{font-size:9px}.squad-unit .unit-stats{font-size:10px;gap:5px}.squad-unit .order-buttons button{min-height:14px;width:14px;font-size:13px}
 .scene-modal{border-width:7px;border-image-width:7px;padding:5px;gap:5px}.ribbon-title{padding:6px 8px;font-size:17px}
 .reward-card{border-width:4px;border-image-width:4px;padding:3px;gap:3px}.reward-card h2{font-size:13px}.reward-card:has(.unit-details-button) h2{font-size:12px}
 .reward-card button,.market-list>.primary,.market-detail button,.restock-line button,.settings-tabs button,.options-box .row button{border-width:4px;border-image-width:4px;padding:3px 7px;min-height:27px;font-size:11px}
 .reward-card .unit-details-button{border:0;border-image:none;padding:0;min-height:18px;font-size:11px}
 .market-detail{padding:4px;border-width:5px;border-image-width:5px}.market-detail h2{font-family:PandaHand,sans-serif;font-size:15px;font-weight:900}
 #app[data-screen=menu] .menu>section{left:5%;top:54%;bottom:5%;width:min(39vw,calc((41dvh - 18px)*1.2));max-width:none}
 #app[data-screen=menu] .menu-buttons button,#app[data-screen=menu] .menu-buttons .play{flex:none;height:auto;max-height:none;padding:2px 9px;aspect-ratio:var(--sign-ratio);font-size:clamp(10px,1.5vw,17px)}
 #app[data-screen=menu] .menu-buttons .play{font-size:clamp(13px,1.9vw,21px)}#app[data-screen=menu] .menu-buttons [data-action=resume]{font-size:clamp(10px,1.4vw,15px)}
 #app[data-screen=menu] .menu-buttons [data-action=install]{width:123px;height:29px;padding:3px 10px;font-size:10px;aspect-ratio:auto}
}
@media(max-height:300px) and (orientation:landscape){.squad-list{height:calc(var(--rows,8)*40px)}.squad-unit .unit-stats{display:none}.squad-unit strong{font-size:10px}.ribbon-title{font-size:15px;padding:4px 8px}}
/* Preserve height, grain and end-caps with uniform scaling. Only central blank
   timber is cropped and joined; no bitmap is squeezed to a new aspect ratio. */
#app[data-screen=menu] .menu-buttons button,#app[data-screen=menu] .menu-buttons .play{--sign-art:url('./sign-honey-v4.webp');--sign-ratio:5.2;background:none!important;isolation:isolate}
#app[data-screen=menu] .menu-buttons .play{--sign-art:url('./sign-ivory-v4.webp')}
#app[data-screen=menu] .menu-buttons [data-action=collection]{--sign-art:url('./sign-teal-v4.webp')}
#app[data-screen=menu] .menu-buttons [data-action=options]{--sign-art:url('./sign-tape-v4.webp')}
#app[data-screen=menu] .menu-buttons button:before,#app[data-screen=menu] .menu-buttons button:after{content:'';display:block;position:absolute;top:0;bottom:0;height:100%;background-image:var(--sign-art);background-repeat:no-repeat;background-size:auto 100%;pointer-events:none;transform:none;z-index:-1;opacity:1}
#app[data-screen=menu] .menu-buttons button:before{left:0;right:auto;width:80%;background-position:left center}
#app[data-screen=menu] .menu-buttons button:after{right:0;left:auto;width:25%;background-position:right center;mask-image:linear-gradient(to right,transparent,#000 15%)}
#app[data-screen=menu] .menu-buttons [data-action=install]{background:transparent url('./button-utility.webp') center/contain no-repeat!important;aspect-ratio:auto}
#app[data-screen=menu] .menu-buttons [data-action=install]:before,#app[data-screen=menu] .menu-buttons [data-action=install]:after{display:none}


/* Exported aspect ratios from actual alpha-trimmed artwork. */
#app[data-screen=menu] .menu-buttons button:before,#app[data-screen=menu] .menu-buttons button:after{content:''!important}
#app[data-screen=menu] .menu-buttons button{--sign-native-ratio:9.863636}
#app[data-screen=menu] .menu-buttons .play{--sign-native-ratio:9.434783}
#app[data-screen=menu] .menu-buttons [data-action=collection]{--sign-native-ratio:9.863636}
#app[data-screen=menu] .menu-buttons [data-action=options]{--sign-native-ratio:8.594059}
#app[data-screen=menu] .menu>section{width:min(39vw,calc((41dvh - 18px)*1.3))}
/* Center under the painted sign (27.5% of the 16:9 artwork), not in a left gutter. */
#app[data-screen=menu] .menu>section{--menu-width:min(39vw,calc((41dvh - 18px)*1.3));width:var(--menu-width);left:calc(50vw - max(22.5vw,40dvh));margin-left:calc(var(--menu-width)* -.5);translate:none}
#app[data-screen=menu] .menu-buttons [data-action=collection]{--sign-art:url('./sign-honey-v4.webp')}
.scene-camp .field-scene{background:none}
.scene-camp .camp-stage{display:none}
.scene-camp .encounter-dock{position:absolute;inset:70px 3% 55px;display:flex;flex-direction:column;gap:18px;align-items:stretch}
.encounter-options{display:flex;flex:1;min-height:0;gap:22px}
.encounter-options .route-choice{flex:1;min-width:0;display:flex;flex-direction:column;border:9px solid transparent;border-image:url('./panel-paper-v4.webp') 72 fill /9px/1px stretch;background:none;padding:15px;rotate:-.6deg;gap:10px}
.encounter-options .route-choice:nth-child(2){rotate:.7deg}
.route-choice h2{text-align:center;font-size:28px;color:#277f79}
.route-choice.challenge h2{color:#b13c2b}
.encounter-options .route-choice.challenge{outline:4px solid #bc352c;outline-offset:-7px;border-radius:5px 9px 6px 4px}
.encounter-options .route-choice.challenge>div{background:none}
.encounter-options .route-choice ul{flex:1;min-height:0;display:flex;justify-content:center;align-items:center;gap:12px;flex-wrap:wrap}
.encounter-options .route-choice li{display:flex;flex-direction:column;text-align:center;font-size:20px}
.encounter-options .route-choice li img{width:150px;height:130px;object-fit:contain}
.encounter-options .route-choice>div{background:none;color:#412719;gap:8px;padding:0}
.event-road{overflow:hidden;gap:1px;background:#f7e6c2;color:#422a18}
.event-road>span{display:flex;flex:1;min-width:0;flex-direction:column;justify-content:center;font-size:12px;color:#67462e}
.event-road>span small{display:none;font-size:10px;color:inherit}
.event-road>span.current{flex:3;transform:none;outline:0;rotate:-2deg}
.event-road>span.current small{display:block}
.collection-album{display:grid;grid-template-columns:minmax(150px,24%) 1fr;gap:20px;flex:1;min-height:0}
.collection-index{overflow:auto;display:flex;flex-direction:column;gap:7px;padding:3px}
.collection-index h2{font-size:19px;margin:5px}
.collection-index button{display:flex;align-items:center;gap:8px;text-align:left;font-family:PandaHand;font-size:15px;padding:5px;min-height:44px}
.collection-index button img{width:36px;height:33px;object-fit:contain}
.collection-index button span{flex:1}.collection-index button.selected{outline:2px dashed #278b85;outline-offset:-5px;color:#216f69}
.collection-content{display:flex;flex-direction:column;min-height:0;gap:12px}
.collection-content>h2{font-size:24px;align-self:flex-start;background:#fff0cc;padding:5px 12px;rotate:-.5deg;box-shadow:1px 2px #43271944}
#app[data-screen=collection] .collection-grid{gap:10px}
#app[data-screen=collection] .collection-grid .choice-card{padding:8px}
.collection-content .empty{flex:1;min-height:0;padding:20px}
.collection-mobile-index{display:none}
.collection-content .empty{border:7px solid transparent;border-image:url('./panel-paper-v4.webp') 72 fill /7px/1px stretch;background:none;display:flex;flex-direction:column;justify-content:center;gap:10px;margin:0;max-width:none}
.collection-content .empty h2{font-size:22px;margin:0}.collection-content .empty p{font-size:16px;margin:0}
@media(max-height:550px) and (orientation:landscape){
 .scene-camp .encounter-dock{inset:53px 3% 36px;gap:7px}.encounter-options{gap:12px}
 .encounter-options .route-choice{border-width:5px;border-image-width:5px;padding:6px;gap:4px}
 .route-choice h2{font-size:18px}.encounter-options .route-choice li{font-size:13px}
 .encounter-options .route-choice li img{height:clamp(35px,18dvh,80px);width:90px}
 .encounter-options .route-choice ul{gap:5px;margin:0}
 .encounter-options .route-choice>div strong{font-size:13px}
 .encounter-options .route-choice button{min-width:65px;font-size:12px;padding:4px;min-height:28px}
 .collection-album{gap:10px;grid-template-columns:155px 1fr}.collection-index{gap:4px}
 .collection-index h2{font-size:14px}.collection-index button{font-size:11px;min-height:31px;padding:2px;gap:3px;border-width:3px;border-image-width:3px}
 .collection-index button img{width:25px;height:22px}.collection-content{gap:5px}.collection-content>h2{font-size:17px}
 #app[data-screen=collection] .collection-grid .choice-card h3{font-size:12px}#app[data-screen=collection] .collection-grid .choice-card p{font-size:10px}
 .collection-index{display:none}.collection-album{display:flex}.collection-content{width:100%}
 .collection-mobile-index{display:flex;align-items:center;gap:10px;font-size:13px;flex:none;background:#fff0cf;padding:4px 8px}
 .collection-mobile-index select{flex:1;min-height:28px;padding:3px;font-size:13px}
 .collection-content .empty h2{font-size:18px}.collection-content .empty p{font-size:12px}
 .scene-relics{grid-template-columns:repeat(auto-fit,minmax(17px,1fr));padding:1px 0;max-height:none;gap:3px}.scene-relics button{height:18px}
 .dense-squad .squad-unit .unit-stats{display:none}
 .dense-squad .squad-unit{border-width:3px;border-image-width:3px;padding:0}
 .dense-squad .squad-unit strong{font-size:9px;line-height:1}.dense-squad .squad-unit small{font-size:8px;line-height:1}
 #app[data-screen=collection] .collection-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:minmax(0,1fr)}
 #app[data-screen=collection] .relic-icon{height:32%;max-height:45px}
 #app[data-screen=collection] .choice-pager{gap:8px;font-size:11px;flex:none}
 #app[data-screen=collection] .choice-pager button{min-height:24px;padding:1px 8px;font-size:12px}
}

/* Upcoming events remain visible, including on a phone. */
.event-road{background:#c9444b;border-color:#613c2b}
.event-road>span{font-size:18px;line-height:1;gap:2px;color:#f6d699}
.event-road>span.current{flex:1;rotate:-2deg}
.event-road>span small,.event-road>span.current small{display:block;font-family:PandaHand;font-size:9px;line-height:1;color:inherit}
.event-road>span.current{color:#50301e}
.event-road>span img{width:18px;height:21px;object-fit:contain}
/* Smaller loose paper cards, rather than a full-screen form. */
.scene-camp .encounter-dock{justify-content:center;align-items:center;gap:12px}
.scene-camp .encounter-dock>.ribbon-title{font-size:22px;align-self:center;padding:7px 22px;max-width:90%;rotate:-1deg}
.encounter-options{flex:0 1 275px;width:min(96%,850px);max-height:72%;gap:24px}
.encounter-options .route-choice{padding:12px;gap:8px}
.encounter-options .route-choice.challenge{outline:0 solid transparent;border:9px solid transparent;border-image:url('./card-frame-red.svg') 16 fill /9px/1px stretch;border-radius:0;background:none}
.route-choice h2{font-size:23px}.encounter-options .route-choice li{font-size:17px;flex:1;min-width:0}
.encounter-options .route-choice li img{width:110px;height:90px}
.encounter-options .route-choice ul{flex-wrap:nowrap}
@media(max-height:550px) and (orientation:landscape){
 .event-road>span{font-size:13px;gap:1px}.event-road>span small,.event-road>span.current small{font-size:7px}
 .event-road>span img{width:11px;height:14px}
 .scene-camp .encounter-dock{gap:9px}
 .scene-camp .encounter-dock>.ribbon-title{font-size:14px;padding:5px 14px}
 .encounter-options{flex:0 1 180px;width:96%;max-height:76%;gap:14px}
 .encounter-options .route-choice,.encounter-options .route-choice.challenge{padding:6px;border-width:6px;border-image-width:6px;gap:4px}
 .route-choice h2{font-size:16px}.encounter-options .route-choice li{font-size:12px;line-height:1.1}
 .encounter-options .route-choice li img{height:clamp(28px,13dvh,65px);width:70px}
}

/* Every road marker shares the same centered icon row above its day number. */
.event-road>span{align-items:center}
.event-road>span .road-icon{display:grid;place-items:center;height:21px;width:100%;line-height:1}
.event-road>span .road-icon img{display:block;margin:0}
@media(max-height:550px) and (orientation:landscape){.event-road>span .road-icon{height:14px}}

@media(max-height:500px){.settings-tabs button.selected{border-width:4px;border-image-width:4px}}

/* Gecko mis-slices border images under the desktop body zoom. Keep Chromium's
   existing renderer and assemble the same nine artwork regions in SVG on Gecko. */
@supports (-moz-appearance:none){
 .encounter-options .route-choice.challenge{border-image:none;background:url('./card-frame-red-9.svg') 0 0/100% 100% no-repeat border-box}
 @media(max-height:550px) and (orientation:landscape){.encounter-options .route-choice.challenge{background-image:url('./card-frame-red-6.svg')}}
}
