/* YouTube プレイヤーのスタイル */
.youtube-player {
  position: fixed;
  bottom: -400px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 600px;
  background: linear-gradient(135deg, #1a1f25, #0f1923);
  border: 2px solid #ff4655;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(255, 70, 85, 0.4);
  transition: bottom 0.5s ease;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
}

.youtube-player.active {
  bottom: 120px;
  opacity: 1;
  visibility: visible;
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #333;
}

.player-header h3 {
  color: #ff4655;
  margin: 0;
}

.close-player {
  background: none;
  border: none;
  color: #ff4655;
  font-size: 1.5rem;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.close-player:hover {
  background-color: rgba(255, 70, 85, 0.2);
}

.player-container {
  padding: 1rem;
}

/* 音楽カードのアニメーション強化 */
.music-card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.music-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 70, 85, 0.2), transparent);
  transition: left 0.5s ease;
}

.music-card:hover::before {
  left: 100%;
}

.music-card.playing {
  border-color: #00d4ff;
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.4);
}

.music-card.playing .music-cover {
  background: linear-gradient(45deg, #00d4ff, #ff4655);
  animation: rotate 3s linear infinite;
}

/* 再生ボタンを常に▶に固定 */
.play-button {
  position: relative;
  color: transparent;
  font-size: 0;
}

.play-button::after {
  content: "▶";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: white;
  pointer-events: none;
  transition: transform 0.3s ease;
}

.music-cover:hover .play-button::after {
  transform: translate(-50%, -50%) scale(1.2);
}

.music-card.playing .play-button::after {
  content: "▶";
}

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

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .youtube-player {
    width: 95%;
  }
  
  .youtube-player.active {
    bottom: 140px;
  }
  
  .player-container iframe {
    height: 250px;
  }
  
  .music-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .music-card {
    padding: 2rem;
  }
  
  .music-cover {
    width: 80px;
    height: 80px;
  }
  
  .play-button::after {
    font-size: 1.5rem;
  }
  
  .player-header {
    padding: 0.8rem;
  }
  
  .player-header h3 {
    font-size: 1rem;
  }
  
  .player-container {
    padding: 0.8rem;
  }
}

@media (max-width: 480px) {
  .youtube-player {
    width: 98%;
  }
  
  .youtube-player.active {
    bottom: 120px;
  }
  
  .player-container iframe {
    height: 200px;
  }
  
  .music-grid {
    gap: 1rem;
  }
  
  .music-card {
    padding: 1.5rem;
  }
  
  .music-cover {
    width: 70px;
    height: 70px;
  }
  
  .play-button::after {
    font-size: 1.3rem;
  }
  
  .player-header h3 {
    font-size: 0.9rem;
  }
  
  .close-player {
    font-size: 1.2rem;
    width: 25px;
    height: 25px;
  }
}
