/* Shop (#shop), Inventário (#inventario) e Feed de Pacotes Abertos (#feed). */

.shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  padding: 14px 18px;
  margin-bottom: 18px;
}
.shop-balance-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.shop-bal-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
}
.shop-bal-val {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
  color: var(--gold-strong, var(--text));
}
.shop-bal-val .ic { width: 18px; height: 18px; color: var(--gold, #f0b85c); }
.shop-qty-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* Tradicional em destaque */
.shop-featured {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  gap: 20px 26px;
  align-items: center;
  padding: 24px;
  margin-bottom: 20px;
  background: radial-gradient(80% 70% at 14% 50%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), var(--glass, var(--felt));
}
.shop-feat-art {
  display: grid;
  place-items: center;
}
.shop-pack-hero { --pack-w: 152px; }
.shop-pack-med  { --pack-w: 118px; }
.shop-pack-mini { --pack-w: 66px; }
.shop-pack-thumb,
.shop-pack-hero,
.shop-pack-med,
.shop-pack-mini,
.inv-pack-visual {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--pack-w, 120px);
  flex: none;
}

.shop-work-featured .shop-feat-body { min-width: 0; }
.shop-work-featured .shop-buy-btn { white-space: normal; }
.work-pack-art { aspect-ratio: 640 / 1116; }
.work-pack-art > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.shop-kicker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.shop-owned-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-strong, #ffe29e);
  background: rgba(240, 184, 92, .14);
  border: 1px solid rgba(240, 184, 92, .35);
}
.shop-owned-link .ic { width: 14px; height: 14px; }
.shop-feat-body h2 {
  margin: 0 0 6px;
  font-size: clamp(20px, 2.1vw, 26px);
}
.shop-feat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.shop-buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.shop-buy-btn .coin {
  display: inline-flex;
  align-items: center;
}

.shop-price-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold-strong, #ffe29e);
  background: rgba(240, 184, 92, .12);
  border: 1px solid rgba(240, 184, 92, .3);
  white-space: nowrap;
}
.shop-price-tag .ic { width: 15px; height: 15px; }

/* Grade de seleção por tipo */
.shop-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.shop-pack-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--type, var(--edge)) 34%, var(--edge));
  background: linear-gradient(180deg, color-mix(in srgb, var(--type, var(--accent)) 10%, rgba(10, 13, 24, .75)), rgba(10, 13, 24, .88));
}
.shop-pack-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.shop-owned-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #4ade80;
  background: rgba(74, 222, 128, .14);
  border: 1px solid rgba(74, 222, 128, .35);
}
.shop-pack-visual {
  display: grid;
  place-items: center;
  padding: 8px 0;
  min-height: 180px;
}
.shop-pack-info {
  display: grid;
  gap: 4px;
  flex: 1;
}
.shop-pack-info h3 {
  margin: 0;
  font-size: 16px;
}
.shop-pack-info p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
}
.shop-pack-info small {
  color: var(--muted);
  font-size: 11.5px;
}

/* Seleção de obra na Shop */
.shop-work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.shop-work-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border-radius: 16px;
  border: 1px solid var(--edge, rgba(255, 255, 255, .1));
  background: rgba(255, 255, 255, .03);
}
.shop-work-card.has-stock {
  border-color: rgba(74, 222, 128, .38);
}
.shop-work-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.shop-work-pack-art {
  position: relative;
  display: grid;
  place-items: center;
}
.shop-work-pack-art .shop-owned-pill {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 5;
}
.shop-work-meta {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.shop-work-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.shop-work-meta h4 {
  margin: 0;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Inventário */
.inv-income-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.inv-filters {
  margin-bottom: 16px;
}
.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 16px;
}
.inv-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--pack-accent, var(--accent)) 35%, var(--edge));
  background: radial-gradient(80% 55% at 50% 28%, color-mix(in srgb, var(--pack-accent, var(--accent)) 14%, transparent), transparent 72%), var(--glass, var(--felt));
}
.inv-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.inv-kind-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--soft);
}
.inv-count-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--gold-strong, #ffe29e);
  background: rgba(240, 184, 92, .16);
  border: 1px solid rgba(240, 184, 92, .4);
}
.inv-pack-art {
  display: grid;
  place-items: center;
  min-height: 225px;
  padding: 8px 0;
}
.inv-pack-visual { --pack-w: 132px; }
.inv-card-meta {
  text-align: center;
  display: grid;
  gap: 4px;
  flex: 1;
}
.inv-card-meta h3 {
  margin: 0;
  font-size: 16px;
}
.inv-card-meta p {
  margin: 0;
  font-size: 12.5px;
}
.inv-open-btn {
  width: 100%;
  margin-top: 4px;
}

/* Feed de pacotes abertos */
.feed-pack-list {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}
.feed-pack-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--edge, rgba(255, 255, 255, .1));
  background: rgba(255, 255, 255, .025);
}
.feed-pack-card.is-mine {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--edge));
}
.fp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
}
.fp-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.fp-user:hover .rk-name { text-decoration: underline; }
.fp-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  background: #101324;
  border: 2px solid var(--edge-strong, rgba(255, 255, 255, .25));
  display: grid;
  place-items: center;
}
.fp-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
}
.fp-av-fb {
  font-weight: 800;
  font-size: 16px;
  color: var(--text);
}
.fp-avatar .pres-dot-inline {
  position: absolute;
  bottom: 1px;
  right: 1px;
  box-shadow: 0 0 0 2px #0b0d18;
}
.fp-user-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.fp-user-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.fp-pack-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.fp-pack-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--soft);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
}
.fp-pack-pill .ic { width: 13px; height: 13px; }

.fp-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.fp-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--rarity, var(--edge)) 36%, var(--edge));
  background: linear-gradient(135deg, color-mix(in srgb, var(--rarity, var(--accent)) 10%, rgba(12, 14, 24, .78)), rgba(12, 14, 24, .92));
  align-items: center;
}
.fp-card-art {
  width: 64px;
  aspect-ratio: 3 / 4.2;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--rarity, var(--edge)) 65%, transparent);
  border-radius: 10px;
  overflow: hidden;
  background: #0b0d18;
  cursor: pointer;
}
.fp-card-art .card-visual {
  width: 100%;
  height: 100%;
}
.fp-card-art .cv-label { display: none; }
.fp-card-body {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.fp-card-name {
  text-align: left;
  padding: 0;
  background: none;
  border: 0;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fp-card-name:hover { color: var(--accent-hover, var(--accent)); }
.fp-card-work {
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fp-card-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.fp-card-act {
  margin-top: 3px;
}
.fp-btn {
  padding: 4px 10px;
  font-size: 12px;
}

@media (max-width: 960px) {
  .fp-cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .shop-featured { grid-template-columns: 1fr; text-align: center; }
  .shop-kicker-row, .shop-feat-actions { justify-content: center; }
  .shop-type-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
  .shop-pack-med { --pack-w: 96px; }
  .inv-pack-visual { --pack-w: 110px; }
}

.shop-work-featured {
  background: radial-gradient(80% 70% at 14% 50%, rgba(114, 210, 247, .14), transparent 70%), var(--glass, var(--felt));
}

/* Modal de seleção de obra ao abrir no Inventário */
.work-pick-dialog {
  width: min(820px, calc(100vw - 24px));
  max-height: min(86dvh, 760px);
  padding: 22px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: hidden;
}
.work-pick-dialog:not([open]) { display: none; }
.wpk-head { padding-right: 36px; }
.wpk-head h2 { margin: 4px 0 6px; font-size: clamp(20px, 2.2vw, 24px); }
.wpk-head p { margin: 0; font-size: 13px; line-height: 1.5; }
.wpk-controls { margin: 0; }
.wpk-list {
  overflow-y: auto;
  padding-right: 4px;
  min-height: 180px;
}
.wpk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.wpk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--edge, rgba(255, 255, 255, .1));
  background: rgba(255, 255, 255, .03);
}
.wpk-item.is-wish {
  border-color: rgba(240, 184, 92, .4);
  background: rgba(240, 184, 92, .06);
}
.wpk-item-info {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 4px;
}
.wpk-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.wpk-item-top b {
  font-size: 13.5px;
  line-height: 1.25;
}
.wpk-pick-btn {
  flex: none;
  white-space: nowrap;
}
.wpk-foot {
  margin: 0;
  padding-top: 6px;
  border-top: 1px solid var(--edge, rgba(255, 255, 255, .08));
}
.wpk-empty {
  padding: 20px 8px;
  text-align: center;
}
@media (max-width: 640px) {
  .work-pick-dialog {
    width: calc(100vw - 16px);
    max-height: 90dvh;
    padding: 16px;
  }
  .wpk-grid { grid-template-columns: 1fr; }
  .wpk-item { flex-direction: column; align-items: stretch; }
}


/* Seleção de Obra: a embalagem própria compartilha o movimento vivo da vitrine. */
.work-pack-art {
  isolation: isolate;
  transform-origin: 50% 65%;
  filter: drop-shadow(0 16px 18px #0008);
  animation: shop-work-float 6s ease-in-out infinite;
}
.work-pack-art::before,
.work-pack-art::after { content: ''; position: absolute; pointer-events: none; }
.work-pack-art::before {
  inset: 5% -14%; z-index: -1; border-radius: 50%;
  background: radial-gradient(ellipse, #d9b66f40, #4ee7d52b 42%, transparent 72%);
  filter: blur(12px); animation: shop-work-aura 4.8s ease-in-out infinite;
}
@supports (mask-image: url("")) or (-webkit-mask-image: url("")) {
  .work-pack-art::after {
    inset: 0; z-index: 1;
    background: linear-gradient(110deg, transparent 38%, #fff6 49%, #fff9 50%, transparent 62%) no-repeat;
    background-size: 300% 100%;
    -webkit-mask: var(--pack-art) center / contain no-repeat;
    mask: var(--pack-art) center / contain no-repeat;
    mix-blend-mode: screen; animation: shop-work-sheen 5.6s ease-in-out infinite;
  }
}
@keyframes shop-work-float {
  0%, 100% { transform: translate3d(0, 4px, 0) rotate(-2deg); }
  50% { transform: translate3d(0, -7px, 0) rotate(1deg); }
}
@keyframes shop-work-aura { 0%, 100% { opacity: .55; transform: scale(.96); } 50% { opacity: .95; transform: scale(1.06); } }
@keyframes shop-work-sheen { 0%, 18% { background-position: 135% 0; opacity: 0; } 28%, 62% { opacity: .7; } 78%, 100% { background-position: -35% 0; opacity: 0; } }
:is(html.ambient-paused, html.opening-active) .work-pack-art,
:is(html.ambient-paused, html.opening-active) .work-pack-art::before,
:is(html.ambient-paused, html.opening-active) .work-pack-art::after { animation-play-state: paused; }
.reduce-motion .work-pack-art,
.reduce-motion .work-pack-art::before,
.reduce-motion .work-pack-art::after { animation: none; transform: none; }
.reduce-motion .work-pack-art::after { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .work-pack-art, .work-pack-art::before, .work-pack-art::after { animation: none; transform: none; }
  .work-pack-art::after { opacity: 0; }
}
