/* ==========================================================================
   Smart Music for Devs - CSS Design System & Layout
   ========================================================================== */

/* Variables */
:root {
  --bg-color: #08090d;
  --panel-bg: rgba(13, 17, 23, 0.7);
  --panel-bg-hover: rgba(255, 255, 255, 0.03);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-border-active: rgba(6, 182, 212, 0.5);
  
  --accent-purple: #a855f7;
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.3);
  --accent-purple-glow: rgba(168, 85, 247, 0.3);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #4b5563;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --glow-shadow: 0 0 15px var(--accent-cyan-glow);
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  width: 100%;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
  transition: background 0.6s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;

  background:
    rgba(255,255,255,.02);

  backdrop-filter: blur(60px) saturate(140%);
  -webkit-backdrop-filter: blur(60px) saturate(140%);
}

/* All: ブラック基調 */
body.mode-all {
  background-color: var(--bg-color);
  background-image: none;
}

/* リラックス: 鮮やかな寒色グラデーション */
body.mode-relax {
  background-color: #06201a;
  background-image:
    radial-gradient(ellipse at 15% 0%, rgba(45, 212, 191, 0.55) 0%, transparent 52%),
    radial-gradient(ellipse at 85% 15%, rgba(56, 189, 248, 0.5) 0%, transparent 48%),
    radial-gradient(ellipse at 50% 100%, rgba(251, 191, 36, 0.35) 0%, transparent 55%),
    linear-gradient(165deg, #04332c 0%, #0a4f5c 40%, #0b2a4a 75%, #071018 100%);
  background-attachment: fixed;
}

/* クリエイティブ: 暖色→赤紫の縦グラデーション */
body.mode-creative {
  /* background-color: #7a1040; */
  /* background-image: linear-gradient(to bottom, #fee140 0%, #fa709a 20%, #c026d3 100%); */
  background-color: #1b1b1b;

  background-image:
  /* 上20%は黒 */
  linear-gradient(
    to bottom,
    #1b1b1b 0%,
    #1b1b1b 20%,
    rgba(27,27,27,.85) 28%,
    rgba(27,27,27,.35) 36%,
    transparent 44%
  ),

  /* 左ブルー */
  radial-gradient(
    circle at 20% 52%,
    rgba(70,125,255,.95) 0%,
    rgba(70,125,255,.70) 18%,
    rgba(70,125,255,.25) 32%,
    transparent 46%
  ),

  /* 右ブルー */
  radial-gradient(
    circle at 80% 52%,
    rgba(70,125,255,.95) 0%,
    rgba(70,125,255,.70) 18%,
    rgba(70,125,255,.25) 32%,
    transparent 46%
  ),

  /* 紫 */
  radial-gradient(
    circle at 50% 62%,
    rgba(165,120,255,.7) 0%,
    rgba(165,120,255,.25) 28%,
    transparent 52%
  ),

  /* 左ピンク */
  radial-gradient(
    ellipse at 20% 82%,
    #ff57b8 0%,
    #ff2f90 35%,
    transparent 72%
  ),

  /* 右ピンク */
  radial-gradient(
    ellipse at 80% 82%,
    #ff57b8 0%,
    #ff2f90 35%,
    transparent 72%
  ),

  /* オレンジ */
  radial-gradient(
    ellipse at 50% 108%,
    #ffc24a 0%,
    #ff8c2b 18%,
    #ff6325 40%,
    transparent 74%
  );

  background-attachment: fixed;
}

/* スマイル: 陽光イエロー〜ライムの明るいグラデーション */
body.mode-smile {
    /* background: #FF4E50;
    background: -webkit-linear-gradient(to right, #F9D423, #FF4E50);
    background: linear-gradient(to right, #F9D423, #FF4E50); */

    /* background-color: #7EC151;
    --text-main: #FFF449;
    --text-muted: #a855f7; */


  background-color: #FFF8F0;
  --text-main: #a855f7;
  --text-muted: #060606;
      
  background-attachment: fixed;
}



/* Background Neon Glows */
.bg-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.12;
  pointer-events: none;
  z-index: -1;
  transition: var(--transition-smooth);
}

.bg-glow-purple {
  top: -10%;
  left: -10%;
  background: var(--accent-purple);
}

.bg-glow-cyan {
  bottom: -10%;
  right: -10%;
  background: var(--accent-cyan);
}

body.mode-relax .bg-glow-purple {
  background: #2dd4bf;
  opacity: 0.28;
}

body.mode-relax .bg-glow-cyan {
  background: #38bdf8;
  opacity: 0.32;
}

body.mode-creative .bg-glow-purple {
  background: #e879f9;
  opacity: 0.22;
}

body.mode-creative .bg-glow-cyan {
  background: #fb7185;
  opacity: 0.2;
}

body.mode-all .bg-glow {
  opacity: 0.12;
}

/*
  レスポンシブ全幅:
  画面幅いっぱいに広げ、左右は padding で余白を確保
*/
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px clamp(16px, 3vw, 48px);
  gap: 24px;
  box-sizing: border-box;
}

/* クリエイティブ時: 明るい暖色背景向けに暗いパネルで可読性確保 */
body.mode-creative {
  color: #fff7fb;
}

body.mode-creative .glass-panel {
  /* background: linear-gradient(to top, #6713d2 0%, #cc208e 100%);
  border-color: rgba(255, 255, 255, 0.8); */
  background: none;
  box-shadow: 0 12px 40px rgba(88, 28, 135, 0.35);
  color: #fff7fb;
}




body.mode-creative .app-header {
  border-bottom-color: rgba(255, 255, 255, 0.18);
  z-index: 10;
}

body.mode-creative .header-logo h1,
body.mode-creative #current-track-title,
body.mode-creative .panel-header h3,
body.mode-creative .yt-meta-value,
body.mode-creative .push-comment-text {
  color: #ffffff;
}

body.mode-creative .selector-label,
body.mode-creative .track-sub,
body.mode-creative .track-count,
body.mode-creative .yt-meta-label,
body.mode-creative .time-label,
body.mode-creative .text-muted,
body.mode-creative .app-footer {
  color: rgba(255, 247, 251, 0.78);
}

body.mode-creative .mode-tabs {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.2);
}

body.mode-creative .mode-tab {
  color: rgba(255, 247, 251, 0.75);
}

body.mode-creative .mode-tab.active {
  color: #1a0610;
  background: linear-gradient(135deg, #fee140, #fa709a);
}

body.mode-creative .push-comment-block {
  background: rgba(0, 0, 0, 0.45);
  border-color: rgba(253, 224, 71, 0.55);
}

body.mode-creative .push-comment-label {
  color: #fde68a;
}

body.mode-creative .yt-meta-block {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(250, 112, 154, 0.4);
}

body.mode-creative .playlist-item {
  color: #fff7fb;
}

body.mode-creative .playlist-item:hover,
body.mode-creative .playlist-item.active {
  background: rgba(255,255,255,0.08);
  border: none;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 10;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
  font-size: 1.5rem;
  text-shadow: 0 0 10px var(--accent-cyan-glow);
}

.header-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.accent-text {
  color: var(--accent-purple);
  text-shadow: 0 0 10px var(--accent-purple-glow);
}

/* Mode Selector */
.mode-selector-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.selector-label {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Mood Slider (今日の気分) — Spotify Mix 風コンパクトカード */
.mood-slider-panel {
  width: 100%;
  margin-top: -4px;
  margin-bottom: 4px;
  z-index: 10;
}

/* .mood-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
} */

/* .mood-slider-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
} */

.mood-slider {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.mood-slider::-webkit-scrollbar {
  height: 4px;
}

.mood-slider::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
}

.mood-slider-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 8px 0;
}

.mood-card {
  flex: 0 0 128px;
  width: 128px;
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
  color: inherit;
}

.mood-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.mode-smile .mood-card-cover{
  background-color: #FFF;
}

.mood-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mood-card-title-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12%;
  padding: 4px 6px;
  min-height: 22px;
  display: flex;
  align-items: center;
  z-index: 1;
}
.mode-smile .mood-card-title-bar {
  background-color: #B0E4CC;
}

.mood-card-title {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mode-smile .mood-card-title {
  color: #FFF;
}

/* Spotify Mix 風: ホバー時に右下へ再生ボタン */
.mood-card-play {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;

  /* background: #1ed760; */
  background: #d4fc79;  /* fallback for old browsers */
  background: -webkit-linear-gradient(to right, #96e6a1, #d4fc79);  /* Chrome 10-25, Safari 5.1-6 */
  background: linear-gradient(to right, #96e6a1, #d4fc79); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
  

  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.mood-card-play svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  margin-left: 1px;
}

.mood-card:hover .mood-card-play,
.mood-card:focus-visible .mood-card-play {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.mood-card-overview {
  margin-top: 6px;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 1.9em;
}

.mood-card:hover .mood-card-cover {
  transform: translateY(-2px);
  transition: var(--transition-smooth);
}

.mode-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 30px;
  border: 1px solid var(--panel-border);
}

.mode-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.mode-tab:hover {
  color: var(--text-main);
}

.mode-tab.active {
  /* background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan)); */
  /* background: linear-gradient(to right, #a8e063, #56ab2f); */
  background-color: var(--text-main);
  
  color: #fff;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.2);
}
.mode-smile .mode-tab.active {
  background-color: #000;
}

/* Layout Grid — 左:動画エリア伸縮 / 右:プレイリスト最小350px */
.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(350px, 400px);
  gap: 24px;
  flex: 1;
  align-items: start;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Glass Panels Base */
.glass-panel {
  /* background: var(--panel-bg); */
  /* border: 1px solid var(--panel-border); */
  background-color: rgb(255,255,255,0.2);
  border-radius: 16px;
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  max-width: 100%;
}

.mode-smile .glass-panel {
  background-color: #FFF;
  border: 1px dashed rgb(128 128 128);
  box-shadow: none;
}


.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.panel-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Player Section (Main) - 全段20列スパン */
.player-section {
  grid-column: 1 / 2;
}

/* 動画の下にインサイトを縦積み */
.media-insight-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: stretch;
}

.media-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

/* インサイトカラム（動画の下） */
.insight-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
  width: 100%;
}

/* 押しコメント (最も目立つ) */
.push-comment-block {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08) 0%, rgba(6, 182, 212, 0.06) 100%);
  /* border: 1px solid rgba(168, 85, 247, 0.3); */
  border-radius: 14px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* .push-comment-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan));
} */

.push-comment-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-bottom: 14px;
}

.push-icon {
  width: 16px;
  height: 16px;
  fill: var(--accent-purple);
  flex-shrink: 0;
}

.push-comment-text {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.7;
  color: var(--text-main);
  font-style: italic;
  margin: 0 0 16px 0;
  padding: 0;
  border: none;
  position: relative;
}

.push-comment-text::before {
  content: '\201C';
  font-size: 3rem;
  color: var(--accent-purple);
  opacity: 0.3;
  position: absolute;
  top: -10px;
  left: -6px;
  line-height: 1;
  pointer-events: none;
}

/* YouTube メタ情報ブロック */
.yt-meta-block {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.yt-meta-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.yt-meta-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
  min-width: 52px;
}

.yt-meta-value {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 概要ブロック */
.yt-description-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yt-description-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Video Container — プレイヤー列いっぱいに広げ、ウインドウ高は超えない */
.video-container {
  width: min(100%, calc((100dvh - 240px) * 16 / 9));
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #000;
  border: 1px solid var(--panel-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: var(--transition-smooth);
  margin: 0 auto 24px;
  box-sizing: border-box;
}

.mode-smile .video-container {
  box-shadow: none;
}

.video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Play state active neon outline */
.video-container.playing {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 25px var(--accent-cyan-glow);
}
.mode-smile .video-container.playing {
  /* border: none; */
}

/* Focus Mode (Video OFF) Visualizer */
.focus-visualizer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, #0e111a 30%, #050608 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
  pointer-events: none;
  z-index: 2;
}

/* Video OFF State triggers */
.video-container.video-off .focus-visualizer {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.video-container.video-off iframe {
  opacity: 0;
  pointer-events: none;
}

/* Equalizer Bars for Focus Mode */
.focus-visualizer .equalizer-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 60px;
  margin-bottom: 16px;
}

.focus-visualizer .equalizer-bars span {
  display: block;
  width: 4px;
  height: 6px;
  background: linear-gradient(to top, var(--accent-cyan), var(--accent-purple));
  border-radius: 2px;
  transition: height 0.1s ease;
}

/* Equalizer Bounce animation when playing */
.video-container.playing .focus-visualizer .equalizer-bars span {
  animation: bounce 1.2s ease-in-out infinite alternate;
}

/* Distribute animation delay to make equalizer look organic */
.video-container.playing .focus-visualizer .equalizer-bars span:nth-child(even) {
  animation-duration: 0.8s;
  animation-delay: 0.15s;
}
.video-container.playing .focus-visualizer .equalizer-bars span:nth-child(odd) {
  animation-duration: 1.1s;
  animation-delay: 0.3s;
}
.video-container.playing .focus-visualizer .equalizer-bars span:nth-child(3n) {
  animation-duration: 1.3s;
  animation-delay: 0.45s;
}
.video-container.playing .focus-visualizer .equalizer-bars span:nth-child(4n) {
  animation-duration: 0.6s;
  animation-delay: 0.05s;
}

@keyframes bounce {
  0% {
    height: 6px;
  }
  100% {
    height: 50px;
  }
}

.focus-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 8px var(--accent-cyan-glow);
  animation: pulse 2s infinite alternate;
}

@keyframes pulse {
  0% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
    text-shadow: 0 0 15px var(--accent-cyan-glow);
  }
}

/* Video Toggle Button Active State */
.video-toggle-btn.active svg {
  fill: var(--accent-cyan);
  filter: drop-shadow(0 0 5px var(--accent-cyan-glow));
}

/* Track Info */
.track-info-display {
  text-align: center;
  margin-bottom: 20px;
}

.track-info-display h2 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin-bottom: 6px;
}

.track-sub {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Custom Controls & Progress */
.custom-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.time-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 40px;
  text-align: center;
}

.progress-bar-wrapper {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
}

.mode-smile .progress-bar-wrapper {
  background: #E3F2FD;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--accent-purple), var(--accent-cyan));
  width: 0%;
  border-radius: 3px;
  position: relative;
}

.progress-handle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  left: 0%;
  opacity: 0;
  box-shadow: 0 0 8px var(--accent-cyan);
  transition: opacity 0.2s;
  pointer-events: none;
}

.progress-bar-wrapper:hover .progress-handle {
  opacity: 1;
}

.progress-bar-wrapper:hover {
  height: 8px;
}

/* Control Buttons */
.control-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.control-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.control-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.control-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.play-btn {
  background: #fff;
  color: #000;
  width: 52px;
  height: 52px;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.play-btn:hover {
  background: #fff;
  color: #000;
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
}

.volume-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 200px;
  margin: 0 auto;
}

.volume-btn {
  width: 32px;
  height: 32px;
}

.volume-btn svg {
  width: 18px;
  height: 18px;
}

.volume-slider {
  -webkit-appearance: none;
  width: 80px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 6px var(--accent-cyan);
}

/* Playlist Section (Aside) */
.playlist-section {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  min-width: 350px;
  width: 100%;
}

.playlist-panel {
  display: flex;
  flex-direction: column;
}

.playlist-overview {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
  height: 300px;
  overflow-y: auto;
  margin-bottom: 50px;
  padding-right: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: normal;
  word-break: break-word;
}

.track-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.playlist-container {
  overflow-y: auto;
  flex: 1;
  max-height: 500px;
  padding-right: 4px;
}

/* Custom Scrollbar for playlist / overview */
.playlist-container::-webkit-scrollbar,
.playlist-overview::-webkit-scrollbar {
  width: 6px;
}

.playlist-container::-webkit-scrollbar-track,
.playlist-overview::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

.playlist-container::-webkit-scrollbar-thumb,
.playlist-overview::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.playlist-container::-webkit-scrollbar-thumb:hover,
.playlist-overview::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

.playlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.playlist-item:hover {
  background: var(--panel-bg-hover);
  border-color: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}

.playlist-item.active {
  background: rgba(6, 182, 212, 0.06);
  border-color: var(--panel-border-active);
  box-shadow: inset 0 0 10px rgba(6, 182, 212, 0.05);
}

.item-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.item-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

.playlist-item.active .item-title {
  color: var(--accent-cyan);
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.item-tag {
  background: rgba(168, 85, 247, 0.1);
  color: var(--accent-purple);
  padding: 1px 6px;
  border-radius: 10px;
  font-family: var(--font-mono);
}

.item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.item-bpm {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.playlist-item.active .item-bpm {
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-cyan);
  border-color: rgba(6, 182, 212, 0.2);
}

.item-duration {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Details & Review Section (Article) - 統合済みのため非表示 */
.details-section {
  display: none;
}

.details-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.track-metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.meta-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.meta-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.detail-description-block h4,
.review-block h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
  position: relative;
  padding-left: 12px;
}

.detail-description-block h4::before,
.review-block h4::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 12px;
  background: var(--accent-cyan);
  border-radius: 2px;
}

.detail-description-block p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Review Block */
.review-block {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 16px;
  border-radius: 12px;
  position: relative;
}

.review-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.rating-stars {
  color: #fbbf24;
  font-size: 0.9rem;
}

.rating-score {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.review-text {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 16px;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 16px 0;
  color: var(--text-dark);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  border-top: 1px solid rgba(255, 255, 255, 0.02);
}

/* Media Queries — 2カラム維持に足りない幅では縦積み */
@media (max-width: 900px) {
  .layout-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }
  
  .player-section,
  .playlist-section {
    grid-column: auto;
    width: 100%;
    min-width: 0;
  }
  
  .playlist-container {
    max-height: 350px;
  }

  .video-container {
    width: min(100%, calc((100dvh - 220px) * 16 / 9));
  }

  .app-container {
    padding: 20px clamp(16px, 4vw, 32px);
  }
}

@media (max-width: 600px) {
  .app-container {
    padding: 16px clamp(12px, 4vw, 20px);
  }

  .video-container {
    width: min(100%, calc((100dvh - 200px) * 16 / 9));
  }
  
  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .mode-selector-container {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .mode-tabs {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ==========================================================================
   Playlist Loading / Error States
   ========================================================================== */

.playlist-loading,
.playlist-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.playlist-error {
  color: #f87171;
}

