/* Shop extras (2026-11-16): the try-on chip, the shop's two links, Try on on an item, My collection, History, and the
   ▶ on every click sound (the shop's tiles and the Settings list). Prefixes: .tryon- (core/tryon.js), .shopx- (screens/
   shop-sheet.js, screens/collection-sheet.js). The piggy bank, "I can afford it" and Return were taken out (owner). */

/* ---------- the try-on chip: what is on, the seconds left, Buy / Take off ---------- */
.tryon-chip {
  position: fixed; z-index: 45; left: 50%; bottom: calc(var(--tabbar-h) + var(--tabbar-gap) + var(--safe-b) + 14px);
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 6px 6px 6px 18px; border-radius: var(--r-pill);
  transform: translate(-50%, 12px); opacity: 0; transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}
.tryon-chip.glass { position: fixed; }
.tryon-chip.is-in { transform: translate(-50%, 0); opacity: 1; }
.tryon-chip.is-leaving { transform: translate(-50%, 12px); opacity: 0; pointer-events: none; }
.tryon-chip__txt { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.tryon-chip__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.tryon-chip__time { flex: none; font-size: 14px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.tryon-chip__acts { display: flex; align-items: center; gap: 6px; flex: none; }
.tryon-chip__acts .btn { white-space: nowrap; }
@media (max-width: 480px) {
  .tryon-chip { flex-wrap: wrap; justify-content: center; gap: 8px; width: calc(100vw - 32px); padding: 10px 10px 10px; border-radius: 24px; }
  .tryon-chip__txt { width: 100%; justify-content: center; }
  .tryon-chip__acts { width: 100%; }
  .tryon-chip__acts .btn { flex: 1 1 0; min-width: 0; }
}
body.sheet-open .tryon-chip { display: none; }

/* ---------- the shop's links: My collection · History ---------- */
.shopx-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin: 4px 0 2px; }
.shopx-links { display: flex; gap: 8px; min-width: 0; }
.shopx-chip.shopx-link { gap: 6px; padding: 0 10px 0 14px; }
.shopx-link__t { min-width: 0; margin-right: auto; overflow: hidden; text-overflow: ellipsis; }
.shopx-link svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
/* a phone: My collection and History side by side across the width */
@media (max-width: 600px) {
  /* each chip takes its natural width (long translations: uk, tr, de...), the rest is shared out; only then do they shrink and wrap */
  .shopx-links { flex: 1 1 100%; display: flex; }
  .shopx-link { flex: 1 1 auto; min-width: 0; }
  .shopx-link__t { white-space: normal; line-height: 1.15; text-align: start; }
}
.shopx-chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px; border: 0; border-radius: var(--r-pill);
  background: rgb(var(--fg-rgb) / .07); box-shadow: inset 0 0 0 1px var(--line); color: var(--fg); cursor: pointer;
  font: 600 13px/1.2 var(--f-sans); letter-spacing: -0.01em; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
@media (hover: hover) { .shopx-chip:hover { background: rgb(var(--fg-rgb) / .11); } }
.shopx-chip:active { transform: scale(.96); }
.shopx-chip:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.shopx-chip__n { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- an item: Try on ---------- */
.shopx-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shopx-acts > :only-child { grid-column: 1 / -1; }
.shop-detail__acts .shopx-acts .btn { min-height: 44px; font-size: 14px; padding: 0 12px; }
.shopx-acts .btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shopx-acts .btn svg { width: 17px; height: 17px; flex: none; }
.shopx-trynote { align-self: center; text-align: center; text-wrap: balance; }

/* ---------- My collection ---------- */
.shopx-colhead { display: flex; flex-direction: column; gap: 10px; padding: 2px 0 6px; }
.shopx-colhead__n { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.shopx-colbar { position: relative; height: 6px; border-radius: 6px; background: rgb(var(--fg-rgb) / .1); overflow: hidden; }
.shopx-colbar i { position: absolute; inset: 0; transform-origin: left center; transform: scaleX(var(--p, 0)); border-radius: inherit; background: rgb(var(--cta-rgb)); }
[dir="rtl"] .shopx-colbar i { transform-origin: right center; }
.shopx-colsec { margin-top: 22px; }
.shopx-colsec__title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.shopx-colsec__n { font-size: 14px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.shopx-colgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 12px; }
.shopx-colitem {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 8px 4px 9px; border: 0; border-radius: 16px;
  background: rgb(var(--fg-rgb) / .045); box-shadow: inset 0 0 0 1px var(--line); color: var(--fg); cursor: pointer; font: inherit;
  -webkit-tap-highlight-color: transparent; transition: transform .15s ease, background-color .15s ease;
}
.shopx-colitem:active { transform: scale(.96); }
.shopx-colitem:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.shopx-colitem .shop-tile__art { width: 48px; height: 48px; }
.shopx-colitem .shopx-colitem__name { max-width: 100%; font-size: 11.5px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; text-align: center; overflow-wrap: normal; hyphens: manual; text-wrap: balance; }
.shopx-colitem.is-missing .shop-tile__art { opacity: .3; filter: grayscale(1); }
.shopx-colitem.is-missing .shopx-colitem__name { color: var(--faint); }
.shopx-colitem.is-owned { background: rgb(var(--fg-rgb) / .075); }

/* ---------- Focus sounds (v7): a soft sound wave on the tile ---------- */
.shop-ambient-ico { color: var(--muted); }
.shop-ambient-ico svg { width: 36px; height: 22px; }
.shop-tile.is-owned .shop-ambient-ico, .shopx-colitem.is-owned .shop-ambient-ico { color: rgb(var(--cta-rgb)); }

/* ---------- ▶ on a click sound (2026-11-16): one tap plays it, without opening it ---------- */
.shop-tilebox { position: relative; display: grid; min-width: 0; }
.shop-tilebox > .shop-tile { min-width: 0; }
.shop-tile__play, .st-snd__play {
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  background: rgb(var(--fg-rgb) / .1); box-shadow: inset 0 0 0 1px var(--line); color: var(--fg); cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.shop-tile__play { position: absolute; top: 6px; right: 6px; z-index: 1; }
[dir="rtl"] .shop-tile__play { right: auto; left: 6px; }
.shop-tile__play svg, .st-snd__play svg { width: 15px; height: 15px; margin-left: 2px; fill: currentColor; }
@media (hover: hover) { .shop-tile__play:hover, .st-snd__play:hover { background: rgb(var(--fg-rgb) / .16); } }
.shop-tile__play:active, .st-snd__play:active { transform: scale(.9); background: rgb(var(--cta-rgb) / .22); }
.shop-tile__play:focus-visible, .st-snd__play:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
/* the Settings list: the row and its ▶ side by side */
.st-sndrow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.st-sndrow > .st-snd { flex: 1 1 auto; min-width: 0; }

/* ---------- shop9 (2026-11-18): ▶ on a Focus sound (ui/ambient-listen.js): play → a small turning ring while the
   recording loads → stop while it plays. Shared by the shop's tiles and the Focus screen's list. ---------- */
.amb-listen > span { display: contents; }
.amb-listen .amb-listen__stop, .amb-listen .amb-listen__spin { display: none; }
.amb-listen[data-state="playing"] .amb-listen__play, .amb-listen[data-state="loading"] .amb-listen__play { display: none; }
.amb-listen[data-state="playing"] .amb-listen__stop { display: contents; }
.amb-listen[data-state="playing"] .amb-listen__stop svg { margin-left: 0; }
.amb-listen[data-state="playing"], .amb-listen[data-state="loading"] { background: rgb(var(--cta-rgb) / .22); box-shadow: inset 0 0 0 1px rgb(var(--cta-rgb) / .45); }
.amb-listen[data-state="loading"] .amb-listen__spin {
  display: block; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgb(var(--fg-rgb) / .25); border-top-color: var(--fg); animation: amb-listen-spin .8s linear infinite;
}
@keyframes amb-listen-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .amb-listen[data-state="loading"] .amb-listen__spin { animation-duration: 2.4s; } }

/* 2026-11-22 (owner): the ▶ / ■ buttons are glass like the rest of the app — clear, a bright rim, no blue fill when playing */
.shop-tile__play, .st-snd__play, .fc-amb-play {
  background: var(--glass-tint);
  -webkit-backdrop-filter: var(--glass-fallback); backdrop-filter: var(--glass-fallback);
  box-shadow: inset 0 1px 0 rgb(var(--glass-rim) / calc(var(--glass-rim-a) * .9)), inset 0 0 0 1px rgb(var(--glass-rim) / .16), var(--glass-shadow-s);
}
@media (hover: hover) { .shop-tile__play:hover, .st-snd__play:hover, .fc-amb-play:hover { background: var(--glass-tint); filter: brightness(1.08); } }
.shop-tile__play:active, .st-snd__play:active, .fc-amb-play:active { background: var(--glass-tint); }
.amb-listen[data-state="playing"], .amb-listen[data-state="loading"] {
  background: var(--glass-tint);
  box-shadow: inset 0 1px 0 rgb(var(--glass-rim) / var(--glass-rim-a)), inset 0 0 0 1.5px rgb(var(--fg-rgb) / .35), var(--glass-shadow-s);
}
