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

body {
  background: #111;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  padding: 20px;
  color: #e0e0e0;
}

/* ---- ヘッダー ---- */
.site-header {
  padding: 10px 20px;
  border-bottom: 1px solid #222;
  margin: -20px -20px 0;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  height: 28px;
  width: auto;
  display: block;
}

.logo {
  font-size: 20px;
  font-weight: 300;
  color: #fff;
  letter-spacing: 0.04em;
}

.logo strong {
  font-weight: 700;
  color: #fff;
}

.app {
  margin: 24px 0 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---- コントロールパネル ---- */
.control-panel {
  display: flex;
  align-items: flex-start;
  gap: 28px;
}

/* ---- ボタングループ ---- */
.button-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.ctrl-btn {
  width: 76px;
  height: 76px;
  background: #1c1c1c;
  border: 1px solid #333;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.12s, border-color 0.12s;
}

.ctrl-btn:hover {
  background: #2a2a2a;
  border-color: #555;
}

.ctrl-btn:active {
  background: #111;
  border-color: #777;
}

.ctrl-btn i {
  font-size: 20px;
  color: #fff;
}

.key-hint {
  color: #555;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.03em;
}

.mute-btn.is-muted {
  background: #2e2e2e;
  border-color: #555;
}

.mute-btn.is-muted i {
  color: #666;
}

/* ---- レイアウト切替ボタン ---- */
.layout-group {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.layout-btn {
  width: 48px;
  height: 36px;
  background: #1c1c1c;
  border: 1px solid #333;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  color: #555;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.layout-btn:hover {
  background: #2a2a2a;
  border-color: #555;
  color: #aaa;
}

.layout-btn.active {
  border-color: #888;
  color: #e0e0e0;
}

.layout-btn svg {
  width: 100%;
  height: 100%;
}

/* ---- サイズ変更レイアウト ---- */
.video-panel.layout-v1-main .video-container:nth-child(1) {
  flex: 3;
}
.video-panel.layout-v1-main .video-container:nth-child(2) {
  flex: 1;
}

.video-panel.layout-v2-main .video-container:nth-child(1) {
  flex: 1;
}
.video-panel.layout-v2-main .video-container:nth-child(2) {
  flex: 3;
}

/* ---- 設定パネル ---- */
.settings-panel {
  border: 1px solid #2e2e2e;
  padding: 14px 18px;
  background: #1c1c1c;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 360px;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.setting-row label {
  font-size: 13px;
  color: #aaa;
  min-width: 110px;
  letter-spacing: 0.02em;
}

.time-input {
  width: 80px;
  padding: 5px 8px;
  border: 1px solid #333;
  background: #111;
  color: #e0e0e0;
  font-size: 14px;
  text-align: center;
  outline: none;
}

.time-input:focus {
  border-color: #666;
}

.skip-input {
  width: 60px;
  padding: 5px 8px;
  border: 1px solid #333;
  background: #111;
  color: #e0e0e0;
  font-size: 14px;
  text-align: center;
  outline: none;
}

.skip-input:focus {
  border-color: #666;
}

.buffering-input {
  width: 80px;
}

.unit {
  font-size: 13px;
  color: #aaa;
}

.set-btn {
  padding: 5px 10px;
  border: 1px solid #333;
  background: #111;
  color: #aaa;
  cursor: pointer;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  white-space: pre-line;
  transition: background 0.12s, color 0.12s;
}

.set-btn:hover {
  background: #2a2a2a;
  color: #e0e0e0;
}

/* ---- 動画パネル ---- */
.video-panel {
  display: flex;
  gap: 12px;
}

.video-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ---- URLバー ---- */
.url-bar {
  display: flex;
  align-items: center;
  background: #1c1c1c;
  border: 1px solid #2e2e2e;
  border-bottom: none;
}

.url-input {
  flex: 1;
  padding: 8px 12px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: #ccc;
}

.url-input::placeholder {
  color: #444;
}

.search-btn {
  padding: 8px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #555;
  display: flex;
  align-items: center;
  transition: color 0.12s;
  border-left: 1px solid #2e2e2e;
}

.search-btn:hover {
  color: #e0e0e0;
}

/* ---- プレイヤー領域 ---- */
.player-wrapper {
  background: #0a0a0a;
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border: 1px solid #2e2e2e;
}

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

/* ---- 使い方 ---- */
.how-to {
  border-top: 1px solid #222;
  padding-top: 32px;
  margin-top: 8px;
}

.how-to-title {
  font-size: 20px;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 8px;
}

.how-to-note {
  font-size: 12px;
  color: #666;
  margin-bottom: 20px;
}

.how-to-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.how-to-card {
  background: #1c1c1c;
  border: 1px solid #2e2e2e;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.how-to-step {
  width: 28px;
  height: 28px;
  border: 1px solid #444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #888;
  flex-shrink: 0;
}

.how-to-card h3 {
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e0;
  letter-spacing: 0.02em;
}

.how-to-card p {
  font-size: 12px;
  color: #888;
  line-height: 1.8;
}

.how-to-card i {
  color: #aaa;
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 3px;
  font-size: 11px;
  color: #ccc;
  font-family: inherit;
  line-height: 1.6;
}

.how-to-shortcuts {
  background: #1c1c1c;
  border: 1px solid #2e2e2e;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.how-to-shortcuts h3 {
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e0;
  letter-spacing: 0.02em;
}

.shortcut-table {
  border-collapse: collapse;
  font-size: 12px;
}

.shortcut-table td {
  padding: 5px 20px 5px 0;
  color: #888;
  vertical-align: middle;
}

.shortcut-table td:first-child {
  color: #ccc;
  white-space: nowrap;
}

.shortcut-note {
  font-size: 11px;
  color: #555;
}

/* ---- フッター ---- */
.site-footer {
  margin: 0 -20px -20px;
  padding: 20px 20px;
  border-top: 1px solid #222;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-disclaimer {
  font-size: 11px;
  color: #555;
  line-height: 1.7;
}

.footer-disclaimer a {
  color: #777;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-disclaimer a:hover {
  color: #aaa;
}

.footer-credit {
  font-size: 11px;
  color: #444;
}

.footer-credit a {
  color: #555;
  text-decoration: none;
}

.footer-credit a:hover {
  color: #aaa;
}

.footer-sep {
  margin: 0 8px;
  color: #333;
}

/* ---- レスポンシブ ---- */
@media (max-width: 900px) {
  .control-panel {
    flex-direction: column;
    gap: 16px;
  }

  .control-left {
    order: 2;
    width: 100%;
  }

  .settings-panel {
    order: 1;
    min-width: 0;
    width: 100%;
  }

  .video-panel {
    flex-direction: column;
  }

  .how-to-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  body {
    padding: 12px;
  }

  .ctrl-btn i {
    font-size: 16px;
  }

  .button-group {
    gap: 4px;
    width: 100%;
  }

  .button-group .ctrl-btn {
    flex: 1;
    width: auto;
    min-width: 0;
    height: 56px;
  }

  .how-to-grid {
    grid-template-columns: 1fr;
  }
}
