:root {
  --primary: #ff3366;
  --primary-hover: #ff1a53;
  --bg-dark: #0a0a0c;
  --text-light: #f5f5f7;
  --text-dim: #a1a1a6;
  --glass-bg: rgba(20, 20, 25, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
}

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

body {
  font-family: 'Noto Sans JP', 'Montserrat', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-light);
  height: 100vh;
  overflow: hidden;
}

/* 共通フェードイン効果 */
.fade-in {
  animation: fadeIn 0.8s ease forwards;
}

.hidden {
  display: none !important;
}

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

/* 1. ログイン画面 */
#login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: radial-gradient(circle at center, #1c1c24 0%, #0a0a0c 100%);
}

.login-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  padding: 40px;
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.logo {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.logo span {
  color: var(--primary);
  font-weight: 300;
}

.subtitle {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 30px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.input-group {
  text-align: left;
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.input-group input {
  width: 100%;
  padding: 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-light);
  font-size: 16px;
  transition: all 0.3s;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(255, 51, 102, 0.2);
}

.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, transform 0.1s;
  margin-top: 10px;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

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

.error-msg {
  color: #ff453a;
  font-size: 14px;
  margin-top: 15px;
}

/* 2. メインプレイヤー画面 (デジタルサイネージ) */
#player-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* 背景スライドショー */
.bg-slideshow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: background-image 2.5s ease-in-out;
  transform: scale(1.05);
  animation: bgZoom 30s infinite alternate;
  z-index: 1;
}

@keyframes bgZoom {
  from { transform: scale(1.02); }
  to { transform: scale(1.08); }
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(10, 10, 12, 0.9) 0%, rgba(10, 10, 12, 0.7) 100%);
  z-index: 2;
}

/* プレイヤーコンテンツ */
.player-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 30px;
  justify-content: space-between;
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 20px;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand span {
  color: var(--primary);
  font-weight: 300;
}

.shop-info {
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
}

.player-main {
  display: grid;
  grid-template-columns: 1.2fr 1fr; /* 左側の曲カラムを少し広めにする */
  gap: 40px;
  align-items: center;
  flex: 1;
  padding: 40px 0;
}

/* 曲の流れを表示する左カラム */
.music-flow-column {
  display: flex;
  flex-direction: column;
  gap: 15px; /* 上下のカードとの隙間 */
  width: 100%;
}

/* 前後の曲の共通スタイル */
.side-song-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 12px 25px;
  backdrop-filter: blur(15px);
  transition: all 0.5s ease;
  position: relative;
}

.card-indicator {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(255, 51, 102, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.side-song-info {
  text-align: left;
}

.side-song-info h4 {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 2px;
  color: var(--text-light);
}

.side-song-info p {
  font-size: 11px;
  color: var(--text-dim);
}

/* 前の曲 (過去：より薄く表示) */
.prev-song {
  opacity: 0.45;
  transform: scale(0.93);
}

/* 次の曲 (未来：少し薄く表示) */
.next-song {
  opacity: 0.7;
  transform: scale(0.96);
}

/* 楽曲カード (現在：最も際立たせる) */
.now-playing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 30px;
  backdrop-filter: blur(30px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  transform: scale(1.0);
  z-index: 5;
}


.album-art-wrapper {
  position: relative;
  width: 240px;
  height: 240px;
  margin-bottom: 30px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
}

.album-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.wave-visualizer {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 30px;
}

.wave-visualizer span {
  width: 4px;
  height: 5px;
  background-color: var(--primary);
  border-radius: 2px;
  animation: bounce 1.2s infinite ease-in-out;
}

.wave-visualizer span:nth-child(2) { animation-delay: 0.2s; }
.wave-visualizer span:nth-child(3) { animation-delay: 0.4s; height: 10px; }
.wave-visualizer span:nth-child(4) { animation-delay: 0.6s; }
.wave-visualizer span:nth-child(5) { animation-delay: 0.8s; }

@keyframes bounce {
  0%, 100% { height: 5px; }
  50% { height: 25px; }
}

.song-details .channel-tag {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}

.song-details h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
}

.song-details .song-category {
  color: var(--text-dim);
  font-size: 15px;
  background: rgba(255, 255, 255, 0.05);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
}

/* 制御パネル & タイマー */
.control-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 30px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(30px);
}

.timer-section h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

/* 音源選択グループ */
.select-group {
  margin-bottom: 20px;
  text-align: left;
}

.select-group label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.custom-select {
  width: 100%;
  padding: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 14px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.3s;
}

.custom-select:focus {
  border-color: var(--primary);
}

.custom-select option {
  background-color: var(--bg-dark);
  color: var(--text-light);
}

/* ドラッグ＆ドロップ エリア */
.drop-zone {
  width: 100%;
  margin-bottom: 25px;
  padding: 20px;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(255, 51, 102, 0.05);
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.15);
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.drop-icon {
  font-size: 24px;
  margin-bottom: 2px;
}

.drop-zone p {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
}

.drop-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.timer-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 15px;
  line-height: 1.5;
}



.timer-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

/* 全画面画像表示用モーダル (デジタルサイネージ) */
.image-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(5, 5, 8, 0.95);
  backdrop-filter: blur(25px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.close-modal-btn {
  position: absolute;
  top: 30px;
  right: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 44px;
  width: 60px;
  height: 60px;
  line-height: 52px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1010;
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.close-modal-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: rotate(90deg) scale(1.1);
}

.modal-content-wrapper {
  max-width: 90%;
  max-height: 90%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content-wrapper img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

/* セレクトボックスとアクションボタンの横並びレイアウト */
.select-with-action {
  display: flex;
  gap: 10px;
  width: 100%;
}

.select-with-action .custom-select {
  flex: 1; /* セレクトボックスを限界まで広げる */
}

.btn-delete {
  background: rgba(255, 69, 58, 0.1);
  border: 1px solid rgba(255, 69, 58, 0.25);
  border-radius: 8px;
  width: 44px;
  height: 44px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.btn-delete:hover {
  background: rgba(255, 69, 58, 0.8);
  border-color: #ff453a;
  color: white;
  transform: scale(1.05);
}


/* コントロールパネルのセクション構成 */
.control-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.control-section h3 {
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  border-left: 3px solid var(--primary);
  padding-left: 10px;
  margin-bottom: 5px;
}

.border-top {
  border-top: 1px solid var(--glass-border);
  padding-top: 20px;
  margin-top: 5px;
}

.btn-primary-small {
  flex: 1;
  padding: 12px;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary-small:hover {
  background: var(--primary-hover);
}

/* 割り込み動画用オーバーレイ (MP4対応) */
.video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: black;
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ヘッダー内音量スライダーのスタイリング */
.header-volume {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 8px 16px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.header-volume span {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
}

.header-volume input[type="range"] {
  width: 120px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* 左カラム上部音量コントロールのスタイリング */
.left-volume-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 15px 25px;
  border-radius: 16px;
  backdrop-filter: blur(15px);
  width: 100%;
}

/* チャンネル切り替えタブ */
.channel-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

.channel-tab {
  padding: 10px 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.channel-tab:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-light);
}

.channel-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 51, 102, 0.3);
}

.channel-tab:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.2);
}

.left-volume-control span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
}

.left-volume-control input[type="range"] {
  width: 65%;
  accent-color: var(--primary);
  cursor: pointer;
}


/* ミニドラッグ＆ドロップ エリア (コンパクト版) */
.mini-drop-zone {
  padding: 12px 10px !important;
  margin-bottom: 5px !important;
  border-width: 1px !important;
  background: rgba(0, 0, 0, 0.15) !important;
}

.mini-drop-zone .drop-icon {
  font-size: 18px !important;
}

.mini-drop-zone p {
  font-size: 11px !important;
}

.mini-drop-zone .drop-sub {
  font-size: 9px !important;
}

/* ファイル選択用専用ボタン */
.btn-select-file {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: var(--text-light);
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.btn-select-file:hover {
  background: rgba(255, 51, 102, 0.15);
  border-color: var(--primary);
  color: white;
}





.btn-outline {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-light);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-light);
}

.btn-alert {
  flex: 1;
  padding: 12px;
  background: rgba(255, 69, 58, 0.2);
  border: 1px solid #ff453a;
  border-radius: 8px;
  color: #ff453a;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-alert:hover {
  background: #ff453a;
  color: white;
}

.announcement-status {
  font-size: 14px;
  color: var(--primary);
  font-weight: 500;
  min-height: 20px;
}

.volume-section {
  display: flex;
  align-items: center;
  gap: 15px;
  border-top: 1px solid var(--glass-border);
  padding-top: 25px;
}

.volume-section span {
  font-size: 14px;
  color: var(--text-dim);
}

.volume-section input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
  cursor: pointer;
}

/* 自動再生ポリシー対策オーバーレイ */
#play-trigger-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(15px);
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 24px;
}

.btn-large {
  padding: 20px 40px;
  background: var(--primary);
  border: none;
  border-radius: 50px;
  color: white;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255, 51, 102, 0.4);
  transition: all 0.3s;
}

.btn-large:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

/* フッター */
.player-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--glass-border);
  padding-top: 20px;
  color: var(--text-dim);
  font-size: 14px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #30d158;
  border-radius: 50%;
  box-shadow: 0 0 10px #30d158;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(48, 209, 88, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); }
}

.timer-display {
  font-family: monospace;
  font-size: 16px;
  letter-spacing: 1px;
}

/* 配信停止ボタン */
.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.btn-stop {
  padding: 8px 18px;
  background: rgba(255, 69, 58, 0.15);
  border: 1px solid rgba(255, 69, 58, 0.4);
  border-radius: 20px;
  color: #ff453a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}

.btn-stop:hover {
  background: rgba(255, 69, 58, 0.3);
  border-color: #ff453a;
  box-shadow: 0 0 10px rgba(255, 69, 58, 0.2);
}

.btn-stop.stopped {
  background: rgba(48, 209, 88, 0.15);
  border-color: rgba(48, 209, 88, 0.4);
  color: #30d158;
}

.btn-stop.stopped:hover {
  background: rgba(48, 209, 88, 0.3);
  border-color: #30d158;
  box-shadow: 0 0 10px rgba(48, 209, 88, 0.2);
}

/* モバイル・タブレット レスポンシブ化 */
@media (max-width: 1024px) {
  html, body {
    height: auto !important;
    min-height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative !important;
    -webkit-overflow-scrolling: touch;
  }

  #player-container {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
  }

  .player-content {
    height: auto !important;
    min-height: 100vh !important;
    padding: 15px;
    gap: 20px;
    overflow: visible !important;
  }

  .player-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
  }

  .player-main {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 10px 0;
    align-items: start;
  }

  /* タブレット横向き（Landscape）: 左右2カラム分割 */
  @media (orientation: landscape) and (min-width: 640px) {
    .player-main {
      grid-template-columns: 1fr 1fr !important;
      gap: 20px;
    }
  }

  /* タブレット縦向き（Portrait）: 縦一列1カラム並び */
  @media (orientation: portrait) {
    .player-main {
      grid-template-columns: 1fr !important;
      gap: 25px;
    }
  }

  .music-flow-column {
    gap: 15px;
  }

  .control-panel {
    width: 100%;
    margin-top: 0;
    border-radius: 20px;
  }

  .channel-tabs {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 8px;
    gap: 8px;
  }

  .channel-tab {
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 12px;
  }

  .now-playing-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
  }

  .album-art-wrapper {
    margin-right: 0;
    margin-bottom: 15px;
    width: 160px;
    height: 160px;
  }

  .song-details {
    align-items: center;
    text-align: center;
  }

  .left-volume-control {
    width: 100%;
    justify-content: space-between;
  }

  .player-footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    margin-top: 20px;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 24px;
  }
  
  .login-card {
    padding: 25px 15px;
  }

  .btn-large {
    padding: 15px 30px;
    font-size: 16px;
  }
}
