/* UPSKINS — «Обменник», макет «Туманный город» (пакет UPSKINS_EXCHANGE_FOG_CITY_v1, 26.11.2026). Только страница обменника.
   Фон — assets/exchange-fog-city-background-v2.png ОДИН раз за всей областью (тот же слой .city-sky, что был у варианта 2), cover / center top.
   Две отдельные панели (как в утверждённом макете): дымчатое серо-синее стекло (backdrop-filter только у слоя ::before) и тонкая бронзовая
   линия со срезанными углами (слой ::after, заливка по контуру clip-path — как у карточек главной). Карточки скинов — со своей тонкой рамкой
   и полоской редкости. Заголовки — засечками (системный Georgia: на сайте нет подключённого антиквенного шрифта).
   — agent: main, model: claude-opus-5-5 */

/* ---------- фон: туманный город вместо каменного свода ---------- */
body.exchange-page .site-world { background: #283744; }
body.exchange-page .site-world .city-sky {
  inset: var(--ex-bg-top, 196px) 0 0 0; height: auto;
  background: #283744 url('assets/exchange-fog-city-background-v2.png') center top / cover no-repeat;
  -webkit-mask-image: none; mask-image: none;
}

#exchangeView .exf {
  --exf-serif: Georgia, 'Times New Roman', serif;
  --exf-line: rgba(161, 128, 91, .88); --exf-line-soft: rgba(184, 134, 74, .5); --exf-cut: 9.425px;
  --exf-glass: linear-gradient(180deg, rgba(38, 48, 60, .58), rgba(26, 34, 44, .66));
  --exf-card: rgba(24, 30, 38, .86); --exf-card-line: rgba(120, 128, 140, .55);
  width: min(1500px, calc(100% - 40px)); padding: 26px 0 30px;
}

/* ---------- заголовок ---------- */
#exchangeView .exf-head { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; }
#exchangeView .exf-head h1 { margin: 0; font: 400 34px/1 var(--exf-serif); letter-spacing: .06em; text-transform: uppercase; color: #ece6da; white-space: nowrap; }
#exchangeView .exf-mark { flex: none; width: 10px; height: 10px; background: #ff7200; transform: rotate(45deg); display: inline-block; }
#exchangeView .exf-head > .exf-mark { width: 11px; height: 11px; }
#exchangeView .exf-line { flex: 1 1 auto; min-width: 40px; height: 1px; background: var(--exf-line-soft); }
#exchangeView .exf-link { display: inline-flex; align-items: center; gap: 6px; padding: 4px 2px; border: 0; background: none; color: #c9c3b8; font: 13px var(--font); cursor: pointer; white-space: nowrap; }
#exchangeView .exf-link:hover { color: #fff; }
#exchangeView .exf-link .ex-icon { width: 16px; height: 16px; }

/* ---------- две панели одинаковой высоты: 32% / 68% ---------- */
#exchangeView .exf-panels { display: grid; grid-template-columns: minmax(0, 32fr) minmax(0, 68fr); gap: 10px; height: clamp(540px, calc(100vh - 300px), 740px); }
#exchangeView .exf-panel { position: relative; isolation: isolate; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 14px 18px 0; }
#exchangeView .exf-panel::before, #exchangeView .exf-panel::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
#exchangeView .exf-panel::before { z-index: -1; background: var(--exf-glass);
  -webkit-backdrop-filter: blur(10px) saturate(1.15); backdrop-filter: blur(10px) saturate(1.15);
  -webkit-clip-path: polygon(var(--exf-cut) 0, calc(100% - var(--exf-cut)) 0, 100% var(--exf-cut), 100% calc(100% - var(--exf-cut)), calc(100% - var(--exf-cut)) 100%, var(--exf-cut) 100%, 0 calc(100% - var(--exf-cut)), 0 var(--exf-cut));
  clip-path: polygon(var(--exf-cut) 0, calc(100% - var(--exf-cut)) 0, 100% var(--exf-cut), 100% calc(100% - var(--exf-cut)), calc(100% - var(--exf-cut)) 100%, var(--exf-cut) 100%, 0 calc(100% - var(--exf-cut)), 0 var(--exf-cut)); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { #exchangeView .exf-panel::before { background: rgba(30, 38, 48, .88); } }
#exchangeView .exf-panel::after { z-index: 5;
  background: linear-gradient(rgba(208, 179, 139, .30), rgba(208, 179, 139, .30)) no-repeat 0 0 / calc(100% - 9px) 1.45px, var(--exf-line);
  -webkit-clip-path: polygon(evenodd, 9.425px 0, calc(100% - 9.425px) 0, 100% 9.425px, 100% calc(100% - 9.425px), calc(100% - 9.425px) 100%, 9.425px 100%, 0 calc(100% - 9.425px), 0 9.425px, 9.425px 0,
    10.025px 1.45px, 1.45px 10.025px, 1.45px calc(100% - 10.025px), 10.025px calc(100% - 1.45px), calc(100% - 10.025px) calc(100% - 1.45px), calc(100% - 1.45px) calc(100% - 10.025px), calc(100% - 1.45px) 10.025px, calc(100% - 10.025px) 1.45px, 10.025px 1.45px);
  clip-path: polygon(evenodd, 9.425px 0, calc(100% - 9.425px) 0, 100% 9.425px, 100% calc(100% - 9.425px), calc(100% - 9.425px) 100%, 9.425px 100%, 0 calc(100% - 9.425px), 0 9.425px, 9.425px 0,
    10.025px 1.45px, 1.45px 10.025px, 1.45px calc(100% - 10.025px), 10.025px calc(100% - 1.45px), calc(100% - 10.025px) calc(100% - 1.45px), calc(100% - 1.45px) calc(100% - 10.025px), calc(100% - 1.45px) 10.025px, calc(100% - 10.025px) 1.45px, 10.025px 1.45px); }

/* верхняя строка панели */
#exchangeView .exf-ph { display: flex; align-items: center; gap: 12px; min-height: 40px; }
#exchangeView .exf-ph h2 { display: flex; align-items: center; gap: 12px; margin: 0 auto 0 0; font: 400 19px/1.1 var(--exf-serif); letter-spacing: .05em; text-transform: uppercase; color: #ece6da; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#exchangeView .exf-ph h2 .exf-mark { width: 8px; height: 8px; }
#exchangeView .exf-only { display: inline-flex; align-items: center; gap: 8px; font: 13px var(--font); color: #d3d6db; white-space: nowrap; cursor: pointer; }
#exchangeView [data-side="inventory"] .exf-only { font-size: 12px; gap: 6px; }
#exchangeView [data-side="inventory"] .exf-ph { gap: 10px; }
#exchangeView [data-side="inventory"] .exf-ph h2 { font-size: 17px; gap: 10px; flex: none; overflow: visible; }
#exchangeView .exf-only input { position: absolute; opacity: 0; width: 1px; height: 1px; }
#exchangeView .exf-switch { position: relative; width: 32px; height: 18px; border-radius: 9px; background: #4a5260; transition: background .15s; }
#exchangeView .exf-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #d9dde3; transition: transform .15s; }
#exchangeView .exf-only input:checked + .exf-switch { background: #ff7200; }
#exchangeView .exf-only input:checked + .exf-switch::after { transform: translateX(14px); }
#exchangeView .exf-only input:focus-visible + .exf-switch { outline: 2px solid #ffe0a6; outline-offset: 2px; }
#exchangeView .exf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px; padding: 6px 12px; border: 1px solid rgba(205, 210, 218, .38); border-radius: 4px;
  background: rgba(18, 24, 32, .45); color: #e8e6e1; font: 14px var(--exf-serif); cursor: pointer; white-space: nowrap; }
#exchangeView .exf-btn:hover:not(:disabled) { border-color: #c8a67a; color: #fff; }
#exchangeView .exf-btn:disabled { opacity: .5; cursor: default; }
#exchangeView .exf-btn .ex-icon { width: 16px; height: 16px; }
#exchangeView .exf-btn--icon { width: 40px; padding: 0; }
#exchangeView .exf-btn--caps { font: 12px/1 var(--exf-serif); letter-spacing: .06em; text-transform: uppercase; min-height: 38px; padding: 0 18px; }
#exchangeView [data-side="inventory"] .exf-btn { min-height: 30px; padding: 4px 10px; font-size: 13px; }
#exchangeView [data-side="inventory"] .exf-btn--caps { min-height: 38px; padding: 0 18px; font-size: 12px; }

/* вкладки игр */
#exchangeView .exf-games { display: flex; gap: 26px; margin: 8px 0 12px; border-bottom: 1px solid rgba(200, 205, 212, .16); }
#exchangeView .exf-game { display: inline-flex; align-items: center; gap: 8px; padding: 10px 2px 11px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none;
  color: #c4c8ce; font: 15px var(--font); cursor: pointer; white-space: nowrap; }
#exchangeView .exf-game[aria-selected="true"] { color: #f2efe8; border-bottom-color: #ff7200; }
#exchangeView .exf-game[aria-selected="true"] .ex-icon { color: #ff9a3d; }
#exchangeView .exf-game[aria-disabled="true"] { color: #8f96a0; cursor: not-allowed; }
#exchangeView .exf-gcount { color: inherit; }

/* фильтры каталога */
#exchangeView .exf-more { margin: 0 0 12px; padding: 10px 12px; background: rgba(16, 22, 30, .55); border: 1px solid rgba(200, 205, 212, .18); }
#exchangeView .exf-more .exchange-search { flex: 1 1 200px; }

/* сетка: прокрутка внутри панели, нижняя строка всегда видна */
#exchangeView .exf-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -10px 0 0; padding: 2px 10px 12px 0; scrollbar-width: thin; scrollbar-color: rgba(200, 205, 212, .35) transparent; }
#exchangeView .exf-grid { display: grid; gap: 10px; align-content: start; }
#exchangeView .exf-grid--cat { grid-template-columns: repeat(6, minmax(0, 1fr)); }
#exchangeView .exf-grid--inv { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#exchangeView .exf-scroll .ex-pages { margin-top: 14px; }

/* карточка скина: своя тонкая рамка, полоска редкости сверху */
#exchangeView .exf-card { position: relative; display: flex; flex-direction: column; height: 136px; padding: 9px 10px 8px; background: var(--exf-card); border: 1px solid var(--exf-card-line); border-radius: 3px;
  cursor: pointer; outline: none; transition: border-color .15s, box-shadow .15s; overflow: hidden; }
#exchangeView .exf-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--rarity-color); }
#exchangeView .exf-card:hover { border-color: rgba(205, 175, 130, .85); }
#exchangeView .exf-card:focus-visible { box-shadow: 0 0 0 2px #ffe0a6; }
#exchangeView .exf-card.is-selected { border-color: #ff8a1e; box-shadow: inset 0 0 0 1px #ff8a1e, 0 0 14px rgba(255, 122, 0, .28); background: linear-gradient(180deg, rgba(80, 46, 14, .55), var(--exf-card) 70%); }
#exchangeView .exf-card.is-off { opacity: .55; cursor: not-allowed; }
#exchangeView .exf-card-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; font: 600 13px/1 var(--font); color: #f1eee8; }
#exchangeView .exf-price { min-width: 0; overflow: hidden; }
#exchangeView .exf-price .upcoin-amount { --upcoin-icon-size: 15px; gap: 5px; }
#exchangeView .exf-wear { flex: none; font: 500 12px/1 var(--font); color: #c7ccd3; }
#exchangeView .exf-wear b { color: #ff9a3d; font-weight: 600; }
#exchangeView .exf-card .ex-art { flex: 1 1 auto; min-height: 0; width: 100%; height: auto; max-height: 62px; margin: 5px auto 3px; object-fit: contain; filter: drop-shadow(0 5px 7px #000a); }
#exchangeView .exf-card .ex-art.sprite { aspect-ratio: 4 / 3; height: 100%; max-height: 62px; width: auto; background-repeat: no-repeat; background-size: 400% 400%; }
#exchangeView .exf-name { display: grid; gap: 1px; min-width: 0; }
#exchangeView .exf-name small { font: 11.5px/1.2 var(--font); color: #c3c8cf; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#exchangeView .exf-name b { font: 600 14px/1.2 var(--font); color: #f4f1ea; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#exchangeView .exf-tick { position: absolute; right: 8px; bottom: 8px; display: none; width: 20px; height: 20px; border-radius: 50%; background: #ff7a00; color: #1a1006; place-items: center; }
#exchangeView .exf-tick .ex-icon { width: 13px; height: 13px; stroke-width: 2.6; }
#exchangeView .exf-card.is-selected .exf-tick { display: grid; }
#exchangeView .exf-reason { position: absolute; left: 6px; right: 6px; bottom: 30px; font: 11px/1.2 var(--font); color: #f0c8a0; text-align: center; }

/* нижняя строка панели */
#exchangeView .exf-foot { flex: none; display: flex; align-items: center; gap: 14px; min-height: 84px; margin: 0 -18px; padding: 10px 20px 12px; border-top: 1px solid rgba(200, 205, 212, .16); }
#exchangeView .exf-sum { display: grid; gap: 6px; margin-right: auto; min-width: 0; }
#exchangeView .exf-sum span { font: 16px var(--exf-serif); color: #e6e2da; white-space: nowrap; }
#exchangeView .exf-sum strong { font: 600 19px/1 var(--font); color: #f4f1ea; }
#exchangeView .exf-sum .upcoin-amount { --upcoin-icon-size: 18px; }
#exchangeView .exf-foot .ex-hint { flex: 0 1 220px; margin: 0; text-align: right; font: 12px/1.3 var(--font); color: #b9c0c9; }
#exchangeView .exf-foot .ex-hint.is-warn { color: #e8b98a; }
#exchangeView .exf-cta { width: auto; min-width: 230px; min-height: 46px; margin: 0; padding: 0 22px; border-radius: 4px; font: 400 16px/1 var(--exf-serif); letter-spacing: .08em; text-transform: uppercase;
  background: linear-gradient(180deg, #ff8a1e, #e06a00); color: #1b1006; }
#exchangeView .exf-cta:disabled { opacity: 1; background: linear-gradient(180deg, rgba(150, 98, 52, .75), rgba(112, 72, 38, .75)); color: rgba(232, 214, 192, .55); }

/* «Как это работает?» */
#exchangeView .exf-how { display: flex; align-items: center; gap: 28px; margin-top: 18px; padding: 16px 32px; border-top: 1px solid var(--exf-line-soft); border-bottom: 1px solid var(--exf-line-soft);
  background: linear-gradient(90deg, rgba(18, 24, 32, .35), rgba(18, 24, 32, .15)); }
#exchangeView .exf-how h2 { margin: 0; padding-right: 28px; border-right: 1px solid rgba(200, 205, 212, .3); font: 400 22px/1.2 var(--exf-serif); color: #ece6da; white-space: nowrap; }
#exchangeView .exf-how ol { display: flex; flex-wrap: wrap; gap: 18px 70px; margin: 0; padding: 0; list-style: none; }
#exchangeView .exf-how li { display: flex; align-items: center; gap: 14px; font: 16px var(--exf-serif); color: #e1ddd4; }
#exchangeView .exf-how li span { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #c08a4a; color: #e8c79c; font: 16px var(--exf-serif);
  clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 9px, 100% calc(100% - 9px), calc(100% - 9px) 100%, 9px 100%, 0 calc(100% - 9px), 0 9px); border-radius: 0; }

/* средние экраны: каталог 4 колонки, левая — 2; узкие — панели друг под другом (прежняя адаптивность без горизонтального скролла) */
/* до 1365 px (ноутбуки 1280–1366): каталог 5 колонок, инвентарь 2 — карточки того же размера; подписи внизу компактнее */
@media (max-width: 1365px) {
  #exchangeView .exf-grid--cat { grid-template-columns: repeat(5, minmax(0, 1fr)); } #exchangeView .exf-grid--inv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #exchangeView .exf-panel { padding-left: 14px; padding-right: 14px; } #exchangeView .exf-foot { margin: 0 -14px; padding: 10px 14px 12px; gap: 10px; }
  #exchangeView .exf-sum span { font-size: 14px; } #exchangeView .exf-btn--caps { padding: 0 12px; font-size: 11px; }
  #exchangeView .exf-cta { min-width: 0; padding: 0 16px; font-size: 14px; white-space: nowrap; } #exchangeView .exf-foot .ex-hint { flex-basis: 150px; }
  #exchangeView [data-side="inventory"] .exf-ph { gap: 8px; } #exchangeView [data-side="inventory"] .exf-ph h2 { font-size: 15px; letter-spacing: .03em; gap: 8px; }
  #exchangeView [data-side="inventory"] .exf-only { font-size: 11px; gap: 5px; } #exchangeView [data-side="inventory"] .exf-ph .exf-btn { padding: 4px 8px; gap: 5px; }
  #exchangeView .exf-games { gap: 18px; } #exchangeView .exf-game { font-size: 14px; }
}
@media (max-width: 1100px) { #exchangeView .exf-grid--cat { grid-template-columns: repeat(4, minmax(0, 1fr)); } #exchangeView .exf-grid--inv { grid-template-columns: repeat(1, minmax(0, 1fr)); } }
@media (max-width: 999px) {
  #exchangeView .exf-panels { grid-template-columns: minmax(0, 1fr); height: auto; }
  #exchangeView .exf-panel { height: 620px; }
  #exchangeView .exf-head { flex-wrap: wrap; } #exchangeView .exf-head h1 { font-size: 26px; white-space: normal; }
  #exchangeView .exf-ph { flex-wrap: wrap; } #exchangeView .exf-foot { flex-wrap: wrap; }
  #exchangeView .exf-how { flex-direction: column; align-items: flex-start; padding: 14px 16px; } #exchangeView .exf-how h2 { border: 0; padding: 0; }
}
@media (max-width: 599px) { #exchangeView .exf-grid--cat, #exchangeView .exf-grid--inv { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* до 1535 px: заголовок левой панели в одну строку (ужаты отступы, переключатель и кнопка «Цена») */
@media (max-width: 1535px) {
  #exchangeView [data-side="inventory"] .exf-ph { gap: 8px; }
  #exchangeView [data-side="inventory"] .exf-ph h2 { font-size: 15px; letter-spacing: .02em; gap: 8px; }
  #exchangeView [data-side="inventory"] .exf-only { font-size: 11px; gap: 5px; }
  #exchangeView [data-side="inventory"] .exf-switch { width: 28px; height: 16px; } #exchangeView [data-side="inventory"] .exf-switch::after { width: 12px; height: 12px; }
  #exchangeView [data-side="inventory"] .exf-only input:checked + .exf-switch::after { transform: translateX(12px); }
  #exchangeView [data-side="inventory"] .exf-ph .exf-btn { padding: 4px 7px; gap: 4px; }
}
@media (max-width: 1365px) { #exchangeView [data-side="inventory"] .exf-ph h2 { font-size: 14px; } }
#exchangeView .exf-cta { white-space: nowrap; }
@media (max-width: 1535px) { #exchangeView .exf-cta { min-width: 0; padding: 0 16px; font-size: 14px; letter-spacing: .06em; } }
/* 27.11.2026: на 390 px четыре вкладки игр (CS 2 · Dota 2 · Rust · Games) не помещались — горизонтальная прокрутка 15 px; на узком экране промежуток меньше */
@media (max-width: 480px) { #exchangeView .exf-games { gap: 14px; flex-wrap: wrap; } }
