/* Ripple effect for buttons */
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.6);
  width: 100px;
  height: 100px;
  margin-top: -50px;
  margin-left: -50px;
  animation: ripple 0.8s ease-out;
  transform: scale(0);
  opacity: 1;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(3);
    opacity: 0;
  }
}

/* Custom cursor effect for play button */
.play-button {
  --x: 0;
  --y: 0;
  position: relative;
  overflow: hidden;
}

.play-button:after {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  top: var(--y);
  left: var(--x);
  transform: translate(-50%, -50%);
  opacity: 0;
  background: radial-gradient(circle closest-side, rgba(255, 255, 255, 0.2), transparent);
  transition: opacity 0.3s ease;
}

.play-button:hover:after {
  opacity: 1;
}

/* Enhanced Effects for Game Page */

/* Ripple effect for play button */
.play-button {
  position: relative;
  overflow: hidden;
}

.play-button:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(100, 100);
    opacity: 0;
  }
}

.play-button:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

/* Hover effects for game cards */
.recommended-game-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Custom scrollbar for recommended games */
.recommended-games-grid::-webkit-scrollbar {
  height: 6px;
}

.recommended-games-grid::-webkit-scrollbar-track {
  background: #e6e1f9;
  border-radius: 10px;
}

.recommended-games-grid::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #ff4d7d, #b066ff, #ff4d7d);
  background-size: 200% 200%;
  animation: scrollbarAnimation 3s ease infinite;
  border-radius: 10px;
}

.recommended-games-grid::-webkit-scrollbar-thumb:hover {
  background: #9a4dff;
}

/* Card hover effects */
.game-details-section,
.recommended-games-section,
.game-description-section {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Pulsing animation for play button */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(176, 102, 255, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(176, 102, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(176, 102, 255, 0);
  }
}

.play-button {
  animation: pulse 2s infinite;
}

/* Smooth fade-in animation for page elements */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-header,
.game-details-section,
.recommended-games-section,
.game-article-section,
.ad-space {
  animation: fadeInUp 0.6s ease-out forwards;
}

.game-details-section {
  animation-delay: 0.1s;
}

.ad-space-middle {
  animation-delay: 0.2s;
}

.ad-space-logo {
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.15s;
}

.ad-space-between-sections {
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.35s;
}

.recommended-games-section {
  animation-delay: 0.3s;
}

.game-article-section {
  animation-delay: 0.4s;
}

.ad-space-large {
  animation-delay: 0.5s;
}

/* Edge ad spaces animations */
.edge-ad-space {
  animation: fadeInSide 0.8s ease-out forwards;
}

.edge-ad-left {
  animation-delay: 0.2s;
}

.edge-ad-right {
  animation-delay: 0.3s;
}

@keyframes fadeInSide {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.edge-ad-right {
  animation-name: fadeInSideRight;
}

@keyframes fadeInSideRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Animated gradient for edge ad spaces */
.edge-ad-space .ad-container::before {
  background: linear-gradient(90deg, #ff4d7d, #b066ff, #ff4d7d);
  background-size: 200% 200%;
  animation: borderAnimation 3s ease infinite;
}

/* Staggered animation for recommended games */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.recommended-game-card {
  opacity: 0;
  animation: fadeInRight 0.5s ease-out forwards;
}

.recommended-game-card:nth-child(1) {
  animation-delay: 0.3s;
}
.recommended-game-card:nth-child(2) {
  animation-delay: 0.4s;
}
.recommended-game-card:nth-child(3) {
  animation-delay: 0.5s;
}
.recommended-game-card:nth-child(4) {
  animation-delay: 0.6s;
}
.recommended-game-card:nth-child(5) {
  animation-delay: 0.7s;
}
.recommended-game-card:nth-child(6) {
  animation-delay: 0.8s;
}
.recommended-game-card:nth-child(7) {
  animation-delay: 0.9s;
}
.recommended-game-card:nth-child(8) {
  animation-delay: 1.0s;
}

/* Staggered animation for game features */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.game-features li {
  opacity: 0;
  animation: fadeInLeft 0.5s ease-out forwards;
}

.game-features li:nth-child(1) {
  animation-delay: 0.4s;
}
.game-features li:nth-child(2) {
  animation-delay: 0.5s;
}
.game-features li:nth-child(3) {
  animation-delay: 0.6s;
}
.game-features li:nth-child(4) {
  animation-delay: 0.7s;
}
.game-features li:nth-child(5) {
  animation-delay: 0.8s;
}
.game-features li:nth-child(6) {
  animation-delay: 0.9s;
}
.game-features li:nth-child(7) {
  animation-delay: 1.0s;
}

/* Hover effect for game image */
.game-image-container {
  overflow: hidden;
}

.game-image-container:before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  z-index: 2;
  display: block;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 100%);
  transform: skewX(-25deg);
  transition: all 0.75s;
  opacity: 0;
}

.game-details-section:hover .game-image-container:before {
  animation: shine 1.5s;
}

/* Ad space logo effects */
.ad-space-logo:before {
  background: linear-gradient(90deg, #30c9c9, #7b68ee, #30c9c9);
  background-size: 200% 200%;
  animation: borderAnimation 3s ease infinite;
}

.ad-space-logo:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(30, 201, 201, 0.15);
}

@keyframes logoAdPulse {
  0% {
    background-color: rgba(240, 235, 255, 0.7);
  }
  50% {
    background-color: rgba(230, 225, 249, 0.7);
  }
  100% {
    background-color: rgba(240, 235, 255, 0.7);
  }
}

.ad-space-logo .ad-container {
  animation: logoAdPulse 3s infinite ease-in-out;
}

@keyframes shine {
  100% {
    left: 125%;
    opacity: 1;
  }
}

/* Floating animation for recommended games */
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
  100% {
    transform: translateY(0px);
  }
}

.recommended-game-card:hover {
  animation: float 2s ease-in-out infinite;
}

/* Gradient text effect for section titles */
.section-title {
  position: relative;
  background: linear-gradient(to right, #333, #555);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: all 0.3s ease;
}

.section-title:hover {
  background: linear-gradient(to right, #ff4d7d, #b066ff);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Subtle hover effect for article content */
.full-article-content p {
  transition: all 0.3s ease;
  padding: 5px 0;
  border-radius: 5px;
}

.full-article-content p:hover {
  background-color: #f9f7ff;
  padding: 5px 10px;
  transform: translateX(5px);
}

/* Subtle shadow for game features and how to play sections */
.game-features,
.how-to-play {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.game-features:hover,
.how-to-play:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

/* Animated gradient border for game details section */
@keyframes borderAnimation {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.game-details-section:before {
  background: linear-gradient(90deg, #ff4d7d, #b066ff, #ff4d7d);
  background-size: 200% 200%;
  animation: borderAnimation 3s ease infinite;
}

/* Enhanced ad space between sections effects */
.ad-space-between-sections:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(140, 82, 255, 0.12);
}

@keyframes adPulse {
  0% {
    background-color: rgba(240, 235, 255, 0.7);
  }
  50% {
    background-color: rgba(230, 225, 249, 0.7);
  }
  100% {
    background-color: rgba(240, 235, 255, 0.7);
  }
}

.ad-space-between-sections .ad-container {
  animation: adPulse 3s infinite ease-in-out;
  background-size: 200px 200px;
}

/* Improved focus styles for accessibility */
.play-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(176, 102, 255, 0.5);
}

/* Add subtle texture to backgrounds */
.game-details-section,
.recommended-games-section,
.game-article-section {
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%239C92AC' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* Side ad spaces animations */
.side-ad-space {
  animation: fadeInSide 0.8s ease-out forwards;
}

.side-ad-left {
  animation-delay: 0.2s;
}

.side-ad-right {
  animation-delay: 0.3s;
}

@keyframes fadeInSide {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.side-ad-right {
  animation-name: fadeInSideRight;
}

@keyframes fadeInSideRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Animated gradient for side ad spaces */
.side-ad-space .ad-container::before {
  background: linear-gradient(90deg, #ff4d7d, #b066ff, #ff4d7d);
  background-size: 200% 200%;
  animation: borderAnimation 3s ease infinite;
}

/* Ad space logo-left effects */
.ad-space-logo-left:before {
  background: linear-gradient(90deg, #30c9c9, #7b68ee, #30c9c9);
  background-size: 200% 200%;
  animation: borderAnimation 3s ease infinite;
}

.ad-space-logo-left:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(30, 201, 201, 0.15);
}

@keyframes logoAdPulse {
  0% {
    background-color: rgba(240, 235, 255, 0.7);
  }
  50% {
    background-color: rgba(230, 225, 249, 0.7);
  }
  100% {
    background-color: rgba(240, 235, 255, 0.7);
  }
}

.ad-space-logo-left .ad-container {
  animation: logoAdPulse 3s infinite ease-in-out;
}
