@import url("https://fonts.googleapis.com/css2?family=LINE+Seed+JP:wght@100;400;700;800&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap");
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Roboto", "LINE Seed JP", sans-serif;
}

::-moz-selection {
  background-color: rgba(0, 0, 0, 0.0941176471);
}

::selection {
  background-color: rgba(0, 0, 0, 0.0941176471);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f0f0f0;
  color: #0f0f0f;
  line-height: 1.5;
}
body::-webkit-scrollbar {
  width: 8px;
}
body::-webkit-scrollbar-track {
  background-color: transparent;
}
body::-webkit-scrollbar-thumb {
  background-color: #777;
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.app-container {
  max-width: 800px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 16px;
}

header {
  text-align: center;
  margin-bottom: 32px;
}
header svg {
  height: 52px;
}

.input-section {
  margin-bottom: 24px;
  margin-top: 24px;
}
.input-section .input-group {
  display: flex;
  gap: 8px;
}
.input-section .input-group input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 1rem;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.input-section .input-group input::-moz-placeholder {
  color: #ccc;
}
.input-section .input-group input::placeholder {
  color: #ccc;
}
.input-section .input-group input:focus {
  border-color: #ff0033;
  box-shadow: 0 0 0 2px rgba(255, 0, 51, 0.1);
}
.input-section .input-group input:disabled {
  background: #e9e9e9;
  cursor: not-allowed;
}
.input-section .input-group button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background-color: #ff0033;
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.input-section .input-group button:hover:not(:disabled) {
  background-color: rgb(229.5, 0, 45.9);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}
.input-section .input-group button:active:not(:disabled) {
  scale: 0.9;
}
.input-section .input-group button:disabled {
  background: #cccccc;
  cursor: not-allowed;
}
.input-section .error-msg {
  color: #ff0033;
  font-size: 0.85rem;
  margin-top: 8px;
  display: none;
}
.input-section .error-msg.active {
  display: block;
}

.hidden {
  display: none !important;
}

.video-info-section {
  margin-bottom: 32px;
  animation: fadeIn 0.4s ease-out;
}
.video-info-section .video-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.video-info-section .video-embed-container {
  width: 100%;
  aspect-ratio: 16/9;
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #000;
}
.video-info-section .video-embed-container iframe {
  display: block;
  width: 100%;
  height: 100%;
}
.video-info-section .video-header {
  margin-bottom: 16px;
}
.video-info-section .video-header h2 {
  font-size: 1.25rem;
  margin-bottom: 4px;
  word-wrap: break-word;
  font-family: "LINE Seed JP", sans-serif;
}
.video-info-section .video-header p {
  color: #606060;
  font-size: 0.9rem;
  font-weight: 400;
  font-family: "LINE Seed JP", sans-serif;
}
.video-info-section .ratio-container {
  height: 8px;
  background-color: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}
.video-info-section .ratio-container .ratio-bar {
  height: 100%;
  background-color: #ff0033;
  width: 0%;
  transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.video-info-section .ratio-text {
  text-align: right;
  font-size: 0.8rem;
  color: #606060;
  margin-top: 4px;
  font-weight: 400;
}
.video-info-section .stats-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 8px;
  position: relative;
}
.video-info-section .stats-row .stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 1rem;
  font-weight: 500;
  color: #0f0f0f;
}
.video-info-section .stats-row .stat-item svg {
  width: 28px;
  height: 28px;
  color: #606060;
}
.video-info-section .stats-row .stat-item span {
  font-weight: 400;
  color: #606060;
  font-size: 18px;
}
.video-info-section .stats-row .stat-info-trigger {
  margin-left: auto;
  color: #606060;
  cursor: pointer;
  display: flex;
  align-items: center;
  position: relative;
  transition: color 0.2s;
}
.video-info-section .stats-row .stat-info-trigger:hover {
  color: #ff0033;
}
.video-info-section .stats-row .stat-info-trigger:hover .stat-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.video-info-section .stats-row .stat-info-trigger svg {
  width: 18px;
  height: 18px;
}
.video-info-section .stats-row .stat-info-trigger .stat-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  right: -10px;
  width: 280px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  font-size: 0.8rem;
  line-height: 1.5;
  color: #0f0f0f;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  text-align: left;
}
.video-info-section .stats-row .stat-info-trigger .stat-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 14px;
  border: 6px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.95);
}

#loading-spinner {
  text-align: center;
  padding: 32px 0;
}
#loading-spinner .spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: #ff0033;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
#loading-spinner p {
  color: #606060;
  font-size: 0.9rem;
}

span.hr {
  display: block;
  width: 100%;
  height: 1px;
  background-color: #bbb;
  margin: 16px 0;
}

.comments-section {
  animation: fadeIn 0.4s ease-out;
}
.comments-section .comments-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.comments-section .comments-header-row .comments-header {
  font-weight: 400;
  color: #606060;
  font-size: 0.9rem;
  margin: 0;
}
.comments-section .comments-header-row .sort-container {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}
.comments-section .comments-header-row .sort-container .sort-icon {
  width: 18px;
  height: 18px;
  fill: #606060;
}
.comments-section .comments-header-row .sort-container .custom-dropdown {
  position: relative;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.comments-section .comments-header-row .sort-container .custom-dropdown .dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #606060;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.comments-section .comments-header-row .sort-container .custom-dropdown .dropdown-trigger:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #0f0f0f;
}
.comments-section .comments-header-row .sort-container .custom-dropdown .dropdown-trigger .chevron-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.comments-section .comments-header-row .sort-container .custom-dropdown .dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 6px;
  min-width: 140px;
  z-index: 100;
  animation: dropdownFade 0.2s ease-out;
}
.comments-section .comments-header-row .sort-container .custom-dropdown .dropdown-menu .dropdown-item {
  padding: 8px 12px;
  font-size: 0.9rem;
  color: #0f0f0f;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}
.comments-section .comments-header-row .sort-container .custom-dropdown .dropdown-menu .dropdown-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}
.comments-section .comments-header-row .sort-container .custom-dropdown .dropdown-menu .dropdown-item.active {
  color: #ff0033;
  background-color: rgba(255, 0, 51, 0.05);
  font-weight: 400;
}
@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.comments-section .comments-list {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 8px 0;
  margin-bottom: 24px;
}
.comments-section .scroll-anchor {
  text-align: center;
  padding: 16px;
  color: #606060;
  font-size: 0.95rem;
  font-weight: 500;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comment-item {
  padding: 20px;
  display: flex;
  gap: 16px;
  transition: background-color 0.2s ease;
  position: relative;
}
.comment-item:hover {
  background-color: rgba(0, 0, 0, 0.02);
}
.comment-item::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 10%;
  width: 80%;
  height: 1px;
  background-color: #eee;
}
.comment-item:last-child::after {
  display: none;
}
.comment-item .comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  -o-object-fit: cover;
     object-fit: cover;
  background-color: #e9e9e9;
  flex-shrink: 0;
}
.comment-item .comment-content {
  flex: 1;
  min-width: 0;
}
.comment-item .comment-content .comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.comment-item .comment-content .comment-meta .comment-author {
  font-weight: 400;
  font-size: 0.9rem;
  color: #0f0f0f;
  background-color: rgba(0, 0, 0, 0.05);
  padding: 2px 12px;
  border-radius: 12px;
}
.comment-item .comment-content .comment-meta .comment-date {
  font-size: 0.8rem;
  color: #606060;
}
.comment-item .comment-content .comment-text-container {
  margin-bottom: 12px;
}
.comment-item .comment-content .comment-text-container .comment-text {
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.comment-item .comment-content .comment-text-container .comment-text.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.comment-item .comment-content .comment-text-container .comment-text .comment-timestamp {
  color: #3da0f6;
  background-color: rgba(61, 160, 246, 0.1);
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 500;
}
.comment-item .comment-content .comment-text-container .read-more-btn {
  display: inline-block;
  color: #606060;
  background-color: rgba(0, 0, 0, 0.0509803922);
  padding: 2px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 400;
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.2s ease;
}
.comment-item .comment-content .comment-text-container .read-more-btn:hover {
  color: #0f0f0f;
  background-color: rgba(0, 0, 0, 0.1019607843);
}
.comment-item .comment-content .comment-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 0;
}
.comment-item .comment-content .comment-actions .action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #606060;
  font-size: 0.85rem;
  font-weight: 600;
}
.comment-item .comment-content .comment-actions .action-btn .yt-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.comment-item .comment-content .comment-actions .action-btn span {
  font-weight: 400;
}
.comment-item .comment-content .comment-actions .yt-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: #606060;
  text-decoration: none;
  font-weight: 400;
  padding: 2px 12px;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}
.comment-item .comment-content .comment-actions .yt-link:hover {
  color: #ff0033;
  background-color: rgba(255, 0, 51, 0.1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 600px) {
  .app-container {
    padding: 16px 8px;
  }
  .input-group {
    flex-direction: column;
  }
  .input-group button {
    padding: 12px;
  }
  .comment-item {
    padding: 16px;
    gap: 12px;
  }
}
footer {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  min-height: 100px;
  background-color: #346cba;
}
footer a {
  display: flex;
  align-items: center;
  justify-content: start;
  height: 100px;
  padding-inline: 24px;
}
footer a svg {
  fill: #fff;
  height: 36px;
}
footer a:hover svg {
  fill: rgba(255, 255, 255, 0.6666666667);
}
footer p {
  display: flex;
  align-items: end;
  justify-content: end;
  margin: auto 12px 12px auto;
  text-align: right;
  font-family: "LINE Seed JP", sans-serif;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6666666667);
  font-size: 16px;
}