/* Global Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Floating Banner */
.floating-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #000000;
  color: #ffffff;
  text-align: center;
  padding: 8px;
  font-weight: 500;
  z-index: 1000;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Adjust content wrapper to account for banner */
.content-wrapper {
  padding-top: 40px;
}

:root {
  /* Light theme (default) */
  --primary-color: #7f5af0;
  --secondary-color: #2cb67d;
  --text-color: #333;
  --light-text: #fff;
  --background-color: #f7f9fc;
  --card-bg: #ffffff;
  --heading-color: #2a2a2a;
  --muted-color: #666;
  --border-color: rgba(0, 0, 0, 0.08);
  --shadow-color: rgba(0, 0, 0, 0.04);
  --card-shadow: 0 4px 20px var(--shadow-color);
  --hover-card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
  --hover-transform: translateY(-5px);
  --header-bg: rgba(255, 255, 255, 0.9);
  --footer-bg: rgba(247, 249, 252, 0.7);
  --tooltip-bg: rgba(42, 42, 42, 0.95);
  --tooltip-color: #fff;
  --tile-bg: rgba(255, 255, 255, 0.85);
  --shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  --border-radius: 12px;
  --tech-info-bg: rgba(255, 255, 255, 0.8);
  --tech-section-bg: rgba(255, 255, 255, 0.9);
  --tech-pill-bg: rgba(106, 17, 203, 0.08);
  --tech-border: rgba(106, 17, 203, 0.08);
  --tech-gradient: rgba(106, 17, 203, 0.2);
  --tech-shadow: rgba(106, 17, 203, 0.1);
  --tech-pill-shadow: rgba(106, 17, 203, 0.2);
  --primary-color-rgb: 127, 90, 240;
  --secondary-color-rgb: 44, 182, 125;
  --accent-color-rgb: 255, 142, 60;
}

/* Dark theme */
[data-theme="dark"] {
  --primary-color: #7f5af0;
  --secondary-color: #2cb67d;
  --text-color: #ececec;
  --light-text: #fff;
  --background-color: #16161a;
  --tile-bg: rgba(30, 30, 30, 0.85);
  --card-bg: #242629;
  --heading-color: #fff;
  --muted-color: #94a1b2;
  --border-color: rgba(255, 255, 255, 0.08);
  --shadow-color: rgba(0, 0, 0, 0.2);
  --card-shadow: 0 4px 20px var(--shadow-color);
  --hover-card-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  --header-bg: rgba(18, 18, 18, 0.9);
  --footer-bg: rgba(22, 22, 26, 0.7);
  --tooltip-bg: rgba(220, 220, 220, 0.95);
  --tooltip-color: #16161a;
  --tag-bg: rgba(138, 43, 226, 0.2);
  --tag-text: #a56eff;
  --tech-info-bg: rgba(30, 30, 30, 0.8);
  --tech-section-bg: rgba(40, 40, 40, 0.9);
  --tech-pill-bg: rgba(138, 43, 226, 0.15);
  --tech-border: rgba(138, 43, 226, 0.15);
  --tech-gradient: rgba(138, 43, 226, 0.3);
  --tech-shadow: rgba(138, 43, 226, 0.2);
  --tech-pill-shadow: rgba(138, 43, 226, 0.3);
  --primary-color-rgb: 127, 90, 240;
  --secondary-color-rgb: 44, 182, 125;
  --accent-color-rgb: 255, 142, 60;
}

body {
  font-family: 'Poppins', sans-serif;
  color: var(--text-color);
  background-color: var(--background-color);
  overflow-x: hidden;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Canvas Background */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Content Layout */
.content-wrapper {
  display: flex;
  flex-direction: column;
  padding: 0 5%;
}

/* Main Section - Games Grid */
main {
  flex: 1 0 auto;
  padding: 0 0 80px;
  width: 100%;
}

#games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin: 30px 0;
}

.game-tile {
  background-color: var(--tile-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: background-color 0.3s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  box-shadow: var(--shadow);
  cursor: pointer;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 480px;
  will-change: transform;
}

.game-tile:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(var(--primary-color-rgb), 0.15);
}

.game-image-container {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
  background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
  background-size: 200% 100%;
  animation: 1.5s shine linear infinite;
}

.game-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  background-color: #f0f0f0;
}

/* Dark theme placeholder */
[data-theme="dark"] .game-image-container {
  background: linear-gradient(110deg, #2a2a2a 8%, #3a3a3a 18%, #2a2a2a 33%);
  background-size: 200% 100%;
  animation: 1.5s shine linear infinite;
}

/* Animation for the placeholder shimmer effect */
@keyframes shine {
  to {
    background-position-x: -200%;
  }
}

/* Style for loaded images */
.game-image.loaded {
  opacity: 1;
}

.game-info {
  padding: 12px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 120px;
}

.game-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-color);
}

.game-author {
  font-size: 0.85rem;
  color: var(--primary-color);
  font-weight: 500;
  margin-bottom: 6px;
}

.author-link {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
}

.author-link:hover {
  color: var(--secondary-color);
}

.author-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  transition: var(--transition);
}

.author-link:hover::after {
  width: 100%;
}

.game-description {
  font-size: 0.8rem;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--text-color);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-height: 48px;
}

.game-tech-info {
  background: var(--tech-info-bg);
  backdrop-filter: blur(10px);
  padding: 12px 12px 8px 12px;
  margin-top: auto;
  border-top: 1px solid var(--tech-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: visible;
  flex-shrink: 0;
  height: auto;
  min-height: 120px;
  transition: background 0.3s ease;
}

.game-tech-info::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--tech-gradient),
    transparent
  );
  transition: background 0.3s ease;
}

.tech-section {
  background: var(--tech-section-bg);
  border-radius: 8px;
  padding: 8px;
  transition: all 0.3s ease;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tech-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--tech-shadow);
}

.tech-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--tech-border);
  color: var(--text-color);
}

.tech-header i {
  font-size: 0.9rem;
}

.tech-header span {
  font-size: 0.8rem;
}

.tech-content {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 2px;
  align-content: flex-start;
  overflow: visible;
  flex: 1;
  transition: background 0.3s ease;
}

.tech-pill {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 16px;
  background: var(--tech-pill-bg);
  color: var(--text-color);
  transition: all 0.3s ease;
  cursor: default;
  white-space: nowrap;
  line-height: 1.2;
  animation: fadeIn 0.3s ease forwards;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.tech-pill:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--tech-pill-shadow);
}

.game-tile:hover .game-tech-info {
  transform: translateY(-5px);
  transition-delay: 0.05s;
  box-shadow: 0 5px 15px var(--tech-shadow);
}

.game-tile:hover .tech-section {
  transform: translateY(-2px);
  transition-delay: 0.1s;
  box-shadow: 0 3px 10px var(--tech-shadow);
}

.game-tags {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: calc(100% - 20px);
  z-index: 2;
}

.game-tag {
  background-color: var(--tag-bg);
  color: var(--tag-text);
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
  position: relative;
  overflow: hidden;
}

.game-tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: translateX(-100%);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-tag:hover {
  transform: translateY(-3px) scale(1.05);
  background: var(--primary-color);
  color: white;
  box-shadow: 0 5px 15px rgba(106, 17, 203, 0.4);
}

.game-tag:hover::before {
  transform: translateX(100%);
}

/* Add a subtle gradient overlay to the image container */
.game-image-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4) 0%,
    transparent 30%,
    transparent 100%
  );
  pointer-events: none;
}

/* Add hover effect for the image */
.game-tile:hover .game-image {
  transform: scale(1.05);
}

/* Add stagger animation for tags on tile hover */
.game-tile:hover .game-tag {
  animation: tagPop 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.game-tile:hover .game-tag:nth-child(2) {
  animation-delay: 0.1s;
}

.game-tile:hover .game-tag:nth-child(3) {
  animation-delay: 0.2s;
}

@keyframes tagPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1) translateY(-5px);
  }
  100% {
    transform: scale(1) translateY(-3px);
  }
}

/* Add rainbow effect for specific tags */
.game-tag:nth-child(1) {
  background: linear-gradient(45deg, #ff6b6b, #6a11cb);
  color: white;
  border: none;
}

.game-tag:nth-child(2) {
  background: linear-gradient(45deg, #4facfe, #00f2fe);
  color: white;
  border: none;
}

.game-tag:nth-child(3) {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  border: none;
}

/* Footer */
footer {
  margin-top: auto;
  padding: 40px 0;
  background-color: var(--footer-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 -8px 32px 0 rgba(31, 38, 135, 0.15);
  margin: 20px 0;
  position: relative;
  overflow: hidden;
  color: var(--footer-text);
  transition: background-color 0.3s ease, color 0.3s ease;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, 
    transparent,
    var(--primary-color),
    var(--secondary-color),
    transparent
  );
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 0 40px;
}

.footer-left {
  flex: 1;
  min-width: 200px;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.8;
}

.footer-social {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

.social-link {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-link:hover {
  transform: translateY(-3px) scale(1.1);
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  box-shadow: 0 4px 15px rgba(106, 17, 203, 0.2);
}

.footer-right {
  text-align: right;
}

.footer-love {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  color: var(--text-color);
}

.heart-icon {
  color: #ff6b6b;
  display: inline-block;
  animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.3); }
  28% { transform: scale(1); }
  42% { transform: scale(1.3); }
  70% { transform: scale(1); }
}

.footer-credits {
  margin-top: 5px;
  font-size: 0.8rem;
  opacity: 0.7;
}

.footer-credits a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
}

.footer-credits a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.footer-credits a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

@media (max-width: 768px) {
  footer {
    padding: 30px 0;
    margin: 10px 0;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    padding: 0 20px;
  }

  .footer-right {
    text-align: center;
  }

  .footer-social {
    justify-content: center;
  }

  .tech-content {
    gap: 4px;
  }
  
  .tech-pill {
    font-size: 0.7rem;
    padding: 2px 6px;
  }
  
  .tech-header {
    margin-bottom: 6px;
  }

  .game-tile, .ad-tile {
    min-height: 420px;
  }
  
  .game-tech-info {
    min-height: 100px;
    padding: 10px 10px 6px 10px;
  }
  
  .game-info {
    min-height: 110px;
  }
}

/* Enhanced Ad Tile Styles */
.ad-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 24px;
  transition: all 0.3s ease;
  cursor: pointer;
  background: linear-gradient(135deg, rgb(89, 103, 222) 0%, rgb(70, 81, 184) 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 20px rgba(89, 103, 222, 0.5);
  overflow: hidden;
  position: relative;
}

.ad-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 0.2) 100%);
  opacity: 0.7;
  z-index: 0;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.pulse-animation {
  animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder {
  0% {
    box-shadow: 0 0 0 0 rgba(89, 103, 222, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(89, 103, 222, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(89, 103, 222, 0);
  }
}

.ad-content {
  color: white;
  z-index: 1;
  width: 100%;
  padding: 2rem 1.5rem;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.5s ease-out;
  position: relative;
  backdrop-filter: blur(3px);
}

.ad-logo {
  height: 60px;
  margin-bottom: 1.5rem;
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.ad-tile:hover .ad-logo {
  transform: scale(1.05);
}

.ad-title {
  font-size: 2.8rem;
  font-weight: 800;
  margin: 0 0 1.5rem 0;
  letter-spacing: 0.5px;
  line-height: 1.2;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
}

.ad-icon {
  font-size: 2.5rem;
  margin: 0.5rem 0 1.5rem;
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.3));
  animation: float 3s ease-in-out infinite;
}

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

.ad-image-container {
  width: 85%;
  margin: 0 auto 1.5rem;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ad-image {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.ad-tile:hover .ad-image-container {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.ad-description {
  font-size: 1.2rem;
  margin: 0 0 2rem 0;
  line-height: 1.5;
  font-weight: 400;
  opacity: 0.95;
  max-width: 90%;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.ad-cta {
  background: white;
  color: rgb(89, 103, 222);
  border: none;
  padding: 0.85rem 2.2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
}

.ad-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0.1), rgba(255,255,255,0.3), rgba(255,255,255,0.1));
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.ad-cta:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
  background: #ffffff;
}

.ad-cta:hover::before {
  transform: translateX(3px);
}

/* Floating Publish Button */
.publish-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, #10B981, #047857);
  color: white;
  padding: 16px 32px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 100;
  border: 2px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  box-shadow: 
    0 8px 20px rgba(16, 185, 129, 0.3),
    0 2px 4px rgba(16, 185, 129, 0.1),
    inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.publish-button .emoji {
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
  transform: translateY(-1px);
}

.publish-button span:not(.emoji) {
  transform: translateY(1px);
}

.publish-button:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 15px 30px rgba(16, 185, 129, 0.4),
    0 5px 10px rgba(16, 185, 129, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
  padding: 16px 36px;
}

.publish-button:hover .emoji {
  transform: translateY(-1px) rotate(15deg) scale(1.2);
}

/* Responsive styles for publish button */
@media (max-width: 768px) {
  .publish-button {
    bottom: 20px;
    right: 20px;
    padding: 14px 28px;
    font-size: 0.9rem;
  }
  
  .publish-button:hover {
    padding: 14px 32px;
  }
  
  .publish-button .emoji {
    font-size: 1.2rem;
  }
}

/* Theme Toggle Button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--light-text);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  margin-left: 15px;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: var(--transition);
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: var(--transition);
}

.theme-toggle .sun-icon {
  opacity: 0;
}

.theme-toggle .moon-icon {
  opacity: 1;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  opacity: 1;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  opacity: 0;
}

/* 3D Theme Toggle */
.theme-toggle-3d {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 4;
  background: rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 2px 10px rgba(255, 255, 255, 0.2),
    inset 0 -2px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  overflow: hidden;
  transform-style: preserve-3d;
  perspective: 800px;
}

.theme-toggle-3d:hover, 
.theme-toggle-3d.hover {
  transform: scale(1.15) rotate(5deg) translateZ(10px);
  box-shadow: 
    0 15px 35px rgba(var(--primary-color-rgb), 0.4),
    0 5px 15px rgba(0, 0, 0, 0.1),
    inset 0 2px 10px rgba(255, 255, 255, 0.3),
    inset 0 -2px 5px rgba(0, 0, 0, 0.2);
}

.theme-toggle-3d::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, 
    var(--primary-color), 
    var(--secondary-color), 
    var(--primary-color), 
    var(--secondary-color));
  background-size: 300% 300%;
  animation: gradientShift 8s ease infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.9;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.theme-toggle-3d::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 15px rgba(var(--primary-color-rgb), 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.theme-toggle-3d:hover::after,
.theme-toggle-3d.hover::after {
  opacity: 1;
}

.theme-toggle-3d canvas {
  border-radius: 50%;
  transform: translateZ(5px);
}

/* Mobile responsiveness for theme toggle */
@media (max-width: 768px) {
  .theme-toggle-3d {
    width: 60px;
    height: 60px;
    bottom: 15px;
    left: 15px;
    box-shadow: 
      0 5px 20px rgba(0, 0, 0, 0.15),
      inset 0 1px 5px rgba(255, 255, 255, 0.15),
      inset 0 -1px 3px rgba(0, 0, 0, 0.1);
  }
  
  .theme-toggle-3d:hover, 
  .theme-toggle-3d.hover {
    transform: scale(1.1) rotate(3deg);
  }
}

@media (max-width: 480px) {
  .theme-toggle-3d {
    width: 50px;
    height: 50px;
    bottom: 10px;
    left: 10px;
  }
}

/* Featured Game Tile Styles */
.featured-tile {
  background-color: var(--tile-bg);
  border: 2px solid var(--primary-color);
  transform-origin: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(var(--primary-color-rgb), 0.2);
}

.featured-tile::before {
  content: "★";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 1;
  border: 2px solid white;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(var(--primary-color-rgb), 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0);
  }
}

.featured-tile .game-image-container {
  height: 180px;
  position: relative;
}

.featured-tile .game-image {
  height: 100%;
  object-fit: cover;
}

.featured-tile .game-title {
  font-size: 1.2em;
  color: var(--text-color);
  font-weight: 700;
}

.featured-tile .game-description {
  font-size: 0.9em;
  line-height: 1.5;
  color: var(--text-color);
}

.featured-tile .tech-pill {
  background: var(--tech-pill-bg);
  border: 1px solid var(--tech-border);
}

.featured-tile:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(var(--primary-color-rgb), 0.3);
}

/* Responsive adjustments for ad tile */
@media (max-width: 768px) {
  .ad-tile {
    min-height: 360px;
    padding: 1.5rem;
  }
  
  .ad-content {
    padding: 1.5rem 1rem;
  }
  
  .ad-title {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
  }
  
  .ad-logo {
    height: 50px;
    margin-bottom: 0.75rem;
  }
  
  .ad-image-container {
    width: 90%;
    margin-bottom: 1rem;
    padding: 4px;
  }
  
  .ad-description {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    max-width: 95%;
  }
}

@media (max-width: 480px) {
  .ad-tile {
    min-height: 340px;
    padding: 1.25rem;
  }
  
  .ad-content {
    padding: 1.25rem 0.75rem;
  }
  
  .ad-title {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
  }
  
  .ad-logo {
    height: 40px;
    margin-bottom: 0.75rem;
  }
  
  .ad-image-container {
    width: 95%;
    margin-bottom: 0.75rem;
    padding: 3px;
  }
  
  .ad-description {
    font-size: 1rem;
    margin-bottom: 1.25rem;
  }
  
  .ad-cta {
    padding: 0.7rem 1.75rem;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tech-pill:nth-child(2) {
  animation-delay: 0.1s;
}

.tech-pill:nth-child(3) {
  animation-delay: 0.2s;
}

.tech-pill:nth-child(4) {
  animation-delay: 0.3s;
}

/* Modern Rating System */
.stars-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 8px 0;
}

.vote-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #8a2be2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stars {
  display: inline-block;
  position: relative;
  font-size: 20px;
  color: rgba(var(--text-color-rgb), 0.15);
  overflow: hidden;
  user-select: none;
  height: 20px;
  letter-spacing: 3px;
  text-align: center;
}

.stars::before {
  content: "☆☆☆☆☆";
  position: absolute;
  top: 0;
  left: 0;
}

.stars::after {
  content: "☆☆☆☆☆";
  position: absolute;
  top: 0;
  left: 0;
  color: #FFD700;
  overflow: hidden;
  width: calc(var(--rating, 0) * 20%);
  white-space: nowrap;
}

.stars-interactive {
  position: relative;
  display: inline-block;
  font-size: 20px;
  user-select: none;
  cursor: pointer;
  letter-spacing: 3px;
  text-align: center;
  margin: 5px 0 10px;
}

.stars-interactive span {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 20px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  color: rgba(var(--text-color-rgb), 0.15);
  transition: all 0.2s ease;
}

.stars-interactive span::before {
  content: "☆";
  position: absolute;
  top: 0;
  left: 0;
}

/* New styles for persistent star selection */
.stars-interactive span.filled::before {
  content: "★";
  color: #FFD700;
}

.stars-interactive span.selected::before {
  color: #FFD700;
  transform: scale(1.2);
}

/* Keep hover behavior clean */
.stars-interactive:hover span::before {
  content: "★";
  color: rgba(255, 215, 0, 0.5);
}

.stars-interactive span:hover ~ span::before {
  content: "☆";
  color: rgba(var(--text-color-rgb), 0.15);
}

.stars-interactive span:hover::before {
  content: "★";
  color: #FFD700;
  transform: scale(1.2);
}

/* Rating label */
.vote-count {
  font-size: 12px;
  color: rgba(var(--text-color-rgb), 0.6);
  transition: all 0.2s ease;
  text-align: center;
  font-weight: 400;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Rating indicator chip */
.chips-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.rating-chip {
  background: rgba(var(--bg-color-rgb), 0.8);
  color: rgba(var(--text-color-rgb), 0.9);
  border-radius: 12px;
  padding: 3px 12px;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  cursor: default;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-weight: 600;
  border: 1px solid rgba(var(--text-color-rgb), 0.1);
}

.rating-chip.poor {
  background-color: #FEE2E2;
  color: #B91C1C;
  border-color: rgba(185, 28, 28, 0.2);
}

.rating-chip.fair {
  background-color: #FEF3C7;
  color: #B45309;
  border-color: rgba(180, 83, 9, 0.2);
}

.rating-chip.good {
  background-color: #FEF9C3;
  color: #A16207;
  border-color: rgba(161, 98, 7, 0.2);
}

.rating-chip.great {
  background-color: #DCFCE7;
  color: #15803D;
  border-color: rgba(21, 128, 61, 0.2);
}

.rating-chip.excellent {
  background-color: #DBEAFE;
  color: #1D4ED8;
  border-color: rgba(29, 78, 216, 0.2);
}

/* Call to action for unrated games */
.game-rating[data-votes="0"] .vote-count {
  background-color: rgba(var(--primary-color-rgb), 0.08);
  color: rgba(var(--primary-color-rgb), 0.9);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Rating confirmation message */
.rating-thanks {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.95), rgba(var(--secondary-color-rgb), 0.95));
  color: var(--light-text);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.8rem;
  animation: feedbackSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow: 0 10px 25px rgba(var(--primary-color-rgb), 0.25);
  white-space: nowrap;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  min-width: 240px;
}

.rating-feedback-icon {
  background: rgba(255, 255, 255,.2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rating-feedback-icon i {
  font-size: 1rem;
}

.rating-feedback-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.rating-feedback-title {
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.rating-feedback-subtitle {
  font-weight: 400;
  font-size: 0.75rem;
  opacity: 0.9;
}

.rating-thanks::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.95), rgba(var(--secondary-color-rgb), 0.95));
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes feedbackSlideIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Also update error message to match the same style */
.rating-error {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.8rem;
  animation: feedbackSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow: 0 10px 25px rgba(185, 28, 28, 0.25);
  white-space: nowrap;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  min-width: 240px;
}

.rating-error i {
  background: rgba(255, 255, 255, .2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.rating-error::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translate(-50%, -6px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Floating Feedback Button - 2025 Design */
.feedback-button-floating {
  position: absolute;
  bottom: 15px;
  left: 75%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 120px;
  height: 36px;
  padding: 0 16px;
  background: rgba(59, 130, 246, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 18px;
  color: white;
  box-shadow: 
    0 4px 12px rgba(59, 130, 246, 0.3),
    0 0 20px rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 5;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 1;
  text-decoration: none;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
}

.feedback-button-floating i {
  font-size: 0.9rem;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.feedback-button-floating::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, rgba(255,255,255,0.1), rgba(255,255,255,0.2));
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 18px;
}

.game-tile:hover .feedback-button-floating {
  transform: translateX(-50%) translateY(-5px);
}

.feedback-button-floating:hover {
  transform: translateX(-50%) translateY(-7px);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 
    0 5px 15px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.15);
}

.feedback-button-floating:hover::before {
  opacity: 1;
}

.feedback-button-floating:hover i {
  transform: scale(1.2);
}

[data-theme="dark"] .feedback-button-floating {
  background: rgba(79, 70, 229, 0.9);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 4px 12px rgba(79, 70, 229, 0.3),
    0 0 20px rgba(79, 70, 229, 0.2);
}

[data-theme="dark"] .feedback-button-floating:hover {
  background: rgba(0, 0, 0, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 5px 15px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(0, 0, 0, 0.2);
}

/* Remove previous feedback button styles that are no longer needed */
.feedback-button-container {
  display: none;
}

/* Dropdown Menu Styles */
nav .dropdown {
  position: relative;
}

nav .dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
}

nav .dropdown-toggle i {
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

nav .dropdown:hover .dropdown-toggle i {
  transform: rotate(180deg);
}

nav .dropdown-menu {
  position: absolute;
  background: var(--header-bg);
  backdrop-filter: blur(15px);
  border-radius: 15px;
  padding: 0.8rem 0;
  min-width: 220px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: all 0.3s ease;
  z-index: 150;
  border: 1px solid rgba(255, 255, 255, 0.2);
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(15px);
  overflow: visible;
}

nav .dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

nav .dropdown-menu a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

nav .dropdown-menu a:hover {
  background-color: rgba(var(--primary-color-rgb), 0.1);
  color: var(--primary-color);
}

@media (max-width: 768px) {
  nav .dropdown-menu {
    position: static;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
    border-radius: 5px;
    opacity: 1;
    visibility: visible;
    transform: none;
    margin: 0.5rem 0 0.5rem 1rem;
    max-height: 0;
    overflow: visible;
    transition: max-height 0.3s ease;
  }
  
  nav .dropdown:hover .dropdown-menu,
  nav .dropdown-toggle.active + .dropdown-menu {
    max-height: 100%;
  }
  
  nav .dropdown-toggle {
    width: 100%;
    justify-content: space-between;
  }
}

/* Mobile menu open state */
body.menu-open {
  overflow: hidden;
}

/* Add a nice subtle overlay when the menu is open */
body.menu-open::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(3px);
  z-index: 99;
  animation: fadeIn 0.3s ease-in-out;
  pointer-events: none;
}

[data-theme="dark"] body.menu-open::after {
  background: rgba(0, 0, 0, 0.5);
}

@media (min-width: 769px) {
  body.menu-open::after {
    display: none;
  }
}

/* Game Modal Styles */
.game-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.game-modal.active {
  opacity: 1;
  visibility: visible;
}

.game-modal-content {
  width: 90%;
  height: 90%;
  max-width: 1200px;
  background-color: var(--tile-bg);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-modal.active .game-modal-content {
  transform: scale(1);
}

.game-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.game-modal-title {
  color: white;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.game-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-modal-close,
.game-modal-newtab,
.game-modal-fullscreen {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.game-modal-close:hover,
.game-modal-newtab:hover,
.game-modal-fullscreen:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.game-modal-close:hover {
  transform: rotate(90deg) scale(1.1);
}

.game-modal-newtab:hover {
  transform: translateY(-2px) scale(1.1);
}

.game-modal-fullscreen::before,
.game-modal-newtab::before,
.game-modal-close::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 50%;
}

.game-modal-fullscreen:hover::before,
.game-modal-newtab:hover::before,
.game-modal-close:hover::before {
  opacity: 1;
}

/* Common button icon effects */
.game-modal-close svg,
.game-modal-newtab svg,
.game-modal-fullscreen svg:not(.fullscreen-icon) {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.3s ease;
  stroke-dasharray: 50;
  stroke-dashoffset: 0;
  animation: dashOffset 0.6s ease-in-out forwards;
  stroke: white;
}

.game-modal-close:hover svg,
.game-modal-newtab:hover svg,
.game-modal-fullscreen:hover .fullscreen-icon {
  stroke-width: 2.5;
  filter: drop-shadow(0px 0px 2px rgba(255, 255, 255, 0.5));
}

.game-modal-close:active svg,
.game-modal-newtab:active svg,
.game-modal-fullscreen:active .fullscreen-icon {
  transform: scale(0.9);
  transition-duration: 0.1s;
}

/* SVG Fullscreen Icons */
.fullscreen-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.3s ease;
  stroke-dasharray: 80;
  stroke-dashoffset: 0;
  stroke: white;
}

/* Entry animation for SVG paths */
@keyframes dashOffset {
  from {
    stroke-dashoffset: 80;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.fullscreen-icon path {
  animation: dashOffset 0.6s ease-in-out forwards;
}

.fullscreen-icon.expand {
  opacity: 1;
}

.fullscreen-icon.compress {
  opacity: 0;
}

.game-modal-content.fullscreen .fullscreen-icon.expand {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
}

.game-modal-content.fullscreen .fullscreen-icon.compress {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.game-modal-content.fullscreen .game-modal-fullscreen:hover .fullscreen-icon.compress {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Fullscreen button color changes in fullscreen mode */
.game-modal-content.fullscreen .game-modal-fullscreen {
  background: rgba(255, 255, 255, 0.15);
}

.game-modal-content.fullscreen .game-modal-fullscreen:hover {
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

/* Fullscreen state */
.game-modal-content.fullscreen {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  transform: none !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-modal-content.fullscreen .game-modal-header {
  padding: 10px 15px;
  background: rgba(0, 0, 0, 0.8);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  opacity: 0.6;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(0);
}

.game-modal-content.fullscreen .game-modal-header:hover {
  opacity: 1;
}

/* Hide header on scroll down in fullscreen mode */
.game-modal-content.fullscreen.header-hidden .game-modal-header {
  transform: translateY(-100%);
}

.game-modal-content.fullscreen .game-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

.game-modal-content.fullscreen .iframe-loading {
  z-index: 6;
}

/* Mobile fullscreen adjustments */
@media (max-width: 768px) {
  .game-modal-content.fullscreen .game-modal-header {
    padding: 8px 12px;
  }
  
  .game-modal-content.fullscreen .game-modal-actions {
    gap: 8px;
  }
  
  .game-modal-content.fullscreen .game-modal-close,
  .game-modal-content.fullscreen .game-modal-newtab,
  .game-modal-content.fullscreen .game-modal-fullscreen {
    width: 28px;
    height: 28px;
  }
}

.game-modal-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.game-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background-color: var(--bg-color);
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000;
  -webkit-transform: translateZ(0) scale(1.0, 1.0);
  -webkit-backface-visibility: hidden;
  -webkit-perspective: 1000;
}

/* Style for paused iframe to reduce resource usage */
.game-iframe.paused {
  will-change: auto;
  animation-play-state: paused;
  -webkit-animation-play-state: paused;
  filter: blur(0.5px);
  opacity: 0.98;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.game-modal-content.fullscreen .game-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  -webkit-backface-visibility: hidden;
}

.iframe-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-color);
  z-index: 1;
}

.iframe-loading p {
  margin-top: 20px;
  color: var(--text-color);
  font-size: 1.2rem;
  font-weight: 500;
}

.iframe-loading .loading-cube {
  width: 60px;
  height: 60px;
}

/* Dark theme adjustments */
[data-theme="dark"] .game-modal-content {
  background-color: var(--tile-bg);
  border-color: rgba(255, 255, 255, 0.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .game-modal-content {
    width: 95%;
    height: 95%;
  }
  
  .game-modal-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .game-modal-content {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
  
  .game-modal-header {
    padding: 10px 15px;
  }
  
  .game-modal-title {
    font-size: 1rem;
  }
  
  .game-modal-close,
  .game-modal-newtab,
  .game-modal-fullscreen {
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
  }
}

/* Rating Request Modal */
.rating-request-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.rating-request-modal.active {
  opacity: 1;
  visibility: visible;
}

.rating-request-content {
  background-color: #ffffff;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  border: 1px solid rgba(130, 130, 130, 0.15);
}

.rating-request-modal.active .rating-request-content {
  transform: translateY(0);
}

.rating-request-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(130, 130, 130, 0.15);
}

.rating-request-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color);
}

.rating-request-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color-secondary);
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
  border-radius: 50%;
}

.rating-request-close:hover {
  opacity: 1;
  transform: scale(1.1);
}

.rating-request-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rating-request-body p {
  margin: 0 0 20px;
  text-align: center;
  color: var(--text-color-secondary);
  font-size: 14px;
}

.rating-request-stars {
  display: flex;
  gap: 8px;
  margin-bottom: 25px;
  flex-direction: row-reverse; /* Reverse the order for proper hover effect */
  justify-content: center;
}

.rating-request-star {
  cursor: pointer;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  position: relative;
}

.rating-request-star svg {
  width: 100%;
  height: 100%;
  stroke: #aaaaaa;
  stroke-width: 1.5;
  fill: transparent;
  transition: fill 0.2s ease, stroke 0.2s ease, transform 0.2s ease;
}

.rating-request-star:hover {
  transform: scale(1.15);
}

/* Reset all stars when hovering the container */
.rating-request-stars:hover .rating-request-star svg {
  stroke: #d4d4d4;
  fill: transparent;
}

/* Fill stars from right to left (due to flex-direction: row-reverse) */
.rating-request-star:hover svg, 
.rating-request-star:hover ~ .rating-request-star svg {
  stroke: #ffc107;
  fill: #ffc107;
}

/* Set the selected star appearance */
.rating-request-star.selected svg {
  fill: #ffc107;
  stroke: #ffc107;
}

/* Add sequential hover effect for stars */
.rating-request-stars:hover .rating-request-star svg {
  stroke: #d4d4d4;
  fill: transparent;
}

/* This rule applies to all stars before the hovered one */
.rating-request-star:hover svg,
.rating-request-star:hover ~ .rating-request-star svg {
  stroke: #ffc107;
  fill: #ffc107;
}

/* This fills all stars up to and including the hovered one */
.rating-request-stars .rating-request-star:hover svg,
.rating-request-stars .rating-request-star:hover ~ .rating-request-star:hover svg {
  stroke: #ffc107;
  fill: #ffc107;
}

/* Fix the hover logic - in rating stars, earlier siblings come AFTER in DOM */
.rating-request-stars {
  display: flex;
  gap: 8px;
  margin-bottom: 25px;
  flex-direction: row-reverse; /* Reverse the order for proper hover effect */
  justify-content: center;
}

/* Now adjust the hover effect for the correct direction */
.rating-request-stars .rating-request-star:hover ~ .rating-request-star svg {
  stroke: #ffc107;
  fill: #ffc107;
}

/* Prevent hover effects when a star is already selected */
.rating-request-star.selected ~ .rating-request-star svg {
  stroke: #d4d4d4;
  fill: transparent;
}

/* Make stars glow slightly in dark mode */
[data-theme="dark"] .rating-request-star svg {
  stroke: #777777;
}

[data-theme="dark"] .rating-request-star:hover svg,
[data-theme="dark"] .rating-request-star.selected svg {
  stroke: #ffcd3c;
  filter: drop-shadow(0 0 3px rgba(255, 193, 7, 0.5));
}

[data-theme="dark"] .rating-request-star.selected svg {
  fill: #ffcd3c;
}

@media (max-width: 480px) {
  .rating-request-stars {
    gap: 5px;
  }
  
  .rating-request-star {
    width: 40px;
    height: 40px;
  }
}

.rating-request-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
}

.rating-request-skip,
.rating-request-submit {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rating-request-skip {
  background-color: transparent;
  color: var(--text-color-secondary);
  border: 1px solid rgba(130, 130, 130, 0.2);
}

.rating-request-skip:hover {
  background-color: rgba(130, 130, 130, 0.1);
}

.rating-request-submit {
  background-color: #4F46E5;
  color: white;
}

.rating-request-submit:hover:not(:disabled) {
  background-color: #4338CA;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(67, 56, 202, 0.3);
}

.rating-request-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Success animation */
.rating-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

.rating-success p {
  margin-top: 15px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-color);
}

.checkmark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: #4F46E5;
  stroke-miterlimit: 10;
  animation: fill 0.4s ease-in-out 0.4s forwards, scale 0.3s ease-in-out 0.9s both;
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: #4F46E5;
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes scale {
  0%, 100% {
    transform: none;
  }
  50% {
    transform: scale3d(1.1, 1.1, 1);
  }
}

@keyframes fill {
  100% {
    box-shadow: inset 0px 0px 0px 30px rgba(79, 70, 229, 0.1);
  }
}

/* Dark mode adjustments */
[data-theme="dark"] .rating-request-content {
  background-color: #1e2028;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .rating-request-header {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .rating-request-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .rating-request-content {
    width: 95%;
  }
  
  .rating-request-stars {
    gap: 5px;
  }
  
  .rating-request-star {
    width: 35px;
    height: 35px;
  }
  
  .rating-request-buttons {
    width: 100%;
  }
  
  .rating-request-skip,
  .rating-request-submit {
    flex: 1;
  }
} 

/* Loading state for stars */
.rating-request-stars.rating-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Error message styling */
.rating-error-message {
  color: #e74c3c;
  text-align: center;
  margin-top: 15px;
  font-size: 14px;
  padding: 8px 12px;
  background-color: rgba(231, 76, 60, 0.1);
  border-radius: 6px;
  animation: fadeIn 0.3s ease-in-out;
}

[data-theme="dark"] .rating-error-message {
  background-color: rgba(231, 76, 60, 0.2);
}

/* Animation for the loading cube in iframe */
.loading-cube {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  position: relative;
  transform-style: preserve-3d;
  animation: rotate 2s infinite linear;
}

.cube-face {
  position: absolute;
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.9);
  border: 3px solid var(--primary-color);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.cube-face-front {
  transform: translateZ(40px);
}

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

.cube-face-right {
  transform: rotateY(90deg) translateZ(40px);
}

.cube-face-left {
  transform: rotateY(-90deg) translateZ(40px);
}

.cube-face-top {
  transform: rotateX(90deg) translateZ(40px);
}

.cube-face-bottom {
  transform: rotateX(-90deg) translateZ(40px);
}

@keyframes rotate {
  0% {
    transform: rotateX(0) rotateY(0);
  }
  100% {
    transform: rotateX(360deg) rotateY(360deg);
  }
}