* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: linear-gradient(135deg, #0d2d4a 0%, #1a4d6f 50%, #2a6f95 100%);
  min-height: 100vh;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #0d2d4a 0%, #1a4d6f 50%, #2a6f95 100%);
  background-attachment: fixed;
  color: #fff;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

/* Animated dot marble pattern (キラキラドット - 増量版！) */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    /* 大きめの水色ドット（メイン） */
    radial-gradient(circle at 10% 20%, rgba(100, 220, 255, 0.5) 0%, transparent 3%),
    radial-gradient(circle at 80% 80%, rgba(50, 200, 255, 0.4) 0%, transparent 3%),
    radial-gradient(circle at 50% 50%, rgba(150, 240, 255, 0.45) 0%, transparent 3%),
    radial-gradient(circle at 90% 10%, rgba(80, 210, 255, 0.4) 0%, transparent 3%),
    radial-gradient(circle at 20% 90%, rgba(120, 230, 255, 0.5) 0%, transparent 3%),
    radial-gradient(circle at 60% 30%, rgba(100, 220, 255, 0.4) 0%, transparent 3%),
    radial-gradient(circle at 30% 60%, rgba(70, 200, 255, 0.45) 0%, transparent 3%),
    radial-gradient(circle at 70% 70%, rgba(130, 235, 255, 0.4) 0%, transparent 3%),
    /* 中くらいのドット（追加） */
    radial-gradient(circle at 15% 45%, rgba(110, 225, 255, 0.35) 0%, transparent 2%),
    radial-gradient(circle at 85% 25%, rgba(90, 215, 255, 0.3) 0%, transparent 2%),
    radial-gradient(circle at 45% 85%, rgba(120, 230, 255, 0.35) 0%, transparent 2%),
    radial-gradient(circle at 65% 15%, rgba(100, 220, 255, 0.3) 0%, transparent 2%),
    radial-gradient(circle at 25% 35%, rgba(80, 210, 255, 0.35) 0%, transparent 2%),
    radial-gradient(circle at 75% 55%, rgba(140, 235, 255, 0.3) 0%, transparent 2%),
    /* 小さいドット（キラキラ感） */
    radial-gradient(circle at 35% 25%, rgba(160, 240, 255, 0.25) 0%, transparent 1.5%),
    radial-gradient(circle at 55% 65%, rgba(140, 235, 255, 0.25) 0%, transparent 1.5%),
    radial-gradient(circle at 95% 45%, rgba(120, 230, 255, 0.25) 0%, transparent 1.5%),
    radial-gradient(circle at 5% 75%, rgba(100, 220, 255, 0.25) 0%, transparent 1.5%),
    radial-gradient(circle at 40% 10%, rgba(130, 235, 255, 0.25) 0%, transparent 1.5%),
    radial-gradient(circle at 88% 60%, rgba(110, 225, 255, 0.25) 0%, transparent 1.5%);
  background-size: 100% 100%;
  animation: marbleFlow 25s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}

/* Floating particles overlay (白いキラキラ - 増量版！) */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    /* 明るい白いドット */
    radial-gradient(circle at 15% 35%, rgba(255, 255, 255, 0.2) 0%, transparent 2%),
    radial-gradient(circle at 85% 45%, rgba(255, 255, 255, 0.15) 0%, transparent 2%),
    radial-gradient(circle at 45% 75%, rgba(255, 255, 255, 0.22) 0%, transparent 2%),
    radial-gradient(circle at 75% 15%, rgba(255, 255, 255, 0.12) 0%, transparent 2%),
    radial-gradient(circle at 25% 85%, rgba(255, 255, 255, 0.18) 0%, transparent 2%),
    radial-gradient(circle at 55% 25%, rgba(255, 255, 255, 0.2) 0%, transparent 2%),
    /* 中くらいの白いドット */
    radial-gradient(circle at 12% 55%, rgba(255, 255, 255, 0.14) 0%, transparent 1.5%),
    radial-gradient(circle at 92% 70%, rgba(255, 255, 255, 0.16) 0%, transparent 1.5%),
    radial-gradient(circle at 62% 40%, rgba(255, 255, 255, 0.15) 0%, transparent 1.5%),
    radial-gradient(circle at 38% 12%, rgba(255, 255, 255, 0.13) 0%, transparent 1.5%),
    /* 小さいキラキラ */
    radial-gradient(circle at 8% 68%, rgba(255, 255, 255, 0.1) 0%, transparent 1%),
    radial-gradient(circle at 68% 88%, rgba(255, 255, 255, 0.12) 0%, transparent 1%),
    radial-gradient(circle at 48% 58%, rgba(255, 255, 255, 0.11) 0%, transparent 1%),
    radial-gradient(circle at 78% 28%, rgba(255, 255, 255, 0.1) 0%, transparent 1%),
    radial-gradient(circle at 28% 48%, rgba(255, 255, 255, 0.12) 0%, transparent 1%),
    radial-gradient(circle at 98% 38%, rgba(255, 255, 255, 0.11) 0%, transparent 1%);
  background-size: 100% 100%;
  animation: particleFloat 20s ease-in-out infinite reverse;
  z-index: 0;
  pointer-events: none;
  opacity: 0.8;
}

@keyframes marbleFlow {
  0%, 100% {
    transform: translate(0%, 0%) scale(1);
  }
  25% {
    transform: translate(10%, 5%) scale(1.05);
  }
  50% {
    transform: translate(20%, 10%) scale(1);
  }
  75% {
    transform: translate(10%, 5%) scale(1.05);
  }
}

@keyframes particleFloat {
  0%, 100% {
    transform: translate(0%, 0%);
  }
  50% {
    transform: translate(-15%, -15%);
  }
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 40px;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #5dd9ff, #00d4ff, #5dd9ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite;
  background-size: 200% auto;
}

@keyframes shimmer {
  0%, 100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

.subtitle {
  color: #aaa;
  font-size: 1rem;
}

.terms-link {
  color: #5dd9ff;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.3s ease;
}

.terms-link:hover {
  color: #00d4ff;
}

/* Mobile Swipe Carousel (モバイル専用) */
.mobile-carousel {
  display: none; /* デフォルトは非表示 */
  position: relative;
  width: 100%;
  height: calc(100vh - 180px);
  overflow: hidden;
  margin-bottom: 20px;
}

.carousel-track {
  display: flex;
  height: 100%;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 0 5vw;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-card {
  flex: 0 0 90vw;
  width: 90vw;
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.carousel-card-inner {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  padding: 30px;
  backdrop-filter: blur(20px);
  border: 2px solid rgba(100, 220, 255, 0.3);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3),
              0 0 50px rgba(100, 220, 255, 0.2);
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 500px;
}

.carousel-artwork {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4),
              0 0 40px rgba(100, 220, 255, 0.3);
  position: relative;
  z-index: 20;
  background: #000;
}

.carousel-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 21;
  display: block;
}

.carousel-info {
  margin-bottom: 20px;
  text-align: center;
}

.carousel-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #5dd9ff, #00d4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
}

.carousel-arranger {
  color: #5dd9ff;
  font-size: 1.1rem;
  font-weight: 500;
}

.carousel-seekbar-container {
  margin-bottom: 25px;
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.carousel-indicator {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #5dd9ff;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(100, 220, 255, 0.4);
  backdrop-filter: blur(10px);
  z-index: 100;
}

/* Desktop Player with Stats Container */
.player-with-stats-container {
  display: flex;
  gap: 30px;
  max-width: 1400px;
  margin: 0 auto 40px auto;
  align-items: flex-start;
}

/* Desktop Player (PC専用) */
.player-container {
  flex: 0 0 450px;
  max-width: 450px;
}

.player-card {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  padding: 30px;
  backdrop-filter: blur(20px);
  border: 2px solid rgba(100, 220, 255, 0.3);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3),
              0 0 50px rgba(100, 220, 255, 0.2);
  position: relative;
  z-index: 10;
}

/* 1. Large Jacket Image */
.player-jacket {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4),
              0 0 40px rgba(100, 220, 255, 0.3);
  position: relative;
  z-index: 20;
  background: #000;
}

.player-jacket img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 21;
  display: block;
}

/* 2. Title */
.player-title {
  margin-bottom: 15px;
  text-align: center;
}

.player-title div {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(90deg, #5dd9ff, #00d4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
}

/* 3. Credits (Auto-scrolling like old Walkman) */
.player-credits-container {
  height: 30px;
  overflow: hidden;
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 6px 10px;
  position: relative;
}

.player-credits {
  display: inline-block;
  white-space: nowrap;
  animation: marquee 20s linear infinite;
}

.player-credits .credits-text {
  color: #5dd9ff;
  font-size: 1.15rem;
  font-weight: 500;
  padding-right: 50px; /* Space before looping */
}

/* Pause animation on hover */
.player-credits-container:hover .player-credits {
  animation-play-state: paused;
}

@keyframes marquee {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* 4-6. Producer Section (Photo + Info) */
.player-producer {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  border: 1px solid rgba(100, 220, 255, 0.2);
}

.producer-photo {
  flex-shrink: 0;
}

.producer-photo img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(100, 220, 255, 0.4);
  background: #2a2a3e;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.producer-info {
  flex: 1;
  min-width: 0;
}

.producer-label {
  color: #888;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.producer-name {
  color: #5dd9ff;
  font-size: 1.1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 9. Production Date (Bottom Right) */
.production-date {
  position: absolute;
  bottom: 8px;
  right: 8px;
  color: #888;
  font-size: 0.65rem;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.5);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(100, 220, 255, 0.15);
  backdrop-filter: blur(10px);
  z-index: 50;
}

/* 8. Player Controls Row (Mode + Play + Waveform) */
.player-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

/* Hide default audio player */
#audio-player {
  display: none;
}

/* Seekbar (Full Width) */
.seekbar-container-full {
  margin-bottom: 25px;
}

.time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.time-text {
  font-size: 0.9rem;
  color: #aaa;
  font-variant-numeric: tabular-nums;
}

/* Player Controls (Vertical Layout) */
.player-controls-vertical {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.control-btn-icon {
  background: rgba(100, 220, 255, 0.15);
  border: 2px solid rgba(100, 220, 255, 0.4);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #5dd9ff;
  flex-shrink: 0;
}

.control-btn-icon:hover {
  background: rgba(100, 220, 255, 0.3);
  transform: scale(1.1);
  box-shadow: 0 0 25px rgba(100, 220, 255, 0.5);
  border-color: #5dd9ff;
}

.control-btn-icon:active {
  transform: scale(0.95);
}

.share-btn {
  border-radius: 999px;
  width: auto;
  padding: 0 14px;
  gap: 8px;
}

.share-btn-text {
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.control-btn-large {
  background: linear-gradient(135deg, rgba(100, 220, 255, 0.3), rgba(0, 212, 255, 0.3));
  border: 3px solid #5dd9ff;
  border-radius: 50%;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 5px 20px rgba(100, 220, 255, 0.4);
}

.control-btn-large:hover {
  background: linear-gradient(135deg, rgba(100, 220, 255, 0.5), rgba(0, 212, 255, 0.5));
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(100, 220, 255, 0.6);
}

.control-btn-large:active {
  transform: scale(0.95);
}

/* Waveform Animation */
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 40px;
  width: 50px;
  flex-shrink: 0;
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.waveform.playing {
  opacity: 1;
}

.wave-bar {
  width: 4px;
  height: 8px;
  background: linear-gradient(180deg, #00d4ff, #0099ff);
  border-radius: 2px;
  animation: wave 0.8s ease-in-out infinite;
  transform-origin: center;
}

.wave-bar:nth-child(1) {
  animation-delay: 0s;
}

.wave-bar:nth-child(2) {
  animation-delay: 0.1s;
}

.wave-bar:nth-child(3) {
  animation-delay: 0.2s;
}

.wave-bar:nth-child(4) {
  animation-delay: 0.3s;
}

.wave-bar:nth-child(5) {
  animation-delay: 0.4s;
}

.waveform:not(.playing) .wave-bar {
  animation: none;
  height: 8px;
}

@keyframes wave {
  0%, 100% {
    height: 8px;
  }
  50% {
    height: 32px;
  }
}

.time-display {
  font-size: 0.9rem;
  color: #aaa;
  min-width: 45px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Custom Seekbar */
.seekbar-container {
  flex: 1;
  padding: 10px 0;
}

.seekbar {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  cursor: pointer;
  overflow: visible;
  padding: 10px 0;
  margin: -10px 0;
}

.seekbar-progress {
  position: absolute;
  height: 6px;
  top: 10px;
  background: linear-gradient(90deg, #00d4ff, #0099ff);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
  pointer-events: none;
}

.seekbar-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  background: #00d4ff;
  border: 3px solid #fff;
  border-radius: 50%;
  top: 13px;
  transform: translate(-50%, -50%);
  left: 0%;
  cursor: grab;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(0, 212, 255, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  pointer-events: auto;
}

.seekbar-handle:hover {
  transform: translate(-50%, -50%) scale(1.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 212, 255, 0.8);
}

.seekbar-handle:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.1);
}

.seekbar:hover .seekbar-handle {
  transform: translate(-50%, -50%) scale(1.2);
}

/* Tracks Grid */
.tracks-scroll-container {
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 16px;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(100, 220, 255, 0.2);
}

.tracks-grid {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 10px 0;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity; /* Subtle snap for better UX */
}

.tracks-grid::-webkit-scrollbar {
  height: 10px;
}

.tracks-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 5px;
}

.tracks-grid::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.4), rgba(0, 153, 255, 0.6));
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.tracks-grid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.7), rgba(0, 153, 255, 0.9));
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
}

.track-card {
  flex: 0 0 200px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(0, 212, 255, 0.2);
  scroll-snap-align: start;

  /* Enhanced floating effect (強調された浮遊) */
  animation: float 4s ease-in-out infinite;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3),
              0 0 30px rgba(100, 220, 255, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.track-card:nth-child(1) { animation-delay: 0s; }
.track-card:nth-child(2) { animation-delay: 0.5s; }
.track-card:nth-child(3) { animation-delay: 1s; }
.track-card:nth-child(4) { animation-delay: 1.5s; }
.track-card:nth-child(5) { animation-delay: 2s; }
.track-card:nth-child(6) { animation-delay: 2.5s; }
.track-card:nth-child(7) { animation-delay: 3s; }
.track-card:nth-child(8) { animation-delay: 3.5s; }
.track-card:nth-child(n+9) { animation-delay: 0s; }

.track-card:hover {
  transform: translateY(-20px) scale(1.05) rotate(2deg);
  border-color: #00d4ff;
  box-shadow: 0 20px 50px rgba(100, 220, 255, 0.5),
              0 0 60px rgba(100, 220, 255, 0.4),
              inset 0 2px 0 rgba(255, 255, 255, 0.2);
  animation-play-state: paused;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-15px) rotate(1deg);
  }
  50% {
    transform: translateY(-25px) rotate(-1deg);
  }
  75% {
    transform: translateY(-15px) rotate(1deg);
  }
}

.track-card.active {
  border-color: #00d4ff;
  background: rgba(0, 212, 255, 0.15);
}

.track-card-cover {
  width: 100%;
  height: 200px;
  background: #2a2a3e;
  position: relative;
  overflow: hidden;
}

.track-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.track-card-info {
  padding: 15px;
}

.track-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-card-arranger {
  color: #00d4ff;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.track-card-date {
  color: #888;
  font-size: 0.8rem;
}

.track-card-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.track-delete-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 120, 120, 0.6);
  color: #ff9aa2;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.track-delete-btn:hover {
  color: #fff;
  border-color: #ff9aa2;
  box-shadow: 0 0 12px rgba(255, 120, 120, 0.35);
}

.loading,
.error {
  text-align: center;
  padding: 20px;
  font-size: 1.1rem;
}

.error {
  color: #ff4444;
}

.new-track-badge {
  animation: pulse 2s ease-in-out;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.7);
  }
  50% {
    box-shadow: 0 0 0 20px rgba(0, 212, 255, 0);
  }
}

/* Mode Toast Notification */
.mode-toast {
  position: fixed;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.95), rgba(0, 153, 255, 0.95));
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.6),
              0 0 40px rgba(0, 212, 255, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.3);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.mode-toast.show {
  opacity: 1;
}

/* Share Toast Notification */
.share-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.share-toast.show {
  opacity: 1;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(10px);
  }
}

/* Responsive */
@media (max-width: 768px) {
  /* モバイル: PCと同じレイアウトを使用 */
  .mobile-carousel {
    display: none;
  }

  header h1 {
    font-size: 1.8rem;
  }

  .track-card {
    flex: 0 0 220px;
  }

  .track-card-cover {
    height: 220px;
  }

  .player-container {
    max-width: 100%;
    margin: 0 auto 30px auto;
  }

  .player-card {
    padding: 25px;
  }

  .carousel-title {
    font-size: 1.5rem;
  }

  .carousel-arranger {
    font-size: 1rem;
  }
}

@media (min-width: 769px) {
  /* PC: デスクトップレイアウト表示、カルーセル非表示 */
  .mobile-carousel {
    display: none;
  }
}

@media (min-width: 1400px) {
  /* Very wide screens: show more tracks */
  .tracks-grid {
    gap: 16px;
    padding: 14px 0 22px 0;
  }

  .track-card {
    flex: 0 0 200px;
  }

  .track-card-cover {
    height: 200px;
  }
}

/* Terms of Service Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: linear-gradient(135deg, rgba(26, 77, 111, 0.95), rgba(42, 111, 149, 0.95));
  border-radius: 20px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border: 2px solid rgba(100, 220, 255, 0.4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
              0 0 80px rgba(100, 220, 255, 0.3);
  animation: slideUp 0.3s ease;
}

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

.modal-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(100, 220, 255, 0.4);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #5dd9ff;
  transition: all 0.3s ease;
  z-index: 10;
}

.modal-close-btn:hover {
  background: rgba(100, 220, 255, 0.3);
  transform: rotate(90deg);
  box-shadow: 0 0 20px rgba(100, 220, 255, 0.6);
}

.modal-body {
  padding: 60px 40px 30px 40px;
  overflow-y: auto;
  flex: 1;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(100, 220, 255, 0.4);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 220, 255, 0.6);
}

.modal-body h2 {
  color: #5dd9ff;
  font-size: 2rem;
  margin-bottom: 30px;
  text-align: center;
  background: linear-gradient(90deg, #5dd9ff, #00d4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.terms-content h3 {
  color: #5dd9ff;
  font-size: 1.3rem;
  margin-top: 25px;
  margin-bottom: 10px;
}

.terms-content p {
  color: #fff;
  line-height: 1.8;
  margin-bottom: 15px;
  font-size: 0.95rem;
}

.terms-content ul {
  color: #fff;
  line-height: 1.8;
  margin-left: 20px;
  margin-bottom: 15px;
}

.terms-content li {
  margin-bottom: 8px;
}

.terms-footer {
  text-align: center;
  color: #aaa;
  font-size: 0.85rem;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(100, 220, 255, 0.2);
}

.modal-close-bottom-btn {
  background: linear-gradient(135deg, rgba(100, 220, 255, 0.3), rgba(0, 212, 255, 0.3));
  border: 2px solid #5dd9ff;
  border-radius: 12px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 15px 40px;
  margin: 0 40px 40px 40px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(100, 220, 255, 0.3);
}

.modal-close-bottom-btn:hover {
  background: linear-gradient(135deg, rgba(100, 220, 255, 0.5), rgba(0, 212, 255, 0.5));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(100, 220, 255, 0.5);
}

.modal-close-bottom-btn:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 85vh;
  }

  .modal-body {
    padding: 50px 25px 20px 25px;
  }

  .modal-body h2 {
    font-size: 1.5rem;
  }

  .terms-content h3 {
    font-size: 1.1rem;
  }

  .terms-content p {
    font-size: 0.9rem;
  }

  .modal-close-bottom-btn {
    margin: 0 25px 25px 25px;
    padding: 12px 30px;
    font-size: 1rem;
  }
}

/* Metadata display styles */
.player-metadata {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  backdrop-filter: blur(10px);
}

.metadata-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.metadata-row:last-child {
  border-bottom: none;
}

.metadata-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.metadata-value {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  text-align: right;
}

@media (max-width: 768px) {
  .player-metadata {
    padding: 12px;
    margin: 12px 0;
  }

  .metadata-row {
    padding: 6px 0;
  }

  .metadata-label {
    font-size: 0.85rem;
  }

  .metadata-value {
    font-size: 0.9rem;
  }
}

/* Right Column Container */
.right-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* Arrangement Report Styles */
.arrangement-report {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  padding: 24px;
  backdrop-filter: blur(20px);
  border: 2px solid rgba(100, 220, 255, 0.3);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3),
              0 0 50px rgba(100, 220, 255, 0.2);
  position: relative;
  z-index: 10;
}

.report-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
  background: linear-gradient(90deg, #5dd9ff, #00d4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}

.report-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.report-meta {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  margin: 0 0 8px 0;
}

.report-toggle {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0;
}

.report-toggle-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.report-toggle-btn.active {
  background: rgba(0, 212, 255, 0.2);
  border-color: rgba(0, 212, 255, 0.5);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 212, 255, 0.25);
}

.report-toggle-btn:active {
  transform: scale(0.98);
}

.report-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #5dd9ff;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(100, 220, 255, 0.3);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.ranking-item:hover {
  background: rgba(100, 220, 255, 0.15);
  transform: translateX(4px);
}

.ranking-number {
  font-size: 1.2rem;
  font-weight: 700;
  color: #00d4ff;
  min-width: 24px;
}

.ranking-name {
  flex: 1;
  font-size: 0.95rem;
  color: #fff;
}

.ranking-count {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}

.ranking-count {
  font-size: 0.85rem;
  color: #5dd9ff;
  font-weight: 600;
}

/* Voice Map Styles */
.voice-map {
  position: relative;
  width: 100%;
  max-width: 250px;
  margin: 0 auto;
  aspect-ratio: 1;
}

#voice-canvas {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.voice-map-labels {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.voice-map-labels span {
  position: absolute;
  font-size: 0.75rem;
  color: #5dd9ff;
  font-weight: 600;
  white-space: nowrap;
}

.label-top {
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
}

.label-right {
  right: -50px;
  top: 50%;
  transform: translateY(-50%);
}

.label-bottom {
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
}

.label-left {
  left: -50px;
  top: 50%;
  transform: translateY(-50%);
}

/* Responsive - Stack vertically on tablet screens */
@media (max-width: 1100px) {
  .player-with-stats-container {
    flex-direction: column;
  }

  .player-container {
    flex: 1;
    max-width: 100%;
  }

  .right-column {
    width: 100%;
  }

  .track-card {
    flex: 0 0 220px;
  }

  .track-card-cover {
    height: 220px;
  }
}

/* Hide report on mobile */
@media (max-width: 768px) {
  .arrangement-report {
    display: none;
  }

  .tracks-scroll-container {
    margin-top: 20px;
  }
}
