/* games.css — Game Zone Grid — Pure Telmo Tech Style */
/* CLOSE BUTTON — BOTTOM CENTER OF GAMES GRID */
/* GAMES PAGE — DIALOGUE TEXT CUSTOMIZATION */
.chat-trigger {
  color: #00ccff !important;
  text-shadow: 0 0 20px #00ccff;
  cursor: pointer;
  transition: all 0.4s ease;
  text-decoration: none !important;
  font-weight: 900;
}

.chat-trigger:hover {
  color: white !important;
  text-shadow: 0 0 40px white;
  transform: scale(1.05);
}

/* DIALOGUE BOX — DEFAULT (DESKTOP) */
#dialogueBox.dialogue-visible {
  bottom: 170px !important; 
  opacity: 1;
  pointer-events: auto;
}

/* MOBILE — DIALOGUE BOX LOWER (NOT TOO HIGH) */
@media (max-width: 768px) {
  #dialogueBox.dialogue-visible {
    bottom: 80px !important;   /* ← LOWER ON TABLET/MOBILE */
  }
}

@media (max-width: 480px) {
  #dialogueBox.dialogue-visible {
    bottom: 60px !important;   /* ← EVEN LOWER ON SMALL PHONES */
  }
}

/* FORCE CANVAS TO NEVER BLOCK CLICKS */
canvas#spaceCanvas,
canvas {
  pointer-events: none !important;
  z-index: 0;
}

#dialogueBox .dialogue-content {
  font-size: 18px;
  line-height: 1.6;
  letter-spacing: 1px;
}

#dialogueBox .dialogue-content strong {
  color: #00ffff;
  font-weight: 900;
  text-shadow: 0 0 30px #00ffff;
}

#dialogueBox .dialogue-content .dialogue-small {
  font-size: 22px;
  opacity: 0.8;
  line-height: 1.5;
}

#dialogueBox .dialogue-btn {
  display: inline-block;
  padding: 16px 20px;
  background: rgba(255,255,255,0.1);
  border: 2px solid white;
  color: white;
  font-size: 28px;
  font-weight: bold;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.4s ease;
  margin-top: 20px;
}

#dialogueBox .dialogue-btn:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.05);
  box-shadow: 0 0 40px white;
}

.grid-close-btn {
  position: fixed;
  bottom: 140px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  border: 4px solid white;
  color: white;
  font-size: 48px;
  font-weight: 100;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100001;
  box-shadow: 
    0 0 60px rgba(255,255,255,0.8),
    0 20px 40px rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
}

.grid-close-btn:hover {
  background: rgba(255,255,255,0.15);
  transform: translateX(-50%) scale(1.25);
  box-shadow: 0 0 100px white;
}

/* Mobile — slightly higher so it's not hidden by fingers */
@media (max-width: 768px) {
  .grid-close-btn {
    bottom: 60px;
    width: 85px;
    height: 85px;
    font-size: 44px;
  }
}

#gamesGrid {
  position: fixed;
  top: 100vh;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 20, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99998;
  transition: top 1.8s cubic-bezier(0.22, 1, 0.36, 1);
  padding: 100px 40px 60px;
  overflow-y: auto;
  box-sizing: border-box;
}

#gamesGrid.games-grid-visible {
  top: 0;
}

.grid-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
}

.game-card {
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 35px;
  text-align: center;
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, transparent, rgba(0, 136, 255, 0.05));
  opacity: 0;
  transition: opacity 0.6s;
}

.game-card:hover::before {
  opacity: 1;
}

.game-card:hover {
  transform: translateY(-20px) scale(1.02);
  border-color: #00ffff;
  box-shadow: 
    0 30px 60px rgba(0, 255, 255, 0.25),
    0 0 80px rgba(0, 255, 255, 0.15);
}

.placeholder {
  width: 100%;
  height: 220px;
  background: linear-gradient(45deg, #0a0a1a, #1a1a2e);
  border-radius: 20px;
  margin-bottom: 25px;
  border: 3px dashed rgba(255, 255, 255, 0.2);
  background-size: 400% 400%;
  animation: gradient 8s ease infinite;
}

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

.game-card h3 {
  color: #00ffff;
  font-size: 32px;
  font-weight: 900;
  margin: 20px 0 12px;
  text-shadow: 0 0 30px #00ffff;
  letter-spacing: 1px;
}

.game-card p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 20px;
  font-style: italic;
}

/* Mobile */
@media (max-width: 768px) {
  #gamesGrid { padding: 80px 20px 40px; }
  .grid-container { gap: 30px; }
  .game-card h3 { font-size: 28px; }
}

@media (max-width: 480px) {
  .game-card h3 { font-size: 24px; }
  .game-card p { font-size: 18px; }
}

/* MUSIC PLAYER — STICKS TO BOTTOM PERFECTLY ON MOBILE */
#musicPlayer {
  position: fixed;
  bottom: -100px;
  left: 0;
  width: 100%;
  height: 90px;
  background: rgba(0, 0, 30, 0.95);
  backdrop-filter: blur(25px);
  border-top: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 -15px 40px rgba(0,0,0,0.7);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 15px;
  transition: bottom 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: 'Orbitron', sans-serif;
  color: white;
  font-size: 16px;
}

#musicPlayer.music-visible {
  bottom: 0 !important;
}

/* MOBILE — PLAYER STAYS AT BOTTOM */
@media (max-width: 768px) {
  #musicPlayer {
    height: 100px;
    flex-direction: column;
    gap: 15px;
    padding: 12px;
  }
  
  #musicPlayer.music-visible {
    bottom: 0 !important;
  }
}