.ljc-wrapper {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 9999;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.ljc-wrapper:focus-visible {
  outline: 2px solid #ffe28a;
  outline-offset: 6px;
  border-radius: 12px;
}

.ljc-stage {
  position: relative;
  width: var(--ljc-size, 76px);
  height: var(--ljc-size, 76px);
  perspective: 800px;
  animation: ljc-float 2.8s ease-in-out infinite;
  transition: transform 0.25s ease;
}

.ljc-wrapper:hover .ljc-stage,
.ljc-wrapper:focus-visible .ljc-stage {
  transform: scale(1.12);
}

/* Periodic attention pop triggered by JS */
.ljc-wrapper.is-attention .ljc-stage {
  animation: ljc-hop 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ljc-wrapper.is-attention .ljc-glow {
  opacity: 1;
  transform: scale(1.3);
}

/* Pulsing golden glow */
.ljc-glow {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 215, 102, 0.55) 0%,
    rgba(218, 158, 42, 0.22) 48%,
    rgba(218, 158, 42, 0) 72%
  );
  animation: ljc-pulse 2.2s ease-in-out infinite;
  transition: transform 0.35s ease, opacity 0.35s ease;
  pointer-events: none;
}

/* Ground shadow synced with floating bob */
.ljc-shadow {
  position: absolute;
  bottom: -10px;
  left: 50%;
  width: 68%;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0) 72%);
  animation: ljc-shadow-pulse 2.8s ease-in-out infinite;
  pointer-events: none;
}

/* 3D Coin Container */
.ljc-coin {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: ljc-spin 4.2s linear infinite;
}

.ljc-wrapper:hover .ljc-coin {
  animation-duration: 1.8s;
}

/* Front & Back Faces */
.ljc-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: inset 0 0 6px rgba(255, 240, 179, 0.55);
}

.ljc-face--front {
  transform: translateZ(4px);
}

.ljc-face--back {
  transform: rotateY(180deg) translateZ(4px);
}

/* Metallic sheen sweep */
.ljc-face::after {
  content: '';
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 250, 220, 0.45) 50%,
    transparent 65%
  );
  animation: ljc-sheen 3.2s ease-in-out infinite;
  pointer-events: none;
}

/* Coin artwork layer */
.ljc-sprite {
  width: 100%;
  height: 100%;
  background-image: var(--ljc-img);
  background-repeat: no-repeat;
}

/* Mode 1: 4x4 sprite sheet crop (Top-Left front, Row 4 Col 3 back) */
.ljc-wrapper[data-sprite="true"] .ljc-sprite {
  background-size: 400% 400%;
}

.ljc-wrapper[data-sprite="true"] .ljc-face--front .ljc-sprite {
  background-position: 0% 0%;
  transform: scale(1.09);
}

.ljc-wrapper[data-sprite="true"] .ljc-face--back .ljc-sprite {
  background-position: 66.667% 100%;
  transform: scale(1.22);
}

/* Mode 2: Single isolated coin image */
.ljc-wrapper[data-sprite="false"] .ljc-sprite {
  background-size: contain;
  background-position: center;
}

/* Stacked metallic edge slices for 3D thickness */
.ljc-edge {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    #fff2b2 0%,
    #d4a03a 35%,
    #7f5612 68%,
    #e8c468 100%
  );
}

/* Call-to-action pill */
.ljc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: linear-gradient(180deg, #221a0d 0%, #0e0a04 100%);
  border: 1px solid rgba(240, 198, 99, 0.75);
  color: #ffe28a;
  font: 700 11px/1 system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ljc-wrapper:hover .ljc-badge {
  background: linear-gradient(180deg, #3a2a0f 0%, #1b1306 100%);
  transform: translateY(-2px);
}

.ljc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 8px #ff3b30;
  animation: ljc-blink 1.2s ease-in-out infinite;
}

@keyframes ljc-spin {
  0%   { transform: rotateY(0deg) rotateX(8deg); }
  50%  { transform: rotateY(180deg) rotateX(-8deg); }
  100% { transform: rotateY(360deg) rotateX(8deg); }
}

@keyframes ljc-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

@keyframes ljc-hop {
  0%   { transform: translateY(0) scale(1); }
  40%  { transform: translateY(-18px) scale(1.16); }
  70%  { transform: translateY(2px) scale(0.96); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes ljc-shadow-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.55; }
  50%      { transform: translateX(-50%) scale(0.78); opacity: 0.3; }
}

@keyframes ljc-pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.65; }
  50%      { transform: scale(1.16); opacity: 1; }
}

@keyframes ljc-sheen {
  0%, 70% { transform: translateX(-120%) rotate(15deg); }
  100%    { transform: translateX(120%) rotate(15deg); }
}

@keyframes ljc-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.8); }
}

@media (max-width: 600px) {
  .ljc-wrapper {
    left: 14px;
    bottom: 14px;
  }

  .ljc-stage {
    width: calc(var(--ljc-size, 76px) * 0.82);
    height: calc(var(--ljc-size, 76px) * 0.82);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ljc-stage,
  .ljc-coin,
  .ljc-glow,
  .ljc-shadow,
  .ljc-face::after,
  .ljc-dot {
    animation: none !important;
  }
}