/* ==========================================================================
   RoCandy — trading page (/en/trading/)
   Three columns: your offer · controls and filters · you receive
   ========================================================================== */

.trade-main { padding-top: calc(var(--nav-h) - .5rem); }
.trade {
  display: grid; grid-template-columns: minmax(0, 1fr) 318px minmax(0, 1fr);
  gap: 1.1rem; padding: .75rem 1.25rem 2.5rem; color: var(--cream-100);
}
.trade svg { display: inline-block; }

/* ---------- Panels ---------- */
.panel { display: flex; flex-direction: column; gap: .7rem; min-width: 0; }
.panel-bar {
  display: flex; align-items: center; gap: .55rem;
  height: 54px; padding: 0 .6rem 0 1.1rem; border-radius: 14px;
  background: rgba(255, 255, 255, .05);
}
.panel-receive .panel-bar { padding: 0 1.1rem 0 .6rem; }
.panel-bar h2 { font: 800 1rem/1 var(--font-body); color: var(--cream-50); }
.bar-spacer { flex: 1; }
.bar-btn {
  width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--cream-100);
  display: grid; place-items: center; cursor: pointer; transition: background .2s;
}
.bar-btn svg { width: 20px; height: 20px; }
.bar-btn:hover { background: rgba(255, 255, 255, .08); }
.coin { display: inline-flex; align-items: center; gap: .35rem; font: 800 .95rem/1 var(--font-body); color: var(--cream-50); }
.coin-ico { width: 18px; height: 18px; flex: none; }

.panel-empty {
  position: relative; overflow: hidden; min-height: 270px;
  display: grid; place-items: center; text-align: center;
  border-radius: 16px; background: rgba(255, 255, 255, .035);
  padding: 2rem 1.5rem;
}
.panel-empty h3 { font: 700 1.55rem/1.1 'Space Grotesk', var(--font-body); color: var(--cream-50); }
.panel-empty p { margin-top: .5rem; color: rgba(255, 242, 228, .6); font-weight: 700; }
.panel-empty .deco { position: absolute; width: 190px; opacity: .22; filter: blur(2px); animation-duration: 16s, 8s; }
.deco-a { right: -40px; top: -70px; }
.deco-b { left: -60px; bottom: -80px; width: 210px; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: .5rem; }
.search {
  flex: 1; display: flex; align-items: center; gap: .6rem; height: 48px; padding: 0 1rem;
  border-radius: 12px; background: rgba(255, 255, 255, .05); color: rgba(255, 242, 228, .6);
}
.search svg { width: 20px; height: 20px; flex: none; }
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--cream-50);
  font: 700 .95rem var(--font-body); outline: none;
}
.search input::placeholder { color: rgba(255, 242, 228, .45); }
.search:focus-within { background: rgba(255, 255, 255, .08); }
.sort, .icon-sq {
  display: inline-flex; align-items: center; gap: .55rem; height: 48px; padding: 0 1rem;
  border: 0; border-radius: 12px; background: rgba(255, 255, 255, .05); color: var(--cream-100);
  font: 800 .9rem var(--font-body); cursor: pointer; white-space: nowrap; transition: background .2s;
}
.sort svg, .icon-sq svg { width: 20px; height: 20px; }
.icon-sq { width: 48px; padding: 0; justify-content: center; }
.sort:hover, .icon-sq:hover { background: rgba(255, 255, 255, .09); }

/* ---------- Item grid ---------- */
.grid-wrap { position: relative; }
/* The placeholder grid fades out at the bottom instead of stopping dead. */
.panel-offer .grid-wrap::after {
  content: ""; position: absolute; left: 0; right: 0; top: 46%; bottom: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(42, 26, 23, 0) 0%, rgba(42, 26, 23, .75) 30%, rgba(42, 26, 23, .96) 60%, var(--espresso) 80%);
}
/* "You receive": three and a half rows show; the list scrolls inside, the fade stays fixed at the bottom. */
.grid-fade { position: relative; }
.grid-fade::after {
  content: ""; position: absolute; left: 0; right: 0; top: 68%; bottom: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(42, 26, 23, 0) 0%, rgba(42, 26, 23, .75) 30%, rgba(42, 26, 23, .96) 60%, var(--espresso) 80%);
}
.grid-scroll { max-height: calc(3.5 * 186px + 3 * .45rem); overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; }
.grid-scroll::-webkit-scrollbar { display: none; }

/* Exactly four rows of placeholders show; extra rows are clipped under the fade. */
.item-grid-dim { max-height: calc(4 * 172px + 3 * .45rem); overflow: hidden; }
.item-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; }
.item {
  --r: var(--pink-300);
  position: relative; min-height: 0; padding: .6rem .6rem .75rem;
  border-radius: 12px; background: rgba(255, 255, 255, .04);
  cursor: pointer; user-select: none;
  transition: transform .25s var(--ease-out), background .2s, box-shadow .2s;
}
.item:hover { background: rgba(255, 255, 255, .08); transform: translateY(-3px); }
.item:focus-visible { outline: 3px solid var(--mint-400); outline-offset: 2px; }
.item[aria-pressed="true"] { background: rgba(247, 168, 188, .14); box-shadow: inset 0 0 0 2px var(--pink-300); }
.item .like {
  position: absolute; top: .45rem; left: .45rem; z-index: 2;
  width: 26px; height: 26px; border: 0; border-radius: 999px; background: transparent; color: rgba(255, 242, 228, .55);
  display: grid; place-items: center; cursor: pointer; transition: color .2s, background .2s;
}
.item .like svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linejoin: round; }
.item .like:hover { background: rgba(255, 255, 255, .08); color: var(--cream-50); }
.item .like[aria-pressed="true"] { color: var(--pink-300); }
.item .like[aria-pressed="true"] svg { fill: var(--pink-300); }
.qty {
  position: absolute; top: .5rem; right: .5rem; z-index: 2;
  font: 900 .66rem/1 var(--font-body); color: var(--cream-50);
  padding: .25rem .4rem; border-radius: 6px; background: rgba(0, 0, 0, .35);
}
.item-art { height: 86px; display: grid; place-items: center; }
.item-art .gummy { width: 54px; animation: none; box-shadow: inset -12px -14px 26px var(--c-shade), inset 8px 10px 18px rgba(255, 255, 255, .5), 0 16px 26px -14px rgba(0, 0, 0, .6); }
.item-rarity { display: block; margin-top: .25rem; font: 900 .6rem/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--r); }
.item-name { margin-top: .3rem; font: 800 .8rem/1.25 var(--font-body); color: var(--cream-50); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-price { display: inline-flex; align-items: center; gap: .3rem; margin-top: .4rem; font: 800 .78rem/1 var(--font-body); color: rgba(255, 242, 228, .82); }
.item-price .coin-ico { width: 14px; height: 14px; }
.grid-empty { text-align: center; padding: 2rem 1rem; color: rgba(255, 242, 228, .5); font-weight: 700; }

/* Rarity colours (used by cards and the filter list) */
.r-unique { --r: var(--butter-300); }
.r-chroma { --r: var(--mint-400); }
.r-vintage { --r: var(--latte-300); }
.r-ancient { --r: var(--lilac-300); }
.r-godly { --r: var(--pink-400); }
.r-legendary { --r: #E85A7E; }
.r-rare { --r: var(--mint-600); }
.r-uncommon { --r: #9FB3F0; }
.r-common { --r: rgba(255, 242, 228, .5); }

/* Dimmed skeleton grid under the sign-in overlay */
.item-grid-dim { opacity: .28; pointer-events: none; }
.item.is-skeleton { cursor: default; }
.sk { position: relative; overflow: hidden; border-radius: 8px; background: rgba(255, 255, 255, .12); }
/* Looping shimmer across the placeholder blocks, offset per card so it travels as a wave. */
.sk::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, .38) 50%, rgba(255, 255, 255, 0) 80%);
  animation: skShimmer 2s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 110ms);
}
@keyframes skShimmer { to { transform: translateX(100%); } }
.sk-art { height: 78px; border-radius: 10px; margin-bottom: .7rem; }
.sk-line { height: 9px; margin-top: .4rem; width: 70%; }
.sk-line.short { width: 50%; }
.sk-line.tiny { width: 35%; }
.offer-overlay {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  text-align: center; padding: 2.25rem 1.5rem 2rem; gap: .6rem;
}
.brand-big .brand-mark { width: 48px; height: 48px; }
.brand-big .brand-name { font-size: 1.9rem; }
.offer-overlay h3 { font: 700 1.5rem/1.1 'Space Grotesk', var(--font-body); color: var(--cream-50); margin-top: .4rem; }
.offer-overlay p { max-width: 42ch; color: rgba(255, 242, 228, .62); font-weight: 700; }
.offer-overlay .btn { margin-top: .6rem; }

/* ---------- Middle column ---------- */
.side { display: flex; flex-direction: column; gap: 1rem; }
.btn-hero-md { width: auto; padding: .8rem 1.3rem; font-size: .85rem; border-radius: 9px; }
.btn-hero-md .bolt { width: 16px; height: 16px; }
.btn-hero-md .bolt-tl { left: -7px; top: -9px; } .btn-hero-md .bolt-tr { right: -7px; top: -9px; }
.btn-hero-md .bolt-bl { left: -7px; bottom: -9px; } .btn-hero-md .bolt-br { right: -7px; bottom: -9px; }
.btn-trade { margin: 0 .6rem; width: auto; }
.btn-ico { width: 18px; height: 18px; vertical-align: -4px; margin-right: .45rem; }
.btn-hero > span { display: inline-flex; align-items: center; }
.btn-mint { background: var(--mint-400); color: var(--espresso); box-shadow: 0 3px 0 var(--mint-600); }
.btn-mint:hover { box-shadow: 0 5px 0 var(--mint-600); }
.btn-mint:active { box-shadow: 0 1px 0 var(--mint-600); }
.btn-mint .btn-ico { width: 16px; height: 16px; margin-right: .35rem; }

.promo {
  position: relative; display: flex; align-items: center; gap: .3rem;
  padding: .9rem .4rem; border-radius: 14px; overflow: hidden;
  background: radial-gradient(120% 140% at 50% 120%, rgba(110, 217, 192, .28), rgba(110, 217, 192, 0) 60%), rgba(255, 255, 255, .04);
}
.promo-body { flex: 1; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.promo-body p { font: 800 .95rem/1 var(--font-body); color: var(--cream-50); }
.promo-body p b { color: var(--mint-400); }
.promo-nav {
  width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: rgba(255, 242, 228, .55);
  display: grid; place-items: center; cursor: pointer; transition: color .2s, background .2s;
}
.promo-nav svg { width: 18px; height: 18px; }
.promo-nav:hover { color: var(--cream-50); background: rgba(255, 255, 255, .08); }

.tfilter { padding-top: 1rem; border-top: 1px dashed rgba(255, 255, 255, .09); }
.tfilter h4 { font: 800 1rem/1 var(--font-body); color: var(--cream-50); margin-bottom: .9rem; }

.range-inputs { display: flex; align-items: center; gap: .5rem; }
.range-box {
  flex: 1; display: flex; align-items: center; gap: .5rem; height: 44px; padding: 0 .8rem;
  border-radius: 10px; background: rgba(255, 255, 255, .05);
}
.range-box input {
  width: 100%; min-width: 0; border: 0; background: transparent; color: var(--cream-50);
  font: 800 .95rem var(--font-body); outline: none; -moz-appearance: textfield; appearance: textfield;
}
.range-box input::-webkit-outer-spin-button, .range-box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.range-dash { color: rgba(255, 242, 228, .5); font-weight: 800; }
.range { position: relative; height: 32px; margin-top: .6rem; }
.range-track { position: absolute; left: 6px; right: 6px; top: 50%; height: 5px; margin-top: -2.5px; border-radius: 3px; background: rgba(255, 255, 255, .1); }
.range-fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--pink-300); }
.range input[type="range"] {
  position: absolute; inset: 0; width: 100%; margin: 0; background: transparent; -webkit-appearance: none; appearance: none;
  pointer-events: none; outline: none;
}
.range input[type="range"]::-webkit-slider-runnable-track { background: transparent; height: 32px; }
.range input[type="range"]::-moz-range-track { background: transparent; }
.range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto; cursor: grab;
  width: 18px; height: 18px; margin-top: 7px; border-radius: 50%; border: 0;
  background: var(--pink-300); box-shadow: 0 0 0 3px var(--espresso), 0 3px 8px rgba(0, 0, 0, .5);
}
.range input[type="range"]::-moz-range-thumb {
  pointer-events: auto; cursor: grab; width: 18px; height: 18px; border-radius: 50%; border: 0;
  background: var(--pink-300); box-shadow: 0 0 0 3px var(--espresso), 0 3px 8px rgba(0, 0, 0, .5);
}
.range input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--mint-400); }

.cat-list { display: flex; flex-direction: column; gap: .45rem; }
.tcat {
  display: flex; align-items: center; gap: .7rem; height: 46px; padding: 0 1rem;
  border: 0; border-radius: 12px; background: rgba(255, 255, 255, .05); color: var(--cream-100);
  font: 800 .95rem var(--font-body); cursor: pointer; text-align: left; transition: background .2s, color .2s;
}
.tcat svg { width: 20px; height: 20px; color: rgba(255, 242, 228, .7); }
.tcat span { color: rgba(255, 242, 228, .5); font-weight: 700; }
.tcat:hover { background: rgba(255, 255, 255, .09); }
.tcat.is-active { background: rgba(247, 168, 188, .16); color: var(--cream-50); }
.tcat.is-active svg { color: var(--pink-300); }

.rar-list { display: flex; flex-direction: column; gap: .15rem; }
.rar {
  position: relative; display: flex; align-items: center; gap: .6rem; height: 34px; padding: 0 .35rem;
  border-radius: 8px; cursor: pointer; font: 700 .92rem var(--font-body); color: rgba(255, 242, 228, .85);
  transition: background .2s;
}
.rar:hover { background: rgba(255, 255, 255, .05); }
.rar input { position: absolute; opacity: 0; width: 0; height: 0; }
.rar .box { width: 17px; height: 17px; border-radius: 5px; background: rgba(255, 255, 255, .1); flex: none; display: grid; place-items: center; transition: background .2s; }
.rar .box::after { content: ""; width: 9px; height: 5px; border-left: 2.4px solid var(--espresso); border-bottom: 2.4px solid var(--espresso); transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.rar input:checked + .box { background: var(--pink-300); }
.rar input:checked + .box::after { opacity: 1; }
.rar input:focus-visible + .box { outline: 2px solid var(--mint-400); }
.rar-count { color: rgba(255, 242, 228, .45); }
.rar-bar { margin-left: auto; width: 4px; height: 16px; border-radius: 2px; background: var(--r); }

/* ---------- Entrance: columns rise in, item art fades up card by card ---------- */
.panel-offer, .side, .panel-receive { animation: fadeUp .5s var(--ease-out) both; }
.side { animation-delay: .08s; }
.panel-receive { animation-delay: .14s; }
.item { animation: fadeUp .45s var(--ease-out) both; animation-delay: calc(.1s + var(--i, 0) * 28ms); }
.item-art .gummy { animation: fadeUp .55s var(--ease-out) both; animation-delay: calc(.2s + var(--i, 0) * 32ms); }

/* Short screens: keep the sign-in overlay above the fold. */
@media (max-height: 820px) and (min-width: 961px) {
  .panel-empty { min-height: 180px; padding: 1.4rem 1.5rem; }
  .panel-empty h3 { font-size: 1.35rem; }
  .offer-overlay { padding-top: 1.4rem; gap: .45rem; }
  .brand-big .brand-mark { width: 40px; height: 40px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) { .trade { grid-template-columns: minmax(0, 1fr) 280px minmax(0, 1fr); } }
@media (max-width: 960px) {
  .trade { grid-template-columns: 1fr; padding: .5rem 1rem 2rem; }
  .side { order: 2; }
  .panel-receive { order: 3; }
  .item-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .trade-main { padding-top: calc(var(--nav-h) - .9rem); }
  .panel-empty { min-height: 200px; }
  .toolbar { flex-wrap: wrap; }
  .search { flex-basis: 100%; }
  .item-grid { grid-template-columns: repeat(2, 1fr); }
  .item-grid-dim { display: none; }
  .grid-scroll { max-height: none; overflow: visible; }
  .grid-fade::after { display: none; }
  .offer-overlay { position: static; }
}
