/* ── MelonsTube-style layout ── */
.tube-header {
  background: #0a0a0a;
  border-bottom: 1px solid #222;
}

.tube-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.25rem;
  background: linear-gradient(135deg, #ff3d00, #ff7a00);
  color: #000;
  font-family: Poppins, system-ui, sans-serif;
  font-weight: 900;
  font-size: 1.125rem;
  line-height: 1;
}

.tube-logo-text {
  font-family: Poppins, system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #ff3d00, #ff9a3d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.tube-nav-link {
  color: #ccc;
  transition: color 0.15s;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
}

.tube-nav-link:hover { color: #fff; }

.tube-dropdown {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 0.25rem;
  min-width: 11rem;
  background: #111;
  border: 1px solid #333;
  border-radius: 0.375rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  padding: 0.25rem 0;
  z-index: 60;
}

.tube-dropdown__item {
  display: block;
  padding: 0.45rem 1rem;
  font-size: 0.8125rem;
  color: #ccc;
  transition: background 0.15s, color 0.15s;
}

.tube-dropdown__item:hover {
  background: #1a1a1a;
  color: #fff;
}

.tube-search {
  background: #1a1a1a;
  border: 1px solid #333;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.tube-search:focus {
  outline: none;
  border-color: #ff3d00;
  background: #111;
  box-shadow: 0 0 0 3px rgba(255, 61, 0, 0.12);
}

.tube-zoom {
  display: flex;
  align-items: center;
  background: #111;
  border: 1px solid #333;
  border-radius: 0.25rem;
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 500;
}

.tube-zoom__btn {
  padding: 0.35rem 0.65rem;
  color: #ccc;
  transition: background 0.15s;
}

.tube-zoom__btn:hover { background: #1f1f1f; }

.tube-zoom__label {
  padding: 0.35rem 0.5rem;
  min-width: 2.75rem;
  text-align: center;
  color: #aaa;
  border-left: 1px solid #333;
  border-right: 1px solid #333;
}

.tube-reset-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ccc;
  border: 1px solid #333;
  border-radius: 0.25rem;
  transition: background 0.15s, border-color 0.15s;
}

.tube-reset-btn:hover {
  background: #111;
  border-color: #444;
  color: #fff;
}

.tube-mobile-nav { display: flex; }
.tube-mobile-nav.hidden { display: none; }

.tube-mobile-pill {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  color: #aaa;
  background: #111;
  border: 1px solid #333;
  border-radius: 9999px;
  transition: color 0.15s, border-color 0.15s;
}

.tube-mobile-pill:hover {
  color: #fff;
  border-color: #ff3d00;
}

.tube-section-title {
  font-family: Poppins, system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f1f1f1;
}

.tube-footer {
  border-top: 1px solid #222;
  background: #0a0a0a;
}

.tube-page-btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: #ccc;
  background: #111;
  border: 1px solid #333;
  border-radius: 0.5rem;
  transition: border-color 0.15s, color 0.15s;
}

.tube-page-btn:hover {
  border-color: #ff3d00;
  color: #fff;
}

/* ── Category grid (MelonsTube cards) ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  transform-origin: top center;
  transition: transform 0.2s ease;
}

@media (min-width: 1024px) {
  .category-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.tube-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tube-card:hover {
  transform: translateY(-2px);
}

.tube-card.is-hidden { display: none; }

.tube-card__thumb-link {
  display: block;
  text-decoration: none;
}

.tube-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0a0a0a;
  border-radius: 2px;
}

.tube-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.tube-card:hover .tube-card__thumb img {
  transform: scale(1.06);
  filter: brightness(1.05);
}

.tube-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  color: #555;
  background: #111;
}

.tube-card__badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  color: #f1f1f1;
}

.tube-card__title {
  margin: 6px 2px 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}

.tube-card__title a {
  color: #f1f1f1;
  text-decoration: none;
  transition: color 0.15s;
}

.tube-card__title a:hover { color: #ff9a3d; }

/* ── Video player ── */
.video-player {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid #2a2a2a;
  background: #000;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.video-player__screen.embed-container {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 320px;
  background: #000;
}

.embed-container iframe,
.embed-container object,
.embed-container embed {
  width: 100% !important;
  height: 100% !important;
  min-height: 320px;
  border: none;
  display: block;
}

.video-player__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #141414;
  border-top: 1px solid #2a2a2a;
}

.video-player__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.player-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-control__label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #9ca3af;
  white-space: nowrap;
}

.player-control__icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.player-control__select {
  appearance: none;
  background: #1e1e1e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.6rem center;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  color: #f3f4f6;
  font-size: 0.8125rem;
  padding: 0.4rem 2rem 0.4rem 0.65rem;
  cursor: pointer;
  min-width: 6.5rem;
  transition: border-color 0.15s;
}

.player-control__select:hover,
.player-control__select:focus {
  border-color: #ff3d00;
  outline: none;
}

.player-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #d1d5db;
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.player-btn:hover:not(.player-btn--disabled):not(.is-disabled) {
  background: #252525;
  border-color: #444;
  color: #fff;
}

.player-btn--accent {
  background: #991b1b;
  border-color: #ff3d00;
  color: #fff;
}

.player-btn--accent:hover {
  background: #e63600;
  border-color: #ff3d00;
}

.player-btn--disabled,
.player-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.video-player__note {
  margin: 0;
  padding: 0.5rem 1rem 0.75rem;
  font-size: 0.6875rem;
  color: #6b7280;
  line-height: 1.4;
  background: #141414;
}

.video-player__toast {
  position: absolute;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0.5rem);
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.88);
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  color: #f3f4f6;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
  max-width: 90%;
  text-align: center;
}

.video-player__toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.video-player:fullscreen .video-player__screen {
  min-height: 100vh;
  aspect-ratio: unset;
}

.video-player:fullscreen .video-player__screen iframe {
  min-height: 100vh !important;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

.no-thumb img { display: none; }

#scroll-sentinel { height: 1px; }

.infinite-loading {
  display: flex;
  justify-content: center;
  padding: 2rem;
}

.infinite-loading::after {
  content: "";
  width: 28px;
  height: 28px;
  border: 2px solid #2a2a2a;
  border-top-color: #ff3d00;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

.filter-select {
  transition: border-color 0.15s;
}

.filter-select:focus {
  border-color: #ff3d00;
}

@media (max-width: 1023px) {
  .tube-logo-text { font-size: 1.1rem; }
}