/* ============================================================
   style.css — DrivePlayer ダークテーマ / モバイルファースト
   ============================================================ */

/* ── CSS 変数 ─────────────────────────────────────────────── */
:root {
  --bg:          #0d0d0d;
  --surface:     #1a1a1a;
  --surface2:    #242424;
  --border:      #333333;
  --primary:     #4285f4;
  --primary-dim: #1a3a7a;
  --accent:      #ff6b35;
  --danger:      #ea4335;
  --text:        #ffffff;
  --text-dim:    #b0b0b0;
  --text-muted:  #666666;
  --nav-height:  60px;
  --header-height: 52px;
  --radius:      10px;
  --radius-sm:   6px;
  --transition:  0.2s ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
button { cursor: pointer; border: none; background: none; color: inherit; font: inherit; }
input[type=range] { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }

/* ── アプリ全体 ──────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh; /* dynamic viewport height */
  overflow: hidden;
  position: relative;
}

/* ── ビュー ──────────────────────────────────────────────────── */
.view {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  height: calc(100dvh - var(--nav-height));
}
.view.active { display: flex; }

/* ── ヘッダー ─────────────────────────────────────────────────── */
.view-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.view-header h2 { font-size: 17px; font-weight: 600; }

/* ── ボタン共通 ──────────────────────────────────────────────── */
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background var(--transition);
}
.btn-icon:active { background: rgba(255,255,255,0.12); }
.btn-icon svg { width: 22px; height: 22px; fill: currentColor; }

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  transition: opacity var(--transition), transform var(--transition);
}
.btn-primary:active { opacity: 0.8; transform: scale(0.97); }

.btn-small {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text-dim);
  font-size: 13px;
  border: 1px solid var(--border);
}
.btn-small:active { opacity: 0.7; }

/* ── ログイン画面 ─────────────────────────────────────────────── */
#view-login {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  height: 100dvh;
}
.login-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: var(--surface2);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-logo svg { width: 48px; height: 48px; fill: var(--primary); }
#view-login h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
#view-login .subtitle { color: var(--text-dim); margin-bottom: 48px; font-size: 15px; }
.btn-google {
  background: #fff;
  color: #333;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}
.btn-google svg { width: 20px; height: 20px; }
.login-note { margin-top: 16px; color: var(--text-muted); font-size: 12px; }

/* ── ドライブブラウザ ─────────────────────────────────────────── */
.breadcrumb {
  flex: 1;
  font-size: 14px;
  color: var(--text-dim);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.search-bar {
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.search-bar input {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar input:focus { border-color: var(--primary); }

.file-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}
.file-item:active { background: var(--surface2); }
.file-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.file-icon.folder { background: #2a3a5c; }
.file-icon.video  { background: #2a3a2a; }
.file-icon svg    { width: 22px; height: 22px; }
.file-info { flex: 1; min-width: 0; }
.file-name {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.file-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.file-actions { display: flex; align-items: center; gap: 4px; }
.btn-fav {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: color var(--transition);
}
.btn-fav.active { color: #ffcc00; }
.btn-fav svg { width: 20px; height: 20px; }

.folder-play-bar {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.btn-play-folder {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-play-folder svg { width: 18px; height: 18px; }

/* 空・ローディング・エラー */
.state-empty, .state-loading, .state-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  gap: 12px;
  color: var(--text-muted);
}
.state-error { color: var(--danger); }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── プレイヤービュー ─────────────────────────────────────────── */
#view-player {
  position: relative;
  background: #000;
}

.player-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

#video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ── プレイヤーオーバーレイ ─────────────────────────────────────── */
.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.player-overlay.visible { pointer-events: all; }
.player-overlay.hidden { opacity: 0; pointer-events: none; }

.overlay-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.75), transparent);
  pointer-events: all;
}
.overlay-top .now-playing-title {
  flex: 1;
  font-size: 13px;
  color: var(--text-dim);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0 4px;
}
.btn-overlay {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.btn-overlay:active { background: rgba(255,255,255,0.15); }

.gesture-zone {
  flex: 1;
  pointer-events: all;
}

.overlay-bottom {
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  padding: 8px 8px 12px;
  pointer-events: all;
}

/* プログレスバー */
.progress-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.time-current, .time-total {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 38px;
}
.time-total { text-align: right; }

input[type=range].progress-bar {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.3);
  outline: none;
  position: relative;
}
input[type=range].progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 4px rgba(0,0,0,0.5);
}

/* コントロール行 */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 4px;
}
.controls-row .btn-icon { width: 44px; height: 44px; }
.btn-play-main {
  width: 56px !important;
  height: 56px !important;
  background: rgba(255,255,255,0.15);
  border-radius: 50% !important;
}
.btn-play-main svg { width: 28px; height: 28px; }
.btn-skip-label {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}

.controls-row-2 {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-speed {
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
input[type=range].volume-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.3);
  outline: none;
}
input[type=range].volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
}

/* ── ジェスチャーフィードバック ──────────────────────────────── */
.gesture-feedback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}
.gesture-feedback.show { opacity: 1; }

/* ── 速度ポップアップ ─────────────────────────────────────────── */
.speed-popup {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 100;
  min-width: 120px;
}
.speed-popup-inner {
  display: flex;
  flex-direction: column;
}
.speed-btn {
  padding: 11px 20px;
  text-align: center;
  font-size: 15px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.speed-btn:last-child { border-bottom: none; }
.speed-btn:active { background: var(--surface2); }
.speed-btn.active { color: var(--primary); font-weight: 700; }

/* ── プレイリストパネル ──────────────────────────────────────── */
.playlist-panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  max-height: 55%;
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-radius: var(--radius) var(--radius) 0 0;
}
.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}
.playlist-items {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.playlist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.playlist-item:active { background: var(--surface2); }
.playlist-item.active {
  background: var(--primary-dim);
  border-left: 3px solid var(--primary);
}
.playlist-item-num {
  width: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.playlist-item.active .playlist-item-num { color: var(--primary); }
.playlist-item-name {
  flex: 1;
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.playlist-item-dur {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── 自動次動画 ──────────────────────────────────────────────── */
.auto-next {
  position: absolute;
  bottom: 90px;
  right: 16px;
  background: rgba(0,0,0,0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  max-width: 280px;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.auto-next-text {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.auto-next-countdown {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}
.auto-next-countdown span { color: var(--primary); }
.auto-next-actions {
  display: flex;
  gap: 8px;
}
.auto-next-actions button {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
}
#btn-auto-next-cancel {
  background: var(--surface2);
  border: 1px solid var(--border);
}
#btn-auto-next-now {
  background: var(--primary);
  color: #fff;
}

/* ── 設定画面 ─────────────────────────────────────────────────── */
.settings-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 20px;
}
.settings-section {
  margin-top: 24px;
}
.settings-section h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 16px 6px;
  border-bottom: 1px solid var(--border);
}
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  gap: 12px;
}
.settings-item select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 4px 8px;
  font-size: 14px;
}

/* トグルスイッチ */
.toggle { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface2);
  border-radius: 26px;
  transition: background var(--transition);
  border: 1px solid var(--border);
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 50%;
  transform: translateY(-50%);
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform var(--transition), background var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--primary); border-color: var(--primary); }
.toggle input:checked + .toggle-slider::before {
  transform: translate(20px, -50%);
  background: #fff;
}

/* ── ボトムナビ ──────────────────────────────────────────────── */
.bottom-nav {
  display: flex;
  height: var(--nav-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 10px;
  padding: 6px 0;
  transition: color var(--transition);
}
.nav-btn svg { width: 22px; height: 22px; fill: currentColor; }
.nav-btn.active { color: var(--primary); }
.nav-btn:active { opacity: 0.7; }

/* ── トースト通知 ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface2);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 9999;
  white-space: nowrap;
  pointer-events: none;
  border: 1px solid var(--border);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── フルスクリーン時 ─────────────────────────────────────────── */
:fullscreen #view-player,
:-webkit-full-screen #view-player {
  height: 100vh;
}
:fullscreen .bottom-nav,
:-webkit-full-screen .bottom-nav {
  display: none !important;
}

/* ── スクロールバー ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── シークレットタブ ─────────────────────────────────────────── */
.secret-section {
  margin: 20px 0;
  padding: 0 16px;
}
.secret-section:first-child { margin-top: 16px; }

.secret-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.secret-hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.secret-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  outline: none;
  margin-bottom: 8px;
  display: block;
}
.secret-input:focus { border-color: var(--primary); }

.secret-folder-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.secret-folder-name {
  flex: 1;
  font-size: 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.secret-folder-select {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.secret-folder-select span:first-child { flex-shrink: 0; }
#secret-dest-name { flex: 1; }

.btn-danger {
  background: rgba(234,67,53,0.15);
  border-color: var(--danger) !important;
  color: var(--danger) !important;
}

/* キューアイテム */
.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.queue-item:last-child { border-bottom: none; }
.queue-item-info { flex: 1; min-width: 0; }
.queue-item-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.queue-item-url {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.queue-item-status { flex-shrink: 0; font-size: 12px; }

.qs-pending  { color: var(--text-muted); }
.qs-done     { color: #4caf50; font-weight: 600; }
.qs-error    { color: var(--danger); }
.qs-progress {
  width: 60px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 2px;
}
.qs-bar      { height: 100%; background: var(--primary); border-radius: 2px; transition: width 0.3s; }
.qs-label    { font-size: 11px; color: var(--primary); display: block; text-align: center; }

/* ── モーダルオーバーレイ (汎用) ───────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 20px 32px;
  border-top: 1px solid var(--border);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-sheet-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
}
.modal-sheet-header span { flex: 1; }

/* パスワードモーダル */
.password-modal-sheet {
  max-width: 400px;
  border-radius: var(--radius);
  margin: 24px;
  text-align: center;
  animation: none;
  transform: none;
}
.modal-overlay[style*="flex"] .password-modal-sheet { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

.pm-icon { font-size: 36px; margin-bottom: 12px; }
.password-modal-sheet h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.pm-msg { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }
.pm-actions { display: flex; gap: 10px; margin-top: 8px; }

/* フォルダピッカー */
.fpm-list {
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.fpm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
}
.fpm-item:active { background: var(--surface2); }
.fpm-select-current {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 2px solid var(--primary);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  text-align: left;
}
.fpm-select-current:active { background: var(--surface2); }

/* Driveブラウザ内のシークレットフォルダ表示 */
.secret-folder-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 204, 0, 0.15);
  border: 1px solid rgba(255, 204, 0, 0.4);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  color: #ffcc00;
  margin-left: 6px;
  flex-shrink: 0;
}

/* ── お気に入りボタン (ドライブヘッダー) ──────────────────── */
#btn-favorites-toggle svg { fill: currentColor; }
#btn-favorites-toggle.active { color: #ffcc00; }
#btn-favorites-toggle.active svg { fill: #ffcc00; }

/* ── ボトムナビ: 6タブ対応 ───────────────────────────────── */
.bottom-nav {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.bottom-nav::-webkit-scrollbar { display: none; }
.nav-btn {
  flex: 1 0 52px; /* 最小幅を確保しながら縮小可 */
}
/* 三点リーダーのタブは幅を少し狭く */
.nav-btn--more {
  flex: 0 0 44px;
}

/* ── スプレッドシート連携 ───────────────────────────────── */
.secret-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: 'Courier New', Courier, monospace;
  line-height: 1.6;
  outline: none;
  resize: vertical;
  box-sizing: border-box;
  margin-top: 4px;
  display: block;
}
.secret-textarea:focus { border-color: var(--primary); }
.secret-textarea::placeholder { color: var(--text-muted); }
.ss-config-row { margin-bottom: 4px; }

/* ── 音量ブーストボタン ─────────────────────────────────── */
.btn-boost {
  min-width: 32px;
  font-size: 11px;
  padding: 4px 6px;
  transition: background var(--transition), color var(--transition);
}
.btn-boost.active {
  color: #ff6b35;
  border-color: rgba(255,107,53,0.5);
}

/* ── YouTube ビュー ─────────────────────────────────────── */
.youtube-content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.yt-url-bar {
  display: flex;
  gap: 8px;
  padding: 12px;
  align-items: center;
}

.yt-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  user-select: text;
}
.yt-input:focus { border-color: var(--primary); }

/* 16:9 アスペクト比コンテナ */
#yt-player-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: #000;
  margin: 0 0 4px;
}
#yt-player-wrap > div,   /* YT API が挿入する div */
#yt-player-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

.yt-history-item { cursor: pointer; }

/* ── YouTube プレイリストリンク ─────────────────────────── */
.yt-playlist-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 0, 0, 0.12);
  border: 1px solid rgba(255, 0, 0, 0.3);
  border-radius: var(--radius);
  color: #ff4444;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: background var(--transition);
}
.yt-playlist-link:active { background: rgba(255, 0, 0, 0.22); }

/* ── VOD サービスランチャー ─────────────────────────────── */

/* JustWatch メインボタン */
.vod-justwatch-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  background: rgba(255, 195, 0, 0.1);
  border: 1px solid rgba(255, 195, 0, 0.35);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: background var(--transition);
}
.vod-justwatch-btn:active { background: rgba(255, 195, 0, 0.2); }
.vod-jw-icon { flex-shrink: 0; }
.vod-jw-text { flex: 1; }
.vod-jw-name { font-size: 17px; font-weight: 700; color: #FFC300; }
.vod-jw-desc { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* その他サービス行 */
.vod-service-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: opacity var(--transition);
}
.vod-service-btn:last-child { border-bottom: none; }
.vod-service-btn:active { opacity: 0.6; }
.vod-svc-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.vod-svc-name  { font-size: 14px; font-weight: 600; flex: 1; }
.vod-svc-desc  { font-size: 12px; color: var(--text-dim); }
.vod-external-icon { flex-shrink: 0; opacity: 0.4; }

/* ── メディアクエリ (タブレット/PC) ─────────────────────────── */
@media (min-width: 600px) {
  .player-container { max-width: 900px; margin: 0 auto; }
  .file-list { max-width: 700px; margin: 0 auto; width: 100%; }
  .bottom-nav { max-width: 700px; margin: 0 auto; width: 100%; }
  .password-modal-sheet { margin: auto; }
  #yt-player-wrap { max-width: 640px; padding-bottom: min(56.25%, 360px); }
}
