/* Merchant refresh: clearer exchange cards, compact controls and responsive spacing. */
.merchant-page {
  min-height: 100dvh;
  height: 100dvh;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(112, 73, 31, .32), transparent 62%),
    #100c08;
}
.merchant-frame {
  position: relative;
  isolation: isolate;
  background-color: #21160e;
  background-position: center;
}
.merchant-frame::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(18, 11, 6, .34), rgba(16, 11, 7, .72) 58%, rgba(12, 9, 7, .9)),
    radial-gradient(ellipse at 50% 8%, rgba(255, 193, 90, .13), transparent 58%);
}
.merchant-content {
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  height: calc(100dvh - 96px);
  padding: clamp(12px, 2.6vw, 24px) clamp(12px, 2.8vw, 26px) 118px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 210, 133, .35) transparent;
}
.merchant-content::-webkit-scrollbar { width: 5px; }
.merchant-content::-webkit-scrollbar-thumb {
  background: rgba(255, 210, 133, .35);
  border-radius: 99px;
}
.merchant-top {
  align-items: center;
  gap: 12px;
  margin: 0 auto 14px;
}
.merchant-back-button {
  min-height: 44px;
  padding: 0 15px;
  color: #ffe9bf;
  background: linear-gradient(180deg, rgba(91, 55, 27, .96), rgba(44, 28, 17, .96));
  border: 1px solid rgba(255, 221, 159, .24);
  border-radius: 14px;
  box-shadow: inset 0 1px rgba(255, 255, 255, .1), 0 6px 16px rgba(0, 0, 0, .24);
  font-weight: 900;
  transition: transform .16s ease, border-color .16s ease, filter .16s ease;
}
.merchant-title-box {
  min-height: 56px;
  padding: 8px 13px;
  background: linear-gradient(135deg, rgba(57, 35, 20, .92), rgba(27, 22, 18, .9));
  border: 1px solid rgba(255, 221, 159, .24);
  border-radius: 18px;
  box-shadow: inset 0 1px rgba(255, 255, 255, .1), 0 8px 22px rgba(0, 0, 0, .25);
  backdrop-filter: blur(10px);
}
.merchant-title-box img {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .35));
}
.merchant-title {
  color: #ffe0a0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .55);
  font-size: clamp(20px, 4vw, 24px);
  letter-spacing: .01em;
}
.merchant-subtitle {
  color: rgba(255, 235, 197, .78);
  font-size: 12px;
  line-height: 1.35;
}
.merchant-date,
.merchant-message,
.merchant-loading,
.merchant-empty {
  max-width: 100%;
  box-sizing: border-box;
  color: #f7e7c9;
  background: rgba(34, 25, 18, .78);
  border: 1px solid rgba(255, 223, 171, .16);
  border-radius: 14px;
  margin-bottom: 12px;
  padding: 11px 14px;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .18);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 800;
}
.merchant-date b { color: #ffdc91; }
.merchant-message {
  color: #fff1d0;
  background: rgba(91, 53, 24, .82);
  border-color: rgba(255, 205, 118, .26);
}
.merchant-loading,
.merchant-empty { text-align: center; }
.merchant-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
}
.merchant-card {
  position: relative;
  min-width: 0;
  box-sizing: border-box;
  padding: 13px;
  overflow: hidden;
  color: #fff4df;
  background:
    linear-gradient(145deg, rgba(72, 49, 31, .94), rgba(34, 25, 19, .96) 62%),
    rgba(28, 20, 15, .94);
  border: 1px solid rgba(255, 221, 159, .2);
  border-radius: 20px;
  box-shadow: inset 0 1px rgba(255, 255, 255, .08), 0 10px 26px rgba(0, 0, 0, .28);
  backdrop-filter: blur(12px);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.merchant-card.is-promo {
  background:
    linear-gradient(145deg, rgba(94, 67, 25, .96), rgba(37, 28, 18, .97) 62%),
    rgba(28, 20, 15, .94);
  border-color: rgba(255, 215, 106, .52);
  box-shadow: inset 0 1px rgba(255, 255, 255, .12), 0 0 0 1px rgba(255, 207, 81, .08), 0 12px 28px rgba(0, 0, 0, .3);
}
.merchant-card-head {
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
}
.merchant-card-icon-row {
  height: 72px;
  gap: 4px;
  background: rgba(13, 10, 8, .36);
  border: 1px solid rgba(255, 232, 191, .1);
  border-radius: 17px;
  font-size: 17px;
  color: #ffd982;
}
.merchant-resource-icon {
  width: 30px;
  height: 30px;
  background: rgba(255, 228, 177, .1);
  border: 1px solid rgba(255, 232, 191, .11);
  border-radius: 11px;
}
.merchant-resource-icon img {
  max-width: 25px;
  max-height: 25px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35));
}
.merchant-card-title h3 {
  color: #fff0d2;
  font-size: clamp(15px, 3.2vw, 18px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.merchant-card-title p {
  color: rgba(255, 223, 169, .75);
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.4;
}
.merchant-promo,
.merchant-limit {
  box-sizing: border-box;
  border-radius: 12px;
  margin-top: 10px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
}
.merchant-promo {
  color: #fff2bc;
  background: rgba(255, 205, 67, .13);
  border: 1px solid rgba(255, 218, 110, .22);
}
.merchant-limit {
  color: #f7e2b8;
  background: rgba(12, 10, 8, .28);
  border: 1px solid rgba(255, 232, 191, .08);
}
.merchant-limit b { color: #ffe09a; }
.merchant-exchange-box {
  gap: 10px;
  margin-top: 12px;
}
.merchant-amount-row {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 8px;
}
.merchant-amount-row button,
.merchant-exchange-button {
  color: #f7ffe9;
  background: linear-gradient(180deg, #79bd4c, #437d2e);
  border: 1px solid rgba(229, 255, 203, .16);
  border-radius: 13px;
  box-shadow: inset 0 1px rgba(255, 255, 255, .24), 0 4px 0 rgba(31, 71, 24, .72), 0 7px 14px rgba(0, 0, 0, .2);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.merchant-amount-row button { min-height: 42px; }
.merchant-amount-row input {
  min-height: 42px;
  box-sizing: border-box;
  color: #382717;
  background: linear-gradient(180deg, #fff4d9, #ead8ae);
  border: 1px solid rgba(255, 240, 207, .7);
  border-radius: 13px;
  font-size: 16px;
  font-weight: 900;
}
.merchant-amount-row input:focus {
  outline: 2px solid rgba(255, 212, 115, .78);
  outline-offset: 2px;
}
.merchant-amount-row input::-webkit-inner-spin-button,
.merchant-amount-row input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.merchant-preview { gap: 8px; }
.merchant-preview > div {
  min-width: 0;
  box-sizing: border-box;
  color: rgba(255, 235, 199, .72);
  background: rgba(13, 10, 8, .34);
  border: 1px solid rgba(255, 232, 191, .08);
  border-radius: 13px;
  padding: 9px 10px;
  font-size: 11px;
  line-height: 1.3;
}
.merchant-preview b {
  min-width: 0;
  color: #fff1d3;
  gap: 5px;
  margin-top: 5px;
  font-size: clamp(14px, 3.5vw, 17px);
  overflow-wrap: anywhere;
}
.merchant-preview img { flex: 0 0 auto; }
.merchant-warning {
  color: #ffe7d4;
  background: rgba(133, 46, 30, .48);
  border: 1px solid rgba(255, 153, 115, .24);
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.4;
}
.merchant-exchange-button {
  min-height: 46px;
  padding: 10px 14px;
  font-size: 14px;
  letter-spacing: .01em;
}
.merchant-amount-row button:disabled,
.merchant-exchange-button:disabled {
  opacity: .55;
  filter: grayscale(.35);
  box-shadow: none;
  transform: none;
}
.merchant-confirm-overlay {
  background: rgba(8, 6, 5, .76);
  backdrop-filter: blur(7px);
}
.merchant-confirm-modal {
  max-height: min(90dvh, 620px);
  box-sizing: border-box;
  overflow: auto;
  color: #fff1d2;
  background: linear-gradient(145deg, rgba(78, 51, 29, .98), rgba(31, 23, 18, .99));
  border: 1px solid rgba(255, 222, 163, .34);
  border-radius: 22px;
  box-shadow: inset 0 1px rgba(255, 255, 255, .12), 0 20px 50px rgba(0, 0, 0, .55);
}
.merchant-confirm-title { color: #ffe2a0; }
.merchant-confirm-subtitle { color: rgba(255, 232, 191, .8); }
.merchant-confirm-resource {
  background: rgba(14, 11, 9, .36);
  border-color: rgba(255, 231, 187, .12);
}
.merchant-confirm-resource span,
.merchant-confirm-resource em { color: rgba(255, 230, 184, .76); }
.merchant-confirm-resource b { color: #fff3d6; }
.merchant-confirm-limit {
  color: #ffe9bd;
  background: rgba(14, 11, 9, .38);
  border: 1px solid rgba(255, 231, 187, .1);
}
.merchant-confirm-cancel {
  background: linear-gradient(180deg, #8a7054, #59432e);
}
.merchant-confirm-buy {
  background: linear-gradient(180deg, #79bd4c, #437d2e);
}
.merchant-confirm-actions button {
  border: 1px solid rgba(255, 255, 255, .12);
}
.merchant-confirm-actions button:focus-visible,
.merchant-back-button:focus-visible,
.merchant-amount-row button:focus-visible,
.merchant-exchange-button:focus-visible {
  outline: 2px solid #ffe09b;
  outline-offset: 3px;
}
@media (min-width: 720px) {
  .merchant-content { padding-inline: clamp(22px, 4vw, 38px); }
  .merchant-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .merchant-card { padding: 15px; }
}
@media (max-width: 380px) {
  .merchant-content { padding-inline: 10px; }
  .merchant-top { gap: 8px; }
  .merchant-back-button { padding-inline: 11px; }
  .merchant-title-box { gap: 7px; padding-inline: 9px; }
  .merchant-title-box img { width: 42px; height: 42px; }
  .merchant-card { padding: 10px; }
  .merchant-card-head { grid-template-columns: 76px minmax(0, 1fr); gap: 9px; }
  .merchant-card-icon-row { height: 64px; }
  .merchant-preview > div { padding: 8px; }
}
@media (hover: hover) {
  .merchant-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 224, 162, .38);
    box-shadow: inset 0 1px rgba(255, 255, 255, .1), 0 14px 32px rgba(0, 0, 0, .34);
  }
  .merchant-back-button:hover { filter: brightness(1.12); }
  .merchant-amount-row button:not(:disabled):hover,
  .merchant-exchange-button:not(:disabled):hover { filter: brightness(1.09); }
}
@media (prefers-reduced-motion: reduce) {
  .merchant-card,
  .merchant-back-button,
  .merchant-amount-row button,
  .merchant-exchange-button { transition: none; }
}
