body {
  background: radial-gradient(circle at top left, #2b005f, #00132b, #000);
  background-attachment: fixed;
  color: #0ff;
  font-family: monospace;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  animation: bgMove 20s ease-in-out infinite alternate;
  background-size: 200% 200%;
}

@keyframes bgMove {
  0% {
    background-position: 0% 0%;
  }

  100% {
    background-position: 100% 100%;
  }
}

.logo-container {
  margin-top: 10px;
  text-align: center;
}

.logo {
  width: 300px;
  height: auto;
  filter: drop-shadow(0 0 10px #0ff);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 20px #0ff);
}

.menu {
  margin-top: 20px;
}

#game {
  width: 640px;
  height: 480px;
  margin: 40px auto;
  border: 3px solid #0ff;
  background: #111;
  box-shadow: 0 0 20px #0ff;
}


.chat-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 60px;
  height: 60px;
  background: #0ff;
  border: none;
  border-radius: 50%;
  color: #000;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 0 20px #0ff;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  z-index: 1000;
}

.chat-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 30px #0ff;
}

.chat-icon {
  position: fixed;
  bottom: 30px;
  right: 32px;
  width: 45px !important;
  height: 45px !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain;
  z-index: 1001;
  filter: drop-shadow(0 0 10px #0ff);
  pointer-events: none;
  /* clics passent à travers */
}

.games-container {
  margin-top: 80px;
  padding: 40px;
  text-align: center;
}

/* Search Bar Styles */
.search-container {
  margin-bottom: 30px;
  display: flex;
  justify-content: center;
}

.search-container form {
  display: flex;
  align-items: center;
  background: rgba(10, 10, 20, 0.8);
  border: 2px solid #0ff;
  border-radius: 30px;
  padding: 5px 15px;
  box-shadow: 0 0 15px #0ff, inset 0 0 10px rgba(0, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.search-container form:hover,
.search-container form:focus-within {
  box-shadow: 0 0 30px #0ff, inset 0 0 15px rgba(0, 255, 255, 0.2);
  border-color: #fff;
  transform: scale(1.02);
}

.search-input {
  background: transparent;
  border: none;
  color: #0ff;
  font-family: monospace;
  font-size: 16px;
  padding: 10px;
  width: 200px;
  outline: none;
  text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.search-input::placeholder {
  color: rgba(0, 255, 255, 0.5);
  text-shadow: none;
}

.search-btn {
  background: transparent;
  border: none;
  color: #0ff;
  font-size: 18px;
  cursor: pointer;
  padding: 5px 10px;
  transition: all 0.3s ease;
}

.search-btn:hover {
  transform: scale(1.2) rotate(10deg);
  text-shadow: 0 0 15px #0ff;
  color: #fff;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 30px;
  justify-items: center;
}

.game-card {
  background: rgba(10, 10, 20, 0.8);
  border: 2px solid #0ff;
  border-radius: 15px;
  box-shadow: 0 0 15px #0ff;
  padding: 15px;
  width: 200px;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.game-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px #0ff;
}

.game-card img {
  width: 100%;
  border-radius: 10px;
}

.game-card h3 {
  margin-top: 10px;
  color: #0ff;
  font-size: 16px;
}

.game-card p {
  color: #aaa;
  font-size: 14px;
}

.no-games {
  color: #0ff;
  font-size: 18px;
  margin-top: 50px;
}

.add-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #0ff;
  border: 2px dashed #0ff;
  cursor: pointer;
  transition: all 0.3s ease;
}

#chat-popup {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 380px;
  height: 500px;
  background: linear-gradient(135deg, rgba(15, 15, 30, 0.98) 0%, rgba(20, 20, 40, 0.98) 100%);
  border: 2px solid #0ff;
  border-radius: 15px;
  box-shadow: 0 -8px 32px rgba(0, 255, 255, 0.5),
    0 0 0 1px rgba(0, 255, 255, 0.2) inset,
    0 0 40px rgba(0, 255, 255, 0.3);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(10px);
  /* Animation seulement si la classe .first-open est présente */
  max-width: calc(100vw - 30px);
  max-height: calc(100vh - 120px);
  min-width: 300px;
}

/* Animation seulement au premier affichage */
#chat-popup.first-open {
  animation: slideUp 0.3s ease-out;
}

/* Animation d'apparition depuis le bas avec effet de scale */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-header {
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.25) 0%, rgba(0, 204, 204, 0.2) 100%);
  padding: 18px 20px;
  border-bottom: 2px solid rgba(0, 255, 255, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 255, 255, 0.2);
}

.chat-header h3 {
  margin: 0;
  color: #0ff;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
  letter-spacing: 0.5px;
}

.chat-close {
  background: rgba(255, 0, 0, 0.7);
  color: #fff;
  border: 2px solid rgba(255, 0, 0, 0.5);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.chat-close:hover {
  background: rgba(255, 255, 0, 0.9);
  color: #000;
  border-color: #ff0;
  transform: scale(1.15) rotate(90deg);
  box-shadow: 0 0 15px rgba(255, 255, 0, 0.5);
}

#chat-iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: transparent;
}

/* Petite fleche pointant vers le bouton */
#chat-popup::after {
  content: '';
  position: absolute;
  bottom: -12px;
  right: 45px;
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 15px solid #0ff;
  filter: drop-shadow(0 4px 8px rgba(0, 255, 255, 0.4));
  z-index: 1;
}

/* Ombre de la fleche pour effet neon */
#chat-popup::before {
  content: '';
  position: absolute;
  bottom: -14px;
  right: 43px;
  width: 0;
  height: 0;
  border-left: 17px solid transparent;
  border-right: 17px solid transparent;
  border-top: 17px solid rgba(0, 255, 255, 0.3);
  z-index: 0;
}

/* Responsive pour la popup */
@media (max-width: 768px) {
  #chat-popup {
    width: calc(100vw - 30px);
    max-width: 380px;
    height: 70vh;
    right: 15px;
    bottom: 95px;
    border-radius: 15px;
  }

  #chat-popup::after,
  #chat-popup::before {
    display: none;
  }
}

@media (max-width: 480px) {
  #chat-popup {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 90px;
  }
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
  background-color: #111;
  margin: 10% auto;
  padding: 20px;
  border: 2px solid #0ff;
  width: 400px;
  box-shadow: 0 0 15px #0ff;
  border-radius: 10px;
  color: #0ff;
}

.modal-content input,
.modal-content select {
  width: 100%;
  padding: 8px;
  margin: 5px 0 10px;
  background-color: #000;
  border: 1px solid #0ff;
  color: #0ff;
}

.close-btn {
  float: right;
  font-size: 28px;
  cursor: pointer;
}