html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100vw;
  overflow: hidden;
}
body {
  font-family: 'Segoe UI', 'Meiryo', sans-serif;
  background: #111;
  color: #fff;
  box-sizing: border-box;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
}

header {
  background: #181818;
  padding: 20px 0 10px 0;
  text-align: center;
  flex-shrink: 0;
}

h1 {
  margin: 0 0 10px 0;
  font-size: 2em;
  font-weight: bold;
  letter-spacing: 1px;
}
.logo {
  font-size: 1.1em;
  vertical-align: middle;
}

.url-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  margin-bottom: 6px;
  width: 100%;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

#youtubeUrl {
  flex: 1 1 auto;
  padding: 13px 10px;
  border-radius: 8px;
  border: none;
  font-size: 1.1em;
  background: #232323;
  color: #fff;
  min-width: 0;
}
#addBtn, #pasteBtn {
  padding: 0 18px;
  border-radius: 8px;
  font-size: 1.08em;
  font-weight: bold;
  border: none;
  height: 45px;
  background: #1db954;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
#pasteBtn {
  background: #232323;
  color: #1db954;
  font-weight: normal;
  border: 1px solid #1db954;
}
#addBtn:hover, #pasteBtn:hover {
  background: #14833b;
  color: #fff;
}

main {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

.player-area {
  width: 100%;
  max-width: 480px;
  margin: 0 auto 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.embed-box {
  width: 100%;
  max-width: 370px;
  aspect-ratio: 16/9;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 18px #000b;
  background: #000;
}

#player {
  width: 100%;
  height: 100%;
}

.now-info {
  text-align: center;
  margin: 14px 0 0 0;
}
.now-playing-label {
  font-size: 1.03em;
  color: #ccc;
  margin-bottom: 3px;
}
.now-title-scroll-wrap {
  max-width: 345px;
  margin: 0 auto 2px auto;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  height: 1.6em;
}
.now-title {
  font-size: 1.16em;
  font-weight: bold;
  color: #fff;
  white-space: nowrap;
  display: inline-block;
  position: relative;
  transition: none;
}
.now-title.scroll {
  animation: scroll-left-title 13s linear infinite;
}
@keyframes scroll-left-title {
  0% { transform: translateX(100%);}
  100% { transform: translateX(-100%);}
}

.now-channel {
  font-size: 0.98em;
  color: #bbb;
}

/* いいね・バッド・ヘルプ・設定ボタン */
.like-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 9px 0;
}
.like-btn, .dislike-btn, .help-btn, .settings-btn {
  font-size: 1.7em;
  background: #232323;
  color: #bbb;
  border: none;
  border-radius: 38px;
  padding: 6px 23px;
  cursor: pointer;
  opacity: 1;
  transition: background 0.12s, color 0.12s;
}
.like-btn.active, .dislike-btn.active {
  background: #1db954;
  color: #fff;
}
.help-btn {
  font-size: 1.4em;
  background: #232323;
  color: #1db954;
  padding: 6px 18px 6px 18px;
  margin-left: 3px;
  font-weight: bold;
  border: 1px solid #1db954;
  transition: background 0.16s, color 0.16s;
}
.help-btn:hover {
  background: #1db954;
  color: #232323;
}

/* 設定ボタン（⚙️） */
.settings-btn {
  font-size: 1.35em;
  background: #232323;
  color: #bbb;
  border: 1px solid #1db954;
  border-radius: 38px;
  padding: 7px 21px;
  cursor: pointer;
  margin-left: 3px;
  transition: background 0.14s, color 0.14s;
}
.settings-btn:hover {
  background: #1db954;
  color: #232323;
}

/* シークバー */
.seekbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 97%;
  margin: 0 auto 5px auto;
}
#seekbar {
  flex: 1 1 auto;
  accent-color: #1db954;
  height: 4px;
}
#currentTime, #duration {
  font-size: 0.98em;
  width: 46px;
  text-align: center;
  color: #bbb;
}

/* コントロール */
.controls-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  margin: 16px 0 8px 0;
}
.controls-row button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 2.1em;
  background: #232323;
  color: #fff;
  box-shadow: 0 2px 10px #0005;
  cursor: pointer;
  transition: background 0.17s, color 0.17s, transform 0.13s;
  outline: none;
}
.controls-row button:active, .controls-row button.active {
  background: #1db954;
  color: #111;
  transform: scale(1.1);
}
#playPauseBtn {
  background: #1db954;
  color: #111;
  font-size: 2.25em;
}

/* 曲リストセクション */
.list-section {
  width: 100%;
  max-width: 480px;
  margin: 8px auto 10px auto;
  flex-shrink: 1;
}
.list-label {
  text-align: center;
  color: #fff;
  font-weight: bold;
  margin-bottom: 2px;
  font-size: 1.13em;
  letter-spacing: 0.03em;
}
#playlist {
  width: 100%;
  background: transparent;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 132px;
  overflow-y: auto;
  border-radius: 10px;
  box-sizing: border-box;
}
#playlist li {
  display: flex;
  align-items: center;
  background: #222;
  margin-bottom: 4px;
  padding: 4px 6px;
  border-radius: 7px;
  font-size: 0.97em;
  gap: 7px;
  min-height: 33px;
  transition: background 0.1s;
}
#playlist li span {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  font-size: 0.98em;
}
.btn-group {
  display: flex;
  gap: 5px;
}
#playlist li button {
  background: #2c2c2c;
  color: #fff;
  border: none;
  font-size: 1.12em;
  padding: 4px 13px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.11s, color 0.11s;
  margin-left: 1px;
  height: 31px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
#playlist li .delete-btn {
  min-width: 48px;
  background: #a02b2b;
}
#playlist li button:hover {
  background: #1db954;
  color: #111;
}

/* モーダル（削除・使い方・設定） */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: #232323;
  color: #fff;
  padding: 25px 30px 18px 30px;
  border-radius: 16px;
  text-align: center;
  min-width: 210px;
  box-shadow: 0 4px 40px #0009;
}
.help-modal-content {
  min-width: 250px;
  max-width: 340px;
  padding: 23px 10px 16px 10px;
  box-sizing: border-box;
}
.settings-modal-content {
  min-width: 220px;
  max-width: 320px;
  padding: 22px 15px 18px 15px;
  box-sizing: border-box;
}
.settings-modal-content button {
  margin-bottom: 7px;
}
.settings-close-btn {
  background: #e44;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 1.06em;
  font-weight: bold;
  padding: 7px 30px;
  margin-top: 4px;
  margin-bottom: 0;
  cursor: pointer;
  transition: background 0.18s;
}
.settings-close-btn:hover, .settings-close-btn:active {
  background: #f24c78;
  color: #fff;
}

/* 使い方(help)テキスト枠 拡大！ */
#helpTextArea {
  margin-bottom: 15px;
  white-space: pre-wrap;
  max-height: 220px;
  overflow: auto;
}

/* 閉じるボタン（help用）を赤色で目立たせる！ */
#helpCloseBtn {
  background: #e44;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 1.06em;
  font-weight: bold;
  padding: 7px 30px;
  margin-top: 4px;
  margin-bottom: 0;
  cursor: pointer;
  transition: background 0.18s;
}
#helpCloseBtn:hover, #helpCloseBtn:active {
  background: #f24c78;
  color: #fff;
}

/* help動画サイズの最適化ポイント */
#helpVideo1, #helpVideo2 {
  display: block;
  margin: 0 auto 12px auto;
  background: #000;
  border-radius: 12px;
  width: 96%;
  max-width: 320px;
  max-height: 180px;
  object-fit: contain;
  box-shadow: 0 2px 14px #000a;
}

/* フッター */
footer {
  width: 100vw;
  background: #181818;
  color: #aaa;
  text-align: center;
  padding: 13px 0 10px 0;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 40;
  font-size: 1em;
}
footer a {
  color: #1db954;
  text-decoration: none;
}

/* スマホ対応 */
@media (max-width: 600px) {
  h1 {
    font-size: 1.19em;
  }
  .player-area, .list-section {
    max-width: 97vw;
  }
  .now-title-scroll-wrap {
    max-width: 84vw;
  }
  .embed-box {
    max-width: 97vw;
  }
  #playlist {
    max-width: 97vw;
  }
  .modal-content, .help-modal-content, .settings-modal-content {
    max-width: 99vw !important;
    padding: 12px 3vw 10px 3vw;
  }
  #helpVideo1, #helpVideo2 {
    max-width: 95vw;
    max-height: 30vw;
  }
}