/* Equipment Merge (gear-v1): Gear view, Chests Gear segment, reveal, tile badges.
   Layout rules: docs/MOBILE_UI.md and docs/SCREEN_RULES.md (Gear view, D8 contained
   item grid, D9 Chests switch). Motion is transform/opacity only; reduced motion is static. */

/* Rarity tile (docs/RARITY_COLORS.md): the tile background is the rarity. */
.gear-tile{--tier:var(--rarity-standard);--tier-accent:var(--tier);position:relative;display:grid;grid-template:minmax(0,1fr)/minmax(0,1fr);place-items:center;box-sizing:border-box;width:44px;height:44px;padding:3px;border-radius:9px;border:1.5px solid color-mix(in srgb,var(--tier) 65%,#5e4630);background:radial-gradient(circle at 50% 42%,color-mix(in srgb,var(--tier) 22%,var(--cream-200)) 0 35%,color-mix(in srgb,var(--tier-accent) 50%,#cdb68c) 100%);box-shadow:inset 0 1px #fffb,inset 0 -2px color-mix(in srgb,var(--tier-accent) 40%,#0000)}
.gear-tile img{width:100%;height:100%;max-width:none;object-fit:contain;filter:drop-shadow(0 1px 1px #3a2a1a55)}
.gear-tile .gear-silhouette{width:78%;height:78%;opacity:.75}
.gear-tile.is-empty{border-style:dashed;background:#3a3242;box-shadow:none}
.gear-tile.is-large{width:64px;height:64px;border-radius:var(--vs-radius);padding:5px;flex:none}
/* AC195: a honey pill below the item face, clear of cutouts and skin pips.
   Gear's compact slot row reserves the same pill in flow. */
.gear-plus-badge{position:absolute;top:calc(100% - 2px);left:50%;z-index:2;transform:translateX(-50%);box-sizing:border-box;padding:1px 6px;border-radius:999px;background:linear-gradient(var(--gold-50),#e9bd68);border:1px solid #765033;box-shadow:inset 0 1px var(--cream-200),0 1px var(--text-on-cream);color:var(--text-on-cream);font:12px/1 Lucky;white-space:nowrap;pointer-events:none}
.eq-scene-slots button{position:relative}
/* Visual polish (bugs lane): Relic/Charm gear tiles take the shared Equip slot tile size (no smaller 44px tile in a cream frame). */
.eq-scene-slots button.gear-slot{padding:3px}
.eq-scene-slots .gear-slot-merge-cue{position:absolute;right:-9px;bottom:-5px;z-index:2;width:22px;height:22px;pointer-events:none;animation:gear-slot-merge-bob 1.6s ease-in-out infinite}
@keyframes gear-slot-merge-bob{50%{transform:translateY(-3px);opacity:.9}}
@media (prefers-reduced-motion:reduce){.eq-scene-slots .gear-slot-merge-cue{animation:none}}

/* Bronze tint for the placeholder chest/key/nav art until gear-v1 is approved. */
img.is-tinted,.gear-key-art.is-tinted,.eq-nav-item[data-action="gear-open"] img{filter:sepia(.55) hue-rotate(-18deg) saturate(1.25) brightness(.92)}
.gear-key-art{width:21px;height:23px;object-fit:contain}

/* Gear view */
.gear-collection{gap:7px}
.gear-slots{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;flex:none}
.gear-slot-pick{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;min-height:56px;margin:0;padding:4px 2px 5px;border:2px solid #514148;border-radius:var(--vs-radius);background:linear-gradient(#ead9be,#b99572);box-shadow:inset 0 2px var(--cream-200),0 3px var(--panel-night);color:#3f3031}
.gear-slot-pick[aria-pressed=true]{border-color:var(--active-edge);background:linear-gradient(var(--active-top),var(--active-bottom));box-shadow:inset 0 2px var(--active-shine),inset 0 -3px var(--active-lip),0 3px var(--panel-night);color:var(--ink-brown)}
.gear-slot-pick>.gear-tile{width:42px;height:42px}
.gear-slot-pick small{font:700 10px/1.1 system-ui;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gear-slot-pick .gear-plus-badge{position:static;transform:none;flex:none}
.gear-selected{display:flex;align-items:center;gap:10px;min-height:76px;padding:7px 10px;border:2px solid var(--gem-color,#84715d);border-radius:13px;background:var(--ink-plum);flex:none}
.gear-selected.is-empty{border-color:#84715d;justify-content:center;text-align:center}
/* AC837: the worn practice sword reads as the weapon's card, same box as a Gear item. */
.gear-selected.is-look{border-color:#84715d}
.gear-selected-info{display:grid;gap:2px;min-width:0;flex:1}
/* AC143: the rarity is named once, under the item icon (no cap badge after the level).
   One line, never split inside the word; the long Transcendent names (pl
   "Transcendentny", 92px at 11px) drop to 10px so the name column keeps its width. */
.gear-selected-art{display:grid;justify-items:center;gap:3px;flex:none;min-width:64px}
.gear-selected-rarity{font:800 11px/1.1 system-ui;color:color-mix(in srgb,var(--gem-color,#d8c6a4) 55%,var(--cream-300));text-align:center;white-space:nowrap}
.gear-selected-rarity.is-long{font-size:10px;letter-spacing:-.01em}
/* AC134/AC135: compact Unequip (and Looks on the Weapon) on the card's right edge. */
.gear-selected-actions{display:grid;gap:6px;flex:none;align-self:center}
#online .gear-selected .gear-card-action{min-width:84px;max-width:104px;min-height:var(--tier-compact);margin:0;padding:4px 10px;font-size:16px;line-height:1.05}
.gear-selected.is-empty .gear-selected-info{flex:1}
.gear-item-name{font:18px/1.1 Lucky;color:var(--cream-300)}
.gear-plus-line{font:800 15px/1.15 system-ui;color:#ffe29a}
.gear-plus-line small{font:600 12px/1.1 system-ui;color:#d8c6a4}
.gear-stats{font:700 13px/1.2 system-ui;color:#f7ead2}
.gear-next{font:600 12px/1.2 system-ui;color:#bfe7a8}
.gear-note{font:600 11px/1.25 system-ui;color:#f2c28a}
.gear-selected.is-empty .gear-selected-info>span{font:600 13px/1.25 system-ui;color:#e4d5bc}
.gear-selected.is-empty .gear-selected-info>b{font:18px/1.1 Lucky;color:var(--cream-300)}
.gear-enhance-row{display:grid;grid-template-columns:1fr;gap:8px;flex:none}
.gear-enhance-row.is-paired{grid-template-columns:1fr 1fr}
#online .gear-enhance-row .secondary{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:100%;min-width:0;min-height:var(--tier-full-h);margin:0;padding:5px 6px;font-size:var(--tier-dense-fs);line-height:1.05}
#online .gear-enhance-row .gear-price{padding:1px 7px;border-radius:8px;background:#0000002e;font:800 12px/1.1 system-ui;white-space:nowrap}
#online .gear-enhance-row .gear-price img{width:15px;height:15px;vertical-align:-3px}
.gear-enhance-reason{margin:0;flex:none;text-align:center;font:600 12px/1.25 system-ui;color:#f2c28a}
.gear-list-bar{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;gap:6px;flex:none}
.gear-list-bar h2{margin:0;font:18px/1.1 Lucky;color:var(--gold-50)}
#online .gear-list-bar .secondary{min-width:0;min-height:var(--tier-compact);margin:0;padding:4px 6px;font-size:16px;line-height:1.05}
/* D8: the one contained touch scroll of this view (like K05 Gemstones). */
.gear-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:78px;gap:7px;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;align-content:start;padding:2px 2px 6px}
.gear-card{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;margin:0;padding:5px 2px 7px;border:2px solid var(--gem-color);border-radius:var(--vs-radius);background:linear-gradient(135deg,#4c4554,#211e2b);box-shadow:inset 0 2px #fdf4d52b,0 3px var(--panel-night);color:var(--paper);overflow:hidden}
/* AC278: counts overlap the frame, so an unclipped rectangular lip exposed
   square corners below the rounded card. The rarity border owns the full rim. */
.gear-card:after{display:none}
.gear-card>.gear-tile{width:42px;height:42px}
.gear-card>small{font:700 10px/1.1 system-ui;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gear-card .gemstone-count{top:3px;right:3px;font-size:11px}
.gear-worn-mark,.gear-better-mark{position:absolute;left:4px;top:3px;font:900 12px/1 system-ui;font-style:normal;color:#b8f59a}
.gear-better-mark{color:#9fe36d}
.gear-card.is-equipped{box-shadow:inset 0 0 0 2px #b8f59a55,0 3px var(--panel-night)}
.gear-empty>.secondary{width:80%}

/* Item detail and merge sheets reuse the gemstone dialogs. */
.gear-detail h1 .gear-rarity-name{color:var(--gem-color);-webkit-text-stroke:.12em #2a2032;paint-order:stroke fill}
.gear-detail-art .gear-tile{width:96px;height:96px;border-radius:16px;padding:8px}
.gear-detail .gear-item-name{color:#5a3f2c}
.gear-detail-stats{font:22px/1.1 Lucky;color:#65472c}
.gear-detail .gear-note{color:#9b4e1f}
.gear-tile-mini{position:relative;display:grid;place-items:center}
.gear-tile-mini .gear-tile{width:40px;height:40px}
.gear-tile-mini b{position:absolute;right:-4px;bottom:-4px;padding:1px 3px;border-radius:5px;background:#16151cdc;color:#fff;font:800 10px/1 system-ui}
.gear-upgrade-flag{display:block;font:800 10px/1.1 system-ui;font-style:normal;color:#3f7a35}

/* Chests: D9 two-segment switch (owner exception to "Chests has no tabs"). */
.gear-chest-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;flex:none}
#online .gear-chest-tabs .secondary{min-width:0;min-height:var(--tier-compact);margin:0;padding:4px 6px;font-size:var(--tier-dense-fs);line-height:1.05}
#online .gear-chest-tabs [aria-selected=true]{--small-top:var(--active-top);--small-bottom:var(--active-bottom);--small-edge:var(--active-edge);--small-lip:var(--active-lip);--small-shine:var(--active-shine)}
#online .chest-shop-card.gear-chest-card{background:radial-gradient(ellipse at 27% 52%,#d7a466,#8a5a2e 52%,#4c2f19)}
#online .gear-chest-card>.gem-chest-title{background:linear-gradient(#a8743d,#744a22);box-shadow:inset 0 2px #e2b57a;border-bottom-color:#2a170b;-webkit-text-stroke-color:#2a170b;text-shadow:none}
#online .gear-chest-card .gem-chest-callout{background:#4a2f1a;border-color:#2a170b;box-shadow:inset 0 2px #b78550;-webkit-text-stroke-color:#2a170b}
#online .gear-chest-card .gem-chest-callout:before{background:#4a2f1a;border-color:#2a170b}
/* Visual polish (layout lane, AC226): the bubble shows the slot pool only; its sentence moved to the (?) sheet. */
#online .gear-chest-card .gem-chest-callout.gear-chest-pool{display:flex;align-items:center;padding:9px 7px}
#online .gear-chest-card .gear-chest-pool .gear-pool-strip{margin:0}
.gear-chest-card .gem-chest-keys{-webkit-text-stroke-color:#2a170b}
.gear-chest-extra{display:grid;grid-template-columns:repeat(auto-fit,minmax(0,1fr));gap:8px}
#online .gear-chest-extra .secondary{min-width:0;min-height:var(--tier-compact);margin:0;padding:4px 6px;font-size:var(--tier-dense-fs);line-height:1.05}
#online .gear-chest-buy .gemstone-price.is-free b{font:800 14px/1.1 system-ui}
#online .gear-chest-card .gem-chest-art{height:clamp(96px,19dvh,190px)}
/* The chest art is a grid item: min-height 0 keeps it inside the (shorter) Gear stage. */
#online .gear-chest-card .gem-chest-art img{min-height:0;min-width:0}
@media(max-height:730px){#online .gear-chest-card .gem-chest-art{height:clamp(78px,13dvh,110px)}#online .gear-chest-card .gem-chest-callout{font-size:15px;padding:7px 8px}#online .gear-chest-card .gear-chest-buy{min-height:62px;font-size:22px}.gear-slot-pick{min-height:52px}.gear-selected{min-height:68px;padding:5px 9px}.gear-grid{grid-auto-rows:70px}}
.gear-key-detail .gear-key-art{width:84px;height:84px}

/* AC19 (build 41): a Gear draw plays the shared Gemstone reveal (story-ui.css
   .gem-results / .gem-reveal); only the tile face differs. The merge receipt
   keeps the gear tiles below (.gear-results-grid, .gear-reveal.is-merged). */
.gem-reveal .gear-draw-card{justify-content:center;gap:1px;padding:3px 2px 10px}
.gem-reveal .gear-draw-card>.gear-tile{flex:none;width:52%;height:auto;aspect-ratio:1;margin-bottom:2px;border-radius:10px}
.gem-reveal .gear-draw-card>small{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:800 9px/1.15 system-ui;color:var(--paper)}
.gem-reveal .gear-draw-card>small:first-of-type{color:color-mix(in srgb,var(--gem-color) 55%,#fff)}
.gem-results-grid.single .gear-draw-card{gap:4px;padding:10px 6px 14px}
.gem-results-grid.single .gear-draw-card>.gear-tile{width:58%}
.gem-results-grid.single .gear-draw-card>small{font-size:13px}
.gem-results.is-gear .gear-note{color:#ffd9a0}
/* AC529 (b126): centred for every card count, slots keep the 5-column width. */
.gear-results-grid{display:flex;flex-wrap:wrap;justify-content:center;gap:7px;width:100%}
.gear-results-grid>.gear-reveal{flex:0 0 calc((100% - 28px) / 5 - .01px)}
.gear-results-grid.single>.gear-reveal{flex-basis:min(150px,100%)}
.gear-reveal{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:0;padding:5px 2px 6px;border:2px solid var(--gem-color);border-radius:var(--vs-radius);background:linear-gradient(135deg,#4c4554,#211e2b);color:var(--paper)}
.gear-reveal .gear-tile{width:46px;height:46px}
.gear-results-grid.single .gear-reveal .gear-tile{width:96px;height:96px;border-radius:14px;padding:7px}
.gear-reveal b{font:800 10px/1.1 system-ui;color:var(--gem-color);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gear-reveal small{font:600 10px/1.1 system-ui;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gear-results-grid.single .gear-reveal b,.gear-results-grid.single .gear-reveal small{font-size:13px}
.gear-merged .gear-reveal.is-merged{animation:gear-pop .34s cubic-bezier(.2,.9,.3,1.25) both;animation-delay:calc(90ms * var(--i,0))}
@keyframes gear-pop{from{opacity:0;transform:translateY(10px) scale(.86)}to{opacity:1;transform:none}}
.discovery-gear-chest{width:120px;height:120px;object-fit:contain}
@media(prefers-reduced-motion:reduce){.gear-merged .gear-reveal.is-merged{opacity:1;transform:none;animation:none}}

/* U01 (build 31 feedback): both chests on one Chests screen, stacked compact
   cards, no switch; must fit 375x667 with no page scroll. The cards keep the
   banner look (title bar, chest over static rays, callout, chunky draws) at a
   smaller scale; the stage turns into a row of chest + callout. */
.chest-pair-heading>div{flex-wrap:nowrap}
.chest-pair-heading .gemstone-wallet{padding:4px 6px;font-size:12px}
.chest-pair-heading .gemstone-wallet img{width:19px;height:22px}
.chest-pair-heading h1{flex:none}
/* Visual polish r2 (findings 172/207): under the shared top HUD the Chests title is
   centred and the key chips (the keys the HUD does not show) sit on its right. */
.chest-pair-heading.has-hud{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;min-height:44px}
.chest-pair-heading.has-hud>h1{grid-column:2;font-size:30px;text-align:center}
.chest-pair-heading.has-hud>div{grid-column:3;justify-self:end;display:flex;gap:5px}
.chest-pair-heading.has-hud .gemstone-wallet{padding:4px 8px 4px 5px;font-size:14px}
@media(max-height:730px){.chest-pair-heading.has-hud{min-height:30px}.chest-pair-heading.has-hud>h1{font-size:24px}.chest-pair-heading.has-hud .gemstone-wallet{padding:2px 7px 2px 4px;font-size:13px}#online.shop-view #content{padding-top:0}}
.gemstone-draw.chest-pair{justify-content:center;gap:14px;min-height:0}
/* Grid items: min-size 0 keeps each chest inside its (shorter) stage row. */
#online .chest-pair .gem-chest-art img{min-height:0;min-width:0}
#online .chest-pair .chest-shop-card.gem-chest-card{--gem-title-pt:6px;--gem-title-pb:5px;--gem-title-fs:clamp(20px,5.8vw,24px);flex:0 0 auto;padding:0 10px 9px;gap:6px}
#online .chest-pair .gem-chest-card>.gem-chest-title{margin:0 -10px;padding:var(--gem-title-pt) 44px var(--gem-title-pb)}
.chest-pair .gem-chest-stage{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:8px;margin:0 -10px;padding:2px 10px}
.chest-pair .gem-chest-hero{gap:3px}
#online .chest-pair .gem-chest-art,#online .chest-pair .gear-chest-card .gem-chest-art{height:clamp(58px,12dvh,124px)}
.chest-pair .gem-chest-keys{font-size:12px}
.chest-pair .gem-chest-callout,#online .chest-pair .gear-chest-card .gem-chest-callout{padding:7px 8px;border-radius:13px;font-size:clamp(13px,3.8vw,16px);line-height:1.22}
.chest-pair .gear-keys-line{display:block;margin-top:3px;font:12px/1.15 Lucky;color:#ffe2b0}
#online .chest-pair .gem-chest-card .gemstone-draw-actions{gap:8px}
#online .chest-pair .gem-chest-buy,#online .chest-pair .gear-chest-card .gear-chest-buy{min-height:clamp(54px,8.4dvh,70px);padding:5px 6px;gap:3px;font-size:clamp(19px,5.4vw,23px)}
/* The Gear Chest selector above outranks the shared label + price rule (story-ui.css AC25: row-gap 0), so its Draw
   buttons stood 3px taller between label and price than the Gemstone Chest ones beside them and read 1px low on
   their face (AC631). Same group as its twin. */
#online .chest-pair .gear-chest-card .gear-chest-buy:has(>.button-label+.gemstone-price){row-gap:0}
#online .chest-pair .gem-chest-buy .gemstone-price{padding:2px 7px;font-size:13px}
#online .chest-pair .gem-chest-buy .gemstone-price img,#online .chest-pair .gem-chest-buy .gear-key-art{width:18px;height:18px}
.chest-pair .gemstone-draw-reason{font-size:12px;line-height:1.2}
#online .chest-pair .gear-chest-extra .secondary{min-height:36px}
.gemstone-wallet .gemstone-key-art{width:19px;height:22px;object-fit:contain}
@media(max-height:730px){.gemstone-draw.chest-pair{gap:9px}#online .chest-pair .chest-shop-card.gem-chest-card{--gem-title-pt:5px;--gem-title-pb:4px;--gem-title-fs:20px;padding-bottom:7px;gap:5px}.chest-pair .gem-chest-card>.help-button{--help-disc:28px}.chest-pair .gem-chest-card>.help-button>span{font-size:20px}#online .chest-pair .gear-chest-extra .secondary{min-height:32px}}
/* F05 face clearance: Buy keys / Claim keep clear of the draws' lip even when no
   shortfall line sits between them. */
#online .chest-pair .gear-chest-extra{margin-top:6px}
.chest-pair .gemstone-draw-reason+.gear-chest-extra{margin-top:0}
/* Y05: earned chests are a third peer card, after Gemstones and Gear. */
#online .chest-pair .collection-chest-entry{display:flex;flex-direction:row;flex:0 0 auto;align-items:center;gap:10px;min-height:62px;width:100%;margin:0;padding:5px 12px;border:3px solid #211b31;border-radius:18px;background:linear-gradient(#658c78,#365747);box-shadow:inset 0 2px #b9ddaf,0 4px #171423;color:var(--cream-250)}
/* AC799 (build 182): the chest art is a positioned box so its waiting-count badge hangs on the art's top-right corner;
   the card's own "!" (milestone claim) keeps the card corner. */
.collection-chest-entry>.collection-entry-art{position:relative;flex:none;display:grid;place-items:center;font:inherit}
.collection-chest-entry .collection-entry-art>img{width:48px;height:48px;object-fit:contain}
.collection-chest-entry .collection-entry-count{top:-3px;right:-8px}
.collection-chest-entry>b{flex:1;text-align:left;font:22px/1 Lucky}
.collection-chest-entry>span:not(.attention-badge,.collection-entry-art){font:32px/1 Lucky}
#online .chest-pair.has-collection .gem-chest-art,#online .chest-pair.has-collection .gear-chest-card .gem-chest-art{height:clamp(46px,8.5dvh,88px)}
@media(max-height:730px){#online .chest-pair.has-collection{gap:9px}#online .chest-pair.has-collection .gem-chest-art{height:42px}#online .chest-pair .collection-chest-entry{min-height:54px}.collection-chest-entry .collection-entry-art>img{width:40px;height:40px}}
@media(max-height:730px){
 #online .chest-pair.has-collection .gear-chest-card .gem-chest-callout>span{display:none}
 #online .chest-pair.has-collection .gear-chest-card .gem-chest-callout{padding:8px 4px}
 #online .chest-pair.has-collection .gear-pool-strip{margin:0}
}
/* Shortfall lines add height to both fixed chest cards. Reserve it in gaps,
   keeping the existing text, art, action sizes and Collection entry intact. */
.gemstone-draw.chest-pair:has(.gemstone-draw-reason){gap:9px}
#online .chest-pair:has(.gemstone-draw-reason) .chest-shop-card.gem-chest-card{gap:4px}
@media(max-height:730px){.gemstone-draw.chest-pair:has(.gemstone-draw-reason){gap:8px}}
/* AB12: the AD button is always the first button of the draw row (ads-ui.css). */

/* V09: level against the rarity cap (AC143: no cap badge). */
.gear-level-kept{display:block;font:600 11px/1.2 system-ui;color:#d8c6a4}

/* V10 (build 32 feedback): the item dialog as a card. */
#modal .gear-detail{display:grid;gap:9px;text-align:left}
.gear-detail-hero{position:relative;isolation:isolate;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px;padding:10px 12px;border:2px solid color-mix(in srgb,var(--gem-color) 70%,#5e4630);border-radius:16px;background:linear-gradient(135deg,color-mix(in srgb,var(--gem-color) 30%,var(--cream-200)),color-mix(in srgb,var(--gem-accent) 22%,#f0dcb5));overflow:hidden}
.gear-detail-rays{position:absolute;left:-30px;top:50%;z-index:-1;width:170px;height:170px;margin-top:-85px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--gem-color) 45%,#fff) 0 25%,transparent 70%);opacity:.8;pointer-events:none}
#modal .gear-detail-art{display:grid;place-items:center}
#modal .gear-detail-art .gear-tile{width:88px;height:88px;border-radius:16px;padding:7px;box-shadow:inset 0 1px #fffb,0 3px 0 color-mix(in srgb,var(--gem-color) 50%,#3a2a1a)}
.gear-detail-title{display:grid;justify-items:start;gap:4px;min-width:0}
#modal .gear-detail-title h1{margin:0;font:24px/1.05 Lucky;color:var(--text-on-cream);text-align:left;overflow-wrap:anywhere}
.gear-rarity-pill{padding:2px 9px;border-radius:999px;background:var(--gem-color);border:2px solid color-mix(in srgb,var(--gem-color) 55%,#2a2032);color:#fff;font:800 13px/1.2 system-ui;-webkit-text-stroke:.5px #2a2032;paint-order:stroke fill;text-shadow:none}
.gear-detail-title small{font:700 12px/1.2 system-ui;color:#6b513a}
.gear-stat-rows{display:grid;gap:5px;margin:0;padding:0;list-style:none}
.gear-stat-row{display:grid;grid-template-columns:30px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:40px;padding:3px 10px 3px 6px;border-radius:var(--vs-radius);background:var(--paper);border:1.5px solid #d9c09a}
.gear-stat-row:has(small){grid-template-columns:30px minmax(0,1fr) auto auto}
.gear-stat-icon{display:grid;place-items:center;width:30px;height:30px}
.gear-stat-icon img,.gear-stat-icon svg,.gear-stat-icon>*{width:26px;height:26px;object-fit:contain}
.gear-stat-name{font:800 14px/1.1 system-ui;color:#5a3f2c}
.gear-stat-row b{font:22px/1 Lucky;color:var(--text-on-cream)}
.gear-stat-row small{font:700 11px/1.1 system-ui;color:#3f7a35}
.gear-stat-none{margin:0;text-align:center;font:700 13px system-ui;color:#6b513a}
.gear-detail-facts{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:6px}
.gear-fact{display:grid;align-content:start;gap:4px;min-height:48px;padding:7px 10px;border-radius:var(--vs-radius);background:#3a3242;color:var(--cream-300)}
.gear-fact>small{font:700 11px/1.1 system-ui;color:#d8c6a4;text-transform:uppercase;letter-spacing:.03em}
.gear-fact .gear-plus-line b{font:800 15px/1.15 system-ui;color:#ffe29a}
.gear-worn-chip{display:inline-block;padding:1px 6px;border-radius:7px;background:#3f7a35;color:#eaffd8;font:800 11px/1.25 system-ui;font-style:normal;vertical-align:1px}
.gear-detail-merge{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding:6px 8px 6px 10px;border-radius:var(--vs-radius);background:#f3e2c2;border:1.5px dashed #b99572}
.gear-merge-path{display:flex;align-items:center;gap:4px;min-width:0}
.gear-merge-path .gear-tile{width:36px;height:36px}
.gear-merge-path b{font:800 11px/1 system-ui;color:#5a3f2c}
.gear-merge-path i{font:900 16px/1 system-ui;font-style:normal;color:#8a6a4a}
#modal .gear-detail-merge .secondary{min-height:var(--tier-compact);margin:0;padding:4px 14px;font-size:var(--tier-dense-fs)}
#modal .gear-detail .gear-note,#modal .gear-detail .gemstone-detail-reason{text-align:center}

/* V21 (gear-v3): chest slot pool. */
.gear-pool-strip{display:flex;justify-content:center;gap:3px;margin:5px 0 0;padding:0;min-height:0;border:0;background:none;box-shadow:none;width:100%}
.gear-pool-tile{position:relative;display:inline-grid}
.gear-pool-strip .gear-tile{width:24px;height:24px;padding:2px;border-radius:6px;border-width:1px}
/* The 24px tiles keep the callout compact; the tap region is 44px tall (MOBILE_UI touch targets). */
.gear-pool-strip{position:relative}.gear-pool-strip::after{content:'';position:absolute;left:0;right:0;top:50%;height:44px;margin-top:-22px}
.gear-pool-tile.is-locked .gear-tile{filter:grayscale(1) brightness(.62)}
.gear-pool-lock{position:absolute;right:-3px;bottom:-3px;width:12px;height:12px;border-radius:50%;background:var(--ink-plum) center/8px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Crect x='1.5' y='4.3' width='7' height='5' rx='1' fill='%23ffd66b'/%3E%3Cpath d='M3 4.5V3a2 2 0 0 1 4 0v1.5' fill='none' stroke='%23ffd66b' stroke-width='1.3'/%3E%3C/svg%3E");border:1px solid #ffd66b;font-style:normal}
.gear-pool-list h2{margin:4px 0 6px;font:17px/1.1 Lucky;color:#5a3f2c;text-align:center}
.gear-pool-list ul{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin:0;padding:0;list-style:none}
.gear-pool-list li{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:6px;padding:4px 6px;border-radius:10px;background:var(--cream-200);border:1.5px solid #d9c09a;text-align:left}
.gear-pool-list li.is-locked{background:#e4ddd2;border-color:#b9b0a4;color:#6a625a}
.gear-pool-list li .gear-tile{width:30px;height:30px;padding:2px}
.gear-pool-list li span:last-child{display:grid;min-width:0}
.gear-pool-list b{font:800 12px/1.15 system-ui}
.gear-pool-list small{font:600 10.5px/1.2 system-ui}
.gear-pool-list li.is-available small{color:#3f7a35}
/* V21: the odds sheet with the pool list fits Mini without scrolling. */
.gear-chest-help>p{margin:5px 0;font-size:12.5px;line-height:1.3}
.gear-chest-help .gear-pool-list h2{margin:6px 0 5px}
.gear-chest-help .gear-pool-list li{padding:3px 5px;gap:5px}
.gear-chest-help .gear-pool-list li .gear-tile{width:26px;height:26px}
/* AC82: the Merged! receipt says the equipped copy was kept; readable on the cream receipt. */
#modal .gear-merged .gear-kept-note{display:block;margin-top:6px;color:#6b5236;font-weight:700;opacity:1}

/* AC87: Enhance level-up burst on the selected item card (gear-ui.js gearEnhancePlay).
   Absolutely placed layers, so nothing shifts; transform/opacity only; idle when not
   enhancing (opacity 0), never rendered under reduced motion. */
.gear-selected{position:relative}
.gear-enhance-fx{position:absolute;left:44px;top:50%;width:0;height:0;z-index:3;pointer-events:none}
.gear-enhance-fx>i{position:absolute;left:0;top:0;opacity:0;pointer-events:none}
.gear-enhance-fx .gef-glow{width:104px;height:104px;margin:-52px 0 0 -52px;border-radius:50%;background:radial-gradient(circle,#fff6d0 0,color-mix(in srgb,var(--gem-color,#ffd36b) 70%,#ffd36b) 38%,#ffd36b00 70%);mix-blend-mode:screen}
.gear-enhance-fx .gef-ring{width:70px;height:70px;margin:-35px 0 0 -35px;border-radius:50%;border:3px solid var(--gold-100);box-shadow:0 0 10px #ffd36b,inset 0 0 8px #ffd36b}
.gear-enhance-fx .gef-rays{width:140px;height:140px;margin:-70px 0 0 -70px;border-radius:50%;background:repeating-conic-gradient(from 0deg,#ffe08a99 0 9deg,#ffe08a00 9deg 30deg);-webkit-mask:radial-gradient(circle,#0000 20%,#000 34%,#000 58%,#0000 72%);mask:radial-gradient(circle,#0000 20%,#000 34%,#000 58%,#0000 72%)}
.gear-enhance-fx .gef-spark{width:9px;height:9px;border-radius:2px;background:var(--shine-100);box-shadow:0 0 6px #ffd36b;transform:translate(-50%,-50%) rotate(45deg)}
.gear-enhance-fx .gef-spark:nth-child(odd){width:6px;height:6px;background:var(--honey-200)}
.gear-enhance-pops{position:absolute;left:58px;right:0;top:46%;height:0;z-index:4;pointer-events:none}
.gear-delta-pop{position:absolute;left:calc(50% + var(--pop-x,0px));top:0;opacity:0;white-space:nowrap;padding:2px 7px;border-radius:9px;background:#1d1624e6;border:1.5px solid #b8f59a;color:#c9ff9f;font:900 13px/1.1 system-ui;text-shadow:none;pointer-events:none}
.gear-selected.is-enhancing{border-color:color-mix(in srgb,var(--gem-color,#84715d) 60%,#ffe29a)}
@media (prefers-reduced-motion:reduce){.gear-enhance-fx,.gear-enhance-pops{display:none}}
/* Visual polish r2 (finding 214): Equipment → Gemstones and Gear item grids sit in one
   inset plum well that runs to the bottom bar; dashed ghost cells fill the rows. */
#online .item-well{margin-bottom:0;padding:8px;border:2px solid #3a3242;border-radius:16px;background:radial-gradient(ellipse at 50% 0,#332b3b,#2a2431 70%);box-shadow:inset 0 3px 10px #0007,inset 0 -2px 8px #0004}
#online .item-well>.grid-ghost{border:1.5px dashed #5b4e63;border-radius:12px;opacity:.35}
/* Visual polish r2 (finding 278): empty gear slots show their silhouette larger and clearer. */
.gear-slot-pick>.gear-tile.is-empty .gear-silhouette{width:84%;height:84%;opacity:.6}
/* Owner 2026-11-21 ("te karty powinny być możliwe do scrollowania i pod nagłówkiem"): when the chest cards are taller
   than the space (e.g. 584 x 735: 548 px in 520), centring pushed the first card up over the heading and nothing
   scrolled. The cards start under the heading (safe centring) and only the card list scrolls (contained); the heading,
   wallets and the bar stay fixed. AGENTS.md → Approved contained scrolling. */
#content .gemstone-draw.chest-pair{justify-content:safe center;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
#content .gemstone-draw.chest-pair>*{flex-shrink:0}
