/* ======= SPAWNABLE ITEMS ======= */
.spawn-item {
  position: absolute;
  z-index: 15;
  pointer-events: none;
  animation: itemAppear 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes itemAppear {
  from { transform: scale(0) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.spawn-item.disappear {
  animation: itemDisappear 0.3s ease-in forwards;
}
@keyframes itemDisappear {
  from { transform: scale(1); opacity: 1; }
  to   { transform: scale(0) translateY(-20px); opacity: 0; }
}

/* Float animation for all items */
.spawn-item { animation: itemFloat 2s ease-in-out infinite; }
@keyframes itemFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* Click-spawned item: pops up from floor */
@keyframes itemClickDrop {
  0%   { transform: scale(0) translateY(30px) rotate(-15deg); opacity: 0; }
  55%  { transform: scale(1.25) translateY(-12px) rotate(6deg); opacity: 1; }
  80%  { transform: scale(0.92) translateY(4px) rotate(-2deg); opacity: 1; }
  100% { transform: scale(1) translateY(0) rotate(0deg); opacity: 1; }
}

/* ===== BOOK ITEM ===== */
.item-book {
  width: 30px; height: 38px;
  position: relative;
}
.item-book-cover {
  width: 100%; height: 100%;
  background: #e74c3c;
  border-radius: 2px 5px 5px 2px;
  position: relative;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.3);
}
.item-book-spine {
  position: absolute;
  top: 0; left: 0;
  width: 5px; height: 100%;
  background: #c0392b;
  border-radius: 2px 0 0 2px;
}
.item-book-pages {
  position: absolute;
  top: 2px; right: -2px;
  width: 4px; height: calc(100% - 4px);
  background: repeating-linear-gradient(
    180deg, #f5f5f5 0px, #f5f5f5 2px, #ddd 2px, #ddd 3px
  );
  border-radius: 0 2px 2px 0;
}
.item-book-title {
  position: absolute;
  top: 8px; left: 8px; right: 4px;
  height: 3px; background: rgba(255,255,255,0.5); border-radius: 2px;
}
.item-book-title::after {
  content: '';
  position: absolute;
  top: 6px; left: 0; right: 8px;
  height: 2px; background: rgba(255,255,255,0.3); border-radius: 2px;
}

/* ===== BURGER ITEM ===== */
.item-burger {
  width: 40px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.burger-bun-top {
  width: 38px; height: 14px;
  background: #d4842c;
  border-radius: 50% 50% 30% 30%;
  position: relative;
}
.burger-bun-top::before {
  content: '';
  position: absolute;
  top: 2px; left: 50%;
  transform: translateX(-50%);
  width: 6px; height: 6px;
  background: #e8a040;
  border-radius: 50%;
  box-shadow: -10px 0 0 #e8a040, 10px 0 0 #e8a040;
}
.burger-lettuce {
  width: 42px; height: 8px;
  background: #5ac040;
  border-radius: 30% 30% 0 0;
  clip-path: polygon(0 50%,5% 0,10% 50%,15% 0,20% 50%,25% 0,30% 50%,35% 0,40% 50%,45% 0,50% 50%,55% 0,60% 50%,65% 0,70% 50%,75% 0,80% 50%,85% 0,90% 50%,95% 0,100% 50%,100% 100%,0 100%);
}
.burger-patty {
  width: 38px; height: 10px;
  background: #7a3820;
  border-radius: 5px;
}
.burger-cheese {
  width: 40px; height: 6px;
  background: #f5c842;
  border-radius: 2px;
  clip-path: polygon(0 0,100% 0,95% 100%,5% 100%);
}
.burger-bun-bottom {
  width: 38px; height: 10px;
  background: #c87820;
  border-radius: 30% 30% 50% 50%;
}

/* ===== BED ITEM ===== */
.item-bed {
  width: 60px;
  position: relative;
}
.bed-frame {
  width: 60px; height: 28px;
  background: #8b6914;
  border-radius: 4px;
  position: relative;
}
.bed-mattress {
  position: absolute;
  top: 3px; left: 4px; right: 4px;
  height: 18px;
  background: #e8ddd0;
  border-radius: 3px;
}
.bed-pillow {
  position: absolute;
  top: -6px; left: 5px;
  width: 20px; height: 12px;
  background: #f0e8e0;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.bed-blanket {
  position: absolute;
  top: 3px; right: 4px;
  width: 28px; height: 18px;
  background: #4a90d9;
  border-radius: 3px;
}
.bed-headboard {
  position: absolute;
  top: -12px; left: 0; right: 0;
  height: 14px;
  background: #7a5c10;
  border-radius: 4px 4px 0 0;
}
.bed-leg {
  position: absolute;
  bottom: -8px;
  width: 6px; height: 8px;
  background: #6a4c0a;
  border-radius: 0 0 2px 2px;
}
.bed-leg.left  { left: 4px; }
.bed-leg.right { right: 4px; }

/* ===== COIN ===== */
.item-coin {
  width: 24px; height: 24px;
  background: radial-gradient(circle at 35% 35%, #ffe666, #cc9900);
  border-radius: 50%;
  border: 2px solid #b08800;
  box-shadow: 0 0 10px rgba(255,215,0,0.6), inset 0 -2px 4px rgba(0,0,0,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: bold; color: #8a6000;
  animation: coinSpin 1s linear infinite, itemFloat 2s ease-in-out infinite;
}
@keyframes coinSpin {
  0%,100% { transform: scaleX(1); }
  25%      { transform: scaleX(0.1); }
  50%      { transform: scaleX(1); }
  75%      { transform: scaleX(0.1); }
}
.item-coin::before { content: '₿'; }

/* ===== GOLD BAR ===== */
.item-gold {
  width: 36px; height: 20px;
  background: linear-gradient(135deg, #ffe566 0%, #cc8800 40%, #ffdd44 60%, #bb7700 100%);
  border-radius: 4px;
  clip-path: polygon(8% 0,92% 0,100% 100%,0 100%);
  box-shadow: 0 0 12px rgba(255,200,0,0.7);
  position: relative;
  animation: goldGlow 1.5s ease-in-out infinite alternate, itemFloat 2s ease-in-out infinite;
}
@keyframes goldGlow {
  from { box-shadow: 0 0 8px rgba(255,200,0,0.5); }
  to   { box-shadow: 0 0 20px rgba(255,200,0,0.9), 0 0 40px rgba(255,180,0,0.4); }
}
.item-gold::before {
  content: 'GOLD';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-size: 7px; font-weight: bold; color: #8a5500;
  letter-spacing: 1px;
}

/* ===== GROWTH CHART ===== */
.item-growth {
  width: 44px; height: 34px;
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--green-growth);
  border-radius: 4px;
  padding: 4px;
  box-shadow: 0 0 10px rgba(0,230,118,0.3);
  position: relative;
  animation: itemFloat 2s ease-in-out infinite;
}
.growth-line {
  width: 100%; height: 100%;
  position: relative;
}
.growth-line::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 26'%3E%3Cpolyline points='0,22 6,18 12,14 18,10 24,6 30,3 36,1' fill='none' stroke='%2300e676' stroke-width='2'/%3E%3Cpolyline points='0,22 6,18 12,14 18,10 24,6 30,3 36,1 36,26 0,26' fill='rgba(0,230,118,0.15)' stroke='none'/%3E%3C/svg%3E") no-repeat center/contain;
}
.growth-label {
  position: absolute;
  top: 2px; right: 3px;
  font-size: 7px; color: var(--green-growth);
  font-family: monospace; font-weight: bold;
  animation: countUp 2s ease-out infinite;
}
@keyframes countUp {
  0%  { content: '+12%'; opacity: 1; }
  100% { opacity: 0; }
}

/* ===== LAPTOP ITEM ===== */
.item-laptop {
  width: 42px;
  position: relative;
}
.laptop-screen {
  width: 42px; height: 28px;
  background: #0a0a1e;
  border: 2px solid #444;
  border-radius: 4px 4px 0 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0,180,255,0.3);
}
.laptop-screen::before {
  content: '> RUN';
  position: absolute;
  top: 6px; left: 5px;
  font-family: monospace; font-size: 8px; color: #00ff88;
  animation: typeLine 2.5s steps(6) infinite;
  white-space: nowrap; overflow: hidden; width: 0;
}
.laptop-screen::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 10px;
  background: linear-gradient(90deg, #00ff88 0%, #00aaff 60%, transparent 100%);
  opacity: 0.15;
}
.laptop-base {
  width: 46px; height: 5px;
  background: #555;
  border-radius: 0 0 3px 3px;
  margin-left: -2px;
}

/* ===== DUMBBELL ITEM ===== */
.item-dumbbell {
  display: flex;
  align-items: center;
  gap: 2px;
}
.db-left-plate, .db-right-plate {
  width: 8px; height: 22px;
  background: #888;
  border-radius: 3px;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.4);
}
.db-bar {
  width: 24px; height: 8px;
  background: linear-gradient(180deg, #aaa, #666, #aaa);
  border-radius: 4px;
}
.item-dumbbell {
  animation: dumbbellSpin 2s ease-in-out infinite, itemFloat 2s ease-in-out infinite;
}
@keyframes dumbbellSpin {
  0%,100% { transform: rotate(-15deg); }
  50%      { transform: rotate(15deg); }
}

/* ===== TROPHY ITEM ===== */
.item-trophy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  animation: goldGlow 1.5s ease-in-out infinite alternate, itemFloat 2s ease-in-out infinite;
}
.trophy-cup {
  width: 28px; height: 22px;
  background: linear-gradient(135deg, #ffe566, #cc8800, #ffe566);
  border-radius: 50% 50% 30% 30%;
  position: relative;
  box-shadow: 0 0 12px rgba(255,200,0,0.5);
}
.trophy-cup::before {
  content: '★';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-size: 10px; color: #7a4400;
}
.trophy-cup::after {
  content: '';
  position: absolute;
  top: 5px; left: -7px;
  width: 7px; height: 10px;
  background: #cc8800;
  border-radius: 50% 0 0 50%;
  box-shadow: 28px 0 0 0 #cc8800;
}
.trophy-stem {
  width: 8px; height: 8px;
  background: #cc8800;
  border-radius: 2px;
}
.trophy-base {
  width: 28px; height: 6px;
  background: linear-gradient(135deg, #ffe566, #cc8800);
  border-radius: 3px;
}

/* ===== ENERGY ITEM ===== */
.item-energy {
  font-size: 24px;
  filter: drop-shadow(0 0 8px #ffcc00) drop-shadow(0 0 16px rgba(255,200,0,0.5));
  animation: energyPulse 0.6s ease-in-out infinite alternate, itemFloat 1.5s ease-in-out infinite;
}
@keyframes energyPulse {
  from { transform: scale(1); filter: drop-shadow(0 0 8px #ffcc00); }
  to   { transform: scale(1.2); filter: drop-shadow(0 0 16px #ff6600) drop-shadow(0 0 30px rgba(255,100,0,0.4)); }
}

/* Star sparkles ring */
.sparkle-ring {
  position: absolute;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  animation: ringExpand 0.6s ease-out forwards;
}
@keyframes ringExpand {
  from { transform: scale(0); opacity: 1; }
  to   { transform: scale(2); opacity: 0; }
}
