* {
  box-sizing: border-box;
}

body {
  background-color: #0f0f0f;
  color: #f1f1f1;
  font-family: "Roboto", "Arial", sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ヘッダー */
header {
  width: 100%;
  height: 56px;
  background-color: #0f0f0f;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background-color: #272727;
}

.brand {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.brand-logo-img {
  height: 20px;
  object-fit: contain;
}

.brand-text {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.5px;
}

.country-code {
  font-size: 10px;
  color: #aaa;
  margin-left: 2px;
  align-self: flex-start;
  margin-top: -2px;
}

/* 検索バー */
.search-container {
  display: flex;
  align-items: center;
  max-width: 680px;
  width: 100%;
  margin: 0 16px;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  flex: 1;
  background-color: #121212;
  border: 1px solid #303030;
  border-radius: 40px 0 0 40px;
  padding: 0 16px;
  height: 40px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
}

.search-input-wrapper:focus-within {
  border-color: #1c62b9;
}

.search-input-wrapper input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.95rem;
}

.search-button {
  height: 40px;
  width: 64px;
  background-color: #222;
  border: 1px solid #303030;
  border-left: none;
  border-radius: 0 40px 40px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.search-button:hover {
  background-color: #272727;
}

.mic-btn {
  background-color: #222;
  margin-left: 12px;
  width: 40px;
  height: 40px;
}

.mic-btn:hover {
  background-color: #383838;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #5b21b6;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
  margin-left: 8px;
}

/* メインレイアウト */
.main-container {
  width: 100%;
  margin-top: 56px;
  padding: 24px 24px 0 24px;
}

.app-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  width: 100%;
  max-width: 1750px;
  margin: 0 auto;
}

@media (min-width: 1010px) {
  .app-layout.has-related {
    grid-template-columns: 1fr 402px;
  }
}

.welcome-hero {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
}

.welcome-icon-img {
  width: 120px;
  height: auto;
  margin-bottom: 20px;
}

.welcome-title {
  font-size: 2rem;
  margin: 0 0 12px 0;
}

.welcome-subtitle {
  color: #aaa;
  font-size: 1rem;
}

.status {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  color: #aaa;
  text-align: center;
}

.primary-content {
  width: 100%;
}

.player-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
  border-radius: 12px;
  overflow: hidden;
}

.player-container.shorts {
  max-width: 400px;
  aspect-ratio: 9 / 16;
  margin: 0 auto;
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.embed-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  background-color: #000;
}

.embed-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 動画タイトル・チャンネル名・アクション */
.video-info {
  margin-top: 12px;
}

.video-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 12px 0;
  line-height: 1.35;
}

.meta-details-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.channel-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.channel-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #fff;
}

.channel-meta {
  display: flex;
  flex-direction: column;
}

.channel-name-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.channel-name {
  font-size: 1rem;
  font-weight: 700;
  color: #f1f1f1;
  text-decoration: none;
}

.sub-count {
  font-size: 0.75rem;
  color: #aaa;
}

.sub-button {
  background-color: #f1f1f1;
  color: #0f0f0f;
  border: none;
  padding: 0 16px;
  height: 36px;
  border-radius: 18px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  margin-left: 12px;
}

.sub-button:hover {
  background-color: #d9d9d9;
}

/* アクションボタン群 */
.actions-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.like-dislike-group {
  display: flex;
  align-items: center;
  background-color: #272727;
  border-radius: 18px;
  height: 36px;
}

.btn-pill {
  background-color: #272727;
  border: none;
  height: 36px;
  padding: 0 16px;
  border-radius: 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #f1f1f1;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.btn-pill:hover {
  background-color: #3f3f3f;
}

.like-dislike-group .btn-pill {
  border-radius: 0;
  background: transparent;
}

.like-dislike-group .like-btn {
  border-top-left-radius: 18px;
  border-bottom-left-radius: 18px;
}

.like-dislike-group .dislike-btn {
  border-top-right-radius: 18px;
  border-bottom-right-radius: 18px;
  padding: 0 12px;
}

.btn-divider {
  width: 1px;
  height: 20px;
  background-color: #3f3f3f;
}

.icon-only-pill {
  padding: 0 10px;
  border-radius: 50%;
}

.mode-select-wrapper {
  padding: 0 12px;
}

.mode-select-wrapper select {
  background: transparent;
  color: #f1f1f1;
  border: none;
  outline: none;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.mode-select-wrapper select option {
  background-color: #272727;
  color: #f1f1f1;
}

/* 概要欄 (100%幅) */
.details-bottom-grid {
  width: 100%;
  margin-top: 12px;
}

.description-box {
  background-color: #272727;
  border-radius: 12px;
  padding: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #f1f1f1;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: pointer;
  max-height: 104px;
  overflow: hidden;
  width: 100%;
}

.description-box:hover {
  background-color: #3f3f3f;
}

.description-box.expanded {
  max-height: none;
  cursor: default;
}

.stats-header {
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  gap: 8px;
}

.toggle-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 0.85rem;
  padding: 0;
  cursor: pointer;
  font-weight: 700;
  margin-top: 4px;
}

/* 関連動画（右カラム） */
.secondary-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-chips-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chip {
  background-color: #272727;
  border: none;
  color: #f1f1f1;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.chip.active {
  background-color: #f1f1f1;
  color: #0f0f0f;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.related-card {
  display: flex;
  gap: 8px;
  cursor: pointer;
  border-radius: 8px;
  padding: 2px;
}

.related-card:hover {
  background-color: #272727;
}

.related-thumbnail-wrapper {
  width: 168px;
  min-width: 168px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background-color: #202020;
  position: relative;
}

.related-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.related-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-meta {
  font-size: 0.75rem;
  color: #aaa;
  display: flex;
  flex-direction: column;
  margin-top: 2px;
}

/* 検索結果 */
.search-results-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  width: 100%;
}

.search-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
}

.search-thumb-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
  border-radius: 12px;
  overflow: hidden;
}

.search-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-card-body {
  padding: 8px 0;
}

.search-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 4px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-card-meta {
  font-size: 0.8rem;
  color: #aaa;
}

.creator-credit {
  position: fixed;
  bottom: 16px;
  right: 20px;
  font-size: 0.8rem;
  color: #aaa;
  background-color: rgba(33, 33, 33, 0.9);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #303030;
  pointer-events: none;
}