.episode-card {
  background: rgba(10, 10, 15, 0.9);
  border: 2px solid var(--neon-purple);
  padding: 2rem;
  transition: all 0.3s ease;
  position: relative;
  min-height: 350px;
  display: flex;
  flex-direction: column;
}

.episode-card:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
  transform: translateY(-5px);
}

.episode-card.locked {
  opacity: 0.5;
  filter: grayscale(1);
  pointer-events: none;
}

.episode-status {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--neon-orange);
  color: var(--bg-dark);
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.episode-card.locked .episode-status {
  background: var(--text-secondary);
}

.episode-title {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: var(--neon-cyan);
}

.episode-duration {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-style: italic;
}

.episode-description {
  flex-grow: 1;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.play-btn {
  position: relative;
  background: transparent;
  border: 2px solid var(--neon-magenta);
  color: var(--neon-magenta);
  padding: 1rem 3rem;
  font-size: 1.2rem;
  font-family: 'Courier New', 'Consolas', monospace;
  font-weight: bold;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  width: 100%;
  margin-top: auto;
}

.play-btn:hover:not(:disabled) {
  background: var(--neon-magenta);
  color: var(--bg-dark);
  box-shadow: 0 0 30px var(--neon-magenta);
  transform: scale(1.05);
}

.play-btn:disabled {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.play-btn .btn-text {
  position: relative;
  z-index: 1;
}

.play-btn .btn-glitch {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}

.play-btn:hover:not(:disabled) .btn-glitch {
  animation: btn-glitch 0.3s;
}

@keyframes btn-glitch {
  0%, 100% {
    opacity: 0;
    transform: translate(-50%, -50%);
  }
  25% {
    opacity: 1;
    transform: translate(calc(-50% - 5px), -50%);
  }
  50% {
    opacity: 1;
    transform: translate(calc(-50% + 5px), -50%);
  }
  75% {
    opacity: 1;
    transform: translate(calc(-50% - 5px), -50%);
  }
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.hidden {
  display: none;
}

.modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  cursor: pointer;
}

.modal-content {
  position: relative;
  width: 95vw;
  height: 90vh;
  max-width: 1920px;
  background: var(--bg-darker);
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 0 50px rgba(0, 255, 255, 0.5);
  z-index: 1;
}

.close-btn {
  position: absolute;
  top: -50px;
  right: 0;
  background: transparent;
  border: 2px solid var(--neon-magenta);
  color: var(--neon-magenta);
  font-size: 2rem;
  width: 50px;
  height: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  line-height: 1;
}

.close-btn:hover {
  background: var(--neon-magenta);
  color: var(--bg-dark);
  box-shadow: 0 0 20px var(--neon-magenta);
}

.game-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--neon-cyan);
  z-index: 1;
}

.loading-indicator.hidden {
  display: none;
}

.spinner {
  border: 4px solid rgba(0, 255, 255, 0.2);
  border-top: 4px solid var(--neon-cyan);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

#game-frame {
  width: 100%;
  height: 100%;
  border: none;
}

@media (max-width: 768px) {
  .episode-card {
    min-height: 300px;
    padding: 1.5rem;
  }

  .episode-card:hover {
    transform: none;
  }

  .episode-card:active {
    transform: scale(0.98);
  }

  .play-btn {
    padding: 0.8rem 2rem;
    font-size: 1rem;
  }

  .modal-content {
    width: 100vw;
    height: 100vh;
    border: none;
  }

  .close-btn {
    top: 10px;
    right: 10px;
    z-index: 10001;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }
}

@media (hover: none) {
  .episode-card:hover {
    transform: none;
  }

  .play-btn:hover {
    transform: none;
  }
}
