/* inventory: stacked cards with a quantity stepper and a bottom action bar */
.inv-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 2px 12px 12px; }
.inv-cards .empty { grid-column: 1 / -1; min-height: 300px; }

/* square card: price top-left, tag top-right, picture, name; when picked the name gives way to a -/+ stepper */
.icard { position: relative; aspect-ratio: 1 / 1; min-width: 0; display: grid; grid-template-rows: 1fr auto; padding: 22px 6px 6px; border-radius: 10px; background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--rc, #fcd711) 16%, transparent), transparent 66%), linear-gradient(180deg, #232327, #1b1b1f); box-shadow: inset 0 0 0 1px #2d2d33; cursor: pointer; overflow: hidden; user-select: none; transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s, background 0.3s; }
.icard::after { content: ""; position: absolute; top: -40%; left: -60%; width: 40%; height: 180%; background: linear-gradient(100deg, transparent, #ffffff22, transparent); transform: rotate(12deg); opacity: 0; pointer-events: none; transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s; }
.icard.r0 { --rc: #9aa0ad; } .icard.r1 { --rc: #5ba4ff; } .icard.r2 { --rc: #9b6bff; } .icard.r3 { --rc: #ff5fb1; } .icard.r4 { --rc: #ff5b5b; } .icard.r5 { --rc: #fcd711; }
.icard:hover, .item.item:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px #45454e, 0 10px 20px #0007; }
.icard:hover::after { opacity: 1; transform: rotate(12deg) translateX(520%); }
.icard:focus-visible { outline: 2px solid var(--y, #fcd711); outline-offset: 2px; }
.icard.sel, .item.item.sel { background: radial-gradient(circle at 50% 40%, #fcd71159, transparent 68%), linear-gradient(180deg, #3d3412, #1f1c12); box-shadow: inset 0 0 0 2px var(--y, #fcd711), 0 0 18px #fcd71130; }

.icard img { position: relative; z-index: 1; width: 100%; height: 100%; min-height: 0; object-fit: contain; align-self: center; filter: drop-shadow(0 6px 8px #0009); transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.icard:hover img, .item.item:hover img { transform: scale(1.06) rotate(-2deg); }
.ic-p { position: absolute; z-index: 2; top: 6px; left: 7px; display: inline-flex; align-items: center; gap: 4px; font-family: var(--tek, inherit); font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 4px #000a; }
.ic-p .coin { width: 12px; height: 12px; }
.ic-st { position: absolute; z-index: 2; top: 7px; right: 7px; color: #9a9ba3; font-size: 9.5px; font-weight: 800; letter-spacing: 0.04em; }
.ic-own { position: absolute; z-index: 2; top: 22px; right: 7px; padding: 0 5px; border-radius: 5px; background: #ffffff1a; color: #fff; font-size: 10.5px; font-weight: 800; }
.ic-foot { position: relative; z-index: 1; display: grid; justify-items: center; min-width: 0; height: 30px; align-content: end; transition: opacity 0.2s; }
.ic-t, .ic-n { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.ic-t { color: #8c8d95; font-size: 9.5px; line-height: 1.2; }
.ic-n { color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1.25; }
.icard.sel .ic-foot { opacity: 0; }

.ic-step { position: absolute; z-index: 3; left: 5px; right: 5px; bottom: 5px; height: 30px; display: grid; grid-template-columns: 24px 1fr 24px; align-items: center; padding: 0 3px; border-radius: 8px; background: #111113e6; box-shadow: 0 4px 10px #0008; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity 0.25s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
.icard.sel .ic-step { opacity: 1; transform: none; pointer-events: auto; }
.ic-step b { text-align: center; color: #fff; font-size: 13px; font-weight: 800; font-family: var(--tek, inherit); }
.ic-step button { width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: linear-gradient(180deg, #ffe24a, #f2c40c); color: #1c1c20; cursor: pointer; box-shadow: inset 0 1px 0 #fff8, 0 2px 6px #fcd71140; transition: filter 0.2s, transform 0.15s; }
.ic-step button:hover:not(:disabled) { filter: brightness(1.08); }
.ic-step button:active:not(:disabled) { transform: scale(0.86); }
.ic-step button:disabled { opacity: 0.35; cursor: default; }
.ic-step .ico { width: 13px; height: 13px; stroke-width: 3.2; }

.invbar { position: sticky; bottom: 12px; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 12px 12px; padding: 8px 8px 8px 10px; border-radius: 16px; background: linear-gradient(180deg, #2a2a30, #202024); box-shadow: inset 0 0 0 1px #34343b, 0 16px 40px #000a; }
.ib-pager, .ib-right { display: flex; align-items: center; gap: 8px; }
.ib-page { color: #8c8d95; font-size: 12px; font-weight: 700; padding: 0 4px; }
.ib-picked { color: #9a9ba3; font-size: 12.5px; font-weight: 600; padding-right: 4px; }
.ib-sq { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 11px; background: #17171b; color: #d7d8de; cursor: pointer; box-shadow: inset 0 0 0 1px #34343b; transition: background-color 0.2s, color 0.2s, transform 0.15s; }
.ib-sq:hover:not(:disabled) { background: #26262c; color: #fff; }
.ib-sq:active:not(:disabled) { transform: scale(0.92); }
.ib-sq:disabled { opacity: 0.4; cursor: default; }
.ib-sq .ico { width: 18px; height: 18px; }
.ib-btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border: 0; border-radius: 11px; background: #17171b; color: #e8e8ec; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: inset 0 0 0 1px #34343b; transition: background-color 0.2s, transform 0.15s, opacity 0.2s; }
.ib-btn:hover:not(:disabled) { background: #26262c; }
.ib-btn:active:not(:disabled) { transform: scale(0.96); }
.ib-btn:disabled { opacity: 0.4; cursor: default; }
.ib-btn .ico { width: 16px; height: 16px; }
.ib-total { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 4px 0 16px; border: 0; border-radius: 12px; background: linear-gradient(180deg, #ffe24a, #fcd711 55%, #f0bf0a); color: #1c1c20; font: inherit; font-weight: 800; cursor: pointer; overflow: hidden; box-shadow: inset 0 1px 0 #fff8, 0 6px 18px #fcd71140; transition: transform 0.15s, filter 0.2s, opacity 0.2s; }
.ib-total::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, #fff8, transparent); transform: skewX(-18deg); transition: left 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.ib-total:hover:not(:disabled)::after { left: 130%; }
.ib-total:hover:not(:disabled) { filter: brightness(1.05); }
.ib-total:active:not(:disabled) { transform: scale(0.97); }
.ib-total:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
.ib-sum { display: inline-flex; align-items: center; gap: 6px; font-family: var(--tek, inherit); font-size: 15px; }
.ib-sum .coin { width: 16px; height: 16px; }
.ib-cart { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #1c1c20; color: var(--y, #fcd711); margin-left: 4px; }
.ib-cart .ico { width: 16px; height: 16px; }

@media (max-width: 1100px) { .inv-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) { .inv-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .inv-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 2px 8px 10px; }
  .invbar { bottom: calc(var(--dock, 64px) + 10px); margin: 4px 8px 10px; }
  .ib-right { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .ib-btn span { display: none; }
  .ib-picked { display: none; }
}
@media (prefers-reduced-motion: reduce) { .icard, .icard img, .ic-step, .icard::after { transition: none; } }


/* upgrader shop: same cards, one shared buy bar below the grid */
#mine:has(.shop-card) { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.shop-card { width: 100%; }
#shop-purchase { padding: 0 12px 12px; }
.shopbar { display: flex; align-items: center; gap: 8px; padding-top: 8px; }
.sb-pager { display: flex; gap: 6px; }
.sb-info { flex: 1; color: #9a9ba3; font-size: 12.5px; font-weight: 600; text-align: right; padding-right: 2px; }
.sb-trash { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; background: none; color: #8c8d95; cursor: pointer; border-radius: 9px; transition: color 0.2s, background-color 0.2s; }
.sb-trash:hover:not(:disabled) { color: #fff; background: #ffffff0d; }
.sb-trash:disabled { opacity: 0.35; cursor: default; }
.sb-trash .ico { width: 18px; height: 18px; }
.shopbar .ib-sq { width: 34px; height: 34px; border-radius: 9px; }
.shopbar .ib-total { height: 36px; border-radius: 10px; padding-left: 12px; }
.shopbar .ib-cart { width: 28px; height: 28px; border-radius: 8px; }
.ib-total.short { background: linear-gradient(180deg, #5a4a1a, #4a3c12); color: #d9c27a; }
@media (max-width: 760px) { #mine:has(.shop-card) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* every item grid uses the shop card: square, price top-left, picture, name at the bottom */
.upg-lists .grid, .upg-lists #mine:has(.shop-card) { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.inv-cards { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.item.item { aspect-ratio: 1 / 1; min-height: 0; height: auto; padding: 22px 6px 6px; border-radius: 10px; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; justify-items: center; align-items: end; background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--rc, #fcd711) 16%, transparent), transparent 66%), linear-gradient(180deg, #232327, #1b1b1f); box-shadow: inset 0 0 0 1px #2d2d33; overflow: hidden; transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s, background 0.3s; }
.item.item::before, .item.item.sel::after { display: none; }
.item.item img { position: relative; inset: auto; top: auto; left: auto; width: 100%; height: 100%; max-height: none; min-height: 0; object-fit: contain; align-self: center; transform: none; margin: 0; filter: drop-shadow(0 6px 8px #0009); transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.item.item .item-p { position: absolute; z-index: 2; top: 6px; left: 7px; right: auto; bottom: auto; transform: none; display: inline-flex; align-items: center; gap: 4px; margin: 0; font-family: var(--tek, inherit); font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 4px #000a; }
.item.item .item-p .yt { color: #fff; }
.item.item .item-p .coin { width: 12px; height: 12px; }
.item.item .item-odds { position: absolute; z-index: 2; top: 6px; right: 7px; left: auto; font-size: 10px; }
.item.item .item-ok { top: 5px; right: 5px; left: auto; width: 16px; height: 16px; border-radius: 5px; }
.item.item .item-ok .ico { width: 11px; height: 11px; }
.item.item .item-lbl { position: absolute; z-index: 2; top: 22px; right: 6px; }
.item.item .item-t, .item.item .item-n { position: static; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.item.item .item-t { margin-top: 2px; color: #8c8d95; font-size: 9.5px; line-height: 1.2; }
.item.item .item-n { color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1.25; }
@media (max-width: 760px) { .upg-lists .grid, .upg-lists #mine:has(.shop-card) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* case reel: the winning cell glows yellow in place instead of scaling past the reel edges */
.reel .cell.hit, .reel.done .cell.hit { transform: none; background: radial-gradient(circle at 50% 45%, #fcd71140, transparent 70%), linear-gradient(180deg, #3d3412, #1f1c12); box-shadow: inset 0 0 0 2px var(--y, #fcd711); animation: reel-hit 0.9s cubic-bezier(0.22, 1, 0.36, 1) both; }
.reel .cell.hit img { animation: reel-hit-img 0.9s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes reel-hit { 0% { box-shadow: inset 0 0 0 0 #fcd71100; } 40% { box-shadow: inset 0 0 0 2px var(--y, #fcd711), inset 0 0 34px #fcd71166; } 100% { box-shadow: inset 0 0 0 2px var(--y, #fcd711), inset 0 0 14px #fcd71126; } }
@keyframes reel-hit-img { 0% { filter: drop-shadow(0 6px 8px #0009) brightness(1); } 40% { filter: drop-shadow(0 0 14px #fcd71199) brightness(1.2); } 100% { filter: drop-shadow(0 6px 10px #0009) brightness(1.05); } }
@media (prefers-reduced-motion: reduce) { .reel .cell.hit, .reel .cell.hit img { animation: none; } }

/* withdrawal: the listing the player puts on the market */
.wd-out { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: #121215; color: #9a9ba3; font-size: 12.5px; }
.wd-out b { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; color: #fff; font-size: 13px; white-space: nowrap; }
.wd-out .coin { width: 13px; height: 13px; }
.wd-items { display: flex; align-items: center; gap: 2px; min-width: 0; overflow: hidden; }
.wd-items img { width: 44px; height: 28px; object-fit: contain; }
.wd-items span { color: #8c8d95; font-size: 11px; font-weight: 700; padding-left: 4px; }
.wd-hero { --rc: #fcd711; display: grid; grid-template-columns: 170px 1fr; gap: 14px; padding: 12px; border-radius: 14px; background: linear-gradient(160deg, #2c2a1c, #1c1c20 60%); box-shadow: inset 0 0 0 1px #4a4224, 0 10px 24px #0007; }
.wd-hero-pic { display: grid; place-items: center; border-radius: 10px; background: radial-gradient(circle at 50% 45%, #fcd71133, transparent 70%), #16161a; min-height: 104px; }
.wd-hero-pic img { width: 92%; max-height: 96px; object-fit: contain; filter: drop-shadow(0 8px 12px #000a); }
.wd-hero-info { display: grid; align-content: center; gap: 4px; min-width: 0; }
.wd-kicker { color: var(--y, #fcd711); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.wd-hero-price { display: flex; align-items: center; gap: 8px; }
.wd-hero-price strong { display: inline-flex; align-items: center; gap: 6px; font-size: 22px; color: var(--y, #fcd711); font-family: var(--tek, inherit); }
.wd-hero-price strong .coin { width: 18px; height: 18px; }
.wd-copy { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: #ffffff10; color: #c9cad0; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.wd-copy:hover { background: #ffffff1c; color: #fff; }
.wd-copy .ico { width: 14px; height: 14px; }
.wd-hero-info small { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; color: #8c8d95; font-size: 11.5px; }
.wd-hero-info small .coin { width: 11px; height: 11px; }
.wd-hero .wd-meta { margin-top: 4px; }
.wd-st { padding: 4px 9px; border-radius: 8px; background: #121215; color: #c9cad0; font-size: 12px; box-shadow: inset 0 0 0 1px #2f2f36; }
.wd-how { margin: 0; padding: 0 0 0 18px; display: grid; gap: 5px; color: #b7b8bf; font-size: 13px; line-height: 1.45; }
.wd-how b { color: var(--y, #fcd711); }
.wd-pattern-input { position: relative; display: flex; align-items: center; }
.wd-pattern-input .input { padding-left: 46px; }
.wd-pattern-input .wd-cube { position: absolute; left: 12px; width: 22px; height: 22px; object-fit: contain; pointer-events: none; }
.wd-pattern-input .wd-shot-mini:not([hidden]) ~ .wd-cube { left: 44px; }
.wd-pattern-input .wd-shot-mini:not([hidden]) ~ .input { padding-left: 76px; }
.wd-shot-mini { position: absolute; left: 8px; width: 28px; height: 28px; border-radius: 7px; object-fit: cover; box-shadow: 0 0 0 1px #3b3b43; }
.wd-shot-mini[hidden] { display: none; }
.field label .muted { color: #6f7078; font-weight: 500; }
.ai-st-text { color: #c9cad0; font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-copy { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: #ffffff10; color: #c9cad0; cursor: pointer; }
.ai-copy .ico { width: 13px; height: 13px; }
@media (max-width: 560px) { .wd-hero { grid-template-columns: 1fr; } }

.inventory-entry > .item.item { width: 100%; }
.upg-lists .grid > .inventory-entry .inventory-sell { left: 5px; right: 5px; bottom: 5px; height: 30px; z-index: 3; border-radius: 8px; background: #111113e6; color: var(--y, #fcd711); font-size: 11.5px; font-weight: 800; box-shadow: 0 4px 10px #0008; transform: translateY(8px); transition: opacity 0.25s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.2s; }
.upg-lists .grid > .inventory-entry:has(.item.sel) .inventory-sell { transform: none; }
.upg-lists .grid > .inventory-entry .inventory-sell:hover { background: #1c1c20; color: #ffe24a; }
.inventory-entry:has(.item.sel) .item-t, .inventory-entry:has(.item.sel) .item-n { opacity: 0; }
.reel .cell::after { display: none; }
.reel .cell.hit::before { background: radial-gradient(circle at 50% 45%, #fcd71133, transparent 70%); }
.upg-lists #shop-purchase { display: block; position: static; margin-top: auto; padding: 4px 12px 12px; border-top: 0; background: none; }
.upg-lists #shop-purchase[hidden] { display: none; }

/* one card size everywhere: about the width of a shop card */
.contents .drops { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.res-grid { grid-template-columns: repeat(auto-fill, 112px); justify-content: center; gap: 6px; }
.res-grid.one { grid-template-columns: 150px; }
.g8, .pp-list .grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.battle-side .grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
.item.item.res-tile { animation: pop 0.45s var(--ease) both; }

/* live feed: hovering only brightens the card, the picture stays where it is; no white frame on the top drop */
.drop:hover img.sk { transform: translateY(-50%); }
.drop.best { box-shadow: none; }
.drop:focus-visible { outline: 2px solid var(--y, #fcd711); outline-offset: -2px; }
@media (max-width: 1100px) { .drop:hover img.sk { transform: translate(-50%, -50%); } }
.invbar [hidden], .shopbar [hidden] { display: none; }
.invbar .ib-total:not([hidden]) { animation: ic-bar-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes ic-bar-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.upg-lists #shop-purchase .shopbar { justify-content: flex-end; }

/* gold coin: soft shadow under the coin so it reads as a solid piece */
svg.coin { filter: drop-shadow(0 1px 1.5px #00000080) drop-shadow(0 0 3px #f7b71a33); overflow: visible; }

/* every card gets the same warm yellow glow behind the picture instead of the rarity colour */
.icard, .icard[class*=" r"], .item.item, .item.item[class*=" r"], .reel .cell, .slot.full { --rc: #fcd711; }
.icard, .item.item { background: radial-gradient(circle at 50% 40%, #fcd71129, transparent 64%), linear-gradient(180deg, #25241f, #1b1b1f 70%); }
.icard:not(.sel):hover, .item.item:not(.sel):hover { background: radial-gradient(circle at 50% 40%, #fcd7113d, transparent 66%), linear-gradient(180deg, #2a2820, #1d1d20 70%); }
.sb-pager { align-items: center; }
.sb-page { padding: 0 6px; color: #8c8d95; font-size: 12.5px; font-weight: 700; font-family: var(--tek, inherit); white-space: nowrap; }
.upg-lists #t-pager, .upg-lists #mine-pager { margin-top: auto; padding: 4px 12px 12px; }
.upg-lists #t-pager .shopbar, .upg-lists #mine-pager .shopbar { justify-content: flex-start; }

/* stepper: rounded yellow pill, dark round buttons with yellow signs */
.ic-step { left: 6px; right: 6px; bottom: 6px; height: 28px; padding: 0 3px; border-radius: 99px; background: linear-gradient(180deg, #ffe24a, #f6c90e); box-shadow: inset 0 1px 0 #fff9, 0 4px 12px #fcd71147; }
.ic-step b { color: #1c1c20; font-size: 13.5px; }
.ic-step button { width: 22px; height: 22px; background: #1c1c20; color: var(--y, #fcd711); box-shadow: none; }
.ic-step button:hover:not(:disabled) { filter: none; background: #2c2c32; }
.ic-step button:disabled { opacity: 0.4; }
.ic-step .ico { width: 12px; height: 12px; stroke-width: 3.2; }
.icard.sel .ic-step { animation: step-pop 0.35s cubic-bezier(0.34, 1.4, 0.64, 1) both; }
@keyframes step-pop { from { opacity: 0; transform: translateY(8px) scale(0.92); } to { opacity: 1; transform: none; } }

/* bars and buttons slide in when they appear, without pushing anything around */
.upg-lists #shop-purchase:not([hidden]) { animation: bar-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both; }
.pop-in { animation: bar-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both; }
.invbar .ib-btn:not([hidden]), .invbar .ib-sq[data-do="clear"]:not([hidden]) { animation: bar-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both; }
.invbar .ib-btn:nth-of-type(2) { animation-delay: 0.04s; }
@keyframes bar-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* case reels: added reels slide in one after another */
.reel { transition: height 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.reel.reel-new { animation: reel-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes reel-in { from { opacity: 0; transform: translateY(-10px) scale(0.98); } to { opacity: 1; transform: none; } }

/* result cards, modals' item tiles and freshly drawn grids fade in softly */
.res-grid .item.item { animation: pop 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
@media (prefers-reduced-motion: reduce) { .ic-step, .icard.sel .ic-step, .pop-in, .upg-lists #shop-purchase, .reel.reel-new, .invbar .ib-btn, .invbar .ib-sq { animation: none !important; } }

/* dial pointer: slim golden needle with a light and a dark facet, round base and a soft glow */
.d-ptr { filter: drop-shadow(0 0 4px #fcd71166) drop-shadow(0 2px 3px #000a); }
.d-ptr path, .d-ptr circle { stroke: none; }
.d-ptr .ptr-glow { fill: #fcd711; opacity: 0.25; transform: scale(1.12); transform-origin: 160px 290px; transform-box: view-box; }
.d-ptr .ptr-light { fill: #ffe873; }
.d-ptr .ptr-dark { fill: #e0a40e; }
.d-ptr .ptr-shine { fill: none; stroke: #fffbe0; stroke-width: 0.9; stroke-linecap: round; opacity: 0.85; }
.d-ptr .ptr-knob { fill: url(#coinRim); stroke: #8a5203; stroke-width: 0.6; }
.d-ptr .ptr-dot { fill: #1c1c20; }

/* loss shown like a win: big number and one word, in a calm red */
.cc-miss { --cc: #f27979; }

/* dial pointer v2: notched arrowhead with two facets and a short tapered shaft */
.d-ptr { filter: drop-shadow(0 0 5px #fcd71155) drop-shadow(0 2px 2px #000b); }
.d-ptr .ptr-stem { fill: #f0bd1f; }
.d-ptr .ptr-light { fill: #ffe46a; }
.d-ptr .ptr-dark { fill: #e3a20c; }
.d-ptr .ptr-shine { fill: none; stroke: #fffbe3; stroke-width: 0.8; stroke-linecap: round; opacity: 0.9; }

/* keep every line of a card centred: the single column is exactly the card width */
.item.item, .icard { grid-template-columns: minmax(0, 1fr); }
.item.item .item-t, .item.item .item-n, .icard .ic-t, .icard .ic-n { justify-self: stretch; width: 100%; min-width: 0; text-align: center; }
.item.item img { justify-self: center; }
.lst-filters .chips { flex-wrap: nowrap; overflow-x: auto; }
.reel { transition: height 0.42s cubic-bezier(0.22, 1, 0.36, 1); }
.reel.leaving { pointer-events: none; }
/* both lists end with one bottom row of the same height so the pagers line up */
.shopbar { min-height: 36px; }
.shopbar .ib-total { height: 34px; }
.upg-lists .lst .ph #select-all { margin-left: auto; }
.upg-lists .lst .ph #select-all + #clear { margin-left: 0; }

.upg-lists #mine-pager:empty, .upg-lists #t-pager:empty { display: none; }

/* window titles are written like normal sentences, not in capitals */
.modal-head h2, .tg-head h2, .auth-head h2, .dep-head h2, .res-head h2 { text-transform: none; letter-spacing: 0; }
.modal-head { padding-bottom: 6px; }
.modal-head h2 { font-size: 20px; }
.auth-head h2 { font-size: 24px; }

/* Telegram windows: air between the blocks */
.tg { gap: 26px; }
.tg-head { gap: 16px; }
.tg-head h2 { font-size: 20px; line-height: 1.2; }
.tg-head p { margin-top: 4px; }
.tg-steps li { gap: 14px; padding-bottom: 26px; }
.tg-steps li > div { gap: 10px; }
.tg-steps li > div > .btn { margin: 2px 0 4px; }
.tg-form, .code-form { gap: 10px; }
.tg-hint { line-height: 1.5; }
.tg-back { margin-top: 2px; padding: 6px 10px; border-radius: 8px; }
.modal-body > .tg-lead { margin: 4px 0 20px; line-height: 1.55; }
.modal-body > .code-form { margin-bottom: 16px; }
.modal-body > .tg-hint + .tg-hint { margin-top: 10px; }
.modal-body > .tg-hint { padding: 0 2px; }

/* battles on phones: the preview shrinks to fit instead of being cut at the edge */
@media (max-width: 560px) {
  .battle-preview-list { overflow: hidden; }
  .battle-preview-case, .battle-preview-item { flex: 1 1 0; min-width: 0; max-width: 74px; width: auto; height: auto; aspect-ratio: 1 / 1.05; }
}

@media (max-width: 560px) { .inv-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; } }

/* magic box v2: no frame; soft aurora, sparks drifting up and a floating "?" */
.slot.magic-slot .magic-box { box-shadow: none; border: 0; background: radial-gradient(120% 90% at 50% 110%, #2fbf7f 0%, #17734b 45%, #0d3f2a 100%); animation: none; }
.slot.magic-slot .magic-box::before { content: ""; position: absolute; inset: -30%; background: radial-gradient(40% 35% at 30% 40%, #7cf0bdaa, transparent 70%), radial-gradient(35% 30% at 70% 60%, #b6ffe088, transparent 70%), radial-gradient(30% 25% at 50% 20%, #3fe0a066, transparent 70%); will-change: transform; animation: magic-aurora 9s ease-in-out infinite alternate; }
.slot.magic-slot .magic-box::after { background: linear-gradient(105deg, transparent 40%, #ffffff1f 50%, transparent 60%); animation: magic-box-glint 4.5s ease-in-out infinite; }
.slot.magic-slot .magic-box i { scale: 1; width: 6px; height: 6px; top: auto; bottom: -10px; border-radius: 50%; background: radial-gradient(circle, #f2fff9, #8ff0c4 45%, transparent 70%); opacity: 0; animation: magic-spark 3.6s linear infinite; }
.slot.magic-slot .magic-box i:nth-child(1) { left: 14%; animation-delay: 0s; }
.slot.magic-slot .magic-box i:nth-child(2) { left: 32%; width: 9px; height: 9px; animation-delay: -1.2s; animation-duration: 4.2s; }
.slot.magic-slot .magic-box i:nth-child(3) { left: 50%; animation-delay: -2.4s; }
.slot.magic-slot .magic-box i:nth-child(4) { left: 66%; width: 8px; height: 8px; animation-delay: -0.6s; animation-duration: 3.9s; }
.slot.magic-slot .magic-box i:nth-child(5) { left: 80%; animation-delay: -1.8s; animation-duration: 4.6s; }
.slot.magic-slot .magic-box i:nth-child(6) { left: 90%; width: 5px; height: 5px; animation-delay: -3s; }
.slot.magic-slot .magic-box span { z-index: 2; font-size: 72px; color: #f2fff9; text-shadow: 0 0 22px #8ff0c4aa, 0 4px 18px #04150d80; animation: magic-q 3.2s ease-in-out infinite; }
@keyframes magic-aurora { 0% { transform: translate(-6%, 4%) rotate(0deg) scale(1); } 50% { transform: translate(5%, -3%) rotate(8deg) scale(1.08); } 100% { transform: translate(-3%, -5%) rotate(-6deg) scale(1.02); } }
@keyframes magic-spark { 0% { transform: translate(0, 0) scale(0.6); opacity: 0; } 15% { opacity: 0.95; } 70% { opacity: 0.6; } 100% { transform: translate(14px, -260px) scale(1.1); opacity: 0; } }
@keyframes magic-q { 0%, 100% { transform: translateY(3px) scale(1); } 50% { transform: translateY(-5px) scale(1.04); } }
.slot.magic-slot .magic-box span, .slot.magic-slot .magic-box i { will-change: transform, opacity; }

/* magic reveal: transform/opacity only, so it stays on the compositor and moves smoothly */
.flare { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; border-radius: inherit; --fc: #63e3a4; --fl: #d9ffee; }
.flare.bad { --fc: #e5605a; --fl: #ffd6d2; }
.flare.gold { --fc: #fcd711; --fl: #fff6c2; }
.flare.gold .rays { animation-duration: 2.4s; }
.flare.gold .ring { animation-duration: 1.6s; }
.flare.gold .glow { animation-duration: 2s; }
.flare.gold .spark { animation-duration: 1.7s; }
.flare .rays { position: absolute; left: 50%; top: 50%; width: 190%; aspect-ratio: 1; margin: -95% 0 0 -95%; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--fc) 55%, transparent) 0deg 5deg, transparent 5deg 20deg); -webkit-mask: radial-gradient(circle, #000 0%, transparent 52%); mask: radial-gradient(circle, #000 0%, transparent 52%); opacity: 0; will-change: transform, opacity; animation: flare-rays 1.9s cubic-bezier(.2,.7,.2,1) both; }
.flare .ring { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid var(--fl); opacity: 0; will-change: transform, opacity; animation: flare-ring 1.2s cubic-bezier(.15,.6,.25,1) both; }
.flare .ring.two { border-color: var(--fc); animation-delay: .18s; }
.flare .glow { position: absolute; inset: 0; background: radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--fc) 55%, transparent), transparent 62%); opacity: 0; animation: flare-glow 1.5s ease-out both; }
.flare .sweep { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 40%, #ffffff55 50%, transparent 60%); transform: translateX(-120%); will-change: transform; animation: flare-sweep 1s .25s cubic-bezier(.4,0,.2,1) both; }
.flare .spark { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: var(--fl); box-shadow: 0 0 8px var(--fc); opacity: 0; will-change: transform, opacity; animation: flare-spark 1.3s var(--d) cubic-bezier(.12,.7,.25,1) both; }
@keyframes flare-rays { 0% { opacity: 0; transform: rotate(0) scale(.4); } 25% { opacity: .9; } 100% { opacity: 0; transform: rotate(50deg) scale(1.05); } }
@keyframes flare-ring { 0% { opacity: .95; transform: scale(.3); } 100% { opacity: 0; transform: scale(2.6); } }
@keyframes flare-glow { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
@keyframes flare-sweep { to { transform: translateX(120%); } }
@keyframes flare-spark { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1); } }
@media (prefers-reduced-motion: reduce) { .flare { display: none; } }
@media (prefers-reduced-motion: reduce) { .slot.magic-slot .magic-box::before, .slot.magic-slot .magic-box i, .slot.magic-slot .magic-box span { animation: none; } }

/* case result modal: no outline around the dropped cards, a bit larger single card */
.res-grid .item.item, .res-grid .item.item:hover { box-shadow: none; border: 0; outline: 0; }
.res-grid .item.item:hover { transform: none; }
.res-grid.one { grid-template-columns: 190px; }

/* phones: the shop bar wraps instead of squeezing "В корзине" into a column; the buy pill takes its own row */
.sb-info { white-space: nowrap; }
@media (max-width: 560px) {
  .shopbar, .upg-lists #shop-purchase .shopbar, .upg-lists #t-pager .shopbar, .upg-lists #mine-pager .shopbar { flex-wrap: wrap; justify-content: space-between; row-gap: 8px; }
  .shopbar .sb-pager { order: 1; }
  .shopbar .sb-info { order: 2; flex: 1 1 auto; text-align: right; }
  .shopbar .sb-trash { order: 3; }
  .shopbar .ib-total { order: 4; flex: 1 1 100%; justify-content: center; height: 40px; }
}

/* phones: selected-stake previews were tiny inside the slot */
@media (max-width: 760px) {
  .slot-selected { height: 100px; }
  .slot-selected-item img { max-height: 66px; }
  .slot-selected-item > span { font-size: 9px; }
}

/* nick field above the code on the Telegram login form */
.code-form > .tg-lead { grid-column: 1 / -1; }
.code-form .code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.code-form.with-nick, .code-form:has(> .code-row) { display: flex; flex-direction: column; gap: 12px; }
.code-form .field { display: grid; gap: 6px; }
.code-form .field .tg-hint { margin: 0; }
@media (max-width: 560px) { .code-form .code-row { grid-template-columns: 1fr; } }

/* Target tiles: price and the ST mark share one top row, so a long price never touches the mark. */
.item.item .item-p { height: 18px; max-width: calc(100% - 40px); }
.item.item .item-st { top: 6px; right: 7px; min-width: 22px; height: 18px; padding: 0 5px; font-size: 9px; }
.item.item .item-p .coin { width: 11px; height: 11px; flex: none; }

/* The jump-to-end button uses the price triangles; on the last page they turn over. */
.ib-sq .ico.flip { transform: scaleY(-1); }

/* Price, selection and StatTrack each have their own space. */
.item.item .item-p, .icard .ic-p { max-width: calc(100% - 14px); }
.item.item:has(.item-ok) .item-p { max-width: calc(100% - 35px); }
/* StatTrack belongs to the weapon caption, never over the weapon artwork. */
.item.item .item-t, .icard .ic-t {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  width: 100%; min-width: 0; overflow: hidden;
}
.weapon-caption { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-mark {
  display: inline-block; flex: none; position: static;
  padding: 0; margin: 0; border: 0; outline: 0; box-shadow: none;
  background: none; color: #eeb66b; font-size: 8px; font-weight: 800;
  line-height: 1.2; letter-spacing: .04em;
}
.item.item .item-odds { top: 29px; right: 7px; left: auto; line-height: 1.4; }
.item.item .item-ok { z-index: 3; }
.icard .ic-own { top: 28px; }

/* Room for the result and its actions, including large sale amounts. */
.res { display: grid; gap: 18px; min-width: 0; }
.res .res-head { padding: 4px 24px 0; }
.res .res-grid.one { grid-template-columns: minmax(0, 210px); }
.res .res-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 10px; }
.res .res-actions .btn { min-height: 54px; height: auto; padding: 10px 14px; }
.res .res-actions [data-sell] { flex-direction: column; gap: 3px; }
.res-sell-label { font-size: 11px; font-weight: 600; line-height: 1.2; opacity: .8; }
.res-sell-value { display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-size: 15px; font-weight: 800; line-height: 1.3; white-space: nowrap; }
.res .res-actions .res-sell-value .coin { width: 14px; height: 14px; flex: none; }
@media (max-width: 480px) {
  .res .res-actions { grid-template-columns: minmax(0, 1fr); }
  .res .res-actions [data-sell] { order: -1; }
  .res .res-actions .btn { min-height: 48px; }
}
