.shop-body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Harden hidden behavior so non-selected categories never show */
[hidden] {
  display: none !important;
}

.shop-page {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow-y: auto;
}

.shop-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("/assets/shop_background-f82f5064.png");
  background-size: cover;
  background-position: center;
  z-index: -1;
}

.shop-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 30px 60px;
}

.shop-layout {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0;
  min-height: 0;
  width: 100%;
}

.shop-left {
  flex: 0 0 400px;
  min-height: 320px;
  position: relative;
}

.shop-character {
  position: fixed;
  left: 1px;
  bottom: 0;
  width: min(42vw, 560px);
  max-height: calc(100vh - 84px);
  z-index: 2;
  pointer-events: none;
  user-select: none;
}

.shop-rules-btn {
  position: fixed;
  left: 17%;
  top: 270px;
  z-index: 6;
  pointer-events: auto;
  width: 360px;
  height: 108px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform-style: preserve-3d;
  transform: translate(-50%, 0) perspective(1000px) rotateX(0deg);
  transition: transform 1.4s;
}

.shop-addprize-btn {
  top: 145px; /* sits above Shop Rules */
}

.shop-rules-btn:hover {
  transform: translate(-50%, 0) perspective(1000px) rotateX(360deg);
}

.shop-rules-btn:active {
  transform: translate(-50%, 0) perspective(1000px) rotateX(360deg) scale(0.98);
}

.shop-rules-btn:focus-visible {
  outline: 3px solid rgba(240, 230, 210, 0.75);
  outline-offset: 4px;
}

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

.shop-rules-btn-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  overflow: hidden;
  box-sizing: border-box;
  backface-visibility: hidden;
  user-select: none;
}

.shop-rules-btn-face-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: filter 0.25s;
}

.shop-rules-btn:hover .shop-rules-btn-face-img {
  filter: brightness(1.12) saturate(1.08);
}

/* 4 faces of the cube (child 1 is the SR-only span) */
.shop-rules-btn-face:nth-child(2) { transform: rotateX(0deg) translateZ(36px); }
.shop-rules-btn-face:nth-child(3) { transform: rotateX(90deg) translateZ(36px); }
.shop-rules-btn-face:nth-child(4) { transform: rotateX(180deg) translateZ(36px); }
.shop-rules-btn-face:nth-child(5) { transform: rotateX(270deg) translateZ(36px); }

@media (prefers-reduced-motion: reduce) {
  .shop-rules-btn {
    transition: none;
    transform: translate(-50%, 0);
  }
  .shop-rules-btn:hover {
    transform: translate(-50%, 0);
  }
  .shop-rules-btn-face-img {
    transition: none;
  }
}

.shop-dude {
  position: relative;
  width: 100%;
  height: auto;
  display: block;
}

.shop-dialogue {
  position: absolute;
  left: 62%;
  top: 8%;
  width: 210px;
  max-width: 45%;
  height: auto;
}

.shop-right {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
  padding-left: 0;
}

.shop-top-bar {
  position: fixed;
  top: 110px;
  right: 600px;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-top-bar .shop-reorder-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #c4b89a;
  font-size: 0.9rem;
  font-family: 'Georgia', serif;
}

.shop-upgrade-countdown {
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid rgba(232, 220, 200, 0.65);
  background: rgba(20, 16, 12, 0.58);
  color: #f6eee1;
  font-family: 'Georgia', serif;
  font-weight: 800;
  letter-spacing: 0.4px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.7);
  animation: shopUpgradePulse 1.6s ease-in-out infinite;
}

.shop-upgrade-countdown span {
  font-variant-numeric: tabular-nums;
}

@keyframes shopUpgradePulse {
  0%, 100% {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    border-color: rgba(232, 220, 200, 0.65);
    transform: translateY(0);
  }
  50% {
    box-shadow:
      0 12px 28px rgba(0, 0, 0, 0.45),
      0 0 26px rgba(212, 160, 23, 0.22);
    border-color: rgba(255, 226, 187, 0.85);
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .shop-upgrade-countdown {
    animation: none;
  }
}

/* Category picker + category view */
.shop-category-selector {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  /* Prevent the first row (with pinned item) from stretching differently than other rows */
  align-items: start;
  max-width: 980px;
  margin-top: 110px;
}

.shop-category-selector .shop-card--pinned {
  width: 100%;
}

.shop-category-selector .shop-card--pinned .shop-card-inner {
  height: auto;
  aspect-ratio: 1 / 1;
  min-height: 210px;
}

.shop-category-tile {
  border: 2px solid rgba(232, 220, 200, 0.65);
  border-radius: 12px;
  background-color: rgba(20, 16, 12, 0.55);
  background-image:
    linear-gradient(rgba(20, 16, 12, 0.55), rgba(20, 16, 12, 0.55)),
    url("/assets/faq_bkg-218e4407.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #f6eee1;
  font-family: 'Georgia', serif;
  font-weight: 800;
  font-size: 2.05rem;
  letter-spacing: 0.6px;
  padding: 24px 18px;
  cursor: pointer;
  text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.7);
  box-shadow:
    inset 0 18px 36px rgba(0, 0, 0, 0.22),
    0 10px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
  aspect-ratio: 1 / 1;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Category tile with image: title at top, larger image */
.shop-category-tile:has(.shop-tile-logo) {
  justify-content: flex-start;
  padding-top: 14px;
}

.shop-category-tile:has(.shop-tile-logo) .shop-tile-title {
  margin-bottom: 12px;
  flex-shrink: 0;
}

.shop-category-tile:has(.shop-tile-logo) .shop-tile-logo {
  width: 140px;
  height: 140px;
  flex: 1;
  min-height: 0;
  object-fit: contain;
}

.shop-category-tile:hover {
  transform: translateY(-3px);
  background-image:
    linear-gradient(rgba(20, 16, 12, 0.18), rgba(20, 16, 12, 0.18)),
    url("/assets/faq_bkg-218e4407.jpg");
  border-color: rgba(255, 226, 187, 0.85);
  box-shadow:
    inset 0 18px 36px rgba(0, 0, 0, 0.26),
    0 14px 34px rgba(0, 0, 0, 0.45),
    0 0 0 10px rgba(255, 226, 187, 0.12);
  filter: brightness(1.08) saturate(1.05);
}

.shop-category-tile:active {
  transform: translateY(-1px);
}

.shop-category-view {
  width: 100%;
  max-width: 980px;
  margin-top: 110px;
}

.shop-category-view-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 10px;
}

.shop-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.shop-breadcrumb-seg {
  border: 1px solid rgba(240, 230, 210, 0.28);
  border-radius: 999px;
  background: rgba(20, 16, 12, 0.45);
  color: #f0e6d2;
  font-family: 'Georgia', serif;
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: 0.4px;
  padding: 6px 14px;
  text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.7);
  cursor: pointer;
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-breadcrumb-seg:hover {
  background: rgba(20, 16, 12, 0.65);
}

.shop-breadcrumb-sep {
  color: rgba(240, 230, 210, 0.85);
  font-family: 'Georgia', serif;
  font-weight: 900;
  font-size: 1.35rem;
  text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.7);
}

.shop-breadcrumb-current {
  border: 1px solid rgba(240, 230, 210, 0.22);
  border-radius: 999px;
  background: rgba(20, 16, 12, 0.35);
  color: rgba(240, 230, 210, 0.95);
  font-family: 'Georgia', serif;
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 0.35px;
  padding: 6px 14px;
  text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.7);
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-category-back {
  border: 1px solid rgba(240, 230, 210, 0.35);
  border-radius: 999px;
  background: rgba(20, 16, 12, 0.45);
  color: rgba(240, 230, 210, 0.95);
  font-family: 'Georgia', serif;
  font-weight: 800;
  padding: 8px 12px;
  cursor: pointer;
  text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.65);
}

.shop-category-back:hover {
  background: rgba(20, 16, 12, 0.65);
}

/* Grant type (2nd layer) */
.shop-grant-selector {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
  max-width: 980px;
}

.shop-grant-tile {
  border: 2px solid rgba(232, 220, 200, 0.55);
  border-radius: 12px;
  background-color: rgba(20, 16, 12, 0.45);
  background-image:
    linear-gradient(rgba(20, 16, 12, 0.5), rgba(20, 16, 12, 0.5)),
    url("/assets/faq_bkg-218e4407.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #f6eee1;
  font-family: 'Georgia', serif;
  font-weight: 800;
  font-size: 1.85rem;
  letter-spacing: 0.4px;
  padding: 22px 18px;
  cursor: pointer;
  text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.7);
  box-shadow:
    inset 0 18px 36px rgba(0, 0, 0, 0.18),
    0 10px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
  aspect-ratio: 1 / 1;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Grant tile with image: title at top, larger image */
.shop-grant-tile:has(.shop-tile-logo) {
  justify-content: flex-start;
  padding-top: 12px;
}

.shop-grant-tile:has(.shop-tile-logo) .shop-tile-title {
  margin-bottom: 10px;
  flex-shrink: 0;
}

.shop-grant-tile:has(.shop-tile-logo) .shop-tile-logo {
  width: 140px;
  height: 140px;
  flex: 1;
  min-height: 0;
  object-fit: contain;
}

.shop-tile-title {
  display: block;
  line-height: 1.12;
  margin-bottom: 10px;
}

.shop-tile-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  opacity: 0.96;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55)) saturate(1.04);
}

.shop-category-tile:hover .shop-tile-logo,
.shop-grant-tile:hover .shop-tile-logo {
  opacity: 1;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.65)) saturate(1.12);
}

.shop-grant-tile:hover {
  transform: translateY(-3px);
  background-image:
    linear-gradient(rgba(20, 16, 12, 0.16), rgba(20, 16, 12, 0.16)),
    url("/assets/faq_bkg-218e4407.jpg");
  border-color: rgba(255, 226, 187, 0.8);
  box-shadow:
    inset 0 18px 36px rgba(0, 0, 0, 0.22),
    0 14px 34px rgba(0, 0, 0, 0.4),
    0 0 0 10px rgba(255, 226, 187, 0.10);
  filter: brightness(1.08) saturate(1.05);
}

.shop-grant-tile:active {
  transform: translateY(-1px);
}

.shop-grant-view {
  width: 100%;
  max-width: 980px;
}

.shop-grant-view-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 10px;
}

.shop-grant-back {
  border: 1px solid rgba(240, 230, 210, 0.35);
  border-radius: 999px;
  background: rgba(20, 16, 12, 0.45);
  color: rgba(240, 230, 210, 0.95);
  font-family: 'Georgia', serif;
  font-weight: 800;
  padding: 8px 12px;
  cursor: pointer;
  text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.65);
}

.shop-grant-back:hover {
  background: rgba(20, 16, 12, 0.65);
}

.shop-grant-view-title {
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(20, 16, 12, 0.45);
  border: 1px solid rgba(240, 230, 210, 0.28);
  color: #f0e6d2;
  font-family: 'Georgia', serif;
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: 0.35px;
  text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.7);
}

.shop-category-empty {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(20, 16, 12, 0.35);
  border: 1px dashed rgba(240, 230, 210, 0.3);
  color: rgba(240, 230, 210, 0.9);
  font-family: 'Georgia', serif;
  font-size: 1.05rem;
  text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.55);
}

/* Transparent draggable box: move all cards together */
.shop-cards-pan {
  cursor: grab;
  padding: 16px;
  margin: -16px -16px -16px 0;
  border-radius: 12px;
  display: inline-block;
  user-select: none;
  touch-action: none;
  position: relative;
  top: 40px;
}

.shop-cards-pan:active {
  cursor: grabbing;
}

.shop-cards-pan--grabbing {
  cursor: grabbing;
}

.shop-cards-pan .shop-grid {
  pointer-events: auto;
}

/* Used on shop lock page only */
.shop-title {
  font-family: 'Georgia', serif;
  font-size: 2.6rem;
  color: #f0e6d2;
  text-shadow: 2px 3px 6px rgba(0, 0, 0, 0.7);
  text-align: center;
  margin: 0 0 4px;
}

.shop-subtitle {
  font-family: 'Georgia', serif;
  font-size: 1.05rem;
  color: #c4b89a;
  text-align: center;
  margin: 0 0 32px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* 5x2 grid: 5 columns, 2 rows (10 slots); items cycle when fewer than 10 exist */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(5, 200px);
  grid-template-rows: repeat(2, auto);
  gap: 24px;
  justify-items: center;
}

.shop-card {
  width: 200px;
  perspective: 600px;
}

.shop-card--dragging {
  opacity: 0.6;
  cursor: grabbing;
}

.shop-card-inner {
  background: rgba(240, 230, 210, 0.92);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    inset 0 0 0 4px rgba(92, 64, 51, 0.15),
    inset 0 0 0 8px rgba(92, 64, 51, 0.08),
    2px 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: default;
  position: relative;
  height: 320px;
}

.shop-card-inner::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1.5px solid rgba(92, 64, 51, 0.25);
  border-radius: 5px;
  pointer-events: none;
  z-index: 1;
}

.shop-card-inner > * {
  position: relative;
  z-index: 2;
}

.shop-card:hover .shop-card-inner {
  transform: translateY(-6px);
  box-shadow:
    inset 0 0 0 4px rgba(92, 64, 51, 0.15),
    inset 0 0 0 8px rgba(92, 64, 51, 0.08),
    2px 8px 20px rgba(0, 0, 0, 0.55);
}

.shop-card--pinned .shop-card-inner {
  background: transparent;
  box-shadow: none;
  animation: pinnedGlow 2.2s ease-in-out infinite;
  overflow: visible;
}

.shop-card--pinned .shop-card-inner::before {
  display: none;
}

.shop-card--pinned:hover .shop-card-inner {
  transform: none;
  box-shadow: none;
}

.shop-card--pinned .shop-buy-btn {
  animation: pinnedButtonGlow 2.2s ease-in-out infinite;
}

.shop-card--pinned {
  overflow: visible;
}

.shop-card--pinned .shop-card-image {
  transform: scale(1.04);
  transform-origin: center;
}

.shop-card--pinned .shop-price-badge {
  right: 6px;
  bottom: 6px;
  width: 92px;
  height: 92px;
}

.shop-card--pinned .shop-price-badge-amount {
  font-size: 1.25rem;
}

@keyframes pinnedGlow {
  0%, 100% {
    filter: drop-shadow(0 0 0 rgba(212, 160, 23, 0.0)) drop-shadow(0 0 0 rgba(255, 226, 187, 0.0));
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(212, 160, 23, 0.45)) drop-shadow(0 0 26px rgba(255, 226, 187, 0.20));
  }
}

@keyframes pinnedButtonGlow {
  0%, 100% {
    box-shadow: 0 0 0 rgba(212, 160, 23, 0.0);
  }
  50% {
    box-shadow: 0 0 18px rgba(212, 160, 23, 0.55);
  }
}

.shop-card-image {
  width: 100%;
  height: 130px;
  background-color: rgba(92, 64, 51, 0.2);
  background-image: url("/assets/coming_soon-21663bff.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 10px 10px 0 0;
  flex-shrink: 0;
}

.shop-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 10px 10px 0 0;
}

.shop-card-image-default {
  background-color: rgba(92, 64, 51, 0.2);
  background-image: url("/assets/coming_soon-21663bff.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}


.shop-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 4px;
  min-height: 0;
}

.shop-card-name {
  font-family: 'Georgia', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #6b2c2c;
  margin: 0 0 6px;
  line-height: 1.25;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  min-height: 2.5em;
}

.shop-card-desc {
  font-family: 'Georgia', serif;
  font-size: 0.75rem;
  color: #5c4033;
  margin: 0 0 8px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}


.shop-card-price {
  margin-top: auto;
}

.shop-limit-warning {
  position: absolute;
  right: 22px;
  bottom: 70px;
  z-index: 5; /* above the price chip */
  text-align: center;
  font-family: 'Georgia', serif;
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(255, 245, 245, 0.98);
  background: rgba(185, 30, 30, 0.92);
  border: 2px solid rgba(255, 210, 210, 0.55);
  border-radius: 999px;
  padding: 7px 12px;
  width: 132px;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.35),
    0 0 0 6px rgba(255, 60, 60, 0.12),
    0 0 22px rgba(255, 60, 60, 0.55);
  transform: rotate(-10deg);
  pointer-events: none;
}

.shop-price-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.shop-chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.shop-chip-avatar-lg {
  width: 36px;
  height: 36px;
}

.shop-chip-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.shop-chip-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(139, 105, 20, 0.85);
  box-shadow:
    0 0 0 2px rgba(30, 20, 9, 0.35),
    0 6px 14px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.shop-price-amount {
  font-family: 'Georgia', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #8b6914;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.shop-price-amount-lg {
  font-size: 1.5rem;
  color: #d4a017;
}

.shop-price-chip-lg {
  gap: 10px;
}


.shop-card-actions {
  padding: 16px 14px 100px;
  margin-top: 4px;
  display: flex;
  justify-content: center;
  gap: 12px;
  position: relative;
  z-index: 6;
}

.shop-price-badge {
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 120px;
  height: 120px;
  z-index: 3;
  pointer-events: none;
  user-select: none;
}

.shop-price-badge-img {
  width: 100%;
  height: 100%;
  display: block;
}

.shop-price-badge-amount {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Georgia', serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: #2b1a10;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.shop-card-actions .shop-buy-btn {
  border: none;
  padding: 8px 18px;
  border-radius: 9999px;
  font-family: 'Georgia', serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
}

.shop-card-actions .shop-buy-btn {
  background: #7a2e2e;
  color: #e9dbc0;
}

.shop-card-actions .shop-buy-btn:hover {
  opacity: 0.9;
  transform: scale(1.03);
}

.shop-card-actions .shop-buy-btn:active {
  transform: scale(0.97);
}

.shop-card-actions .shop-buy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.shop-buy-btn {
  background: linear-gradient(135deg, #d4a017 0%, #8b6914 100%);
  color: #fff;
  border: none;
  padding: 8px 28px;
  border-radius: 6px;
  font-family: 'Georgia', serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.shop-buy-btn:hover {
  opacity: 0.88;
  transform: scale(1.03);
}

.shop-buy-btn:active {
  transform: scale(0.97);
}

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


.shop-empty {
  text-align: center;
  padding: 60px 20px;
  color: #c4b89a;
  font-family: 'Georgia', serif;
  font-size: 1.2rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Deck-style modal (reused for Shop item popup) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-overlay#shopItemModal {
  align-items: center;
  padding: 24px 0;
  box-sizing: border-box;
}

.modal-content {
  background: #e2d9bd;
  padding: 0;
  border-radius: 12px;
  width: 92%;
  max-width: 960px;
  max-height: 88vh;
  min-height: 520px;
  aspect-ratio: 16 / 10;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  color: #1e1e1e;
  position: relative;
  isolation: isolate;
  font-family: 'Georgia', serif;
  overflow: hidden;
}

.shop-item-modal-content {
  max-width: 560px;
  min-height: 0;
  aspect-ratio: auto;
  height: calc(100vh - 200px);
  max-height: calc(100vh - 200px);
}

.shop-rules-modal-content {
  max-width: 640px;
  min-height: 0;
  aspect-ratio: auto;
  height: auto;
  max-height: 80vh;
}

.shop-rules-modal-body {
  padding: 1.25rem 2rem 1.75rem;
  overflow: auto;
}

.shop-rules-intro {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(139, 37, 0, 0.08);
  color: #8b2500;
  font-size: 1.02rem;
  line-height: 1.45;
  font-style: italic;
  font-weight: 600;
}

.shop-rules-list {
  margin: 0;
  list-style: none;
  padding-left: 0;
  color: #2c3c3a;
  font-size: 1.05rem;
  line-height: 1.55;
}

.shop-rules-list li {
  margin: 0;
  position: relative;
  padding-left: 1.35rem;
}

/* More breathing room between bullet points (dots) */
.shop-rules-list li + li {
  margin-top: 14px;
}

.shop-rules-list li::before {
  content: "♣";
  position: absolute;
  left: 0;
  top: 0.05em;
  color: rgba(139, 37, 0, 0.95);
}

.shop-item-modal-content .modal-header {
  padding: 1rem 1.5rem;
}

.modal-content::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 200%;
  height: 200%;
  margin-left: -100%;
  margin-top: -100%;
  background: url("/assets/proj_cardCropped-638e34ea.png") center center no-repeat;
  background-size: 100% 100%;
  transform: rotate(90deg);
  z-index: 0;
  opacity: 0.16;
  pointer-events: none;
}

.modal-content > * {
  position: relative;
  z-index: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #2c3c3a;
  padding: 1.5rem 2rem;
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.85rem;
  margin: 0;
  color: #8b2500;
}

.modal-close {
  background: none;
  border: none;
  color: #1e1e1e;
  font-size: 1.5rem;
  cursor: pointer;
}

.project-cancel-btn,
.project-save-btn {
  border-radius: 6px;
  cursor: pointer;
  padding: 9px 14px;
  font-family: 'Georgia', serif;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.project-cancel-btn {
  background: #1e1e1e;
  color: #eae1c8;
  border: 1px solid #2c3c3a;
}

.project-save-btn {
  background: #2c3c3a;
  color: #eae1c8;
  border: 1px solid #212c2a;
}

.project-cancel-btn:hover,
.project-save-btn:hover {
  filter: brightness(1.1);
}

.shop-item-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 32px 26px;
  overflow: hidden;
  min-height: 0;
  flex: 1;
}

.shop-item-hero {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.shop-item-modal-scroll {
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 10px;
  flex: 1;
}

.shop-item-hero-frame {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(240, 230, 210, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.shop-item-hero-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.shop-item-modal-desc {
  margin: 0;
  font-size: 1.05rem;
  color: #2b1a10;
  max-width: 60ch;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}

.shop-item-modal-bottom {
  flex-shrink: 0;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-item-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-item-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shop-item-form-row--shipping {
  justify-content: flex-start;
  gap: 8px;
  align-items: flex-start;
}

.shop-item-form-row--shipping .shop-item-label {
  flex: 0 0 auto;
}

.shop-item-form-row--shipping .shop-item-shipping {
  margin-left: 0;
  margin-top: 6px;
}

.shop-item-label--stacked {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.shop-item-label-sub {
  font-size: 1.05rem;
  color: rgba(60, 40, 30, 0.65);
  font-style: italic;
  margin-top: 2px;
}

.shop-item-label {
  font-size: 1.45rem;
  font-style: italic;
  color: #3b2a1e;
}

.shop-item-label--qty {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
}

.shop-item-limit {
  font-size: 0.95rem;
  font-style: normal;
  color: rgba(60, 40, 30, 0.62);
  white-space: nowrap;
}

.shop-item-input {
  width: 120px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(60, 40, 30, 0.35);
  background: rgba(255, 255, 255, 0.6);
  font-family: 'Georgia', serif;
  font-size: 1rem;
}

.shop-item-divider {
  height: 1px;
  background: rgba(60, 40, 30, 0.18);
  margin: 6px 0;
}

.shop-item-shipping {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.shop-item-currency {
  font-weight: 700;
  color: rgba(60, 40, 30, 0.65);
}

.shop-item-input--shipping {
  width: 110px;
}

.shop-item-hint {
  color: rgba(60, 40, 30, 0.6);
  font-style: italic;
}

.shop-item-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.shop-item-price-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(220, 197, 150, 0.55);
  border: 1px solid rgba(60, 40, 30, 0.18);
  padding: 10px 18px;
  border-radius: 14px;
}

.shop-item-price-amount {
  font-size: 1.3rem;
  font-weight: 700;
  color: #2b1a10;
}

.shop-item-price-chip {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.shop-item-error {
  padding: 14px 18px;
  border-radius: 10px;
  background: rgba(255, 230, 235, 0.7);
  border: 1px solid rgba(170, 70, 90, 0.35);
  color: #6b2c2c;
  font-size: 1.2rem;
  font-style: italic;
}

.shop-item-purchase-btn {
  width: 100%;
  background: rgba(220, 197, 150, 0.75);
  border: 1px solid rgba(60, 40, 30, 0.18);
  color: rgba(40, 30, 20, 0.55);
  padding: 14px 18px;
  border-radius: 10px;
  font-family: 'Georgia', serif;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

.shop-item-purchase-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.shop-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s, visibility 0.3s;
}

.shop-modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.shop-modal {
  background: #1e1409;
  border: 2px solid #8b6914;
  border-radius: 14px;
  padding: 0;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
  font-family: 'Georgia', serif;
  color: #f0e6d2;
  overflow: hidden;
}

.shop-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(139, 105, 20, 0.4);
}

.shop-modal-title {
  font-size: 1.3rem;
  color: #d4a017;
  margin: 0;
}

.shop-modal-close {
  background: none;
  border: none;
  color: #f0e6d2;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.shop-modal-body {
  padding: 24px;
  text-align: center;
}

.shop-modal-body p {
  margin: 0 0 16px;
  font-size: 1rem;
  line-height: 1.5;
}

.shop-modal-cost {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

.shop-modal-balance {
  font-size: 0.9rem;
  color: #c4b89a;
}

.shop-modal-actions {
  padding: 16px 24px 24px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.shop-modal-cancel {
  background: none;
  border: 2px solid rgba(139, 105, 20, 0.5);
  color: #c4b89a;
  padding: 10px 24px;
  border-radius: 6px;
  font-family: 'Georgia', serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.shop-modal-cancel:hover {
  background: rgba(139, 105, 20, 0.15);
  border-color: #d4a017;
  color: #f0e6d2;
}

.shop-buy-confirm {
  padding: 10px 24px;
  font-size: 0.95rem;
}

@media (max-width: 600px) {
  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .shop-card {
    width: 100%;
  }

  .shop-card-inner {
    height: 280px;
  }

  .shop-card-image {
    height: 100px;
  }
}

.purchase-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  pointer-events: none;
}

.purchase-notification[aria-hidden="false"] {
  pointer-events: auto;
}

.purchase-notification-content {
  background: #2d3748;
  color: #f7fafc;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease;
}

.purchase-notification.show .purchase-notification-content {
  opacity: 1;
  transform: translateX(0);
}

.purchase-notification-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: #48bb78;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
}

.purchase-notification-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.purchase-notification-title {
  font-size: 14px;
  font-weight: 600;
  color: #f7fafc;
}

.purchase-notification-message {
  font-size: 13px;
  color: #cbd5e0;
}


@media (max-width: 768px) {
  .shop-title {
    font-size: 2rem;
  }

  .shop-layout {
    flex-direction: column;
    align-items: center;
  }

  .shop-left {
    display: none;
  }

  .shop-grid {
    grid-template-columns: repeat(2, 200px);
  }

  .shop-category-selector {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin-top: 30px;
  }

  .shop-category-tile {
    min-height: 160px;
    font-size: 1.8rem;
  }

  .shop-grant-selector {
    grid-template-columns: 1fr;
    max-width: 520px;
  }

  .shop-grant-tile {
    min-height: 160px;
    font-size: 1.65rem;
  }

  .shop-category-view {
    margin-top: 30px;
  }

  .shop-character {
    left: 0;
    width: 300px;
    max-width: 70vw;
    z-index: 1;
  }
}