.market-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-family: system-ui, sans-serif;
}

.market-ui button {
  min-height: 44px;
  padding: 5px 10px;
  border: 1px solid #9d7549;
  border-radius: 5px;
  background: #302219;
  color: #fff1d5;
  font: 600 13px/1.2 system-ui, sans-serif;
  pointer-events: auto;
  touch-action: manipulation;
}

.market-ui button:focus-visible {
  outline: 2px solid #ffcf83;
  outline-offset: 2px;
}

.market-ui button:disabled { opacity: .7; cursor: default; }

.market-card {
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 20px);
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid #b78c56;
  border-radius: 7px;
  box-shadow: 0 3px 16px #18110cb0;
  background: #302219f7;
  color: #fff1d5;
  pointer-events: auto;
}

.market-card h2 {
  margin: 0;
  font: 600 20px/1.1 Georgia, serif;
}

.market-card p {
  margin: 4px 0 6px;
  color: #ead4b0;
  font-size: 12px;
}

.market-card-icon {
  flex: 0 0 39px;
  width: 39px;
  height: auto;
  object-fit: contain;
  image-rendering: pixelated;
}

.world-stage .market-card-icon { display: block; margin: 0; }
.world-stage, .world-play { position: relative; }

.market-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.market-card [data-market-accept] {
  border-color: #dbb274;
  background: #72482a;
}

.market-card-actions button {
  position: relative;
  --touch-hit-x: 1px;
  --touch-hit-y: 2px;
}
.market-card-actions button::after {
  content: "";
  position: absolute;
  left: calc(-1px - var(--touch-hit-x));
  top: calc(-1px - var(--touch-hit-y));
  width: calc(100% + 2px + var(--touch-hit-x) + var(--touch-hit-x));
  height: calc(100% + 2px + var(--touch-hit-y) + var(--touch-hit-y));
  background: transparent;
  touch-action: manipulation;
}

.market-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.box .market-card {
  z-index: 8;
  top: 50%;
  max-height: calc(100% - 24px);
  padding: 13px;
  gap: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  transform: translate(-50%, -50%);
  border: 1px solid #b28b5c;
  border-radius: 3px;
  box-shadow: inset 0 0 0 2px #241a1b, 0 4px 0 #1b1315d9, 0 8px 24px #130e11a8;
  background: #352729;
}

.box .market-card h2 { color: #ffe7b8; }
.box .market-card p { margin-block: 5px 10px; line-height: 1.4; }
.box .market-card-icon {
  padding: 4px;
  background: #231a1c;
  border: 1px solid #826345;
}

.box .market-ui button {
  min-width: 44px;
  border-radius: 3px;
  box-shadow: inset 0 1px #f2d89f24, 0 2px #1d1416;
}

.box .market-card [data-market-accept] { color: #fff3d8; background: #705035; }
.box .market-ui button:active { transform: translateY(1px); }

@media (max-width: 510px) and (max-height: 380px) {
  .market-card { top: 8px; }
}
