/* THE GIFT SHOP — sells nothing. the prices don't know that. */

@property --price {
  syntax: '<integer>';
  inherits: false;
  initial-value: 0;
}

:root {
  --shop-bg: #16121c;
  --shop-ink: #ece4f2;
  --shop-accent: #ffe62f;
}

body.shop {
  background: var(--shop-bg);
  color: var(--shop-ink);
  min-height: 100vh;
  padding: 4rem 1.5rem 10rem;
}

.shop-header {
  text-align: center;
  margin-bottom: 3rem;
}
.shop-header h1 {
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.8rem;
  color: var(--shop-accent);
}
.shop-header p {
  max-width: 40ch;
  margin: 0.75rem auto 0;
  font-size: 0.8rem;
  opacity: 0.8;
}

.shelf {
  display: grid;
  /* capped max instead of 1fr — same fix as the gallery grids, so a
     row with fewer items doesn't stretch each card wide to fill it */
  grid-template-columns: repeat(auto-fill, minmax(220px, 250px));
  justify-content: center;
  gap: 2rem;
  max-width: 960px;
  margin: 0 auto;
}

.item {
  background: #1f1a29;
  border: 1px solid #352c44;
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  position: relative;
  cursor: pointer;
}

/* click to "buy" — the shop has other ideas */
.item.item-denied {
  animation: denied-shake 0.4s ease-out;
}
.item.item-denied::after {
  content: 'NOT FOR SALE';
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Courier New", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #ff5555;
  background: rgba(10, 5, 15, 0.9);
  padding: 0.3rem 0.6rem;
  border: 1px solid #ff5555;
  border-radius: 4px;
  animation: denied-pop 0.9s ease-out forwards;
  pointer-events: none;
}
@keyframes denied-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
@keyframes denied-pop {
  0%   { opacity: 0; transform: translate(-50%, -40%) scale(0.8); }
  15%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}

.item .thing {
  width: 70px;
  height: 70px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--shop-accent), #7a6b1f 70%);
  box-shadow: 0 0 30px rgba(255, 230, 47, 0.3);
}

.item:nth-child(2) .thing {
  background: radial-gradient(circle at 35% 30%, #ff2fd6, #6a0057 70%);
  box-shadow: 0 0 30px rgba(255, 47, 214, 0.3);
  border-radius: 12% 50% 50% 12%;
}
.item:nth-child(3) .thing {
  background: radial-gradient(circle at 35% 30%, #2fe0ff, #005c6a 70%);
  box-shadow: 0 0 30px rgba(47, 224, 255, 0.3);
  border-radius: 0;
  transform: rotate(45deg);
}
.item:nth-child(4) .thing {
  background: radial-gradient(circle at 35% 30%, #6dff2f, #1c5c00 70%);
  box-shadow: 0 0 30px rgba(109, 255, 47, 0.3);
  border-radius: 50% 8% 50% 8%;
}
.item:nth-child(5) .thing {
  background: radial-gradient(circle at 35% 30%, #ff8a2f, #6a2f00 70%);
  box-shadow: 0 0 30px rgba(255, 138, 47, 0.3);
  border-radius: 50%;
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}
.item:nth-child(6) .thing {
  background: repeating-linear-gradient(135deg, #d8d2c0 0 6px, #a8a290 6px 12px);
  box-shadow: 0 0 30px rgba(216, 210, 192, 0.25);
  border-radius: 4px;
}
.item:nth-child(7) .thing {
  background: radial-gradient(circle at 35% 30%, #b23cff, #3a0a5c 70%);
  box-shadow: 0 0 30px rgba(178, 60, 255, 0.3);
  border-radius: 50% 50% 8% 8%;
}

.item .name {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 1rem;
}
.item .desc {
  font-size: 0.7rem;
  opacity: 0.72;
  margin: 0.4rem 0 1rem;
  min-height: 2.4em;
}

/* the price — climbs forever, in pure CSS, via an animated custom property
   feeding a CSS counter. nobody is charging anybody. */
.price {
  font-family: "Courier New", monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--shop-accent);
  counter-reset: price var(--price);
  animation: climb linear infinite;
}
.price::after {
  content: '$' counter(price) '.99';
}

.item:nth-child(1) .price { animation-duration: 34s; --price: 0; }
.item:nth-child(2) .price { animation-duration: 19s; --price: 0; }
.item:nth-child(3) .price { animation-duration: 61s; --price: 0; }
.item:nth-child(4) .price { animation-duration: 9s; --price: 0; }
.item:nth-child(5) .price { animation-duration: 27s; --price: 0; }
.item:nth-child(6) .price { animation-duration: 44s; --price: 0; }
.item:nth-child(7) .price { animation-duration: 16s; --price: 0; }

@keyframes climb {
  from { --price: 0; }
  to { --price: 999999; }
}

.shop .placard.hint {
  max-width: 40ch;
  margin: 3rem auto 0;
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.7;
}

/* the receipt — printed for a purchase that never happened */
.receipt {
  max-width: 260px;
  margin: 3rem auto 0;
  background: #f4f1e8;
  color: #2a2a2a;
  font-family: "Courier New", monospace;
  font-size: 0.7rem;
  line-height: 1.6;
  padding: 1.5rem 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  transform: rotate(-1deg);
}
.receipt .line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.receipt hr {
  border: none;
  border-top: 1px dashed #999;
  margin: 0.6rem 0;
}
.receipt .total .price::after {
  color: inherit;
}
.receipt .total {
  font-weight: 700;
}
