/* ==========================================================================
   キッズTube: 3歳児向けYouTubeホワイトリストプレイヤー スタイルシート
   ========================================================================== */

:root {
  --primary: #FF6B6B;
  --primary-hover: #EE5253;
  --secondary: #FFD166;
  --accent-blue: #48DBFB;
  --accent-green: #1DD1A1;
  --accent-purple: #A29BFE;
  --bg-main: #FFFDF9;
  --card-bg: #FFFFFF;
  --text-main: #2D3436;
  --text-muted: #636E72;
  --border-color: #F1E7DD;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(255, 107, 107, 0.12);
  --shadow-card: 0 12px 28px rgba(0, 0, 0, 0.07);
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* リセット & 基本設定 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: 'M PLUS Rounded 1c', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ==========================================================================
   ヘッダー (2行構成: 1行目ロゴ&設定、2行目ストーリーズ風丸アイコンナビ)
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 253, 249, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid var(--border-color);
  padding-top: calc(var(--safe-top) + 8px);
  padding-bottom: 10px;
  padding-left: 16px;
  padding-right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 1行目: ロゴ & 歯車 */
.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.logo-title {
  font-size: 24px;
  font-weight: 900;
  color: #2F3640;
  letter-spacing: -0.5px;
}

.logo-title .brand-kids {
  color: #2F3640;
}

.logo-title .highlight {
  color: var(--primary);
  margin-left: 1px;
}

/* ペアレントゲート起動ボタン（3秒長押し、ラベルなしでスッキリ） */
.parent-gate-trigger-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.parent-gate-btn {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #F8F9FA;
  border: 3px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.parent-gate-btn:active {
  transform: scale(0.92);
}

.parent-gate-btn .lock-icon {
  font-size: 30px;
  position: relative;
  z-index: 2;
  transition: transform 0.2s ease;
}

/* 長押しプログレスリング */
.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 68px;
  height: 68px;
  transform: rotate(-90deg);
  pointer-events: none;
}

.progress-ring__circle {
  stroke-dasharray: 175.93; /* 2 * PI * 28 */
  stroke-dashoffset: 175.93;
  transition: stroke-dashoffset 0.1s linear;
}

.progress-ring__circle.filling {
  transition: stroke-dashoffset 3s linear;
  stroke-dashoffset: 0;
}

/* ヘッダー右側ボタングループ */
.header-right-actions {
  display: flex;
  align-items: center;
  gap: 18px; /* 誤タップ防止のため広めの間隔 */
}

/* アプリを閉じる✖️ボタン */
.header-close-app-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #FFF0F0;
  border: 3px solid #FFCDD2;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 3px 8px rgba(235, 77, 75, 0.18);
}

.header-close-app-btn:hover {
  background: #FFEBEE;
  transform: scale(1.06);
}

.header-close-app-btn:active {
  transform: scale(0.92);
}

.close-icon-text {
  font-size: 26px;
  line-height: 1;
}

/* アプリ終了モーダルカード */
.app-close-card {
  max-width: 320px;
  text-align: center;
  padding: 30px 24px;
  border-radius: var(--radius-lg);
  background: #FFFFFF;
}

.bye-emoji {
  font-size: 52px;
  margin-bottom: 12px;
  animation: wave 1.2s infinite ease-in-out;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(18deg); }
}

.bye-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 8px;
}

.bye-message {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.bye-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bye-confirm-btn {
  background: #EB4D4B;
  color: #FFFFFF;
  border: none;
  padding: 14px 20px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 900;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(235, 77, 75, 0.35);
  transition: transform 0.15s ease;
}

.bye-confirm-btn:active {
  transform: scale(0.96);
}

.bye-cancel-btn {
  background: #E8F5E9;
  color: #2E7D32;
  border: 2px solid #C8E6C9;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

/* ブラウザが閉じない場合のグッバイ画面 */
.goodbye-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(180deg, #FFF0F2 0%, #FFFFFF 100%);
}

.goodbye-emoji {
  font-size: 72px;
  margin-bottom: 16px;
  animation: wave 1.2s infinite ease-in-out;
}

.goodbye-title {
  font-size: 28px;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 12px;
}

.goodbye-sub {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-pink);
  margin-bottom: 16px;
}

.goodbye-hint {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
  background: #FFFFFF;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.goodbye-restart-btn {
  background: #4ECDC4;
  color: #FFFFFF;
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 900;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(78, 205, 196, 0.4);
}

/* 2行目: Instagramストーリーズ風アバターカテゴリナビ */
.story-nav {
  width: 100%;
  overflow: hidden;
}

.story-scroll-container {
  display: flex;
  align-items: center;
  gap: 20px; /* 誤タップ防止のため広めの間隔 */
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 10px 16px;
}

.story-scroll-container::-webkit-scrollbar {
  display: none;
}

/* ストーリーズ風丸型サークルボタン（68pxサイズ & ボタン感のある枠線） */
.story-circle-btn {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 3px;
  background: #FFFFFF;
  border: 3px solid #FFD1D6; /* ボタン感を強調する可愛いピンク枠線 */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
  overflow: hidden;
}

.story-circle-btn:active {
  transform: scale(0.92);
}

/* 選択中のハイライトリング（全カテゴリ共通の統一されたグラデーションリング） */
.story-circle-btn.active {
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 50%, #FFD166 100%);
  border: 3px solid #FF4757;
  transform: scale(1.10);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.45);
}

.story-inner-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  object-fit: cover;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 上下の黒帯を外側に押し出して完全に隠す */
img.story-inner-avatar {
  transform: scale(1.36);
  transform-origin: center center;
}

/* 「ぜんぶ」用カラフルサークル */
.story-all-circle {
  background: linear-gradient(135deg, #FFEAA7, #FF7675);
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

/* 「おきにいり」用ゴールドサークル */
.story-fav-circle {
  background: linear-gradient(135deg, #FFF9C4, #FBC02D);
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

/* ==========================================================================
   メインコンテンツ (動画一覧グリッド)
   ========================================================================== */
.main-content {
  flex: 1;
  padding: 16px 16px calc(var(--safe-bottom) + 32px) 16px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.loading-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 45vh;
  text-align: center;
  gap: 16px;
}

.bouncing-ball {
  font-size: 54px;
  animation: bounce 0.8s infinite alternate cubic-bezier(0.28, 0.84, 0.42, 1);
}

@keyframes bounce {
  0% { transform: translateY(0) scale(1.1, 0.9); }
  100% { transform: translateY(-24px) scale(0.9, 1.1); }
}

.loading-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
}

.empty-emoji {
  font-size: 64px;
}

.empty-state h2 {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-main);
}

.empty-state p {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
}

/* 動画グリッド: スマホでは縦並び〜2列、タブレット以上では3〜4列 */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

@media (max-width: 600px) {
  .video-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* 動画カード */
.video-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(255, 107, 107, 0.18);
  border-color: #FFE0D3;
}

.video-card:active {
  transform: scale(0.96);
}

.thumbnail-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9比率 */
  background: #2D3436;
  overflow: hidden;
}

.thumbnail-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 大きな再生ボタンアイコン */
.play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  background: rgba(255, 107, 107, 0.92);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}

.play-badge::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #FFFFFF;
  margin-left: 4px;
}

.video-card:hover .play-badge {
  transform: translate(-50%, -50%) scale(1.15);
}

.video-info {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.video-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-channel {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   専用プレイヤーモーダル (再生画面)
   ========================================================================== */
.player-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 200;
  background: #1E272E;
  display: flex;
  flex-direction: column;
}

.player-modal.hidden {
  display: none;
}

.player-modal-header {
  padding: calc(var(--safe-top) + 10px) 16px 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: #182026;
  border-bottom: 2px solid #2F3640;
}

/* 3歳児でも迷わず押せる「もどる」ボタン */
.big-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 107, 107, 0.4);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.big-back-btn:active {
  transform: scale(0.92);
}

.playing-title {
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.player-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  overflow: hidden;
}

.youtube-player {
  width: 100%;
  height: 100%;
}

/* 動画終了時のカスタムおすすめオーバーレイ */
.ended-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 20, 25, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.ended-overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ended-card {
  max-width: 680px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.ended-buttons-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px; /* ボタン縦1つ分の間隔 */
}

.big-replay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 36px;
  min-width: 220px;
  background: #1DD1A1;
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 19px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(29, 209, 161, 0.4);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.big-replay-btn:active {
  transform: scale(0.94);
}

.big-finish-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 36px;
  min-width: 220px;
  background: #FF4757;
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 19px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.big-finish-btn:active {
  transform: scale(0.94);
}

.custom-recommendations-section {
  width: 100%;
  margin-top: 6px;
}

.rec-heading {
  color: #FFD166;
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 14px;
}

.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 500px) {
  .recommendations-grid {
    grid-template-columns: 1fr;
    max-height: 40vh;
    overflow-y: auto;
  }
}

.rec-card {
  background: #2D3436;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease;
  border: 2px solid transparent;
}

.rec-card:hover {
  transform: scale(1.04);
  border-color: #FFD166;
}

.rec-card:active {
  transform: scale(0.96);
}

.rec-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.rec-title {
  padding: 8px 10px;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: left;
}

/* ==========================================================================
   共通モーダル (ペアレントゲート / 管理者設定)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 300;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.25s ease;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
  padding: 18px 20px;
  background: #FFF9F3;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-main);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

/* ペアレントゲート認証画面 */
.parent-gate-card {
  max-width: 360px;
}

.gate-content {
  padding: 24px 20px;
  text-align: center;
}

.gate-instruction {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.math-question {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 8px;
}

.math-input-display {
  display: inline-block;
  min-width: 80px;
  height: 48px;
  line-height: 48px;
  font-size: 26px;
  font-weight: 900;
  background: #F1F2F6;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  margin-bottom: 20px;
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 260px;
  margin: 0 auto;
}

.key-btn {
  height: 52px;
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  background: #F8F9FA;
  border: 1px solid #DFE4EA;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.key-btn:active {
  background: #DFE4EA;
  transform: scale(0.95);
}

.key-clear {
  font-size: 15px;
  background: #FFEAA7;
  color: #D35400;
  border-color: #FDCB6E;
}

.key-submit {
  font-size: 16px;
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  font-weight: 900;
}

.gate-error {
  margin-top: 14px;
  color: #EB4D4B;
  font-size: 13px;
  font-weight: 700;
}

/* 管理者設定モーダル */
.admin-card {
  max-width: 580px;
}

.admin-content {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-section {
  background: #FAFAFA;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.section-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.section-title .icon {
  font-size: 20px;
}

.section-title h4 {
  font-size: 16px;
  font-weight: 900;
  color: var(--text-main);
}

/* iPhone接続ボックス */
.connect-box {
  display: flex;
  gap: 16px;
  align-items: center;
  background: #FFFFFF;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #ECEFF1;
}

.connect-url-area {
  flex: 1;
}

.connect-url-area p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.url-badge {
  display: inline-block;
  font-family: monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  background: #FFF0E6;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px dashed var(--primary);
  word-break: break-all;
}

.connect-qr-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.qr-code-img {
  width: 96px;
  height: 96px;
  background: #FFFFFF;
  border: 1px solid #DFE4EA;
  border-radius: 8px;
  padding: 4px;
}

.qr-hint {
  font-size: 10px;
  color: var(--text-muted);
}

.pwa-guide-tip {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #4B6584;
  background: #EDF2F7;
  padding: 10px 12px;
  border-radius: 8px;
}

/* チャンネル追加フォーム */
.add-form .form-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.input-group {
  display: flex;
  gap: 8px;
}

.input-group input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid #DFE4EA;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: var(--primary);
}

.primary-btn {
  padding: 10px 18px;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

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

.status-msg {
  font-size: 12px;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 6px;
}

.status-msg.success {
  background: #D4EDDA;
  color: #155724;
}

.status-msg.error {
  background: #F8D7DA;
  color: #721C24;
}

/* 登録済みチャンネル一覧 */
.refresh-btn {
  background: #EAF2F8;
  color: #2980B9;
  border: 1px solid #AED6F1;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.channels-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.channel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #ECEFF1;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  user-select: none;
}

.channel-item.dragging {
  opacity: 0.55;
  background: #FFF0F2;
  border: 2px dashed var(--primary-pink);
  transform: scale(0.98);
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.25);
}

.drag-handle {
  cursor: grab;
  font-size: 18px;
  color: #B0BEC5;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.drag-handle:hover,
.drag-handle:active {
  color: var(--primary-pink);
  background: #FFF0F2;
}

.reorder-btn-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reorder-btn {
  background: #F1F3F5;
  border: none;
  font-size: 9px;
  color: #636E72;
  padding: 2px 5px;
  border-radius: 3px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}

.reorder-btn:hover:not(:disabled) {
  background: var(--primary-pink);
  color: #FFFFFF;
}

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

.channel-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.ch-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: #DFE4EA;
  flex-shrink: 0;
}

.ch-info {
  overflow: hidden;
}

.ch-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.type-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-channel {
  background: #E8F4FD;
  color: #2980B9;
}

.badge-playlist {
  background: #F3E5F5;
  color: #8E44AD;
}

.badge-video {
  background: #FFF9C4;
  color: #F57F17;
}

.ch-count {
  font-size: 12px;
  color: var(--text-muted);
}

.delete-ch-btn {
  background: #FFF0F0;
  color: #EB4D4B;
  border: 1px solid #FFCECE;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.delete-ch-btn:hover {
  background: #EB4D4B;
  color: #FFFFFF;
}

.hidden {
  display: none !important;
}
