.pokedex-pokemart-modal__pokemart {
  position: absolute;
  top: -50px;
  left: -40px;
  width: 175px;
  pointer-events: none;
  image-rendering: pixelated;
  z-index: -1;
  transform: rotate(-4deg);
  filter: drop-shadow(0 12px 20px rgba(15, 23, 42, 0.16));
}

.pokedex-market-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pokedex-market-modal .modal-body {
    overflow-x: hidden !important;
}

.pokedex-market-tabs .btn {
    min-width: 6.5rem;
}

.pokedex-market-tabs {
    justify-content: center !important;
    flex-wrap: wrap;
}

.pokedex-market-mode-tabs {
  width: 100%;
  flex-wrap: nowrap;
  justify-content: stretch !important;
}

.pokedex-market-mode-tabs .js-market-mode-toggle {
  min-width: 0;
  flex: 1 1 0;
}

.pokedex-market-stage {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100%;
}

.pokedex-market-visual-panel,
.pokedex-market-info-panel {
  padding: 1rem;
}

.pokedex-market-stage__focus {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.65rem 0 0.35rem;
  flex: 1 1 auto;
}

.pokedex-market-stage__orb {
  position: relative;
  width: min(28vw, 176px);
  height: min(28vw, 176px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
}

.pokedex-market-stage__orb::before {
  content: "";
  position: absolute;
  width: 350px;
  height: 350px;
  transform: rotate(335deg);
  background: url("../img/pokemon/pokeball-XHyLlyd.svg") center / contain no-repeat;
  opacity: 0.14;
  -webkit-mask-image: linear-gradient(205deg, transparent 0%, rgba(0, 0, 0, 0) 18%, #000 42%);
  mask-image: linear-gradient(205deg, transparent 0%, rgba(0, 0, 0, 0) 18%, #000 42%);
  pointer-events: none;
}

.pokedex-market-stage__orb img {
  position: relative;
  z-index: 1;
  width: min(13vw, 96px);
  height: min(13vw, 96px);
  image-rendering: pixelated;
  object-fit: contain;
  display: block;
}

.pokedex-market-stage__empty {
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pokedex-market-info-panel__summary h4 {
  line-height: 1.2;
}

.pokedex-market-info-panel__badges {
  min-width: 0;
}

.pokedex-market-info-panel__description {
  min-height: 42px;
}

.pokedex-market-info-panel__description p:first-child {
  line-height: 1.45;
}

.pokedex-market-quantity-row {
  min-width: 0;
}

.pokedex-market-quantity-select {
  width: auto;
  min-width: 86px;
  border-radius: 999px;
  font-weight: 600;
  padding-right: 2rem;
}

.pokedex-market-info-panel__footer .btn {
  min-width: 160px;
}

.pokedex-market-reward-preview {
  position: relative;
  width: 100%;
  min-width: 0;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

.pokedex-market-reward-preview:hover,
.pokedex-market-reward-preview:focus-visible {
  border-color: color-mix(in srgb, var(--xds-border) 90%, transparent) !important;
  box-shadow: var(--xds-shadow);
  transform: translateY(-1px);
}

.pokedex-market-reward-preview.is-selected {
  border-color: color-mix(in srgb, var(--xds-border) 100%, transparent) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--xds-border) 20%, transparent), var(--xds-shadow);
}

.pokedex-market-reward-preview.is-disabled {
  opacity: 0.64;
}

.pokedex-market-pagination {
  width: 100%;
}

.pokedex-market-stage .btn {
  min-width: 160px;
}

.market-token-exchange {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.market-token-exchange__hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  overflow: hidden;
}

.market-token-exchange__currency {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-width: 0;
}

.market-token-exchange__currency-image {
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.market-token-exchange__currency-image img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  image-rendering: pixelated;
}

.market-token-exchange__currency-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.market-token-exchange__currency-copy small,
.market-token-exchange__currency-copy span {
  color: var(--bs-secondary-color);
}

.market-token-exchange__currency-copy strong {
  font-size: clamp(1.55rem, 4vw, 2.35rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.market-token-exchange__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
}

.market-token-exchange__arrow .icon-dynamique,
.market-token-exchange__arrow svg {
  width: 48px;
  height: 48px;
  color: var(--bs-primary);
  stroke-width: 1.8;
}

.market-token-exchange__weekly {
  grid-column: 1 / -1;
  max-width: 560px;
  width: 100%;
  margin: 0.25rem auto 0;
  text-align: center;
}

.market-token-exchange__weekly > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem;
}

.market-token-exchange__weekly > div:first-child strong {
  color: var(--bs-primary);
  font-size: 1.25rem;
}

.market-token-exchange__weekly .progress {
  height: 7px;
  margin: 0.6rem 0 0.35rem;
  background: color-mix(in srgb, var(--bs-secondary-bg) 80%, transparent);
}

.market-token-exchange__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 0 0.15rem;
}

.market-token-exchange__offers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.market-token-exchange__offer {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-width: 0;
  padding: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.market-token-exchange__offer:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--xds-border) 90%, transparent);
  box-shadow: var(--xds-shadow-mini);
}

.market-token-exchange__offer.is-featured {
  border-color: color-mix(in srgb, var(--bs-success) 48%, var(--bs-border-color));
}

.market-token-exchange__featured {
  position: absolute;
  top: 0;
  right: 1rem;
  padding: 0.22rem 0.6rem;
  border-radius: 0 0 8px 8px;
  background: var(--bs-success);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.market-token-exchange__offer-visual {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.3rem;
}

.market-token-exchange__offer-image {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 0;
  background: transparent;
}

.market-token-exchange__offer-image img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: pixelated;
}

.market-token-exchange__offer-amount {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.market-token-exchange__offer-amount strong {
  font-size: 1.75rem;
  line-height: 1;
}

.market-token-exchange__offer-amount small,
.market-token-exchange__offer-price span,
.market-token-exchange__offer-limit {
  color: var(--bs-secondary-color);
}

.market-token-exchange__offer-price {
  display: grid;
  grid-template-columns: 30px auto 1fr;
  align-items: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.45rem 0.6rem;
  border-radius: 11px;
  background: var(--bs-tertiary-bg);
}

.market-token-exchange__offer-price img {
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.market-token-exchange__offer-price strong {
  font-size: 1.05rem;
}

.market-token-exchange__offer-price span {
  overflow: hidden;
  font-size: 0.74rem;
  text-overflow: ellipsis;
}

.market-token-exchange__offer-limit {
  min-height: 1.25rem;
  margin: auto 0 0;
  font-size: 0.78rem;
}

.market-token-exchange__fallback {
  font-weight: 800;
}

.market-token-exchange__button-short {
  display: none;
}

.market-token-confirm-modal {
  z-index: 1070;
}

.modal-backdrop + .modal-backdrop {
  z-index: 1065;
}

.market-token-confirm-modal .modal-content {
  overflow: hidden;
}

.market-token-confirm__exchange {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bs-body-bg) 98%, var(--bs-secondary-bg));
}

.market-token-confirm__currency {
  display: flex;
  align-items: center;
  flex-direction: column;
  min-width: 0;
  text-align: center;
}

.market-token-confirm__currency img {
  width: 52px;
  height: 52px;
  margin-bottom: 0.35rem;
  object-fit: contain;
  image-rendering: pixelated;
}

.market-token-confirm__currency strong {
  font-size: 1.3rem;
  line-height: 1.1;
}

.market-token-confirm__currency small {
  color: var(--bs-secondary-color);
  font-size: 0.68rem;
}

.market-token-confirm__arrow {
  color: var(--bs-primary);
  font-size: 1.65rem;
  font-weight: 700;
  text-align: center;
}

.market-token-confirm__arrow .icon-dynamique,
.market-token-confirm__arrow svg {
  width: 34px;
  height: 34px;
  color: var(--bs-primary);
}

.market-token-confirm-modal .modal-footer .btn {
  flex: 1 1 0;
}

[data-bs-theme="dark"] .market-token-confirm__exchange {
  background: rgba(255, 255, 255, 0.012);
  border-color: rgba(255, 255, 255, 0.08);
}

.market-history-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.market-history-entry {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.market-history-entry:last-child {
  border-bottom: 0;
}

.market-history-entry__item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}

.market-history-entry__sprite {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.market-history-entry__sprite img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.market-history-entry__content {
  min-width: 0;
}

.market-history-entry__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.3rem;
}

[data-bs-theme="dark"] .pokedex-market-visual-panel,
[data-bs-theme="dark"] .pokedex-market-info-panel,
[data-bs-theme="dark"] .pokedex-market-reward-preview {
  border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .pokedex-market-reward-preview:hover,
[data-bs-theme="dark"] .pokedex-market-reward-preview:focus-visible {
  border-color: rgba(125, 211, 252, 0.24) !important;
}

[data-bs-theme="dark"] .pokedex-market-reward-preview.is-selected {
  border-color: rgba(125, 211, 252, 0.34) !important;
  box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.12), var(--xds-shadow);
}

[data-bs-theme="dark"] .market-token-exchange__offer:hover {
  border-color: rgba(125, 211, 252, 0.24) !important;
}

[data-bs-theme="dark"] .market-token-exchange__offer-price {
  background: rgba(255, 255, 255, 0.035);
}

[data-bs-theme="dark"] .market-token-exchange__weekly .progress {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 575.98px) {
  .pokedex-pokemart-modal__pokemart {
    top: -23px;
    left: -35px;
    width: 145px;
  }

  .pokedex-market-stage__orb {
    width: 122px;
    height: 122px;
  }

  .pokedex-market-stage__orb img {
    width: 96px;
    height: 96px;
  }

  .pokedex-market-stage .btn {
    width: 100%;
  }

  .pokedex-market-info-panel__summary {
    align-items: stretch !important;
    flex-direction: column;
  }

  .pokedex-market-info-panel__footer .btn {
    width: auto;
    flex: 1 1 auto;
    min-height: 38px;
  }

  .pokedex-market-quantity-row {
    width: auto;
    flex: 0 0 auto;
    align-items: stretch !important;
  }

  .pokedex-market-quantity-row > span {
    display: none;
  }

  .pokedex-market-quantity-select {
    min-width: 96px;
    height: 38px;
  }

  .pokedex-market-visual-panel,
  .pokedex-market-info-panel {
    padding: 0.9rem;
  }

  .market-token-exchange__hero {
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    gap: 0.35rem;
    padding: 1rem 0.7rem;
  }

  .market-token-exchange__currency {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .market-token-exchange__currency-image {
    width: 66px;
    height: 66px;
    border-radius: 18px;
  }

  .market-token-exchange__currency-image img {
    width: 48px;
    height: 48px;
  }

  .market-token-exchange__currency-copy strong {
    font-size: 1.45rem;
  }

  .market-token-exchange__currency-copy span {
    font-size: 0.75rem;
  }

  .market-token-exchange__arrow .icon-dynamique,
  .market-token-exchange__arrow svg {
    width: 30px;
    height: 30px;
  }

  .market-token-exchange__weekly > div:first-child {
    align-items: center;
    flex-direction: column;
    gap: 0;
    font-size: 0.75rem;
  }

  .market-token-exchange__offers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .market-token-exchange__offer {
    gap: 0.55rem;
    padding: 0.7rem;
  }

  .market-token-exchange__offer-visual {
    align-items: center;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.15rem;
    text-align: center;
  }

  .market-token-exchange__offer-image {
    width: 48px;
    height: 48px;
  }

  .market-token-exchange__offer-image img {
    width: 42px;
    height: 42px;
  }

  .market-token-exchange__offer-amount strong {
    font-size: 1.35rem;
  }

  .market-token-exchange__offer-amount small {
    font-size: 0.7rem;
  }

  .market-token-exchange__offer-price {
    grid-template-columns: 22px 1fr;
    gap: 0.3rem;
    min-height: 34px;
    padding: 0.4rem 0.5rem;
    text-align: right;
  }

  .market-token-exchange__offer-price img {
    width: 21px;
    height: 21px;
  }

  .market-token-exchange__offer-price strong {
    font-size: 0.9rem;
  }

  .market-token-exchange__offer-price span {
    display: none;
  }

  .market-token-exchange__offer-limit {
    min-height: 2.1em;
    font-size: 0.67rem;
    line-height: 1.15;
    text-align: center;
  }

  .market-token-exchange__offer .btn {
    min-width: 0;
    min-height: 38px;
    padding-inline: 0.4rem;
    font-size: 0.72rem;
  }

  .market-token-exchange__button-long {
    display: none;
  }

  .market-token-exchange__button-short {
    display: inline;
  }

  .market-token-exchange__featured {
    right: 0.55rem;
    max-width: calc(100% - 1.1rem);
    padding: 0.18rem 0.4rem;
    font-size: 0.54rem;
  }
}

@media (max-width: 359.98px) {
  .market-token-exchange__offers {
    grid-template-columns: 1fr;
  }

  .market-token-exchange__offer-visual {
    flex-direction: row;
    justify-content: center;
    text-align: left;
  }
}

@media (min-width: 576px) and (max-width: 991.98px) {
  .market-token-exchange__offers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
