:root {
  color-scheme: dark;
  --text: #e0e8ff;
  --muted: #8890b8;
  --cyan: #00ccff;
  --magenta: #f030c8;
  --purple: #9030e0;
  --border: rgba(255, 255, 255, 0.1);
  --panel-bg: rgba(13, 8, 40, 0.86);
  --warn: #f5a524;
  --err: #ff6b6b;
  --font-display: 'Orbitron', system-ui, sans-serif;
  --font-body: 'Exo 2', system-ui, -apple-system, Segoe UI, sans-serif;
  /* Shop shelf — row height + wood; columns always fill cabinet width */
  --shop-slot-h: 7.35rem;
  --shop-thumb: 3.65rem;
  --shop-wood-bar: 0.55rem;
  /* Single source of truth for Sylveon + desk scene height (desktop/tablet) */
  --shop-scene-h: clamp(12.5rem, 16vw, 17rem);
  --shop-mascot-x: 31%;
  --shop-bubble-x: 42%;
  --shop-bubble-bottom: 41%;
  --shop-bubble-tail-bottom: 1.05rem;
  --shop-shelf-max-w: 100%;
  --shop-wood: #6b4423;
  --shop-wood-dark: #4a2f14;
  --shop-wood-light: #9a6535;
  /* RNWoPRj shelf selection glow — temp/design-resources/simeydotme/RNWoPRj-ATOZ-GLOW-REFERENCE.md */
  --glow-sens: 30;
  --glow-color: 278deg 62% 78%;
  --glow-boost: 0%;
  --glow-blend: plus-lighter;
  --glow-blend-inner: soft-light;
  --glow-slot-bg: linear-gradient(8deg, hsla(258, 20%, 11%, 0.92) 75%, hsla(258, 16%, 14%, 0.9) 75.5%);
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  background: transparent !important;
  background-color: transparent !important;
  color: var(--text);
  font-family: var(--font-body);
}

body {
  padding: 0.75rem;
  min-height: 120px;
}

.panel {
  position: relative;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.panel-login {
  max-width: 22rem;
  margin: 0 auto;
  text-align: center;
}

.lede {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.embed-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "stat stat"
    "inv inv"
    "shop shop"
    "footer footer";
}

.panel-stat { grid-area: stat; }
.panel-inventory { grid-area: inv; }
.panel-shop { grid-area: shop; }
.widget-footer { grid-area: footer; }

@media (min-width: 720px) {
  .embed-grid {
    grid-template-areas:
      "stat inv"
      "shop shop"
      "footer footer";
    align-items: start;
  }
}

.widget-footer {
  display: flex;
  justify-content: center;
  padding: 0.15rem 0 0.35rem;
}

.btn-logout {
  font-size: 0.82rem;
  padding: 0.45rem 1.15rem;
}

/*
 * Stat card FX — static accent border, name sweep.
 * stat-card-clip overflow:hidden keeps the orbit layer from bleeding past corners.
 * panel-stat is a layout shell only — no outer panel chrome (no title, border, or ghost box).
 */
.panel-stat {
  padding: 0;
  overflow: visible;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

.panel-stat::before {
  display: none;
}

.stat-card-clip {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  isolation: isolate;
}

.stat-border-orbit {
  display: none !important;
}

.stat-inner {
  position: relative;
  z-index: 1;
  padding: 0.85rem 1rem 1rem;
  border-radius: 14px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

body.has-viewer-accent .stat-card-clip {
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.35),
    inset 0 0 0 2px color-mix(in srgb, var(--accent) 52%, transparent);
}

body.has-viewer-accent .stat-inner {
  margin: 2px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background: rgba(13, 8, 40, 0.96);
  padding: calc(1rem - 2px);
  box-shadow: none;
  backdrop-filter: none;
}

.stat-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto;
  gap: 0.5rem 0.75rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

body.has-viewer-accent .stat-header {
  padding: 0.55rem 0.5rem;
  border-radius: 10px;
  background: var(--accent-header-wash);
  border: 1px solid var(--accent-border-subtle);
}

.avatar {
  grid-row: 1;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: #000;
  box-shadow: none;
}

body.has-viewer-accent .avatar {
  border-color: var(--accent);
  box-shadow: var(--avatar-glow);
}

.stat-identity { min-width: 0; }

.name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 2.8vw, 1.32rem);
  letter-spacing: 0.04em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 26ch;
}

body.has-viewer-accent .name {
  background: linear-gradient(
    90deg,
    var(--accent-text) 0%,
    var(--accent-text) 38%,
    var(--accent-bright) 46%,
    #ffffff 50%,
    var(--accent-bright) 54%,
    var(--accent-text) 62%,
    var(--accent-text) 100%
  );
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 22%, transparent));
  animation: name-gradient-flow 7.5s ease-in-out infinite;
}

@keyframes name-gradient-flow {
  0%, 68% { background-position: 100% 50%; }
  82% { background-position: 0% 50%; }
  82%, 100% { background-position: 0% 50%; }
}

.login {
  color: var(--muted);
  font-size: 0.85rem;
}

.coin-block {
  text-align: right;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 204, 255, 0.28);
  background: rgba(0, 204, 255, 0.06);
}

body.has-viewer-accent .coin-block {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.coin-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c8d4f0;
}

body.has-viewer-accent .coin-label {
  color: color-mix(in srgb, var(--accent-bright) 70%, #f4f8ff);
}

.coin-value {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: #b8f0ff;
}

body.has-viewer-accent .coin-value {
  color: #f4f8ff;
  text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 45%, transparent);
}

.btn.tiny {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: var(--font-body);
}

.btn.twitch {
  background: linear-gradient(135deg, #c818a8 0%, #7820cc 100%);
  color: white;
  width: 100%;
}

.btn.ghost {
  color: var(--muted);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.link-fallback {
  display: block;
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: var(--cyan);
}

/* C-style: sharp inner stat tiles */
.stats-grid {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.stats-grid div {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.5rem 0.6rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px;
  transition: border-color 0.2s ease;
}

body.has-viewer-accent .stats-grid div {
  background: linear-gradient(
    155deg,
    color-mix(in srgb, var(--accent-dark) 28%, rgba(8, 6, 22, 0.95)),
    rgba(6, 5, 18, 0.92) 55%,
    color-mix(in srgb, var(--accent) 10%, rgba(6, 5, 18, 0.94))
  );
  border-color: var(--accent-border-subtle);
  box-shadow: inset 0 1px 0 var(--accent-whisper);
}

body.has-viewer-accent .stats-grid dt {
  color: color-mix(in srgb, var(--accent-bright) 65%, #e0e8ff);
}

body.has-viewer-accent .stats-grid dd {
  color: #f2f6ff;
  font-weight: 700;
}

.stats-grid .stat-slot-wide {
  grid-column: 1 / -1;
}

.stats-grid .stat-slot-wide dd {
  font-size: 0.84rem;
  letter-spacing: 0.02em;
}

.stat-tile-podium {
  gap: 0.2rem !important;
  justify-content: center;
}

.stat-podium-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.35rem;
  line-height: 1.2;
}

.stat-podium-label {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--muted);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.has-viewer-accent .stat-podium-label {
  color: color-mix(in srgb, var(--accent-bright) 65%, #e0e8ff);
}

.stat-podium-value {
  margin: 0;
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1.2;
  color: #f2f6ff;
}

.stats-grid dt {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stats-grid dd {
  margin: 0;
  font-weight: 600;
  font-size: 0.86rem;
  line-height: 1.35;
  word-break: break-word;
}

/* C-style section headers; channel cyan for shop/inventory */
.panel-title {
  margin: 0 0 0.65rem;
  padding-bottom: 0.45rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.has-viewer-accent .panel-inventory {
  background: var(--accent-panel-fill-inv);
  border-color: var(--accent-border-subtle);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 var(--accent-whisper);
}

body.has-viewer-accent .panel-inventory .panel-title {
  color: var(--accent-text);
  border-bottom-color: var(--accent-border-subtle);
}

.phase-note {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
}

/* Phase E — Sylveon shop (channel colors only; not viewer accent) */
.panel-shop {
  background: linear-gradient(168deg, rgba(22, 10, 48, 0.94), rgba(8, 5, 24, 0.92));
  border-color: rgba(0, 204, 255, 0.22);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(0, 204, 255, 0.06);
}

.panel-shop .panel-title {
  color: var(--cyan);
  border-bottom-color: rgba(0, 204, 255, 0.18);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shop-layout {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
}

/* —— RPG counter (top) —— */
.shop-rpg {
  padding: 0.75rem 0.7rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(144, 48, 224, 0.38);
  background: linear-gradient(165deg, rgba(78, 32, 118, 0.58), rgba(12, 6, 34, 0.97) 62%);
  overflow: visible;
}

.shop-rpg-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr) minmax(0, 1fr);
  grid-template-rows: auto;
  gap: 0.5rem;
  align-items: end;
  min-height: 0;
  padding-bottom: 0.2rem;
}

.shop-stage-slots {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
  height: auto;
  min-height: 0;
  align-self: end;
  justify-self: center;
  margin: 0;
  padding: 0;
}

.shop-stage-slots--left,
.shop-stage-slots--right {
  justify-self: center;
  width: 100%;
  max-width: var(--shop-shelf-max-w);
}

/* Wooden shelf — framed cubbies up top, solid panel down to floor */
.shop-shelf-unit {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  align-self: end;
}

.shop-shelf-cubbies {
  flex: 0 0 auto;
  width: 100%;
  padding: var(--shop-wood-bar);
  background: linear-gradient(180deg, var(--shop-wood-light) 0%, var(--shop-wood) 55%, var(--shop-wood-dark) 100%);
  border: var(--shop-wood-bar) solid var(--shop-wood-dark);
  box-shadow:
    inset 0 1px 0 rgba(255, 210, 140, 0.2),
    0 2px 6px rgba(0, 0, 0, 0.28);
}

.shop-shelf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: var(--shop-slot-h) var(--shop-slot-h);
  gap: var(--shop-wood-bar);
  width: 100%;
  background: var(--shop-wood);
}

.shop-shelf-lower {
  display: none;
}

.shop-shelf-cell {
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0.24rem 0.38rem;
  background: rgba(6, 3, 18, 0.68);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.42);
  min-width: 0;
  min-height: 0;
}

.shop-shelf-base {
  flex: 0 0 auto;
  height: 0.55rem;
  width: 100%;
  background: linear-gradient(180deg, var(--shop-wood-light) 0%, var(--shop-wood) 38%, var(--shop-wood-dark) 100%);
  border-radius: 0 0 3px 3px;
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.42);
}

.shop-stage-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  padding: 0.34rem 0.26rem;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 4, 22, 0.72);
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
  /* RNWoPRj edge glow when .is-selected */
  --glow-pads: 6px;
  --color-sens: calc(var(--glow-sens) + 20);
  --pointer-°: 45deg;
  --pointer-d: 0;
  isolation: isolate;
  transform: translate3d(0, 0, 0.01px);
}

.shop-stage-slot::before,
.shop-stage-slot::after,
.shop-stage-slot > .shop-slot-glow {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transition: opacity 0.25s ease-out;
  z-index: 0;
  pointer-events: none;
}

@media (hover: hover) {
  .shop-stage-slot:not(:hover)::before,
  .shop-stage-slot:not(:hover)::after,
  .shop-stage-slot:not(:hover) > .shop-slot-glow {
    opacity: 0;
    transition: opacity 0.75s ease-in-out;
  }
}

@media (hover: none) {
  .shop-stage-slot:not(.is-selected)::before,
  .shop-stage-slot:not(.is-selected)::after,
  .shop-stage-slot:not(.is-selected) > .shop-slot-glow {
    opacity: 0;
    transition: opacity 0.75s ease-in-out;
  }
}

.shop-stage-slot::before {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--glow-slot-bg) 0 100%) padding-box,
    linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box,
    radial-gradient(at 80% 55%, hsla(268, 100%, 76%, 1) 0px, transparent 50%) border-box,
    radial-gradient(at 69% 34%, hsla(349, 100%, 74%, 1) 0px, transparent 50%) border-box,
    radial-gradient(at 8% 6%, hsla(136, 100%, 78%, 1) 0px, transparent 50%) border-box,
    radial-gradient(at 41% 38%, hsla(192, 100%, 64%, 1) 0px, transparent 50%) border-box,
    radial-gradient(at 86% 85%, hsla(186, 100%, 74%, 1) 0px, transparent 50%) border-box,
    radial-gradient(at 82% 18%, hsla(52, 100%, 65%, 1) 0px, transparent 50%) border-box,
    radial-gradient(at 51% 4%, hsla(12, 100%, 72%, 1) 0px, transparent 50%) border-box,
    linear-gradient(#c299ff 0 100%) border-box;
  opacity: calc((var(--pointer-d) - var(--color-sens)) / (100 - var(--color-sens)));
  mask-image: conic-gradient(from var(--pointer-°) at center, black 25%, transparent 40%, transparent 60%, black 75%);
}

.shop-stage-slot::after {
  border: 1px solid transparent;
  background:
    radial-gradient(at 80% 55%, hsla(268, 100%, 76%, 1) 0px, transparent 50%) padding-box,
    radial-gradient(at 69% 34%, hsla(349, 100%, 74%, 1) 0px, transparent 50%) padding-box,
    radial-gradient(at 8% 6%, hsla(136, 100%, 78%, 1) 0px, transparent 50%) padding-box,
    radial-gradient(at 41% 38%, hsla(192, 100%, 64%, 1) 0px, transparent 50%) padding-box,
    radial-gradient(at 86% 85%, hsla(186, 100%, 74%, 1) 0px, transparent 50%) padding-box,
    radial-gradient(at 82% 18%, hsla(52, 100%, 65%, 1) 0px, transparent 50%) padding-box,
    radial-gradient(at 51% 4%, hsla(12, 100%, 72%, 1) 0px, transparent 50%) padding-box,
    linear-gradient(#c299ff 0 100%) padding-box;
  mask-image:
    linear-gradient(to bottom, black, black),
    radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%),
    radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%),
    radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%),
    radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%),
    radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%),
    conic-gradient(from var(--pointer-°) at center, transparent 5%, black 15%, black 85%, transparent 95%);
  mask-composite: subtract, add, add, add, add, add;
  opacity: calc((var(--pointer-d) - var(--color-sens)) / (100 - var(--color-sens)));
  mix-blend-mode: var(--glow-blend-inner);
}

.shop-stage-slot > .shop-slot-glow {
  --outset: var(--glow-pads);
  inset: calc(var(--outset) * -1);
  z-index: 0;
  mask-image: conic-gradient(from var(--pointer-°) at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%);
  opacity: calc((var(--pointer-d) - var(--glow-sens)) / (100 - var(--glow-sens)));
  mix-blend-mode: var(--glow-blend);
}

.shop-stage-slot > .shop-slot-glow::before {
  content: "";
  position: absolute;
  inset: var(--outset);
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px hsl(var(--glow-color) / 100%),
    inset 0 0 1px 0 hsl(var(--glow-color) / calc(var(--glow-boost) + 60%)),
    inset 0 0 3px 0 hsl(var(--glow-color) / calc(var(--glow-boost) + 50%)),
    inset 0 0 6px 0 hsl(var(--glow-color) / calc(var(--glow-boost) + 40%)),
    inset 0 0 12px 0 hsl(var(--glow-color) / calc(var(--glow-boost) + 28%)),
    0 0 1px 0 hsl(var(--glow-color) / calc(var(--glow-boost) + 55%)),
    0 0 4px 0 hsl(var(--glow-color) / calc(var(--glow-boost) + 35%)),
    0 0 10px 0 hsl(var(--glow-color) / calc(var(--glow-boost) + 18%));
}

.shop-stage-slot-thumb,
.shop-stage-slot-name,
.shop-stage-slot-price,
.shop-stage-slot-owned {
  position: relative;
  z-index: 1;
}

.shop-shelf-cell:has(.shop-stage-slot:hover),
.shop-shelf-cell:has(.shop-stage-slot.is-selected) {
  overflow: visible;
  z-index: 2;
}

.shop-stage-slot-owned {
  position: absolute;
  top: 0.12rem;
  right: 0.14rem;
  padding: 0.04rem 0.28rem;
  border-radius: 4px;
  font-size: 0.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: #e8fbff;
  background: rgba(0, 204, 255, 0.28);
  border: 1px solid rgba(0, 204, 255, 0.45);
  pointer-events: none;
  z-index: 1;
}

.shop-stage-slot:focus-visible {
  outline: 2px solid rgba(196, 153, 255, 0.45);
  outline-offset: 2px;
}

@media (hover: hover) {
  .shop-stage-slot:hover {
    transform: translate3d(0, -1px, 0.01px);
  }
}

.shop-stage-slot:active:not(.shop-stage-slot--empty) {
  transform: translate3d(0, 0, 0.01px);
}

.shop-stage-slot.is-selected {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(8, 4, 22, 0.78);
}

.shop-stage-slot--empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
  cursor: default;
  pointer-events: none;
}

.shop-stage-slot-thumb {
  width: var(--shop-thumb);
  height: var(--shop-thumb);
  max-width: var(--shop-thumb);
  max-height: var(--shop-thumb);
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.12rem;
}

.shop-stage-slot-name {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  width: 100%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.shop-stage-slot-price {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--cyan);
  font-weight: 600;
}

.shop-rpg-center {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  align-self: end;
  width: 100%;
  height: var(--shop-scene-h);
  min-height: var(--shop-scene-h);
  max-height: var(--shop-scene-h);
  min-width: 0;
  overflow: visible;
}

.shop-stage-hero {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 0;
  overflow: visible;
}

.shop-stage-visual {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
  overflow: visible;
}

.shop-stage-scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0;
  overflow: visible;
}

.shop-stage-cluster {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow: visible;
}

.shop-mascot-wrap {
  position: absolute;
  left: var(--shop-mascot-x);
  bottom: 10%;
  transform: translateX(-50%);
  height: 92%;
  width: auto;
  max-width: 70%;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

/* Shop counter — Sylveon behind (lower z-index), desk in front */
.shop-counter {
  position: absolute;
  left: var(--shop-mascot-x);
  bottom: 0;
  transform: translateX(-50%);
  width: clamp(7.5rem, 48%, 12.5rem);
  z-index: 5;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.5));
}

.shop-counter::after {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -0.35rem;
  height: 0.45rem;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.42) 0%, transparent 72%);
  z-index: 0;
}

/* Counter top — trapezoid face; soft light, no stripe lines */
.shop-counter-surface {
  position: relative;
  z-index: 4;
  width: 126%;
  height: 1.1rem;
  border: 2px solid var(--shop-wood-dark);
  border-bottom: none;
  clip-path: polygon(4% 100%, 96% 100%, 100% 16%, 0 16%);
  background:
    radial-gradient(
      ellipse 85% 120% at 50% 0%,
      rgba(255, 220, 165, 0.38) 0%,
      transparent 58%
    ),
    linear-gradient(
      180deg,
      #a87240 0%,
      var(--shop-wood-light) 55%,
      #8f5a32 100%
    );
  box-shadow: inset 0 2px 0 rgba(255, 210, 140, 0.28);
}

/* Front lip of the countertop — gives depth without drawing on the top face */
.shop-counter-edge {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 0.28rem;
  margin-top: -1px;
  border-left: 2px solid var(--shop-wood-dark);
  border-right: 2px solid var(--shop-wood-dark);
  background: linear-gradient(
    180deg,
    #5a3818 0%,
    var(--shop-wood-dark) 100%
  );
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.25);
}

.shop-counter-front {
  position: relative;
  z-index: 2;
  width: 100%;
  height: clamp(2.45rem, calc(var(--shop-scene-h) * 0.26), 3.75rem);
  border: 2px solid var(--shop-wood-dark);
  border-top: none;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(
    180deg,
    var(--shop-wood-light) 0%,
    var(--shop-wood) 55%,
    var(--shop-wood-dark) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 210, 140, 0.18),
    inset 0 -5px 10px rgba(0, 0, 0, 0.2);
}

.shop-stage-cluster .speech-bubble {
  position: absolute;
  left: var(--shop-bubble-x);
  top: auto;
  bottom: var(--shop-bubble-bottom);
  width: clamp(10.5rem, 24vw, 16.5rem);
  min-width: 10rem;
  max-width: none;
  overflow: visible;
  z-index: 6;
  pointer-events: auto;
  box-sizing: border-box;
}

.speech-bubble-body {
  max-height: min(13rem, 52vh);
  overflow-x: hidden;
  overflow-y: auto;
}

@keyframes shop-mascot-bob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-4px);
  }
}

.shop-mascot-wrap--bob {
  animation: shop-mascot-bob 3.1s ease-in-out infinite;
}

.shop-mascot {
  display: block;
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.55));
}

.speech-bubble {
  position: relative;
  width: 100%;
  max-width: 15.5rem;
  padding: 0;
  box-sizing: border-box;
  border-radius: 14px;
  background: rgba(252, 250, 255, 0.97);
  border: 2px solid rgba(240, 48, 200, 0.48);
  box-shadow:
    0 4px 16px rgba(240, 48, 200, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  z-index: 2;
  overflow: visible;
}

.speech-bubble-body {
  padding: 0.55rem 0.65rem 0.6rem;
  border-radius: 12px;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  border: 10px solid transparent;
  border-top-color: rgba(240, 48, 200, 0.48);
}

.shop-stage-cluster .speech-bubble::before {
  left: -10px;
  top: auto;
  bottom: var(--shop-bubble-tail-bottom);
  transform: none;
  border: 10px solid transparent;
  border-right-color: rgba(240, 48, 200, 0.48);
  border-top-color: transparent;
  border-left: none;
  border-bottom-color: transparent;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: rgba(252, 250, 255, 0.97);
}

.shop-stage-cluster .speech-bubble::after {
  left: -6px;
  top: auto;
  bottom: calc(var(--shop-bubble-tail-bottom) + 2px);
  transform: none;
  border: 8px solid transparent;
  border-right-color: rgba(252, 250, 255, 0.97);
  border-top-color: transparent;
  border-left: none;
  border-bottom-color: transparent;
}

.shop-rpg-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(0, 204, 255, 0.1);
  min-height: 2.5rem;
}

.shop-search-footer {
  grid-column: 3;
  justify-self: end;
  width: min(100%, 11.5rem);
  margin: 0;
}

.speech-bubble-text {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #1a1035;
  font-weight: 500;
  white-space: pre-line;
}

.speech-bubble-text:last-child {
  margin-bottom: 0;
}

.speech-bubble-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(240, 48, 200, 0.2);
}

.speech-bubble-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  width: 100%;
}

.speech-bubble-btn-row:has(.speech-cancel[hidden]) {
  grid-template-columns: 1fr;
}

.speech-bubble .btn.speech-cancel {
  width: 100%;
  padding: 0.34rem 0.45rem;
  font-size: 0.66rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid rgba(90, 40, 120, 0.35);
  background: rgba(255, 255, 255, 0.65);
  color: #5a2878;
  cursor: pointer;
}

.speech-bubble .btn.speech-cancel:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.92);
}

.speech-bubble .btn.speech-cancel:active:not(:disabled) {
  transform: scale(0.97);
}

.speech-bubble-price {
  display: block;
  width: 100%;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  color: #5a2878;
  white-space: nowrap;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  flex-shrink: 0;
}

.speech-bubble .btn.speech-buy {
  width: 100%;
  min-width: 0;
  padding: 0.36rem 0.4rem;
  font-size: 0.66rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none;
  border-radius: 6px;
  background: linear-gradient(180deg, #00e8ff 0%, #00a8d4 100%);
  color: #041220;
  box-shadow: 0 2px 10px rgba(0, 180, 220, 0.5);
  cursor: pointer;
}

.speech-bubble .btn.speech-buy:hover:not(:disabled) {
  background: linear-gradient(180deg, #3df0ff 0%, #00bce8 100%);
  box-shadow: 0 3px 14px rgba(0, 200, 240, 0.6);
  filter: brightness(1.05);
}

.speech-bubble .btn.speech-buy:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.speech-bubble .btn.speech-buy.is-confirming {
  background: linear-gradient(180deg, #f060c8 0%, #c04098 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(240, 48, 200, 0.45);
}

.speech-bubble .btn.speech-buy.is-confirming:hover:not(:disabled) {
  background: linear-gradient(180deg, #f878d4 0%, #d050a8 100%);
  filter: brightness(1.05);
}

.speech-bubble .btn.speech-buy:active:not(:disabled) {
  transform: scale(0.97);
}

.btn.shop-buy.is-confirming {
  border-color: rgba(240, 48, 200, 0.55);
  background: rgba(240, 48, 200, 0.22);
  color: #ffd8f4;
  box-shadow: 0 0 12px rgba(240, 48, 200, 0.28);
}

.shop-stage-pager {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  border: none;
}

.shop-stage-pager:empty {
  display: none;
}

.shop-rpg-footer:has(.shop-stage-pager:empty) {
  grid-template-columns: 1fr;
}

.shop-rpg-footer:has(.shop-stage-pager:empty) .shop-search-footer {
  grid-column: 1;
  justify-self: end;
}

.shop-stage-pager-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.25rem;
}

/* —— Full catalog (bottom) —— */
.shop-catalog {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-height: 10rem;
  padding-top: 0.15rem;
  border-top: 1px solid rgba(0, 204, 255, 0.12);
}

.shop-catalog-head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.shop-catalog-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
}

.shop-catalog-hint {
  margin: 0;
  font-size: 0.72rem;
}

.shop-search {
  width: 100%;
  padding: 0.38rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 204, 255, 0.35);
  background: rgba(8, 4, 20, 0.82);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.78rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.shop-search::placeholder {
  color: var(--muted);
}

.shop-search:focus {
  outline: none;
  border-color: rgba(0, 204, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(0, 204, 255, 0.15);
}

.shop-pager {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.shop-page-btn {
  padding: 0.3rem 0.55rem;
  border-radius: 5px;
  border: 1px solid rgba(0, 204, 255, 0.3);
  background: rgba(0, 204, 255, 0.08);
  color: #b8f0ff;
  cursor: pointer;
  font-size: 0.78rem;
  line-height: 1;
}

.shop-page-btn:hover:not(:disabled) {
  background: rgba(0, 204, 255, 0.18);
  border-color: rgba(0, 204, 255, 0.5);
}

.shop-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.shop-page-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  min-width: 3.2rem;
  text-align: center;
}

.shop-list {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  max-height: min(26rem, 55vh);
  overflow-y: auto;
  padding-right: 0.15rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 204, 255, 0.35) transparent;
}

.shop-empty {
  margin: 0.5rem 0;
}

.shop-group-header {
  margin: 0.35rem 0 0.1rem;
  padding: 0.2rem 0.35rem 0;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(0, 204, 255, 0.75);
}

.shop-group-header:first-child {
  margin-top: 0;
}

.shop-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.42rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

@media (hover: hover) {
  .shop-row:hover {
    border-color: rgba(0, 204, 255, 0.38);
    background: rgba(0, 204, 255, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 204, 255, 0.12);
  }
}

.shop-row:focus-visible {
  outline: 2px solid rgba(196, 153, 255, 0.45);
  outline-offset: 2px;
}

.shop-row.is-selected {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(196, 153, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(196, 153, 255, 0.14);
}

.shop-row-thumb {
  width: 2.1rem;
  height: 2.1rem;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.15rem;
}

.shop-row-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.shop-row-name {
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.25;
  word-break: break-word;
}

.shop-row-owned {
  font-size: 0.68rem;
  color: var(--muted);
}

.shop-row-price {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--cyan);
  white-space: nowrap;
}

.shop-row-price::after {
  content: ' coins';
  font-weight: 500;
  font-size: 0.65rem;
  opacity: 0.85;
}

.btn.shop-buy {
  padding: 0.32rem 0.65rem;
  font-size: 0.72rem;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid rgba(0, 204, 255, 0.4);
  background: rgba(0, 204, 255, 0.12);
  color: #b8f0ff;
  white-space: nowrap;
}

.btn.shop-buy:hover:not(:disabled) {
  background: rgba(0, 204, 255, 0.26);
  border-color: rgba(0, 204, 255, 0.65);
  color: #e8fbff;
  box-shadow: 0 0 12px rgba(0, 204, 255, 0.28);
}

.btn.shop-buy:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.shop-buy:active:not(:disabled),
.btn.use-item:active:not(:disabled),
.btn.inv-sell:active:not(:disabled) {
  transform: scale(0.97);
}

@keyframes coin-pulse {
  0% {
    color: var(--cyan);
    text-shadow: none;
  }
  35% {
    color: #fff;
    text-shadow: 0 0 12px rgba(0, 232, 255, 0.85);
  }
  100% {
    color: var(--cyan);
    text-shadow: none;
  }
}

.coin-value.coin-pulse {
  animation: coin-pulse 0.65s ease-out;
}

@media (max-width: 900px) {
  .shop-stage-cluster .speech-bubble {
    width: clamp(9.75rem, 30vw, 14.5rem);
  }
}

/* Mobile: Sylveon on top, two shelf columns below */
@media (max-width: 640px) {
  :root {
    --shop-slot-h: 7.65rem;
    --shop-thumb: 2.85rem;
    --shop-wood-bar: 0.48rem;
    --shop-scene-h: 11.5rem;
    --shop-mascot-x: 28%;
    --shop-bubble-x: 44%;
    --shop-bubble-bottom: 38%;
    --shop-bubble-tail-bottom: 1rem;
    --shop-shelf-max-w: none;
  }

  .shop-rpg {
    padding-top: 0.5rem;
    touch-action: pan-y pinch-zoom;
  }

  .shop-rpg-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    min-height: 0;
    gap: 0.4rem;
    align-items: end;
  }

  .shop-rpg-center {
    grid-column: 1 / -1;
    grid-row: 1;
    height: var(--shop-scene-h);
    min-height: var(--shop-scene-h);
    max-height: var(--shop-scene-h);
  }

  .shop-stage-slots--left {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    height: auto;
  }

  .shop-stage-slots--right {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    height: auto;
  }

  .shop-stage-hero,
  .shop-stage-visual {
    min-height: 0;
    height: 100%;
  }

  .shop-stage-scene {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }

  .shop-stage-cluster {
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  .shop-mascot-wrap {
    height: 86%;
    max-width: 46%;
    bottom: 8%;
  }

  .shop-stage-cluster .speech-bubble {
    width: min(10.5rem, 46vw);
    min-width: 8rem;
  }

  .shop-counter {
    width: clamp(6.25rem, 44%, 9.5rem);
  }

  .shop-stage-slots {
    height: auto;
    align-self: end;
    max-width: none;
    width: 100%;
    min-width: 0;
  }

  .shop-shelf-unit {
    height: auto;
    min-height: 0;
  }

  .shop-shelf-grid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shop-shelf-cell {
    padding: 0.18rem 0.22rem;
    overflow: hidden;
  }

  .shop-shelf-cell:has(.shop-stage-slot:hover),
  .shop-shelf-cell:has(.shop-stage-slot.is-selected) {
    overflow: visible;
    z-index: 2;
  }

  .shop-stage-slot {
    --glow-pads: 4px;
    justify-content: flex-start;
    padding: 0.26rem 0.18rem 0.3rem;
    gap: 0.1rem;
    overflow: hidden;
  }

  .shop-stage-slot:hover,
  .shop-stage-slot.is-selected {
    overflow: visible;
  }

  .shop-stage-slot-thumb {
    width: var(--shop-thumb);
    height: var(--shop-thumb);
    max-width: var(--shop-thumb);
    max-height: var(--shop-thumb);
    padding: 0.08rem;
    flex-shrink: 0;
  }

  .shop-stage-slot-name {
    display: block;
    font-size: 0.68rem;
    line-height: 1.2;
    max-height: 2.4em;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    text-wrap: pretty;
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
  }

  .shop-stage-slot-price {
    font-size: 0.66rem;
    line-height: 1.15;
    flex-shrink: 0;
    margin-top: auto;
  }

  .shop-rpg-footer {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .shop-stage-pager {
    grid-column: 1;
    justify-self: center;
  }

  .shop-search-footer {
    grid-column: 1;
    justify-self: stretch;
    width: 100%;
  }

  .shop-row {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
  }

  .shop-row-price {
    grid-column: 2;
    grid-row: 2;
    font-size: 0.72rem;
  }

  .btn.shop-buy {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
  }
}

@media (max-width: 400px) {
  :root {
    --shop-slot-h: 7.35rem;
    --shop-thumb: 2.65rem;
  }

  .shop-stage-slot-name {
    font-size: 0.64rem;
  }
}

.inventory-item-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
}

.inventory-thumb {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.15rem;
}

body.has-viewer-accent .inventory-thumb {
  background: var(--accent-mist);
  box-shadow: inset 0 0 0 1px var(--accent-border-subtle);
}

.inventory-list {
  margin: 0;
  padding: 0;
  padding-right: 0.15rem;
  list-style: none;
  max-height: min(26rem, 55vh);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 204, 255, 0.35) transparent;
}

.inventory-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.88rem;
  border-radius: 4px;
  transition: background 0.2s ease;
}

body.has-viewer-accent .inventory-list li {
  border-bottom-color: var(--accent-whisper);
}

body.has-viewer-accent .inventory-list li:hover {
  background: var(--accent-mist);
  padding-left: 0.4rem;
  padding-right: 0.4rem;
  margin-left: -0.4rem;
  margin-right: -0.4rem;
}

.inventory-list li:last-child { border-bottom: none; }

.inventory-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn.use-item {
  flex-shrink: 0;
  padding: 0.28rem 0.65rem;
  font-size: 0.76rem;
  border-radius: 4px;
  border: 1px solid rgba(120, 200, 255, 0.3);
  background: rgba(80, 160, 255, 0.08);
  color: #b8e0ff;
  cursor: pointer;
}

body.has-viewer-accent .btn.use-item {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent-text);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 22%, transparent);
}

.inventory-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.btn.inv-sell {
  padding: 0.28rem 0.55rem;
  font-size: 0.76rem;
  border-radius: 4px;
  border: 1px solid rgba(240, 48, 200, 0.35);
  background: rgba(240, 48, 200, 0.1);
  color: #ffc8f0;
  cursor: pointer;
  font-family: var(--font-body);
}

.btn.inv-sell:hover:not(:disabled) {
  filter: brightness(1.12);
}

.btn.inv-sell:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.inventory-item-desc {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.1rem;
  line-height: 1.35;
}

body.has-viewer-accent .inventory-item-label {
  color: var(--accent-text);
}

body.has-viewer-accent .inventory-item-desc {
  color: var(--accent-text-muted);
}

.btn.use-item:hover:not(:disabled) {
  filter: brightness(1.12);
}

.btn.use-item:disabled {
  opacity: 0.55;
  cursor: wait;
}

.status {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
  border: 1px solid var(--border);
}

.status.warn { background: rgba(245, 165, 36, 0.12); color: #ffd89a; }
.status.err { background: rgba(255, 107, 107, 0.12); color: #ffb3b3; }

.meta {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

body.has-viewer-accent .meta {
  color: color-mix(in srgb, var(--accent) 35%, var(--muted));
}

body.has-viewer-accent .btn.ghost:hover {
  border-color: var(--accent-border-subtle);
  color: var(--accent-bright);
  background: var(--accent-whisper);
}

.inventory-empty-state {
  margin: 0.5rem 0;
  padding: 0.85rem 0.75rem;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

body.has-viewer-accent .inventory-empty-state {
  border-color: var(--accent-border-subtle);
  color: var(--accent-text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .shop-mascot-wrap--bob {
    animation: none !important;
  }

  .coin-value.coin-pulse {
    animation: none !important;
  }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-header {
    grid-template-columns: auto 1fr;
  }
  .coin-block { grid-column: 1 / -1; }
  .coin-block { text-align: left; display: flex; justify-content: space-between; align-items: center; }
  .coin-label { display: inline; margin-right: 0.5rem; }
}
