/* === プロフィール編集 === */
.container-narrow { max-width: 720px; margin: 0 auto; }

.profile-edit-form .profile-edit-section {
  border: 1px solid #ece8f3;
  border-radius: 12px;
  padding: 18px 20px 8px;
  margin-bottom: 18px;
  background: #fff;
}
.profile-edit-section legend {
  padding: 0 8px;
  font-weight: 800;
  color: var(--accent-primary, #5f0cb9);
  font-size: 14px;
}
.avatar-upload {
  display: flex;
  align-items: center;
  gap: 16px;
}
.avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: #f3f0fa;
  flex-shrink: 0;
}
.avatar-preview-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
}
.avatar-preview-empty i { width: 36px; height: 36px; }
.avatar-upload-controls { flex: 1; min-width: 0; }
.avatar-upload-controls input[type="file"] { font-size: 13px; }

.input-with-prefix {
  display: flex;
  align-items: stretch;
  border: 1px solid #d9d3e6;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.input-with-prefix .input-prefix {
  padding: 10px 12px;
  background: #f7f4fb;
  color: #777;
  font-size: 13px;
  border-right: 1px solid #d9d3e6;
  white-space: nowrap;
}
.input-with-prefix input {
  flex: 1;
  border: none !important;
  border-radius: 0 !important;
  padding: 10px 12px !important;
  outline: none;
  min-width: 0;
}

.profile-edit-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 8px;
}
.profile-edit-checkbox input { width: 18px; height: 18px; accent-color: var(--accent-primary, #5f0cb9); }

.profile-edit-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* === 公開プロフィール === */
.profile-section { padding: 24px 0 48px; }
.profile-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 24px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(15,5,35,0.06);
  margin-bottom: 28px;
}
.profile-avatar { flex-shrink: 0; }
.profile-avatar-img,
.profile-avatar-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  background: #f3f0fa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
}
.profile-avatar-placeholder i { width: 56px; height: 56px; }
.profile-info { flex: 1; min-width: 0; }
.profile-display-name {
  margin: 0 0 2px;
  font-size: 24px;
  font-weight: 800;
  color: #1a1a2e;
}
.profile-username {
  margin: 0 0 12px;
  color: #888;
  font-size: 14px;
  font-weight: 600;
}
.profile-bio {
  margin: 0 0 12px;
  color: #444;
  line-height: 1.7;
  white-space: pre-line;
}
.profile-meta {
  margin: 0;
  color: #888;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.profile-meta i { width: 14px; height: 14px; }

.profile-sns {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}
.profile-sns a {
  display: inline-flex;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: #f7f4fb;
  color: #555;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.profile-sns a:hover {
  background: var(--accent-primary, #5f0cb9);
  color: #fff;
  transform: translateY(-1px);
}
.profile-sns i { width: 18px; height: 18px; }

/* === マイページ拡張 === */
.mypage-username {
  margin: 0 0 4px;
  color: #666;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.mypage-public-badge,
.mypage-private-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.mypage-public-badge {
  background: #e8f6ec;
  color: #1f7a2e;
}
.mypage-private-badge {
  background: #f3f0fa;
  color: #777;
}
.mypage-public-badge i,
.mypage-private-badge i { width: 12px; height: 12px; }
.mypage-public-link {
  color: var(--accent-primary, #5f0cb9);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.mypage-public-link:hover { text-decoration: underline; }

.mypage-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  margin-left: auto;
}

@media (max-width: 600px) {
  .profile-card { flex-direction: column; align-items: center; text-align: center; }
  .profile-sns { justify-content: center; }
  .mypage-actions { width: 100%; align-items: stretch; margin-top: 12px; }
  .avatar-upload { flex-direction: column; align-items: flex-start; }
}

/* SNSラベル内の lucide アイコンサイズ調整 */
.profile-edit-section .form-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.profile-edit-section .form-label i,
.profile-edit-section .form-label svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.form-hint-left {
  text-align: left;
  line-height: 1.7;
}
.form-hint-left a {
  color: var(--accent-primary, #5f0cb9);
  text-decoration: underline;
}

/* === ヘッダーのユーザーバッジ === */
.header-userbadge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: #f7f4fb;
  color: #333;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: background .15s ease, color .15s ease;
  max-width: 200px;
}
.header-userbadge:hover {
  background: var(--accent-primary, #5f0cb9);
  color: #fff;
}
.header-userbadge-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: #e6dff0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.header-userbadge-placeholder { color: #999; }
.header-userbadge-placeholder i { width: 13px; height: 13px; }
.header-userbadge-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.header-userbadge-points {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-primary, #5f0cb9);
  background: rgba(95,12,185,.1);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.header-userbadge-points svg { width: 11px; height: 11px; }
.header-userbadge:hover .header-userbadge-points {
  color: #ffcf69;
  background: rgba(255,207,105,.2);
}
@media (max-width: 600px) {
  .header-userbadge-name { display: none; }
  .header-userbadge-points { display: none; }
  .header-userbadge { padding: 2px; }
}

/* エピソードサムネ画像読み込み失敗時のフォールバック */
.episode-card-thumb-fallback-badge { display: none; }
.episode-card-thumb-fallback {
  background: linear-gradient(135deg, var(--accent-secondary, #1a1a2e), var(--accent-primary, #5f0cb9));
  display: flex;
  align-items: center;
  justify-content: center;
}
.episode-card-thumb-fallback .episode-card-thumb-fallback-badge {
  display: inline-block;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: .04em;
}

/* === エピソード一覧（縦リスト） === */
.episode-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.episode-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #ece8f3;
  border-radius: 10px;
  transition: background .15s ease, border-color .15s ease;
}
.episode-row:hover {
  background: #faf7ff;
  border-color: #d6cce8;
}
.episode-row-thumb {
  position: relative;
  flex-shrink: 0;
  width: 120px;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent-secondary, #1a1a2e), var(--accent-primary, #5f0cb9));
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.episode-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.episode-row-no {
  position: absolute;
  bottom: 4px;
  left: 6px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .04em;
  padding: 1px 5px;
  border-radius: 4px;
  pointer-events: none;
  line-height: 1.6;
}
.episode-row-thumb-placeholder .episode-row-no {
  position: static;
  background: transparent;
  font-size: 20px;
  padding: 0;
  display: block;
  text-align: center;
}
.episode-row-body {
  flex: 1;
  min-width: 0;
}
.episode-row-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: #1a1a2e;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}
.episode-row-title:hover { color: var(--accent-primary, #5f0cb9); }
.episode-row-no-inline {
  color: var(--accent-primary, #5f0cb9);
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}
.episode-row-date {
  display: block;
  margin-top: 4px;
  color: #999;
  font-size: 12px;
}
.episode-row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.episode-row-review,
.episode-row-watch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.episode-row-review {
  background: #f3f0fa;
  color: var(--accent-primary, #5f0cb9);
}
.episode-row-review:hover { background: #e6dff0; }
.episode-row-watch {
  background: #00a8e1;
  color: #fff;
}
.episode-row-watch:hover { background: #0091c2; color: #fff; }
.episode-row-review i,
.episode-row-review svg,
.episode-row-watch i,
.episode-row-watch svg { width: 14px !important; height: 14px !important; }

@media (max-width: 600px) {
  .episode-row { flex-wrap: wrap; padding: 10px; gap: 10px; }
  .episode-row-thumb { width: 96px; }
  .episode-row-actions { width: 100%; justify-content: flex-end; }
  .episode-row-title { font-size: 14px; }
  .episode-row-review span,
  .episode-row-watch span { display: none; }
  .episode-row-review, .episode-row-watch { padding: 8px; }
}

.episode-row-desc {
  margin: 4px 0 0;
  font-size: 12px;
  color: #555;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
