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

body {
  font-family: 'Hiragino Maru Gothic ProN', 'BIZ UDPGothic', sans-serif;
  background: #f0f9ff;
  color: #1e293b;
  padding: 8px;
}

h1 {
  text-align: center;
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: #0ea5e9;
}

/* URL入力エリア */
.url-input-area {
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 8px;
}

.url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.url-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.url-field label {
  font-size: 0.85rem;
  font-weight: bold;
  color: #475569;
  white-space: nowrap;
}

.url-field input {
  flex: 1;
  padding: 7px 10px;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.url-field input:focus {
  border-color: #0ea5e9;
}

/* プレイヤーエリア */
.players-area {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.player-wrapper {
  flex: 1;
  background: #000;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  overflow: hidden;
}

.player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
}

.player-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.error-msg {
  color: #ef4444;
  font-size: 0.8rem;
  min-height: 1.2em;
  padding: 3px 8px;
  text-align: center;
  background: #fff;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: #fff;
}

.volume-control span {
  font-size: 1rem;
}

.volume-control input[type="range"] {
  flex: 1;
  accent-color: #0ea5e9;
  height: 4px;
  cursor: pointer;
}

/* コントロールエリア */
.controls-area {
  background: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.main-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ボタン共通 */
.btn {
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: bold;
  transition: opacity 0.2s, transform 0.1s;
  min-height: 44px;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-load {
  background: #0ea5e9;
  color: #fff;
  display: block;
  margin: 0 auto;
}

.btn-load:hover:not(:disabled) {
  background: #0284c7;
}

.btn-play {
  background: #22c55e;
  color: #fff;
}

.btn-play:hover:not(:disabled) {
  background: #16a34a;
}

.btn-pause {
  background: #f97316;
  color: #fff;
}

.btn-pause:hover:not(:disabled) {
  background: #ea580c;
}

.btn-resync {
  background: #8b5cf6;
  color: #fff;
}

.btn-resync:hover:not(:disabled) {
  background: #7c3aed;
}

/* シークバー */
.seek-area {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.seek-area span {
  font-size: 0.8rem;
  color: #64748b;
  white-space: nowrap;
  min-width: 32px;
}

#seekbar {
  flex: 1;
  accent-color: #0ea5e9;
  height: 6px;
  cursor: pointer;
}

#seekbar:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* レスポンシブ */
@media (max-width: 767px) {
  .url-row {
    flex-direction: column;
  }

  .players-area {
    flex-direction: column;
  }

  .controls-area {
    flex-direction: column;
    align-items: stretch;
  }

  .main-buttons {
    justify-content: center;
  }

  .seek-area {
    width: 100%;
  }
}
