.store-avatar-body {
  min-height: 100vh;
  margin: 0;
  color: #eef6ff;
  font-family: "Poppins", sans-serif;
  background:
    radial-gradient(1100px 520px at 78% -12%, rgba(255, 116, 23, 0.17), transparent 62%),
    radial-gradient(760px 420px at 4% 92%, rgba(245, 158, 11, 0.1), transparent 68%),
    #020b1b;
}

.store-avatar-main {
  max-width: 1440px;
  margin: 0 auto;
  padding-top: 18px;
  padding-bottom: 26px;
}

.store-avatar-shell {
  border: 1px solid rgba(77, 120, 178, 0.36);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(5, 18, 42, 0.86), rgba(2, 10, 28, 0.94)),
    #04122a;
  box-shadow: 0 24px 70px rgba(0, 6, 20, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 28px;
}

.store-avatar-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.store-avatar-topbar h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 800;
}

.store-avatar-topbar h1 .material-symbols-outlined {
  color: #ff7a1a;
  font-size: 34px;
}

.store-avatar-topbar h1 span:not(.material-symbols-outlined) {
  color: #f5f8ff;
  font: inherit;
  letter-spacing: 0;
}

.store-avatar-topbar h1 strong {
  color: #ff9b44;
  font: inherit;
}

.store-avatar-topbar p {
  margin: 8px 0 0;
  color: #aebbd2;
  font-size: 16px;
}

.store-view-switch {
  display: inline-flex;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(92, 126, 180, 0.34);
  background: rgba(8, 22, 48, 0.82);
}

.view-switch-btn {
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #aebbd2;
  font-weight: 800;
  padding: 0 15px;
  cursor: pointer;
}

.view-switch-btn.active {
  color: #fff;
  background: #ff7417;
  box-shadow: 0 8px 20px rgba(255, 116, 23, 0.25);
}

.avatar-workshop {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.avatar-preview-card,
.avatar-editor-card,
.store-shop-section,
.inventory-section {
  border: 1px solid rgba(91, 125, 178, 0.42);
  background: linear-gradient(180deg, rgba(8, 24, 53, 0.82), rgba(3, 13, 32, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.rail-btn {
  width: 100%;
  min-height: 96px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 0;
  border-bottom: 1px solid rgba(88, 122, 173, 0.22);
  background: transparent;
  color: #94a5c0;
  font-weight: 700;
  cursor: pointer;
}

.rail-btn .material-symbols-outlined {
  font-size: 30px;
}

.rail-btn.active,
.rail-btn:hover {
  color: #ff8a28;
  background: linear-gradient(180deg, rgba(255, 118, 30, 0.14), rgba(255, 118, 30, 0.04));
  box-shadow: inset 2px 0 0 #ff7417;
}

.store-filter-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.store-filter-row .rail-btn {
  width: auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid rgba(83, 118, 170, 0.44);
  border-radius: 10px;
  background: rgba(15, 32, 66, 0.88);
  box-shadow: none;
}

.store-filter-row .rail-btn .material-symbols-outlined {
  font-size: 20px;
}

.store-filter-row .rail-btn.active,
.store-filter-row .rail-btn:hover {
  color: #ff8a28;
  border-color: rgba(255, 116, 23, 0.8);
  background: rgba(255, 116, 23, 0.12);
  box-shadow: inset 0 -2px 0 #ff7417;
}

.avatar-preview-card {
  border-radius: 18px;
  padding: 14px;
  display: grid;
  grid-template-rows: minmax(360px, 1fr) auto;
  gap: 12px;
}

.avatar-room {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border-radius: 15px;
  background: #061530 url("../assets/store-assets/preview-bg.png") center / cover no-repeat;
}

.avatar-room::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 10, 28, 0.08), rgba(2, 10, 28, 0.18));
  pointer-events: none;
}

.avatar-room canvas {
  display: none;
}

.avatar-platform {
  display: none;
}

.avatar-stack {
  position: absolute;
  inset: auto 0 54px;
  width: min(300px, 82%);
  aspect-ratio: 1;
  margin: 0 auto;
  transform-origin: 50% 66%;
}

.char-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.char-layer[src=""],
.char-layer:not([src]) {
  display: none;
}

.avatar-save-row {
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 10px;
}

.store-primary-btn,
.store-icon-btn,
.store-soft-btn,
.btn-purchase {
  border: 1px solid rgba(255, 126, 32, 0.7);
  border-radius: 10px;
  font-family: inherit;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
}

.store-primary-btn {
  min-height: 44px;
  background: linear-gradient(180deg, #ff8a27, #ff6816);
}

.store-icon-btn {
  background: rgba(16, 34, 67, 0.9);
  color: #ff8a27;
}

.avatar-editor-card {
  border-radius: 18px;
  padding: 14px;
  min-width: 0;
}

.avatar-tabs {
  display: flex;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(83, 118, 170, 0.22);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: #ff7417 rgba(8, 18, 38, 0.95);
  scrollbar-width: thin;
  scroll-behavior: smooth;
}

.avatar-tabs::-webkit-scrollbar {
  height: 8px;
}

.avatar-tabs::-webkit-scrollbar-track {
  background: rgba(8, 18, 38, 0.95);
  border-radius: 999px;
}

.avatar-tabs::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #ff7417, #f59e0b);
  border: 2px solid rgba(8, 18, 38, 0.95);
  border-radius: 999px;
}

.avatar-tab {
  flex: 0 0 auto;
  min-width: 104px;
  max-width: 132px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(14, 32, 67, 0.88);
  color: #aebbd2;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  padding: 0 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar-tab[data-avatar-category="torso-outer"] {
  min-width: 122px;
}

.avatar-tab.active {
  color: #fff;
  border-color: #ff7417;
  box-shadow: inset 0 -2px 0 #ff7417;
}

.avatar-editor-card h2 {
  margin: 18px 0 12px;
  color: #cbd7eb;
  font-size: 19px;
}

.avatar-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 18px;
}

.avatar-option-card,
.store-item,
.inventory-item {
  position: relative;
  border: 1px solid rgba(84, 118, 170, 0.38);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(15, 36, 74, 0.82), rgba(7, 20, 45, 0.92));
  color: #e8f1ff;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.avatar-option-card {
  min-height: 220px;
  padding: 16px 10px 12px;
  display: grid;
  align-content: end;
  justify-items: center;
  gap: 10px;
}

.avatar-option-card:hover,
.avatar-option-card.is-selected,
.store-item:hover,
.inventory-item.is-active {
  transform: translateY(-2px);
  border-color: #ff7a1a;
  box-shadow: 0 14px 32px rgba(0, 5, 18, 0.34);
}

.avatar-option-card.is-selected::after,
.inventory-item.is-active::after {
  content: "check";
  position: absolute;
  right: 8px;
  top: 8px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #ff7a1a;
  color: #fff;
  font-family: "Medu Material Symbols";
  font-size: 17px;
}

.option-preview,
.item-image {
  width: 102px;
  height: 102px;
  display: grid;
  place-items: center;
}

.option-preview img,
.item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.avatar-option-card .option-preview.is-avatar img {
  width: 132px;
  height: 132px;
}

.empty-cosmetic-preview {
  min-height: 70px;
  display: grid;
  place-items: center;
  color: #91a4c0;
  font-weight: 700;
}

.option-title,
.item-name {
  margin: 0;
  color: #eaf2ff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.store-shop-section,
.inventory-section {
  border-radius: 18px;
  margin-top: 10px;
  padding: 18px 20px;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading-row h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  color: #eef6ff;
}

.section-heading-row h2 .material-symbols-outlined {
  color: #ff7a1a;
}

.section-heading-row p {
  margin: 3px 0 0;
  color: #aab8cf;
}

.store-soft-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-color: rgba(83, 118, 170, 0.44);
  background: rgba(15, 32, 66, 0.88);
  padding: 0 16px;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 16px;
}

.store-item {
  min-height: 168px;
  padding: 14px 12px 12px;
  display: grid;
  gap: 6px;
  justify-items: center;
}

.store-item .item-price {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e7eefc;
  font-weight: 800;
}

.store-item .coin-dot {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd75b, #f59e0b);
  color: #6b2c00;
  font-size: 11px;
}

.btn-purchase {
  min-height: 32px;
  width: 100%;
  background: rgba(255, 116, 23, 0.14);
  color: #ff9b44;
}

.btn-purchase:disabled {
  opacity: .62;
  border-color: rgba(88, 122, 173, 0.36);
  color: #aebbd2;
  cursor: default;
}

.store-pagination {
  min-height: 34px;
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.store-page-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(83, 118, 170, 0.44);
  border-radius: 9px;
  background: rgba(15, 32, 66, 0.88);
  color: #aebbd2;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}

.store-page-btn.active,
.store-page-btn:hover {
  border-color: rgba(255, 116, 23, 0.85);
  background: #ff7417;
  color: #fff;
}

.inventory-section {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.inventory-section .section-heading-row {
  margin: 0;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 18px;
}

.inventory-item {
  min-height: 82px;
  padding: 8px;
  display: grid;
  place-items: center;
}

.inventory-item img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.store-empty-state {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(99, 136, 190, 0.36);
  border-radius: 12px;
  color: #9fb0ca;
  background: rgba(9, 23, 50, 0.5);
}

@media (max-width: 1180px) {
  .avatar-workshop {
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 14px;
  }

  .store-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 900px) {
  .store-avatar-shell {
    padding: 16px;
  }

  .store-avatar-topbar,
  .section-heading-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .avatar-workshop {
    grid-template-columns: 1fr;
  }

  .store-filter-row {
    justify-content: flex-start;
  }

  .inventory-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .store-avatar-main {
    padding-left: 10px;
    padding-right: 10px;
  }

  .avatar-room {
    min-height: 320px;
  }

  .avatar-options-grid,
  .store-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .avatar-option-card {
    min-height: 188px;
  }
}
