:root {
  --primary: #1a1a1a;
  --secondary: #111111;
  --accent: #00cfff;
  --accent-hover: #33d4ff;
  --search: #00aff0;
  --search-hover: #33bfff;
  --cta: #ff4d4d;
  --text: #ffffff;
  --muted: #9ca3af;
  --line: #374151; /* gray-700 */
  --placeholder: #9ca3af; /* gray-400 */
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #000;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  /* Match old: bg-gradient-radial from-primary to-secondary over black */
  background-color: #000;
  background-image: radial-gradient(var(--primary), var(--secondary));
  background-attachment: fixed;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* —— Header (logo | search | nav) —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--secondary);
}

.announcement {
  width: 100%;
  border-bottom: 1px solid;
}

.announcement-info {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #93c5fd;
}

.announcement-warning {
  background: rgba(234, 179, 8, 0.2);
  border-color: #eab308;
  color: #fde047;
}

.announcement-success {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
  color: #86efac;
}

.announcement-error {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fca5a5;
}

.announcement-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.announcement-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.announcement-icon {
  flex-shrink: 0;
  display: inline-flex;
  line-height: 0;
}

.announcement-icon-svg {
  width: 1.25rem;
  height: 1.25rem;
}

.announcement-message {
  font-size: 0.875rem;
  line-height: 1.4;
}

.announcement-more {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.announcement-more:hover {
  opacity: 0.85;
}

@media (min-width: 768px) {
  .announcement-message {
    font-size: 1rem;
  }
}

.announcement-dismiss {
  flex-shrink: 0;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  transition: opacity 0.15s ease;
}

.announcement-dismiss:hover {
  opacity: 0.7;
}

.announcement-dismiss-svg {
  width: 1rem;
  height: 1rem;
}

.header-inner {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  flex-shrink: 0;
  padding-left: 0.25rem;
}

.logo img {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.logo:hover {
  opacity: 0.85;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
}

.search-wrap {
  display: none;
  flex: 1;
  justify-content: center;
  min-width: 0;
  position: relative;
}

.search-form {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 600px;
}

.search-form input {
  flex: 1;
  min-width: 0;
  height: 42px;
  background: var(--secondary);
  border: 1px solid var(--line);
  border-right: 0;
  color: #fff;
  caret-color: #fff;
  border-radius: 999px 0 0 999px;
  padding: 0 1rem;
  font-size: 1rem;
  outline: none;
  -webkit-text-fill-color: #fff;
}

.search-form input::placeholder {
  color: var(--placeholder);
  opacity: 1;
  -webkit-text-fill-color: var(--placeholder);
}

.search-form input::-webkit-input-placeholder {
  color: var(--placeholder);
  opacity: 1;
}

.search-form input::-moz-placeholder {
  color: var(--placeholder);
  opacity: 1;
}

.search-form input:focus {
  border-color: var(--accent);
}

.search-form input:-webkit-autofill,
.search-form input:-webkit-autofill:hover,
.search-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
  box-shadow: 0 0 0 1000px var(--secondary) inset;
  transition: background-color 9999s ease-in-out 0s;
}

.search-form button[type="submit"] {
  background: var(--search);
  color: #fff;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 999px 999px 0;
  height: 42px;
  padding: 0 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.search-form button[type="submit"]:hover {
  background: var(--search-hover);
}

.search-form button[type="submit"]:focus {
  border-color: var(--accent);
}

.search-suggest {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 50%;
  right: auto;
  width: min(100%, 600px);
  max-width: 600px;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: #1a1a1a;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 40;
  max-height: min(70vh, 22rem);
  overflow-y: auto;
}

.search-suggest-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.9);
}

.search-suggest-item.is-active,
.search-suggest-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.search-suggest-icon {
  flex-shrink: 0;
  opacity: 0.55;
}

.search-suggest-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.search-suggest-title {
  font-size: 0.95rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-suggest-sub {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-search-suggest {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-suggest-mobile {
  left: 0;
  right: 0;
  width: auto;
  max-width: none;
  transform: none;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.8);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: #fff;
}

.nav-icon {
  width: 1rem;
  height: 1rem;
}

.mobile-tools {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.of-btn {
  margin-right: 0.65rem;
}

.of-btn img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.icon-btn svg {
  width: 24px;
  height: 24px;
}

.icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.mobile-search {
  display: none;
  padding: 0 1rem 1rem;
}

.mobile-search.open {
  display: block;
}

.mobile-search-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 600px;
  margin: 0 auto;
  min-height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
}

.mobile-search-inner input {
  flex: 1;
  background: transparent;
  border: 0;
  color: #fff;
  caret-color: #fff;
  font-size: 1rem;
  outline: none;
  -webkit-text-fill-color: #fff;
}

.mobile-search-inner input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  opacity: 1;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.5);
}

.mobile-search-inner button {
  background: var(--search);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  right: 0.75rem;
  background: var(--secondary);
  padding: 1.25rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  min-width: 220px;
  flex-direction: column;
  gap: 1.25rem;
  z-index: 60;
}

.mobile-nav.open {
  display: flex;
}

/* —— Page —— */
/* Match old VideoList: px-4 py-6 lg:px-8 lg:py-8 */
.page {
  width: 100%;
  flex: 1 0 auto;
  padding: 1.5rem 1rem 4rem;
}

@media (min-width: 1024px) {
  .page {
    padding: 2rem 2rem 4rem;
  }
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: #fff;
}

.page-sub {
  color: var(--muted);
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
}

.home-shelf {
  margin: 0 0 2rem;
}

.home-shelf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.home-shelf-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.home-shelf-link {
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.home-shelf-link:hover {
  color: #33d4ff;
}

.home-section {
  margin-top: 0.25rem;
}

.home-section-title {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

/* One row only: show as many as fit at each breakpoint (hide the rest) */
.video-grid.video-grid-shelf {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.video-grid.video-grid-shelf > :nth-child(n + 3) {
  display: none;
}

/* For you: 2 cards on mobile */
.home-shelf-for-you .video-grid.video-grid-shelf {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-shelf-for-you .video-grid.video-grid-shelf > :nth-child(n + 3) {
  display: none;
}

@media (min-width: 768px) {
  .video-grid.video-grid-shelf {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }

  .video-grid.video-grid-shelf > :nth-child(n + 3) {
    display: block;
  }

  .video-grid.video-grid-shelf > :nth-child(n + 4) {
    display: none;
  }

  .home-shelf-for-you .video-grid.video-grid-shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-shelf-for-you .video-grid.video-grid-shelf > :nth-child(n + 3) {
    display: block;
  }

  .home-shelf-for-you .video-grid.video-grid-shelf > :nth-child(n + 5) {
    display: none;
  }
}

@media (min-width: 1024px) {
  .video-grid.video-grid-shelf {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
  }

  .video-grid.video-grid-shelf > :nth-child(n + 4) {
    display: block;
  }

  .video-grid.video-grid-shelf > :nth-child(n + 5) {
    display: none;
  }

  .home-shelf-for-you .video-grid.video-grid-shelf {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.video-grid-shelf .card-title {
  font-size: 0.8rem;
}

@media (min-width: 640px) {
  .video-grid-shelf .card-title {
    font-size: 0.95rem;
  }
}

.pills {
  display: flex;
  flex: 1;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.pills::-webkit-scrollbar {
  display: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--secondary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  border: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.pill:hover {
  background: #374151;
}

.pill.active {
  background: #fff;
  color: #000;
}

.sort-select {
  background: var(--secondary);
  border: 0;
  color: #fff;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.sort-select:hover {
  background: #374151;
}

.sort-dropdown {
  position: relative;
  flex-shrink: 0;
}

.sort-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--secondary);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.sort-trigger:hover,
.sort-trigger.open {
  background: #374151;
}

.sort-icon,
.sort-caret {
  width: 0.75rem;
  height: 0.75rem;
  flex-shrink: 0;
}

.sort-caret {
  transition: transform 0.15s ease;
}

.sort-trigger.open .sort-caret {
  transform: rotate(180deg);
}

.sort-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 200px;
  background: var(--secondary);
  border: 1px solid #374151;
  border-radius: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 30;
  overflow: hidden;
}

.sort-menu[hidden] {
  display: none;
}

.sort-option {
  display: block;
  padding: 0.75rem 1rem;
  color: #fff;
  transition: background 0.15s ease;
}

.sort-option:hover {
  background: #374151;
}

.sort-option.active {
  background: #374151;
  color: var(--accent);
}

.sort-option-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
}

.sort-option-desc {
  display: block;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.25rem;
}

.sort-option.active .sort-option-desc {
  color: rgba(0, 207, 255, 0.75);
}

/* —— Cards —— */
.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .video-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

.video-card {
  display: block;
  container-type: inline-size;
  container-name: video-card;
}

.video-card:hover .thumb-wrap img {
  transform: scale(1.03);
}

.video-card:hover .card-title {
  color: var(--accent);
}

.thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #000;
}

.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.watched-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 1;
}

.video-card.is-watched .watched-overlay,
.side-card.is-watched .watched-overlay {
  opacity: 1;
}

.badge {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.15rem 0.4rem;
  border-radius: 0.2rem;
  z-index: 2;
}

.card-body {
  padding: 0.5rem 0.15rem 0;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.35;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}

@media (min-width: 1024px) {
  .card-title {
    font-size: 1rem;
  }
}

.card-meta {
  margin-top: 0.4rem;
  color: #9ca3af;
  font-size: 0.75rem;
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.2rem 0.65rem;
}

.card-meta-left {
  min-width: 0;
  flex: 1 1 8rem;
}

.card-meta-left > span {
  display: inline;
}

.card-likes {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #6b7280;
  flex: 0 0 auto;
}

/* Narrow cards (2-col trending / tight grids): stack likes under views+date */
@container video-card (max-width: 260px) {
  .card-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .card-meta-left {
    flex: none;
    width: 100%;
  }
}

@media (min-width: 1024px) {
  .card-meta {
    font-size: 0.8rem;
  }
}

.card-likes.liked {
  color: #ef4444;
}

.card-likes svg {
  width: 0.75rem;
  height: 0.75rem;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 3rem 0;
}

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: min(60vh, 28rem);
  padding: 2rem 1rem 3rem;
}

.error-code {
  margin: 0;
  font-size: clamp(4rem, 14vw, 7rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
  opacity: 0.9;
}

.error-page h1 {
  margin: 0.75rem 0 0;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  color: #fff;
}

.error-message {
  margin: 0.75rem 0 0;
  max-width: 28rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.75rem;
}

.error-actions .btn {
  text-decoration: none;
}

.load-more {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.infinite-status {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0 0.5rem;
}

.infinite-status[hidden] {
  display: none;
}

.infinite-spinner {
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
}

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

#infinite-sentinel {
  height: 1px;
  width: 100%;
}

.btn-load {
  background: #00bfff;
  color: #fff;
  border: 0;
  border-radius: 9999px;
  padding: 0.5rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, background 0.2s ease;
}

@media (min-width: 1024px) {
  .btn-load {
    padding: 0.75rem 2rem;
    font-size: 1.125rem;
  }
}

.btn-load:hover {
  background: #3b82f6;
  transform: scale(1.05);
}

.btn-load:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn,
.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--secondary);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 0.5rem;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
}

.btn:hover,
.pagination a:hover {
  background: #374151;
}

.btn-accent {
  background: var(--search);
  color: #fff;
  border-color: var(--search);
}

.btn-accent:hover {
  background: var(--search-hover);
}

.btn-danger {
  background: var(--cta);
  border-color: var(--cta);
  color: #fff;
}

/* —— Video detail —— */
.page.video-page {
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
}

@media (min-width: 1024px) {
  .page.video-page {
    padding: 1rem 1rem 4rem;
  }
}

.video-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

@media (min-width: 1024px) {
  .video-layout {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 2rem;
  }

  .video-layout.is-expanded {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .video-layout.is-expanded .video-main {
    order: 1;
  }

  .video-layout.is-expanded .video-aside {
    order: 2;
    max-width: none;
  }
}

.player-expand-bar {
  display: none;
}

@media (min-width: 1024px) {
  .player-expand-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
  }
}

.player-expand-btn {
  background: var(--secondary);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.player-expand-btn:hover {
  background: var(--accent);
  color: #000;
}

.player-shell {
  position: relative;
  background: #000;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 0;
}

@media (min-width: 1024px) {
  .player-shell {
    border-radius: 0.5rem;
    margin-bottom: 1rem;
  }

  /* Theater: keep true 16:9; width capped by 70vh so we never letterbox */
  .video-layout.is-expanded .player-shell {
    width: min(100%, calc(70vh * 16 / 9));
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 70vh;
    min-height: 0;
    margin-inline: auto;
    border-radius: 0.5rem;
  }
}

/* When expanded, pull the player edge-to-edge (no side page padding gaps) */
@media (min-width: 1024px) {
  .page.video-page:has(.video-layout.is-expanded) {
    padding-left: 0;
    padding-right: 0;
  }

  .video-layout.is-expanded .player-expand-bar,
  .video-layout.is-expanded .video-meta-card {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .video-layout.is-expanded .video-aside {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

.player-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
  /* Scale past Bunny's white chrome hairlines; shell clips overflow */
  transform: scale(1.012);
  transform-origin: center center;
}

.player-poster {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #000;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.player-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.player-poster-empty {
  background: #000;
}

.player-shell.is-ready .player-poster {
  opacity: 0;
  visibility: hidden;
}

@media (min-width: 1024px) {
  .video-layout.is-expanded .player-shell {
    border-radius: 0;
  }
}

.player-unavailable {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
}

.video-meta-card {
  background: var(--secondary);
  border-radius: 0;
  padding: 1rem;
  margin: 0;
}

@media (min-width: 1024px) {
  .video-meta-card {
    border-radius: 0.5rem;
    padding: 1rem;
  }
}

.video-heading {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.video-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.video-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.like-btn,
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border: 0;
  color: #e5e7eb;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1;
  flex: 0 0 auto;
  min-height: 2.75rem;
  padding: 0.55rem 0.9rem;
  margin: 0;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.share-btn {
  min-width: 2.75rem;
  padding: 0.55rem;
}

.like-btn:hover,
.share-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.like-btn.liked {
  color: #ef4444;
}

.like-btn:disabled,
.share-btn:disabled {
  opacity: 0.5;
  cursor: pointer;
}

.like-icon,
.share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  line-height: 0;
}

.like-icon svg,
.share-icon svg,
.like-icon,
.share-icon {
  width: 1.35rem;
  height: 1.35rem;
}

[data-like-count] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.35rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.video-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  color: #9ca3af;
  font-size: 0.875rem;
  min-width: 0;
}

.video-stats .dot {
  margin: 0 0.15rem;
}

@media (max-width: 767px) {
  .like-btn,
  .share-btn {
    min-height: 3rem;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
  }

  .share-btn {
    min-width: 3rem;
    padding: 0.7rem;
  }

  .like-btn:active,
  .share-btn:active {
    background: rgba(255, 255, 255, 0.16);
  }
}

.video-desc-block {
  color: #d1d5db;
  font-size: 0.875rem;
  line-height: 1.6;
}

.video-desc a {
  color: #60a5fa;
  text-decoration: underline;
}

.video-desc a:hover {
  color: #93c5fd;
}

.video-desc.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-cta-wrap {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.video-cta-note {
  margin: 0;
  color: #d1d5db;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
}

.video-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(0, 175, 240, 0.65);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  padding: 0.55rem 0.95rem;
  border-radius: 0.35rem;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.video-cta-btn:hover {
  background: rgba(0, 175, 240, 0.12);
  border-color: var(--search);
  color: #fff;
}

.video-cta-arrow {
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.15s ease;
}

.video-cta-btn:hover .video-cta-arrow {
  transform: translateX(2px);
}

.player-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: #00aff0;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.7rem 1.15rem;
  border-radius: 0.4rem;
  text-decoration: none;
  transition: background 0.15s ease;
}

.player-cta-btn:hover {
  background: #33bfff;
  color: #fff;
}

.player-cta-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
}

.player-cta-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.player-cta-overlay[hidden] {
  display: none !important;
}

.player-cta-kicker {
  margin: 0;
  color: #fff;
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  font-weight: 600;
  max-width: 22rem;
  line-height: 1.35;
}

/* Mobile: larger tap targets for end CTA */
@media (max-width: 767px) {
  .player-cta-overlay {
    gap: 0.75rem;
    padding: 1rem 0.85rem;
  }

  .player-cta-kicker {
    font-size: 0.95rem;
    max-width: 16rem;
    padding: 0 0.25rem;
  }

  .player-cta-overlay .player-cta-btn {
    width: min(100%, 18rem);
    min-height: 44px;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
  }

  .player-cta-dismiss {
    min-height: 44px;
    padding: 0.55rem 0.75rem;
  }
}

.player-cta-dismiss {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.35rem 0.5rem;
}

.player-cta-dismiss:hover {
  color: #fff;
}

.age-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.age-modal[hidden] {
  display: none !important;
}

.age-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.age-modal-dialog {
  position: relative;
  width: min(100%, 22rem);
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  padding: 1.5rem 1.35rem 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.age-modal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 0.75rem;
  min-width: 3rem;
  height: 1.75rem;
  padding: 0 0.65rem;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.age-modal-title {
  margin: 0 0 0.5rem;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.age-modal-copy {
  margin: 0 0 1.25rem;
  color: #9ca3af;
  font-size: 0.9rem;
  line-height: 1.5;
}

.age-modal-actions {
  display: flex;
  gap: 0.6rem;
}

.age-modal-cancel,
.age-modal-confirm {
  flex: 1;
  border: 0;
  border-radius: 0.4rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.age-modal-cancel {
  background: rgba(255, 255, 255, 0.06);
  color: #d1d5db;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.age-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.age-modal-confirm {
  background: #00aff0;
  color: #fff;
}

.age-modal-confirm:hover {
  background: #33bfff;
}

html.age-modal-open {
  overflow: hidden;
}

.desc-toggle {
  margin-top: 0.5rem;
  background: transparent;
  border: 0;
  color: #60a5fa;
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0;
}

.desc-toggle:hover {
  text-decoration: underline;
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: #fff;
  padding: 0 1rem;
}

@media (min-width: 1024px) {
  .sidebar-title {
    padding: 0;
  }
}

.side-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 1rem;
}

@media (min-width: 1024px) {
  .side-list {
    padding: 0;
  }
}

.side-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.side-card .thumb-wrap {
  width: 11rem;
  flex-shrink: 0;
  border-radius: 0.5rem;
  aspect-ratio: 16 / 9;
}

.side-card-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 99px;
}

.side-card .card-title {
  font-size: 0.875rem;
  font-weight: 600;
  -webkit-line-clamp: 3;
}

.side-card .card-title:hover,
.side-card:hover .card-title {
  color: var(--accent);
}

.side-card .card-meta {
  justify-content: flex-start;
  margin-top: 0.25rem;
  font-size: 0.75rem;
}

.new-badge {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.1rem 0.45rem;
  border-radius: 0.15rem;
  background: rgba(255, 255, 255, 0.1);
  color: #d1d5db;
  width: fit-content;
}

/* —— Footer —— */
.socials-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 0;
}

.socials-row a {
  color: rgba(255, 255, 255, 0.8);
  line-height: 0;
  display: inline-flex;
}

.socials-row a:hover {
  color: #fff;
}

.socials-row svg {
  width: 2rem;
  height: 2rem;
  display: block;
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(17, 17, 17, 0.5);
  backdrop-filter: blur(4px);
  min-height: 80px;
  padding: 1rem 0;
}

.footer-inner {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1rem;
  text-align: center;
}

.footer-copy {
  color: #9ca3af;
  font-size: 0.75rem;
  line-height: 1.5;
  margin: 0 0 0.5rem;
}

.footer-copy p {
  margin: 0;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 0.75rem;
}

.footer-links a {
  color: #6b7280;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: #d1d5db;
}

.legal {
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.6;
  color: #cfcfcf;
}

.legal h1 {
  margin-top: 0;
  color: #fff;
}

/* —— Admin (keep simple) —— */
.link-rows {
  display: grid;
  gap: 0.65rem;
}

.link-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto auto;
  gap: 0.5rem;
  align-items: center;
}

.link-row input,
.link-row select {
  background: #0c0c0c;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 0.5rem;
  padding: 0.5rem 0.65rem;
  width: 100%;
}

@media (max-width: 800px) {
  .link-row {
    grid-template-columns: 1fr;
  }
}

.legal-body {
  line-height: 1.6;
}

.admin-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-nav a {
  color: var(--muted);
  font-weight: 600;
}

.admin-nav a:hover,
.admin-nav a.active {
  color: var(--accent);
}

.panel {
  background: var(--primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  gap: 0.85rem;
}

.form-grid label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.form-grid label:has(> input[type="checkbox"]) {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
}

.form-grid input,
.form-grid textarea,
.form-grid select {
  background: #0c0c0c;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 0.5rem;
  padding: 0.55rem 0.7rem;
}

.form-grid input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  min-width: 1.05rem;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  align-self: center;
}

.form-grid textarea {
  min-height: 120px;
  resize: vertical;
}

.inline-check {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.inline-check input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  min-width: 1.05rem;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.form-actions-danger {
  margin-left: auto;
}

.admin-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.admin-search input[type="search"] {
  flex: 1;
  min-width: 200px;
  background: #0c0c0c;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 0.5rem;
  padding: 0.55rem 0.7rem;
}

.admin-search select {
  background: #0c0c0c;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 0.5rem;
  padding: 0.55rem 0.7rem;
}

.admin-search-count {
  color: var(--muted);
  font-size: 0.85rem;
  margin-left: 0.25rem;
}

.admin-thumb-cell {
  width: 96px;
}

.admin-thumb {
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 0.35rem;
  background: #0c0c0c;
  display: block;
}

.admin-thumb-empty {
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-weight: 600;
}

.flash {
  padding: 0.7rem 0.9rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  background: rgba(0, 207, 255, 0.12);
  border: 1px solid rgba(0, 207, 255, 0.35);
}

.flash.error {
  background: rgba(255, 77, 77, 0.12);
  border-color: rgba(255, 77, 77, 0.35);
}

.login-box {
  max-width: 400px;
  margin: 4rem auto;
}

.upload-box {
  border: 1px dashed var(--line);
  border-radius: 0.65rem;
  padding: 1rem;
}

.upload-progress {
  height: 8px;
  background: #0c0c0c;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.upload-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

@media (min-width: 768px) {
  .search-wrap {
    display: flex;
  }

  .nav-links {
    display: flex;
  }

  .mobile-tools {
    display: none;
  }
}

@media (max-width: 520px) {
  .side-card {
    grid-template-columns: 110px minmax(0, 1fr);
  }
}
