/* Desk items */

#desk-items {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

/* ---- Base desk item ---- */
.desk-item {
  position: absolute;
  padding: 0;
  pointer-events: auto;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), filter 0.25s ease-out;
}

.desk-item:hover {
  transform: scale(1.08);
  filter: brightness(1.1);
}

/* Coins have their own physics hover - no scale */
#desk-coins:hover {
  transform: none;
  filter: none;
}

.desk-item:active {
  transform: scale(0.96);
}

.desk-item:focus-visible {
  outline: 2px solid var(--color-candle-glow);
  outline-offset: 4px;
  border-radius: 4px;
}

.desk-item .placeholder {
  width: 100%;
  height: 100%;
}

.desk-item-label {
  position: fixed;
  pointer-events: none;

  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-parchment);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  letter-spacing: 0.05em;
  text-transform: uppercase;

  opacity: 0;
  transition: opacity var(--dur-quick) ease-out;
  z-index: 1000;
}

/* ---- Individual desk item positions ---- */
/* Items are positioned to partially flow off-screen for a more immersive desk feel */

/* Top-left: Polaroids (Authors) */
#desk-polaroids {
  top: -20px;
  left: -20px;
  width: 350px;
  height: 350px;
}

#desk-polaroids .placeholder {
  box-shadow:
    4px 4px 12px rgba(0, 0, 0, 0.35),
    -2px -2px 0 #f5f0e8,
    -4px -4px 0 #e8e0d4,
    -6px -6px 0 #dbd3c7;
  transform: rotate(-12deg);
  transition: box-shadow 0.25s ease-out, transform 0.25s ease-out;
}

#desk-polaroids:hover .placeholder {
  box-shadow:
    8px 8px 20px rgba(0, 0, 0, 0.4),
    -2px -2px 0 #f5f0e8,
    -4px -4px 0 #e8e0d4,
    -6px -6px 0 #dbd3c7,
    0 0 30px rgba(255, 240, 220, 0.15);
  transform: rotate(-8deg);
}

/* Top-right: Quill & Paper (Updates) */
#desk-quill {
  top: -250px;
  right: -200px;
  width: 600px;
  height: 700px;
}

#desk-quill .placeholder {
  box-shadow: 3px 3px 12px rgba(0, 0, 0, 0.35);
  transform: rotate(-15deg);
  transition: box-shadow 0.25s ease-out, transform 0.25s ease-out;
}

#desk-quill:hover .placeholder {
  box-shadow: 6px 6px 20px rgba(0, 0, 0, 0.4), 0 0 25px rgba(255, 240, 220, 0.15);
  transform: rotate(-10deg);
}

/* Bottom-left: Envelope (Contact) */
#desk-envelope {
  bottom: -20px;
  left: -50px;
  width: 500px;
  height: 300px;
}

#desk-envelope .placeholder {
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.3);
  transform: rotate(10deg);
  transition: box-shadow 0.25s ease-out, transform 0.25s ease-out;
}

#desk-envelope:hover .placeholder {
  box-shadow: 6px 6px 18px rgba(0, 0, 0, 0.35), 0 0 25px rgba(255, 240, 220, 0.15);
  transform: rotate(2deg) translateY(-4px);
}

/* Bottom-right: Coins (Support) */

#desk-coins {
  bottom: 0;
  right: 0;
  width: 380px;
  height: 320px;
}

#coins-container {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Base coin styling - placeholder style */
.coin {
  position: absolute;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(107, 68, 35, 0.1);
  border: 2px dashed var(--color-warm-wood);
}

.coin::after {
  display: none;
}

/* Coin hover */
.coin:hover {
  background: rgba(107, 68, 35, 0.15);
}

/* Coin positions in pixels for JS manipulation - larger size */
.coin:nth-child(1) { width: 90px; height: 90px; top: 10px; left: 5px; }
.coin:nth-child(2) { width: 90px; height: 90px; top: 0px; left: 100px; }
.coin:nth-child(3) { width: 90px; height: 90px; top: 80px; left: 0px; }
.coin:nth-child(4) { width: 90px; height: 90px; top: 60px; left: 150px; }
.coin:nth-child(5) { width: 90px; height: 90px; top: 140px; left: 50px; }
.coin:nth-child(6) { width: 90px; height: 90px; top: 130px; left: 180px; }
.coin:nth-child(7) { width: 90px; height: 90px; top: 10px; left: 200px; }
.coin:nth-child(8) { width: 90px; height: 90px; top: 190px; left: 120px; }
.coin:nth-child(9) { width: 90px; height: 90px; top: 100px; left: 260px; }
.coin:nth-child(10) { width: 90px; height: 90px; top: 200px; left: 250px; }

/* Coin flip animation */
.coin.flipping {
  animation: coinFlip 0.4s ease-in-out;
}

/* ---- Reduced motion accessibility ---- */
@media (prefers-reduced-motion: reduce) {
  .desk-item,
  .desk-item .placeholder,
  .coin {
    transition: none;
  }

  .coin.flipping {
    animation: none;
  }
}
