@charset "UTF-8";

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Arial", "Hiragino Kaku Gothic ProN", sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #f4f5f7;
  color: #222;
}

#header {
  width: 90%;
  height: 46px;
  line-height: 46px;
  margin: 12px auto 16px;
  border: 1px solid #888;
  border-radius: 10px;
  background: #4676d7;
  color: #fff;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease;
  user-select: none;
}

#header:hover {
  background: #2a5cc0;
}

#header.connected {
  background: #2e8b57;
}

#connect {
  font-size: 24px;
  letter-spacing: 0.2rem;
  font-weight: 500;
}

#player {
  width: 100%;
  display: flex;
  gap: 16px;
  padding: 0 2% 24px;
  flex: 1;
}

#left-bar {
  width: 65%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#video {
  width: 100%;
  background: #000;
  border-radius: 6px;
  max-height: 65vh;
}

#connectedDisplay {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 24px;
  color: #fff;
  background: #7b507e;
  border-radius: 6px;
}

#controls {
  display: flex;
  gap: 10px;
}

#controls button {
  flex: 1;
  padding: 12px;
  font-size: 18px;
  border: none;
  border-radius: 6px;
  background: #333;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s;
}

#controls button:hover {
  opacity: 0.85;
}

#play-btn {
  background: #4676d7 !important;
}

#right-bar {
  width: 35%;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #eee;
  font-weight: bold;
}

#add-file-btn {
  padding: 6px 12px;
  background: #4676d7;
  color: #fff;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

#playlist {
  list-style: none;
  margin: 0;
  padding: 8px;
  flex: 1;
  overflow-y: auto;
}

.playlist-item {
  padding: 10px 12px;
  margin-bottom: 6px;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: grab;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.playlist-item.active {
  background: #e3edff;
  border-color: #4676d7;
  font-weight: bold;
}

.csv-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #2e8b57;
  color: #fff;
}

.csv-badge.missing {
  background: #999;
}

/* モバイル対応 */
@media (max-width: 768px) {
  #player {
    flex-direction: column;
  }
  #left-bar,
  #right-bar {
    width: 100%;
  }
  #connectedDisplay {
    font-size: 18px;
  }
}
