.floating-wrapper {
  position: fixed;
  right: 20px;
  top: 180px;
  z-index: 9999;
  width: 64px;
  height: 64px;
  touch-action: none;
  user-select: none;
}

.pulse-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  animation: pulseOut 2.5s ease-out infinite;
}
.r1 {
  inset: -6px;
  animation-delay: 0s;
}
.r2 {
  inset: -12px;
  animation-delay: 0.7s;
}
@keyframes pulseOut {
  0%   { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(1.2);  opacity: 0; }
}

.floating-game-btn {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  background: conic-gradient(
    from 0deg,
    var(--color-amber), var(--color-red), var(--color-orange-11), var(--color-orange-12), var(--color-amber)
  );
  padding: 3px;
  animation: rotateBorder 4s linear infinite;
  box-shadow:
    0 4px 16px var(--color-orange-a35),
    0 2px 8px var(--shadow-black-a12);
  transition: transform 0.2s, box-shadow 0.2s;
}
.floating-game-btn:hover {
  transform: scale(1.08);
  box-shadow:
    0 6px 24px var(--color-orange-a50),
    0 2px 10px var(--shadow-black-a15);
}
.floating-game-btn:active {
  transform: scale(0.95);
}
@keyframes rotateBorder {
  to { filter: hue-rotate(360deg); }
}

.btn-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--color-orange-3), var(--color-yellow-3));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--shadow-white-a90);
}

.btn-shine {
  position: absolute;
  top: -50%;
  left: -120%;
  width: 55%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent,
    var(--shadow-white-a75),
    transparent
  );
  transform: rotate(20deg);
  animation: shineMove 3s ease-in-out infinite;
}
@keyframes shineMove {
  0%, 100% { left: -120%; }
  50%       { left: 160%;  }
}

.floating-game-btn img {
  width: 30px;
  height: 30px;
  position: relative;
  z-index: 1;
  animation: iconRock 2.5s ease-in-out infinite;
  filter:
    drop-shadow(0 2px 4px var(--color-orange-a40))
    drop-shadow(0 0 8px var(--color-orange-a25));
  pointer-events: none;
}
@keyframes iconRock {
  0%, 100% { transform: rotate(-7deg) scale(1); }
  50%       { transform: rotate(7deg) scale(1.1); }
}

.num-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-red);
  border: 2.5px solid var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--color-white);
  font-family: sans-serif;
  z-index: 10;
  box-shadow: 0 2px 6px var(--color-red-a45);
  animation: badgeAppear 0.4s cubic-bezier(0.2, 0.9, 0.2, 1.3) both;
  pointer-events: none;
}
@keyframes badgeAppear {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.fan-menu {
  position: absolute;
  right: 10px;
  bottom: 10px;
  pointer-events: none;
}

.fan-item {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-decoration: none;
  font-size: 20px;
  background: var(--color-white-4);
  border: 1.5px solid var(--color-blue-7);
  box-shadow:
    0 4px 16px var(--shadow-sm),
    0 1px 4px var(--shadow-black-a8);
  opacity: 0;
  transform: scale(0.2) rotate(15deg);
  transition: 0.4s cubic-bezier(0.2, 0.9, 0.2, 1.2);
  pointer-events: none;
  cursor: pointer;
}
.fan-item:hover {
  background: var(--color-orange-3);
  border-color: var(--color-orange-a70);
  box-shadow:
    0 6px 20px var(--color-orange-a25),
    0 2px 8px var(--shadow-sm);
}
.fan-label {
  font-size: 8px;
  color: var(--color-orange-13);
  margin-top: 1px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-family: sans-serif;
  font-weight: 600;
  line-height: 1;
}

.fan-item::before {
  content: attr(data-tip);
  position: absolute;
  right: 58px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--shadow-lg);
  color: var(--color-white);
  font-size: 10px;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.fan-item:hover::before {
  opacity: 1;
}

.floating-wrapper.active .fan-menu {
  pointer-events: auto;
}
.floating-wrapper.active .fan-item {
  pointer-events: auto;
}
.floating-wrapper.active .item1 {
  transform: translate(calc(var(--fx, -1) * 50px), calc(var(--fy, 1) * 20px)) scale(1) rotate(0);
  opacity: 1;
  transition-delay: 0.04s;
}
.floating-wrapper.active .item2 {
  transform: translate(calc(var(--fx, -1) * 110px), calc(var(--fy, 1) * -20px)) scale(1) rotate(0);
  opacity: 1;
  transition-delay: 0.08s;
}
.floating-wrapper.active .item3 {
  transform: translate(calc(var(--fx, -1) * 110px), calc(var(--fy, 1) * -90px)) scale(1) rotate(0);
  opacity: 1;
  transition-delay: 0.12s;
}
  .floating-wrapper.active .item4 {
    transform: translate(calc(var(--fx, -1) * 50px), calc(var(--fy, 1) * -120px)) scale(1) rotate(0);
    opacity: 1;
    transition-delay: 0.12s;
}

.particles {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  overflow: visible;
}
.p-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  opacity: 0;
}
.floating-wrapper.active .p-dot {
  animation: pBurst 0.55s ease-out forwards;
}
@keyframes pBurst {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0); }
}

.floating-wrapper.hidden-edge {
  transform: translate(var(--hx, 28px), var(--hy, 0px));
  opacity: 0.6;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.floating-wrapper.hidden-edge:hover,
.floating-wrapper.active {
  transform: translate(0, 0);
  opacity: 1;
}
.floating-wrapper {
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.floating-wrapper.snapping {
  transition:
    left 0.35s cubic-bezier(0.2, 0.9, 0.2, 1),
    right 0.35s cubic-bezier(0.2, 0.9, 0.2, 1),
    transform 0.4s ease,
    opacity 0.4s ease;
}
