/* «Обмены» (exchanges.js). Panels, tokens, NEW badge and shared select come from the
   existing Database sections; the trade block reads like the game: the reward on the left, what it takes on the right. */
.exchanges-page{display:none;scroll-margin-top:90px}
html[data-page=exchanges] body>main>.intro,html[data-page=exchanges] body>main>.home-discovery,html[data-page=exchanges] body>main>.home-events,html[data-page=exchanges] body>main>.home-shortcuts{display:none}
html[data-page=exchanges] .exchanges-page{display:block;padding-top:12px}
.exchanges-heading p{max-width:520px}

/* Toolbar: count + sort, then filter chips that scroll sideways. */
.exchanges-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.exchanges-count{margin:0;color:var(--shop-muted);font-size:12px}
.exchanges-sort{flex:none}
/* The shared select as is, only a little lower so it sits in proportion with the chips. */
:is(body>main) .exchanges-sort .filter-select-trigger{height:38px;min-height:38px;padding:0 12px;gap:8px}
.exchange-chips{display:flex;gap:8px;margin:0 0 20px;padding:2px 0 4px;overflow-x:auto;scrollbar-width:none;-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 24px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 24px),transparent)}
.exchange-chips::-webkit-scrollbar{display:none}
.exchange-chips.is-dragging,.exchange-options.is-dragging{cursor:grabbing;user-select:none}
.exchange-chips.is-dragging .exchange-chip,.exchange-options.is-dragging a{pointer-events:none}
:is(body>main) .exchange-chip{display:inline-flex;align-items:center;justify-content:center;gap:7px;flex:none;box-sizing:border-box;height:34px;padding:0 7px 0 13px;border:1px solid var(--shop-stroke);border-radius:999px;background:#0f172af0;color:var(--shop-muted);font:600 12.5px/1 ShopInter,system-ui,sans-serif;white-space:nowrap;cursor:pointer;transition:border-color .16s,color .16s,background .16s}
:is(body>main) .exchange-chip span{display:inline-block;box-sizing:border-box;min-width:22px;height:22px;padding:0 7px;border-radius:999px;background:#ffffff0f;color:var(--shop-text);font-size:11px;line-height:22px;text-align:center;font-variant-numeric:tabular-nums}
:is(body>main) .exchange-chip[aria-pressed=true]{border-color:#6f7cff80;background:linear-gradient(135deg,#46a6ff2e,#6f7cff2e);color:var(--shop-text)}
/* Brand gradient with white digits: dark digits on light blue read thinner than white on dark. */
:is(body>main) .exchange-chip[aria-pressed=true] span{background:linear-gradient(135deg,var(--shop-blue),var(--shop-blue-2));color:#fff;font-weight:700}
.exchange-chip-label{position:relative;top:.5px;font-weight:inherit}
:is(body>main) .exchange-chip.is-done-filter svg{width:14px;height:14px;color:#8fe3b0}
@media(hover:hover) and (pointer:fine){:is(body>main) .exchange-chip:hover{border-color:#46a6ff66;color:var(--shop-text)}}

.exchanges-list{display:grid;gap:26px;min-width:0}
.exchange-group-title{display:flex;align-items:baseline;gap:8px;margin:0 2px 12px;font:700 17px/1.25 ShopInter,system-ui,sans-serif}
.exchange-group-title span{color:var(--shop-muted);font-size:12px;font-weight:500}
.exchange-grid{display:grid;gap:14px}
.exchanges-empty{padding:28px 16px;border:1px dashed var(--shop-stroke);border-radius:16px;color:var(--shop-muted);text-align:center;font-size:13px}

/* The exchange card. */
.exchange{position:relative;min-width:0;border:1px solid var(--shop-stroke);border-radius:18px;background:radial-gradient(ellipse at 85% 0,#e6c77f14,transparent 55%),linear-gradient(150deg,#18243bdd,#0b1422e6);overflow:hidden;transition:border-color .2s}
.exchange.is-done{border-color:#4fd18b55;background:radial-gradient(ellipse at 85% 0,#4fd18b14,transparent 55%),linear-gradient(150deg,#16263ad9,#0b1422e6)}
.exchange-top{display:flex;align-items:center;gap:8px;min-width:0;min-height:26px;padding:12px 14px 0}
.exchange-event{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--shop-muted);font-size:10.5px;font-weight:700;letter-spacing:1px;text-transform:uppercase}
.exchange-done-badge{flex:none;padding:3px 6px;border-radius:4px;background:#4fd18b;color:#05210f;font:900 9px/1 ShopInter,system-ui,sans-serif;letter-spacing:.02em;text-transform:uppercase}
.exchange-timer{display:inline-flex;align-items:center;gap:5px;flex:none;margin-left:auto;padding:5px 9px;border-radius:999px;background:#46a6ff1f;color:#b9dcff;font:700 12px/1 ShopInter,system-ui,sans-serif;font-variant-numeric:tabular-nums}
.exchange-timer svg{width:13px;height:13px}
.exchange-timer.is-soon{background:#f59e0b24;color:#fcd38a;box-shadow:0 0 0 1px #f59e0b33 inset}
.exchange-timer.is-upcoming{background:#ffffff10;color:var(--shop-text)}

.exchange-trade{display:grid;grid-template-columns:122px 22px minmax(0,1fr);align-items:center;gap:8px;padding:10px 14px 14px}
.exchange-side-title{display:block;margin-bottom:8px;color:var(--shop-muted);font-size:10px;font-weight:600;letter-spacing:.4px}
.exchange-get .exchange-side-title{text-align:center}
.exchange-slots{display:flex;flex-wrap:wrap;gap:8px}
/* Captions sit under the tiles: the same room on top keeps the tiles themselves on the centre line. */
.exchange-give{padding-top:31px}
/* The reward column has «Награда» above the art (20px) and the name below (37px): lift the arrow
   and the slots by half the difference so they sit on the card art's own centre line. */
.exchange-arrow,.exchange-give{transform:translateY(-8.5px)}
.exchange-arrow{display:grid;place-items:center;color:#6f7cff;opacity:.85}
.exchange-arrow svg{width:22px;height:22px;filter:drop-shadow(0 0 6px #6f7cff66)}

/* Slots: an exact card, a pool placeholder (opens the list) or an item. */
:is(body>main) .exchange-slot{position:relative;display:flex;flex-direction:column;align-items:center;gap:5px;width:64px;margin:0;padding:0;border:0;background:none;color:var(--shop-text);font:inherit;text-decoration:none;cursor:default}
:is(body>main) .exchange-slot.is-pool,:is(body>main) .exchange-slot.is-card{cursor:pointer}
.exchange-slot-face{display:grid;place-items:center;width:64px;height:64px;border-radius:12px;background:#ffffff07;border:1px solid #ffffff12}
.exchange-slot.is-card .exchange-slot-face{border:0;background:none}
.exchange-slot-face canvas,.exchange-slot-face .collection-native-art{display:block;width:64px;height:64px}
.exchange-slot.is-item .exchange-slot-face img{width:42px;height:42px;object-fit:contain;filter:drop-shadow(0 3px 6px #0008)}
.exchange-token-fallback{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:#46a6ff26;color:#a6d1ff;font-weight:800}
.exchange-slot.is-pool .exchange-slot-face{position:relative;background:linear-gradient(160deg,#2a3b5c,#141f33);border:1px dashed #8fb4ff59;box-shadow:inset 0 1px 0 #ffffff12}
.exchange-slot.is-pool[aria-expanded=true] .exchange-slot-face{border-style:solid;border-color:#6f7cffaa;box-shadow:0 0 0 3px #6f7cff26,inset 0 1px 0 #ffffff12}
.exchange-slot-ovr{font:800 19px/1 ShopInter,system-ui,sans-serif;letter-spacing:-.4px;color:#f3d58f;font-variant-numeric:tabular-nums}
.exchange-slot-ovr-label{margin-top:-14px;font-size:8.5px;font-weight:700;letter-spacing:1px;color:var(--shop-muted)}
.exchange-slot-count{position:absolute;top:-7px;right:-7px;z-index:1;box-sizing:border-box;min-width:24px;height:18px;padding:0 6px;border-radius:999px;line-height:18px!important;background:linear-gradient(135deg,var(--shop-blue),var(--shop-blue-2));color:#fff;font:700 10px/1 ShopInter,system-ui,sans-serif;text-align:center;box-shadow:0 2px 6px #0008}
.exchange-slot-caption{width:calc(100% + 8px);margin-inline:-4px;overflow:hidden;color:var(--shop-muted);font-size:10px;line-height:13px;text-align:center;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}

.exchange-get{display:flex;flex-direction:column;align-items:center;min-width:0;text-align:center}
.exchange-reward-art{position:relative;display:block;width:112px;aspect-ratio:1;color:var(--shop-muted)}
.exchange-reward-art::before{content:"";position:absolute;inset:8%;border-radius:50%;background:radial-gradient(circle,#e6c77f40,transparent 70%);filter:blur(10px)}
.exchange-reward-art :is(canvas,.collection-native-art){position:relative;display:block;width:100%;height:auto;aspect-ratio:1;filter:drop-shadow(0 8px 12px #0009)}
.exchange-reward-art.is-item{display:grid;place-items:center;border-radius:16px;background:#ffffff07}
.exchange-reward-art.is-item svg{width:44%;height:44%;opacity:.6}
.exchange-get strong{max-width:100%;margin-top:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 15px/1.25 ShopInter,system-ui,sans-serif}
.exchange-get small{color:var(--shop-muted);font-size:11px}

/* Pool list: the cards that fit, as a sideways strip. */
.exchange-pool{margin:6px 14px 4px;padding:10px 10px 6px;border:1px solid #6f7cff40;border-radius:14px;background:#6f7cff0d}
.exchange-pool p{margin:0 2px 8px;font-size:11.5px;line-height:1.4;color:var(--shop-text)}
/* No visible scrollbar (like «Новое в базе»): the strip scrolls by touch, mouse drag or wheel. */
.exchange-options{display:flex;gap:6px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;padding-bottom:4px}
.exchange-options::-webkit-scrollbar{display:none}
.exchange-option{flex:none;display:flex;flex-direction:column;align-items:center;gap:2px;width:68px;color:var(--shop-text);text-decoration:none}
.exchange-option :is(canvas,.collection-native-art){display:block;width:68px;height:68px}
.exchange-option span{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;text-align:center;color:var(--shop-muted)}

.exchange-repeat{flex:none;padding:3px 7px;border-radius:999px;background:#ffffff0f;color:var(--shop-muted);font:600 10.5px/1 ShopInter,system-ui,sans-serif}
.exchange-slot.is-cost .exchange-slot-count{background:#e6c77f;color:#2b2008}

/* Footer: community verdict and the account's own mark. */
.exchange-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px 12px;border-top:1px solid #ffffff0a;background:#0000001f}
.exchange-votes{display:flex;align-items:center;gap:10px;flex:1;min-width:0}
.exchange-votes .card-votes{gap:6px}
.exchange-votes .card-vote{display:flex;align-items:center;justify-content:center;flex:none;width:auto;height:34px;min-height:34px;min-width:50px;margin:0;padding:0 9px;gap:6px;border:1px solid #ffffff21;border-radius:10px;background:linear-gradient(145deg,#1a2c3bda,#0b1722e8);box-shadow:0 3px 10px #0002,inset 0 1px 0 #ffffff08;color:#e7eef4;font:500 12px/1 GameText,Arial,sans-serif;font-variant-numeric:tabular-nums;cursor:pointer}
.exchange-votes .card-vote svg{width:15px;height:15px}
.exchange-verdict{display:flex;flex-direction:column;gap:4px;min-width:0}
.exchange-verdict-text{overflow:hidden;text-overflow:ellipsis;color:var(--shop-muted);font-size:11px;line-height:1.2;white-space:nowrap}
.exchange-verdict-text b{color:#8fe3b0;font-size:13px}
.exchange-verdict-text.is-few{opacity:.85}
.exchange-verdict-bar{display:block;width:64px;height:4px;border-radius:2px;background:#e499a959;overflow:hidden}
.exchange-verdict-bar i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#4fd18b,#8fe3b0)}
:is(body>main) .exchange-done{display:inline-flex;align-items:center;gap:7px;flex:none;height:34px;padding:0 12px;border:1px solid var(--shop-stroke);border-radius:999px;background:#ffffff06;color:var(--shop-text);font:600 12px/1 ShopInter,system-ui,sans-serif;cursor:pointer;transition:background .18s,border-color .18s}
.exchange-done-check{display:grid;place-items:center;flex:none;box-sizing:border-box;width:22px;height:22px;border-radius:50%;border:1.5px solid #ffffff40;color:transparent;transition:background .18s,border-color .18s,color .18s}
.exchange-done-check svg{display:block;width:14px;height:14px}
:is(body>main) .exchange-done[aria-pressed=true]{border-color:#4fd18b66;background:linear-gradient(135deg,#4fd18b26,#2fae6b14);color:#c9f5da}
.exchange-done[aria-pressed=true] .exchange-done-check{border-color:#4fd18b;background:#4fd18b;color:#05210f}
@media(hover:hover) and (pointer:fine){:is(body>main) .exchange-done:not(:disabled):hover .exchange-done-check{border-color:#4fd18b;color:#4fd18b}}
:is(body>main) .exchange-done:disabled,.exchange-votes .card-vote:disabled{opacity:.6;cursor:default}

@media(max-width:360px){
 .exchange-trade{grid-template-columns:104px 16px minmax(0,1fr);gap:6px;padding-inline:12px}
 .exchange-reward-art{width:96px}
 :is(body>main) .exchange-slot,.exchange-slot-face,.exchange-slot-face canvas,.exchange-slot-face .collection-native-art{width:56px}
 .exchange-slot-face,.exchange-slot-face canvas,.exchange-slot-face .collection-native-art{height:56px}
 .exchange-top,.exchange-foot{padding-inline:12px}
 .exchange-verdict-bar{width:48px}
 .exchange-verdict-text.is-few{display:none}
}
/* Same gap above the pages as in the playstyle cards list (.playstyle-cards .pagination). */
#exchangesPagination{padding:30px 0 0}

/* Card page: «Доступна в обмене» in the shop-offer slot — the shop plaque's shape in the brand
   blue instead of gold, without the sheen, so it never reads as a shop offer. */
.database-offer-button.database-exchange-button{background:radial-gradient(ellipse at 18% 0%,#8fb4ff26,transparent 70%) padding-box,linear-gradient(115deg,#1e2f55,#18213a) padding-box,linear-gradient(115deg,#46a6ffaa,#6f7cff88 55%,#9a8cffaa) border-box;box-shadow:0 5px 20px #46a6ff1c,inset 0 1px 0 #ffffff14;color:#dce9ff;text-decoration:none}
.database-offer-button.database-exchange-button::before{display:none}
.database-exchange-button svg{flex:none;width:20px;height:20px;color:#8fc8ff}
.database-exchange-button .exchange-badge-left{color:inherit;font:inherit;font-variant-numeric:tabular-nums;white-space:nowrap}
/* The exchange opened from a card lights up for a moment. */
.exchange.is-target{animation:exchange-target 2.4s ease-out 1}
@keyframes exchange-target{0%,35%{border-color:#6f7cff;box-shadow:0 0 0 3px #6f7cff40,0 0 28px #6f7cff40}100%{border-color:var(--shop-stroke);box-shadow:none}}
@media(prefers-reduced-motion:reduce){.exchange.is-target{animation:none;border-color:#6f7cff}}
