/* Scope AC179 layout to the new tile and dialog; retain established screens. */
.home-perks-rail:has(.home-key-offer){display:flex;flex-direction:column;align-items:center;gap:10px}
.home-key-offer{display:flex;flex-direction:column;align-items:center;gap:2px;color:var(--cream-200);box-sizing:border-box;width:var(--home-left-rail-width);padding:0 0 4px;border:2px solid #aaa0b76b;border-radius:9px;background:linear-gradient(#625c71dd,#393344dd);box-shadow:inset 0 1px #fff2,0 2px #18142188}
.home-scene .home-key-offer .hub-key-offers{position:static;width:48px;height:48px;min-height:48px;border:0;border-radius:9px;background:transparent;box-shadow:none;margin:0;padding:2px}
.hub-key-offers img{width:29px;height:29px;object-fit:contain}
.hub-key-offers small{font:700 10px/1.1 system-ui;white-space:nowrap}
/* AC715: a contained list keeps the offer shell and Close fixed. */
#modal:has(.key-offers-panel){width:min(calc(100vw - 4px),468px);max-width:calc(100vw - 4px);height:fit-content;max-height:min(780px,calc(100dvh - var(--safe-top,0px) - var(--safe-bottom,0px) - 24px));padding:62px 34px 48px;overflow:visible;overscroll-behavior:contain;top:var(--safe-top,env(safe-area-inset-top,0px));bottom:var(--safe-bottom,env(safe-area-inset-bottom,0px));margin-block:auto;display:flex;flex-direction:column;gap:10px;border:0;background:none;box-shadow:none;isolation:isolate}
/* The transparent dialog shell reserves the ribbon, edge tabs and dots; the
   inset plate is the visible panel. Decoration never enlarges a scroll box. */
#modal:has(.key-offers-panel):before{content:'';position:absolute;inset:52px 22px 36px;z-index:-1;pointer-events:none;border:3px solid #27334e;border-radius:20px;background:linear-gradient(#4b8fd8,#315f9a);box-shadow:inset 0 2px #b8e3ff,inset 0 -4px #244775,0 5px #172b48,0 16px 36px #10192d66}
.key-offers-panel{text-align:center;display:flex;flex-direction:column;gap:8px;min-height:0;flex:0 1 auto}
/* AC226: localized title is painted by the game over the requested banner. */
#modal .key-offer-title{position:relative;align-self:stretch;flex:none;width:100%;height:110px;margin:0;border:2px solid #27334e;border-radius:13px;overflow:hidden;background:#344d70}
.key-offer-banner>img:not(.dialog-hero-art){position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
#modal .key-offer-title h1{position:absolute;bottom:8px;left:8px;right:8px;color:var(--cream-200);font:24px/1.1 Lucky,system-ui;margin:0;letter-spacing:0;white-space:normal;overflow-wrap:normal;paint-order:stroke fill;-webkit-text-stroke:2.5px var(--ink-brown);filter:drop-shadow(0 2px var(--ink-brown))}
#modal .key-offer-title .help-button{position:absolute;top:0;right:0;width:44px;height:44px;min-height:44px;z-index:1;margin:0}
/* The Key offer clock is the shared one-line timer (`.ui-timer`, story-ui.css → AC774). */
.key-offer-navigation{position:relative;display:flex;align-items:center;justify-content:center;min-height:44px;margin-bottom:2px;flex:none}
/* The list keeps the existing three-row viewport and scrolls projected offers. */
.key-offer-steps{--key-offer-window:252px;position:relative;box-sizing:border-box;display:flex;flex-direction:column;min-height:0;flex:0 1 var(--key-offer-window);overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:#93b6dc #263c60;padding:8px;border:2px solid #27334e;border-radius:14px;background:#263c6073;box-shadow:inset 0 2px 4px #13233b55}
.key-offer-status{margin:0;padding:16px 12px;border:2px solid #71513b;border-radius:var(--vs-radius);background:linear-gradient(var(--paper),#efdcba);color:#543a2c;font:700 14px/1.35 system-ui}
.key-offer-step{box-sizing:border-box;width:100%;min-width:0;margin-inline:0;border:2px solid #71513b;border-radius:var(--vs-radius);background:linear-gradient(var(--paper),#efdcba);position:relative;padding:5px 6px;box-shadow:inset 0 2px var(--cream-50);text-align:center}
.key-offer-step[aria-current="step"]{border-color:#ffd96b;background:linear-gradient(#fff3b5,#f4cf78);box-shadow:inset 0 0 0 2px #bd843d}
.key-offer-step.is-claimed{background:linear-gradient(#ece9e0,#d9d3c5)}
.key-offer-steps>.key-offer-track,.key-offer-steps>.key-offer-status{flex:none;margin-block:auto}
/* AC468 (owner choice 2026-10-14): one compact Capybara-style tag for the whole offer, left
   of the art: a pink-red speech bubble whose tail points at the offer panel, the round
   whole-offer value as a big yellow outlined number over a short white playful line.
   Ink outline and hard drop (VISUAL_STYLE.md); decorative, never over the art, help,
   title, timer or arrows. */
#modal .key-offer-title .key-offer-value{position:absolute;top:-58px;left:-18px;z-index:2;display:flex;flex-direction:column;align-items:center;box-sizing:border-box;max-width:96px;padding:5px 7px 6px;border:2px solid var(--vs-ink,#241925);border-radius:10px;background:linear-gradient(#ff6f8b,#e0385c);box-shadow:inset 0 2px #ffb3c2,0 3px 0 var(--vs-ink,#241925);rotate:-5deg;text-align:center;pointer-events:none}
/* The tail: an outlined square turned 45°, its upper half hidden under the bubble. */
#modal .key-offer-title .key-offer-value::after{content:'';position:absolute;bottom:-7px;right:15px;width:10px;height:10px;box-sizing:border-box;background:#e0385c;border-right:2px solid var(--vs-ink,#241925);border-bottom:2px solid var(--vs-ink,#241925);rotate:45deg}
#modal .key-offer-value b{font:28px/1 Lucky,system-ui;letter-spacing:0;color:#ffe14a;white-space:nowrap;-webkit-text-stroke:3px var(--vs-ink,#241925);paint-order:stroke fill;filter:drop-shadow(0 2px var(--vs-ink,#241925))}
#modal .key-offer-value small{position:relative;z-index:1;font:11px/1.05 Lucky,system-ui;letter-spacing:0;color:#fff;-webkit-text-stroke:2px var(--vs-ink,#241925);paint-order:stroke fill;overflow-wrap:normal}
.key-offer-step-main{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:6px}
.key-offer-rewards{display:flex;align-items:center;justify-content:flex-start;gap:6px;flex:1}
.key-offer-reward:not(.backpack-slot){display:flex;flex-direction:column;align-items:center;gap:1px;min-width:42px;font:800 16px/1.1 Lucky,system-ui;color:#543a2c;white-space:nowrap}
.key-offer-reward:not(.backpack-slot) img{width:32px;height:32px;object-fit:contain}
.key-offers-panel .key-offer-rewards{justify-content:center;gap:4px;min-width:0;padding:3px 0;border-radius:9px;background:#d8bc8840}
/* Reuse Backpack's outline, cutout and corner count with a warm honey face. These are
   display tiles, so they retain neither an inventory tap nor its press feedback. */
#modal :is(.key-offers-panel,.key-offer-confirm) .key-offer-reward{box-sizing:border-box;width:48px;height:48px;min-height:48px;flex:none;cursor:default;pointer-events:none}
.key-offer-reward .backpack-count{right:3px;bottom:3px;font-size:13px;letter-spacing:0;-webkit-text-stroke:2.5px var(--vs-ink-text)}
#modal .key-offer-step .key-offer-action{box-sizing:border-box;width:156px;min-width:156px;max-width:156px;min-height:44px;margin:0;padding:4px 8px;flex:none}
#modal .key-offer-step .button-label{display:flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap}
/* AC197: one art source for every padlock in this dialog. */
.key-offer-lock{display:inline-block;width:18px;height:20px;flex:none;background:url('/art/ui-lock-v1/padlock.png') center/contain no-repeat}
.key-offer-claimed{font:800 17px/1 system-ui}
.key-offer-connector{display:block;box-sizing:border-box;width:28px;height:14px;margin:0 auto;background:#ffe19a;clip-path:polygon(0 0,100% 0,50% 100%);filter:drop-shadow(0 1px #263c60)}
#modal:has(.key-offers-panel)>[data-action="dismiss"]{flex:none;min-height:56px;margin:0;font-size:24px;padding:8px 12px}
#modal .key-offer-switch{position:absolute;top:0;width:44px;height:44px;min-width:44px;min-height:44px;margin:0;padding:0;display:grid;place-items:center;border:3px solid #27334e;background:linear-gradient(#c8bddb,#9787b0);box-shadow:inset 0 2px #ece5f7,0 3px #172b48;z-index:2}
#modal .key-offer-prev{left:0;border-radius:14px 5px 5px 14px}
#modal .key-offer-next{right:0;border-radius:5px 14px 14px 5px}
#modal .key-offer-switch .route-arrow-art{width:28px;height:28px}
#modal .key-offer-switch .attention-badge{top:-6px;right:0}
#modal .key-offer-prev .attention-badge{right:auto;left:0;rotate:-8deg}
.key-offer-pages{position:absolute;left:0;right:0;bottom:4px;display:flex;justify-content:center;gap:10px;pointer-events:none}
.key-offer-dot{box-sizing:border-box;width:12px;height:12px;border:2px solid #cabede;border-radius:50%;background:#393344;box-shadow:0 2px #10192d}
.key-offer-dot.is-current{border-color:var(--gold-100);background:var(--active-top,#ffd96b);box-shadow:0 2px #7c4a21}
@media(max-height:730px){.key-offers-panel{gap:6px}}

/* Only the crowded AC179 reduced-height rail: retain its order, all entry targets and
   text tiers while packing the existing two pack illustrations more tightly. */
@media(max-height:800px){
 .home-scene:has(.home-key-offer) .founder-offer:has(+.tester-offer.has-founder){top:78px;height:76px}
 .home-scene:has(.home-key-offer) .tester-offer.has-founder{top:158px;height:76px}
 .home-scene:has(.home-key-offer) .founder-offer:has(+.tester-offer.has-founder) .founder-offer-art,
 .home-scene:has(.home-key-offer) .tester-offer.has-founder .founder-offer-art{height:50px}
 .home-scene:has(.home-key-offer) .founder-offer:has(+.tester-offer.has-founder) .founder-offer-blade,
 .home-scene:has(.home-key-offer) .tester-offer.has-founder .founder-offer-blade{width:46px;height:46px}
 .home-scene:has(.home-key-offer) .founder-offer:has(+.tester-offer.has-founder) .founder-offer-blip,
 .home-scene:has(.home-key-offer) .tester-offer.has-founder .founder-offer-blip{width:42px;height:42px;top:10px}
 .home-scene:has(.home-key-offer) .founder-offer:has(+.tester-offer.has-founder) .founder-offer-tag,
 .home-scene:has(.home-key-offer) .tester-offer.has-founder .founder-offer-tag{top:46px}
 .home-scene:has(.home-key-offer) .founder-offer:has(+.tester-offer.has-founder) .founder-offer-price,
 .home-scene:has(.home-key-offer) .tester-offer.has-founder .founder-offer-price{top:63px}
 .home-perks-rail[data-pack-offers="2"]:has(.home-key-offer){top:239px;padding:0}
}
/* Signed tokens select inspected spacing only; targets, fonts and scroll shell remain fixed. */
.key-offer-title h1{translate:0 var(--content-offerHeaderOffset,0px)}
.key-offer-rewards img{padding:var(--content-artworkInset,0px)}

/* AC275: one cute cutout and a separate full-width title form one card.
   Keep the countdown immediately below the heading, without a scene ribbon. */
#modal:has(.key-offers-panel[data-offer-layout="common"]){padding-top:80px}
#modal:has(.key-offers-panel[data-offer-layout="common"]):before{top:72px}
#modal .key-offers-panel[data-offer-layout="common"] .key-offer-title{display:flex;flex-direction:column;align-items:center;gap:4px;height:auto;border:0;background:none;overflow:visible;isolation:isolate}
#modal .key-offers-panel[data-offer-layout="common"] .dialog-hero-art,
#modal .key-offers-panel[data-offer-layout="common"] .key-offer-fallback-art{position:relative;inset:auto;translate:none;box-sizing:border-box;flex:none;width:224px;height:140px;max-width:100%;margin-top:-80px;object-fit:contain;pointer-events:none;filter:drop-shadow(0 3px 2px #10192d66)}
#modal .key-offers-panel[data-offer-layout="common"] h1{position:static;inset:auto;translate:0 var(--content-offerHeaderOffset,0px);width:100%;max-width:none;margin:0;padding:0;background:none;text-align:center;font:24px/1.15 Lucky,system-ui;white-space:normal;word-break:normal;overflow-wrap:normal}
/* AC775 (build 170): the cutout may peek over the card, the (?) never does: it sits inside the card's top-right corner. */
#modal .key-offers-panel[data-offer-layout="common"] .key-offer-title .help-button{top:0px;right:0}
/* The page indicators are also 44px touch targets for switching offers. */
#modal .key-offer-pages{bottom:0;gap:0;pointer-events:none}
#modal .key-offer-page{display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;margin:0;padding:0;border:0;background:none;box-shadow:none;pointer-events:auto}
#modal .key-offer-page.is-current .key-offer-dot{border-color:var(--gold-100);background:var(--active-top,#ffd96b);box-shadow:0 2px #7c4a21}

/* Build 172 feedback: one valuable honey material, without assigning item rarity. */
#modal .key-offer-reward.backpack-slot{border:var(--vs-outline) solid var(--vs-ink);background:linear-gradient(160deg,#ffffff60 0 17%,transparent 18%),radial-gradient(circle at 48% 34%,#ffe594,transparent 65%),linear-gradient(#ffc14a,#e89828);box-shadow:inset 0 0 0 var(--vs-rim) #ffe9a4,inset 0 -5px #b97126,0 var(--vs-drop-y) 0 var(--vs-ink)}
/* Locks preserve the real action colour; only the current row has the gold frame. */
#modal .key-offer-step .key-offer-action.is-locked:disabled{--small-top:var(--btn-secondary-top);--small-bottom:var(--btn-secondary-bottom);--small-edge:var(--btn-secondary-edge);--small-lip:var(--btn-secondary-lip);--small-shine:var(--btn-secondary-shine);opacity:1;filter:saturate(.85) brightness(.94)}
#modal .key-offer-step .key-offer-action.store-buy.is-locked:disabled{--small-top:var(--btn-claim-top);--small-bottom:var(--btn-claim-bottom);--small-edge:var(--btn-claim-edge);--small-lip:var(--btn-claim-lip);--small-shine:var(--btn-claim-shine)}
/* Only key-offer confirmations use the offer's blue plate and centred reward tiles. */
#modal:has(.key-offer-confirm){border:3px solid #27334e;border-radius:20px;background:linear-gradient(#4b8fd8,#315f9a);box-shadow:inset 0 2px #b8e3ff,inset 0 -4px #244775,0 5px #172b48,0 16px 36px #10192d66;padding:16px;gap:16px}
#modal .key-offer-confirm h1{color:var(--cream-200);font:24px/1.15 Lucky,system-ui;-webkit-text-stroke:2.5px var(--ink-brown);paint-order:stroke fill;filter:drop-shadow(0 2px var(--ink-brown));margin:0 0 16px}
#modal .key-offer-confirm .key-offer-rewards{justify-content:center;gap:12px;padding:8px}
#modal .key-offer-confirm .key-offer-reward{width:64px;height:64px;min-height:64px}
#modal:has(.key-offer-confirm)>.equipment-actions{display:flex;align-items:stretch;gap:8px}
#modal:has(.key-offer-confirm)>.equipment-actions>button{flex:1;min-width:0;margin:0;min-height:56px}
/* AC845 (build 194): the confirm's Buy shows the price alone, lettered like every button. */
/* KR-ODDS: the Chances button mirrors the (?) at the title's left; it opens the chain's chest odds (Back returns). */
#modal .key-offer-title .key-offer-odds{position:absolute;top:0;left:0;width:auto;margin:0;z-index:1}
