/* P2P Phaser Overlay Styles */

#p2p-phaser-container {
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#p2p-phaser-container.active {
  opacity: 1;
  pointer-events: auto;
}

#p2p-phaser-game {
  width: 100%;
  max-width: 520px;
  height: 85vh;
  max-height: 640px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(139, 90, 43, 0.6);
  position: relative;
  background: #1a0f2e;
}

.p2p-phaser-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1100;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
  pointer-events: auto;
}

.p2p-phaser-close:hover {
  transform: scale(1.1);
  background: rgba(139, 0, 0, 0.7);
}

.p2p-phaser-close:active {
  transform: scale(0.95);
}

.p2p-phaser-close img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
}

/* Responsive adjustments */
@media (max-width: 640px) {
  #p2p-phaser-game {
    height: 88vh;
    max-height: none;
  }
  #p2p-phaser-container {
    padding: 8px;
  }
  .p2p-phaser-close {
    top: 6px;
    right: 6px;
    width: 38px;
    height: 38px;
  }
  .p2p-phaser-close img {
    width: 18px;
    height: 18px;
  }
}

/* Entrance animation for modal */
@keyframes p2pModalIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#p2p-phaser-container.active #p2p-phaser-game {
  animation: p2pModalIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Subtle shimmer border effect on active modal */
@keyframes borderShimmer {
  0% { border-color: rgba(139, 90, 43, 0.5); }
  50% { border-color: rgba(255, 215, 0, 0.35); }
  100% { border-color: rgba(139, 90, 43, 0.5); }
}

#p2p-phaser-container.active #p2p-phaser-game {
  animation: p2pModalIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), borderShimmer 3s ease-in-out infinite 0.5s;
}