.fetish-item-shop,
.unlock-item-reveal {
  position: absolute;
  inset: 0;
  z-index: 14;
  container-type: size;
  isolation: isolate;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  --shop-item-w: min(68cqw, 63cqh, 360px);
  --shop-item-h: calc(var(--shop-item-w) * .70);
  --shop-peek: clamp(72px, calc(50cqw - var(--shop-item-w) * .5 - 10px), calc(var(--shop-item-w) * .56));
  --shop-spread: calc(50cqw + var(--shop-item-w) * .5 - var(--shop-peek));
  --shop-row: min(
    calc(var(--portrait-table-edge, 79%) + var(--shop-item-h) * .34),
    calc(100% - var(--shop-item-h) * .5 - 2px)
  );
  --shop-slide: 350ms cubic-bezier(.22, .72, .21, 1);
  --shop-metal: #f0cc90;
}

.fetish-item-shop[hidden] { display: none; }
.fetish-item-shop[data-state="closing"] { pointer-events: none; }

.host-panel > .wager-dock[inert],
.hostess-stage:has(> .fetish-item-shop:not([hidden])) :is(.portrait-effect-badges, .portrait-losing-pressure-bubbles) {
  visibility: hidden;
}

/* Keep the fixed portrait framing and shrink the host to its visible stage. */
body[data-portrait-camera="1"] .host-panel:has(.fetish-item-shop:not([hidden])) {
  align-self: start;
  height: auto;
  min-height: 0;
}

/* The shop hides the dock; its empty grid row must not shorten the art. */
body[data-portrait-camera="1"] .host-panel:has(.fetish-item-shop:not([hidden])) > .wager-dock[inert] {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 0;
}

body[data-portrait-camera="1"] .portrait-camera-world > :is(.fetish-item-shop, .unlock-item-reveal) {
  inset: var(--portrait-table-drop, 0px) auto auto calc(50% + var(--portrait-camera-offset, 0px));
  width: var(--portrait-viewport-width, 100%);
  height: var(--portrait-viewport-height, 100%);
  translate: -50% 0;
}

.fetish-item-shop::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #20101b80, #20101b1f 21%, transparent 44%), linear-gradient(211deg, #21131d40, transparent 28%);
  pointer-events: none;
}

.fetish-shop-shelf {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.fetish-shop-item {
  --shop-position: calc(var(--shop-offset, 0px) + var(--shop-drag, 0px));
  position: absolute;
  top: var(--shop-row);
  left: 50%;
  display: block;
  width: var(--shop-item-w);
  height: var(--shop-item-h);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  appearance: none;
  cursor: pointer;
  pointer-events: auto;
  translate: calc(-50% + var(--shop-position)) -50%;
  transition: translate var(--shop-slide);
}

.fetish-shop-item[data-slot="-1"] { --shop-offset: calc(-1 * var(--shop-spread)); }
.fetish-shop-item[data-slot="1"] { --shop-offset: var(--shop-spread); }
.fetish-shop-item[data-slot="0"] { z-index: 1; }
.fetish-item-shop.is-dragging .fetish-shop-item { cursor: grabbing; }

.fetish-shop-pack {
  --shop-pack-angle: 56deg;
  position: absolute;
  top: 50%;
  left: -2%;
  width: 104%;
  height: calc(var(--shop-item-w) * 1.30);
  margin-top: calc(var(--shop-item-w) * -.65);
  transform: perspective(calc(var(--shop-item-w) * 2.6)) rotateX(var(--shop-pack-angle));
  /* Cancel the slider offset in the projection so all packs recede toward the same point. */
  transform-origin: calc(50% - var(--shop-position)) 54%;
  transition: transform-origin var(--shop-slide);
  pointer-events: none;
}

.fetish-shop-item.is-wrapping,
.fetish-shop-item.is-wrapping .fetish-shop-pack,
.fetish-item-shop.is-dragging :is(.fetish-shop-item, .fetish-shop-pack) { transition: none; }

.fetish-shop-pack::before {
  content: "";
  position: absolute;
  inset: 6% 12% 7%;
  border-radius: 4px;
  box-shadow: 1px 5px 6px #23101985;
}

.fetish-shop-pack img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: .86;
  transition: opacity 170ms ease;
}

.fetish-shop-item:is([data-slot="0"], :hover, :focus-visible) .fetish-shop-pack img {
  opacity: 1;
}

.fetish-shop-item:focus-visible { outline: none; }

.fetish-shop-item:focus-visible .fetish-shop-pack::after {
  content: "";
  position: absolute;
  inset: 6% 8%;
  outline: 2px solid var(--shop-metal);
  border-radius: 6px;
}

@container (min-aspect-ratio: 1 / 1) {
  .fetish-shop-pack {
    --shop-pack-angle: 65deg;
    top: calc(50% + var(--shop-item-w) * .12);
  }

  .fetish-shop-effect { top: calc(13% + var(--shop-item-w) * .16); }
}

.fetish-shop-effect {
  position: absolute;
  z-index: 1;
  top: 13%;
  right: 10%;
  display: grid;
  width: clamp(20px, calc(var(--shop-item-w) * .23), 27px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid #e1bf8c;
  border-radius: 50%;
  color: #f1cca0;
  background: #513640;
  box-shadow: 0 1px 4px #261c28aa;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.fetish-shop-effect .foil-icon { width: 79%; height: 79%; }
.fetish-shop-item[data-slot="0"] .fetish-shop-effect { opacity: 1; }

.fetish-shop-control {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  outline-offset: -1px;
  border: 0;
  border-radius: 50%;
  background: none;
  appearance: none;
  color: #ffe4b7;
  cursor: pointer;
}

.fetish-shop-control::before {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: -1;
  border: 1px solid #d8ad73d9;
  border-radius: inherit;
  background: linear-gradient(160deg, #553440, #281d26);
  box-shadow: 0 2px 7px #2517239c;
}

.fetish-shop-control:hover::before { box-shadow: inset 0 0 0 2px #ffeac34a, 0 2px 7px #2517239c; }
.fetish-shop-control:active::before { box-shadow: inset 0 0 0 3px #ffeac380, 0 2px 7px #2517239c; }
.fetish-shop-control:focus-visible { outline: 2px solid var(--shop-metal); }
.fetish-shop-control .foil-icon { display:block;width:28px;height:28px; }
.fetish-shop-close { top: 7px; right: 7px; }
.fetish-shop-close::before { background: #2b2027cb; }

.fetish-shop-approve {
  top: calc(var(--shop-row) + var(--shop-item-h) * .27);
  left: calc(50% + var(--shop-item-w) * .36);
  translate: -50% -50%;
}

.fetish-shop-approve::before {
  background: linear-gradient(155deg, #e7bd89, #b57755);
  border-color: #ffe6a5;
}

.fetish-shop-approve::before { background:linear-gradient(160deg,#553440,#281d26); }
.fetish-shop-approve[aria-disabled="true"] { cursor: not-allowed; }
.fetish-shop-approve:is([aria-disabled="true"], [data-failed])::before { background: #3f2e37; border-color: #ae8c86; }
.fetish-shop-approve:is([aria-disabled="true"], [data-failed]) > .foil-icon,
.fetish-shop-approve:not([aria-disabled="true"], [data-failed]) .fetish-shop-unavailable { display: none; }
.fetish-shop-approve[data-failed] { animation: fetish-shop-refuse 250ms ease both; }

.fetish-shop-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.fetish-item-shop[data-state="open"] { animation: fetish-shop-open 320ms ease-out both; }
.fetish-item-shop[data-state="open"] .fetish-shop-pack { animation: fetish-shop-slide-in 390ms cubic-bezier(.2, .8, .24, 1) both; }
.fetish-item-shop[data-state="closing"] { animation: fetish-shop-close 220ms ease-in both; }
.fetish-item-shop[data-state="closing"][data-exit-reason="purchase"] .fetish-shop-item[data-slot="0"] .fetish-shop-pack {
  animation: fetish-shop-take-package 220ms ease-in both;
}

@keyframes fetish-shop-open { from { opacity: 0; } to { opacity: 1; } }
@keyframes fetish-shop-close { to { opacity: 0; } }
@keyframes fetish-shop-slide-in {
  from { opacity: 0; translate: 0 24px; scale: .94; }
  to { opacity: 1; translate: 0 0; scale: 1; }
}
@keyframes fetish-shop-take-package { to { translate: 24px 12px; scale: .87; } }
@keyframes fetish-shop-refuse { 28% { transform: translateX(-3px); } 72% { transform: translateX(3px); } }

@media (prefers-reduced-motion: reduce) {
  .fetish-item-shop, .fetish-item-shop *, .fetish-item-shop *::before { animation: none !important; transition: none !important; }
  body[data-shimei-voice] .hostess-portrait .portrait-callout { animation: none !important; }
  .fetish-shop-item { --shop-position: var(--shop-offset, 0px); }
}

/* Paper sits above the bag image and shares its tabletop projection. */
.fetish-shop-price-sticker {
  position: absolute;
  z-index: 1;
  left: var(--sticker-x);
  top: var(--sticker-y);
  translate: -50% -50%;
  transform: rotate(var(--sticker-angle)) skewX(var(--sticker-skew));
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 29%;
  height: 12%;
  border: 1px solid #e0dbce;
  border-radius: 5px;
  background: linear-gradient(115deg, #fffef8, #f2eee3);
  box-shadow: 1px 3px 4px #241c284f, inset 0 1px 1px #fff;
  color: #25212a;
  font: 900 clamp(18px, calc(var(--shop-item-w) * .09), 32px)/1 "Ink Free", "Segoe Print", "Segoe Script", cursive;
  letter-spacing: .025em;
  white-space: nowrap;
  pointer-events: none;
}

.fetish-shop-price-sticker::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1.5px solid #b83b3c;
  border-radius: 3px;
}

.fetish-shop-price-ink {
  display: inline-flex;
  transform: skewX(-7deg) rotate(-2deg);
  text-shadow: .35px .2px 0 currentColor, -.25px .15px .35px currentColor;
  -webkit-text-stroke: .3px currentColor;
}
.fetish-shop-price-digit {
  display: inline-block;
  transform: translateY(var(--ink-y)) rotate(var(--ink-angle)) scale(var(--ink-size));
  transform-origin: 50% 75%;
}

/* Spoken requests sit quietly at the table edge. */
#shimei-panel::before { background: linear-gradient(0deg, #27102140, transparent 35%); }
.fetish-shop-shelf[hidden] { display: none; }
.fetish-shop-requests {
  position: absolute;
  left: 50%;
  top: 83%;
  translate: -50% -50%;
  display: flex;
  gap: 4px;
}
#shimei-panel .fetish-shop-control { position: relative; inset: auto; width: 44px; height: 44px; }
#shimei-panel .shimei-icon .foil-icon { width:32px;height:32px; }
#shimei-panel .fetish-shop-approve[hidden],
#shimei-panel[data-committing="true"] .fetish-shop-requests { display: none; }
body[data-shimei-voice]:not([data-shimei-voice=""]) .hostess-portrait .portrait-callout {
  font-style: italic;
  font-weight: 400;
  transition: opacity 120ms ease;
}
body[data-shimei-voice]:not([data-shimei-voice=""]) .portrait-callout::after { content: none; }
body[data-shimei-voice="preview"] .hostess-portrait .portrait-callout:is(.left, .right) { opacity: .55; animation: shimeiHesitate 170ms steps(2, end) infinite; }
body[data-shimei-voice="said"] .hostess-portrait .portrait-callout:is(.left, .right) { opacity: 1; animation: shimeiSaid 180ms ease-out; }
@keyframes shimeiHesitate { 25% { transform: translate(1px, -1px); } 75% { transform: translate(-1px, 1px); } }
@keyframes shimeiSaid { from { scale: .97; } to { scale: 1; } }
body[data-shimei-motion="still"] .hostess-portrait .portrait-callout:is(.left, .right) { animation: none; }

/* Icon-only visuals retain square hit areas, including the receipt replay. */
body .host-panel .wager-dock :is(button, [role="button"]),
body .host-panel .ending-continue {
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
}
/* Keep portrait keyboard feedback on its existing frame, without a second ring. */
body .wager-portrait-controls button:focus-visible,
body .surrender-portrait .choice-option:focus-visible {
  border-color: #fff0cb;
  outline: none;
}
body .fetish-shop-control:is(:hover, :active, :focus-visible) { outline: none; }
body .fetish-shop-control:is(:hover, :active, :focus-visible)::before {
  border-color: #fff0cb;
  box-shadow: 0 2px 7px #2517239c;
}
body .host-panel .wager-dock :is(button, [role="button"]):not(:disabled):is(:hover, :focus-visible),
body .host-panel .ending-continue:not(:disabled):is(:hover, :focus-visible) {
  background: radial-gradient(circle at center, rgba(216, 187, 129, .18) 0%, rgba(216, 187, 129, .09) 48%, transparent 70%);
}
body .host-panel .wager-dock :is(button, [role="button"]):not(:disabled):active,
body .host-panel .ending-continue:not(:disabled):active {
  background: radial-gradient(circle at center, rgba(216, 187, 129, .28) 0%, rgba(216, 187, 129, .14) 48%, transparent 70%);
}
body .host-panel .wager-dock :is(button, [role="button"]):not(:disabled):focus-visible,
body .host-panel .ending-continue:not(:disabled):focus-visible {
  outline: 1px solid #fff0cb;
  outline-offset: -3px;
}
body .host-panel .wager-dock :is(button, [role="button"]):disabled,
body .host-panel .ending-continue:disabled {
  opacity: .35;
  background: transparent;
  box-shadow: none;
  animation: none;
}
/* The portrait ledger uses fixed edge anchors; interaction states remain owned above. */
body[data-portrait-camera="1"] .host-panel > .wager-dock {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 0 8px 0 14px;
  gap: 8px;
  align-items: center;
  background: linear-gradient(90deg, #251320ee, #2e1929ee);
  box-shadow: inset 0 1px #d8bb8166;
}
body .wager-dock .wager-dock-balance {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  max-width: none;
  padding: 0;
  justify-items: start;
  background: transparent;
  font-family: Georgia, "Times New Roman", serif;
  font-variant-numeric: lining-nums tabular-nums;
}
body .wager-dock .wager-balance-value {
  height: auto;
  align-items: baseline;
  line-height: 1;
  gap: .22em;
  letter-spacing: .015em;
  transform-origin: left center;
}
body .wager-dock .wager-balance-currency { font-size: .68em; line-height: 1; }
body .wager-dock .wager-balance-number { font-size: 1em; line-height: 1; }
body .wager-dock > :is(button, .wager-recovery) {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
}
