.shop-page {
  --shop-page-gradient:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.12), transparent 22%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent 18%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.shop-shell {
  max-width: 1240px;
  margin: 28px auto 56px;
  padding: 0 24px;
}

.daily-reward-popup {
  position: fixed;
  left: calc(env(safe-area-inset-left, 0px) + 18px);
  top: calc(var(--headerH, 0px) + 18px);
  z-index: 1100;
  width: min(360px, calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 36px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(14px);
  animation: dailyRewardPopupIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.daily-reward-popup__icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #92400e;
  background: linear-gradient(180deg, rgba(254, 243, 199, 0.98) 0%, rgba(253, 230, 138, 0.92) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.daily-reward-popup__body {
  min-width: 0;
}

.daily-reward-popup__eyebrow {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
}

.daily-reward-popup__title {
  margin: 0;
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: #0f172a;
}

.daily-reward-popup__copy {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #475569;
}

.daily-reward-popup__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.daily-reward-popup__amount,
.daily-reward-popup__streak {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.daily-reward-popup__amount {
  background: #111827;
  color: #ffffff;
}

.daily-reward-popup__streak {
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
}

.daily-reward-popup__track {
  margin-top: 12px;
}

.daily-reward-popup__button {
  grid-column: 1 / -1;
  width: 100%;
}

@keyframes dailyRewardPopupIn {
  from {
    opacity: 0;
    transform: translateY(-10px) translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateX(0);
  }
}

.shop-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  padding: 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(10px);
}

.shop-toolbar-info {
  max-width: 560px;
}

.shop-eyebrow {
  color: #64748b;
}

.shop-toolbar-info h1 {
  color: #0f172a;
}

.shop-toolbar-desc {
  max-width: 48ch;
  color: #475569;
}

.shop-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.shop-stat-pills {
  gap: 8px;
  flex-wrap: wrap;
}

.shop-pill {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.95);
  color: #334155;
}

.shop-currency-icon {
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
}

.shop-currency-icon[hidden] {
  display: none !important;
}

.shop-currency-icon-sm {
  width: 24px;
  height: 24px;
}

.shop-currency-icon-md {
  width: 26px;
  height: 26px;
}

.shop-toolbar-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.shop-primary-btn,
.shop-ghost-btn {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  font: 700 12px/1 Inter, sans-serif;
}

.shop-ghost-btn {
  border-color: rgba(15, 23, 42, 0.12);
}

.shop-tabs-bar {
  margin-top: 16px;
  padding: 0 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  gap: 8px;
}

.shop-tab {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 14px;
  color: #64748b;
  font-weight: 700;
}

.shop-tab.active {
  color: #0f172a;
}

.shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  padding-top: 20px;
  min-width: 0;
}

.shop-main,
.shop-sidebar {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.shop-sidebar {
  position: sticky;
  top: 22px;
}

.shop-section,
.shop-preview-card,
.shop-sidebar-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(10px);
  min-width: 0;
}

.shop-section {
  padding: 20px;
}

.shop-section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 16px;
}

.shop-section-head h2 {
  font-size: 16px;
  color: #0f172a;
}

.shop-section-head span {
  color: #64748b;
}

.shop-items-row {
  gap: 12px;
  max-width: 100%;
  min-width: 0;
  overscroll-behavior-x: contain;
}

.shop-items-row > .shop-item-card {
  flex-basis: 170px;
  min-width: 0;
}

.shop-items-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  min-width: 0;
}

.shop-item-card {
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.04);
}

.shop-item-card.is-owned:not(.is-equipped) {
  background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
  border-color: rgba(168, 85, 247, 0.16);
}

.shop-item-card.is-equipped {
  background: linear-gradient(180deg, #effaf1 0%, #ffffff 100%);
  border-color: rgba(34, 197, 94, 0.18);
}

.shop-item-preview {
  border-color: rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  padding: 12px;
}

.shop-item-title {
  font-size: 14px;
  color: #0f172a;
}

.shop-avatar-stage-card,
.shop-frame-stage,
.shop-effect-stage,
.shop-background-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 134px;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  isolation: isolate;
}

.shop-frame-stage,
.shop-effect-stage {
  background:
    radial-gradient(circle at top, rgba(148, 163, 184, 0.12), transparent 52%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.shop-stage-avatar.mini-avatar {
  position: relative;
  z-index: 2;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

.shop-stage-avatar-lg.mini-avatar {
  width: 88px;
  height: 88px;
  border-radius: 24px;
}

.shop-stage-avatar-sm.mini-avatar {
  width: 58px;
  height: 58px;
  border-radius: 18px;
}

.shop-background-stage > .shop-stage-avatar {
  position: absolute;
  right: 12px;
  bottom: 12px;
}

.shop-frame-stage-media,
.shop-background-stage-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  z-index: 1;
}

.shop-frame-stage-media {
  opacity: 0.96;
}

.shop-background-stage-media {
  opacity: 0.88;
}

.shop-item-meta {
  gap: 8px;
}

.item-pill {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
}

.item-pill.warning {
  background: #fff7ed;
  color: #c2410c;
}

.item-pill.success {
  background: #effaf1;
  color: #15803d;
}

.shop-item-btn {
  min-height: 38px;
  border-radius: 10px;
  font: 700 12px/1 Inter, sans-serif;
}

.shop-preview-card {
  padding: 18px;
}

.shop-preview-label {
  color: #64748b;
}

.shop-preview-banner strong {
  font-size: 16px;
  color: #0f172a;
}

.shop-preview-avatar {
  width: 112px;
  height: 112px;
  position: relative;
  z-index: 2;
}

.shop-preview-avatar-stage {
  position: relative;
  isolation: isolate;
  min-height: 146px;
  min-width: 0;
}

.shop-preview-frame-layer {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 148px;
  height: 148px;
  transform: translate(-50%, -50%);
  object-fit: cover;
  border-radius: 34px;
  z-index: 1;
  pointer-events: none;
}

.shop-preview-meta {
  gap: 10px;
  min-width: 0;
}

.preview-label {
  color: #94a3b8;
}

.shop-preview-meta strong {
  color: #334155;
  overflow-wrap: anywhere;
}

.shop-sidebar-card {
  padding: 16px;
}

.wallet-label,
.wallet-unit,
.wallet-copy {
  color: #64748b;
}

.shop-wallet-divider {
  background: rgba(15, 23, 42, 0.08);
}

.shop-streak-track {
  background: rgba(15, 23, 42, 0.08);
}

.shop-streak-fill {
  background: #111827;
}

.shop-status-line {
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.92);
}

.status-copy {
  color: rgba(255, 255, 255, 0.76);
}

.empty-state {
  min-height: 132px;
  border: 1px dashed rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%);
  color: #64748b;
}

.login-gate {
  margin-top: 8px;
  min-height: 340px;
  display: grid;
  place-items: center;
}

.login-gate-card {
  width: min(100%, 360px);
  border-radius: 18px;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.05);
}

.shop-footnote {
  margin-top: 24px;
  color: #64748b;
}

@media (max-width: 920px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .shop-sidebar {
    order: -1;
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .shop-sidebar-card:first-child,
  .shop-status-line,
  .shop-preview-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .shop-shell {
    padding: 0 16px;
    margin-top: 18px;
  }

  .daily-reward-popup {
    left: calc(env(safe-area-inset-left, 0px) + 12px);
    top: calc(var(--headerH, 0px) + 12px);
    width: calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 24px);
    padding: 14px;
    border-radius: 18px;
  }

  .daily-reward-popup__title {
    font-size: 18px;
  }

  .shop-toolbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
    border-radius: 20px;
  }

  .shop-toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .shop-section {
    padding: 16px;
    border-radius: 18px;
  }

  .shop-tabs-bar {
    padding: 0 6px;
  }

  .shop-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .shop-items-row > .shop-item-card {
    flex-basis: min(160px, 44vw);
  }

  .shop-sidebar {
    grid-template-columns: 1fr;
  }

  .shop-preview-meta {
    grid-template-columns: 1fr;
  }
}
