:root {
  --bg: #0d0d0f;
  --bg-card: #16161a;
  --bg-elevated: #1e1e24;
  --border: #2a2a32;
  --text: #f0f0f5;
  --text-muted: #8b8b9a;
  --accent: #ff3d5a;
  --accent-hover: #ff5c75;
  --vanchez: #ffd700;
  --success: #3dd68c;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

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

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

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 13, 15, 0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header__top {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.55rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow: hidden;
}

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

.logo__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), #c41e3a);
  border-radius: 10px;
  font-size: 1.1rem;
  box-shadow: none;
}

.logo__text {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text);
}

.header__nav {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.header__nav-item {
  padding: 0.5rem 0.85rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.header__nav-item:hover,
.header__nav-item.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.search-form {
  flex: 1;
  min-width: 0;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.search-form__icon {
  color: var(--text-muted);
  font-size: 1rem;
}

.search-form input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  outline: none;
  font-size: 0.95rem;
  min-width: 0;
}

.search-form input::-webkit-search-cancel-button,
.search-form input::-webkit-search-decoration {
  display: none;
}

.search-form--live {
  position: relative;
  padding-right: 2.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form__icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.search-form__icon svg {
  display: block;
}

.search-form__clear {
  position: absolute;
  right: 2.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.search-form__clear:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.search-form__spinner {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  transform: translateY(-50%);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: search-spin 0.65s linear infinite;
}

.search-form--loading .search-form__icon {
  opacity: 0.45;
}

.search-form--filled:not(.search-form--loading) {
  padding-right: 4.25rem;
}

@keyframes search-spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

.search-live {
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.search-live__title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.search-live__query {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.search-live__meta {
  margin: -0.5rem 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.search-live__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
}

.header__user {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  flex-shrink: 0;
}

.header__icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.header__icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.header__avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 38px;
  padding: 0 0.75rem 0 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
  max-width: 200px;
}

.header__username {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
  line-height: 1;
}

.header__avatar-btn img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

/* Toolbar */
.toolbar {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.toolbar__cats {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.cat-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.cat-pill__icon {
  color: var(--vanchez);
  font-size: 0.75rem;
}

.cat-pill__count {
  opacity: 0.7;
  font-size: 0.8rem;
}

.cat-pill:hover {
  border-color: rgba(255, 61, 90, 0.4);
  color: var(--text);
}

.cat-pill.active {
  background: rgba(255, 61, 90, 0.15);
  border-color: var(--accent);
  color: var(--text);
}

.cat-pill.active .cat-pill__count {
  color: var(--accent);
  opacity: 1;
}

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

.header__btn-mod {
  flex-shrink: 0;
  height: 38px;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 61, 90, 0.45);
  background: rgba(255, 61, 90, 0.1);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: none;
  transition: background 0.2s, border-color 0.2s;
}

.header__btn-mod:hover {
  background: rgba(255, 61, 90, 0.18);
  border-color: var(--accent);
}

.btn--suggest-header {
  flex-shrink: 0;
  height: 38px;
  padding: 0 1rem;
  font-size: 0.75rem;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(255, 61, 90, 0.4);
}

.btn--suggest-header:hover {
  box-shadow: 0 4px 16px rgba(255, 61, 90, 0.45);
}

.btn--suggest {
  background: var(--accent);
  color: #fff;
  padding: 0.55rem 1.15rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 20px rgba(255, 61, 90, 0.35);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn--suggest:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn--suggest__icon {
  font-size: 0.65rem;
}

.toolbar__grid-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
}

.toolbar__grid-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.toolbar--simple {
  justify-content: flex-end;
}

.toolbar__actions--end {
  margin-left: auto;
}

.upload-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

@media (max-width: 900px) {
  .upload-page {
    grid-template-columns: 1fr;
  }
}

.upload-drop {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-height: 320px;
  justify-content: center;
}

.upload-drop--over {
  border-color: var(--accent);
  background: rgba(255, 61, 90, 0.06);
}

.upload-drop__icon {
  font-size: 2.5rem;
}

.upload-drop__title {
  font-weight: 600;
}

.upload-drop__hint {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.upload-drop__filename {
  color: var(--accent);
  font-size: 0.9rem;
  word-break: break-all;
}

.upload-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.75rem 0 0.35rem;
}

.upload-form input,
.upload-form textarea,
.upload-form select {
  width: 100%;
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}

.btn--wide {
  width: 100%;
  margin-top: 1.25rem;
  justify-content: center;
}

.page-title {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.section-title {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.empty-hint {
  color: var(--text-muted);
  padding: 1rem 0;
}

.admin-item__meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.admin-item__link {
  color: var(--accent);
  font-size: 0.85rem;
  word-break: break-all;
}

@media (max-width: 900px) {
  .header__nav {
    display: none;
  }
  .search-form {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
  }

  .search-form input {
    font-size: 16px;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: transform 0.15s, background 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

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

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

.btn--ghost {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  border-color: var(--accent);
}

.btn--danger {
  background: #c62828;
  color: #fff;
  border: 1px solid #b71c1c;
}

.btn--danger:hover {
  background: #b71c1c;
  color: #fff;
}

/* Main */
.main {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
  width: 100%;
}

/* Video grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem 1.25rem;
}

.video-card {
  cursor: pointer;
  transition: transform 0.2s;
}

.video-card:hover {
  transform: translateY(-3px);
}

.video-card__thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
  border-radius: 14px;
}

.video-card__thumb-static {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.15s;
}

.video-card__thumb-player {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.video-card__thumb-player iframe,
.video-card__thumb-clip {
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  object-fit: cover;
  display: block;
}

.video-card__thumb.is-previewing .video-card__thumb-static {
  opacity: 0;
}

.video-card__thumb.is-previewing .video-card__thumb-player {
  opacity: 1;
}

.video-card__date {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.75);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  color: #fff;
}

.video-card__duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.85);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  z-index: 5;
  pointer-events: none;
}

.video-card__duration:empty {
  display: none;
}

.video-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.65rem;
  gap: 0.5rem;
}

.video-card__author {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.video-card__author img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.video-card__author span {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-like {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
}

.card-like:hover {
  border-color: var(--accent);
}

.card-like--active {
  border-color: var(--accent);
  background: rgba(255, 61, 90, 0.12);
  color: var(--accent);
}

.video-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.45rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.video-card__meta-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.video-card__channel {
  font-weight: 600;
  color: var(--text);
}

.video-card__meta-item {
  color: var(--text-muted);
}

.video-card__views {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.badge-vanchez {
  display: inline-block;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #1a1a1a;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

/* Video page */
.video-page {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
}

@media (max-width: 960px) {
  .video-page {
    grid-template-columns: 1fr;
  }
}

.player-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
}

.player-wrap video,
.player-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.player-wrap .player-external {
  margin: 2rem auto;
  display: inline-flex;
}

.player-mount {
  width: 100%;
  height: 100%;
  min-height: inherit;
}

.player-native-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  background: #000;
}

.player-native-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.95rem;
}

.player-native-loading[hidden] {
  display: none;
}

.player-native-loading__spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--gold, #d4a84b);
  border-radius: 50%;
  animation: player-spin 0.9s linear infinite;
}

.player-native-loading__bar {
  width: min(280px, 70%);
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.player-native-loading__bar-fill {
  height: 100%;
  width: 0;
  background: var(--gold, #d4a84b);
  border-radius: 2px;
  transition: width 0.35s ease;
}

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

.player-native {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.player-iframe {
  display: block;
  border: 0;
}

.player-wrap--telegram {
  aspect-ratio: auto;
  min-height: 480px;
}

.player-wrap--telegram .player-iframe {
  min-height: 480px;
}

.player-wrap--tiktok {
  aspect-ratio: 9/16;
  max-width: 400px;
  margin: 0 auto;
}

.player-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 240px;
  padding: 2rem;
  color: var(--text-muted);
  text-align: center;
}

.player-wrap--telegram-fallback {
  aspect-ratio: 16/9;
  min-height: 320px;
}

.player-telegram-fallback {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: inherit;
  background: #0a0a0a;
}

.player-telegram-fallback__poster {
  position: relative;
  flex: 1;
  min-height: 200px;
  background: #111 center / cover no-repeat;
  cursor: pointer;
}

.player-telegram-fallback__poster::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.75));
}

.player-telegram-fallback__play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.85);
  font-size: 1.25rem;
  color: #fff;
  pointer-events: none;
}

.player-telegram-fallback__duration {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 1;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.player-telegram-fallback__body {
  padding: 1rem 1.25rem 1.25rem;
  text-align: center;
  border-top: 1px solid rgba(212, 168, 75, 0.2);
}

.player-telegram-fallback__title {
  margin: 0 0 0.5rem;
  font-weight: 600;
  color: var(--text);
}

.player-telegram-fallback__hint {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.player-telegram-fallback__btn {
  display: inline-flex;
}

.video-page__main {
  min-width: 0;
}

.video-page__sidebar-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: var(--text-muted);
}

.video-grid--sidebar {
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.video-info__provider {
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
}

.video-info__channel,
.video-info__author,
.video-info__desc {
  color: var(--text-muted);
  margin: 0.35rem 0 0;
  line-height: 1.5;
}

.suggest-sources {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
}

.suggest-sources__title {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.suggest-sources__list {
  margin: 0;
  padding: 0 0 0 1rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.suggest-sources__list strong {
  color: var(--text);
  font-weight: 600;
}

.video-info h1 {
  font-size: 1.35rem;
  margin: 1rem 0 0.5rem;
}

.video-info__row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.video-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.versions-block {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.versions-block h3 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.version-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  cursor: pointer;
}

.version-item:hover {
  color: var(--accent);
}

.comments {
  margin-top: 1.5rem;
}

.comment-form textarea {
  width: 100%;
  min-height: 80px;
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  resize: vertical;
  margin-bottom: 0.5rem;
}

.comment-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.comment-item__author {
  font-weight: 600;
  font-size: 0.9rem;
}

.comment-item__date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  max-width: 480px;
  width: 100%;
  padding: 1.5rem;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h2 {
  margin-bottom: 1rem;
}

.modal label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.75rem 0 0.25rem;
}

.modal input,
.modal textarea,
.modal select {
  width: 100%;
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}

.modal__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
  justify-content: flex-end;
}

.modal__actions--center {
  justify-content: center;
}

.modal--auth {
  text-align: center;
  max-width: 360px;
}

.modal__hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.5rem 0 1.25rem;
  line-height: 1.4;
}

.btn--kick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: none;
  border-radius: 8px;
  background: #53fc18;
  color: #0e0e10;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn--kick:hover {
  background: #45e015;
  transform: translateY(-1px);
  color: #0e0e10;
}

.btn--kick-header {
  height: 38px;
}

.btn--kick__icon {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  display: block;
  color: #0e0e10;
}

.hidden {
  display: none !important;
}

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

.load-more {
  text-align: center;
  margin-top: 2rem;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  z-index: 300;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.profile-header {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.profile-header img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}

.admin-section-title {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.admin-section-title:first-of-type {
  margin-top: 0.5rem;
}

.admin-section-hint {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-list--published {
  margin-bottom: 2rem;
}

.admin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Thumb with duration badge */
.thumb-box {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

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

.thumb-box__placeholder {
  aspect-ratio: 16/9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  background: var(--bg-elevated);
}

.thumb-box__duration {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 0.12rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.82);
  border-radius: 4px;
  color: #fff;
  line-height: 1.2;
}

.thumb-box--large {
  width: 100%;
}

.modal--suggest {
  max-width: 720px;
  width: 100%;
  position: relative;
}

.modal__close-x {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.modal__close-x:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.suggest-modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 0.75rem;
}

.suggest-modal__preview {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.suggest-modal__preview .thumb-box--large {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.suggest-preview__info {
  margin-top: 0;
  padding: 0 0.15rem;
}

.suggest-preview__info strong {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.suggest-preview__info strong {
  display: block;
  font-size: 0.9rem;
}

.suggest-preview__channel {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

@media (max-width: 640px) {
  .suggest-modal__grid {
    grid-template-columns: 1fr;
  }

  .btn--suggest-header {
    padding: 0 0.65rem;
    font-size: 0.7rem;
  }

  .btn--suggest-header .btn--suggest__icon {
    display: none;
  }

  .header__btn-mod {
    padding: 0 0.55rem;
    font-size: 0.75rem;
  }
}

.suggest-preview {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.suggest-preview strong {
  display: block;
  margin-top: 0.5rem;
}

.suggest-preview p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.suggest-preview__img {
  width: 100%;
  border-radius: 8px;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.suggest-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  min-height: 1.25rem;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 1.25rem 1rem 0;
}

.site-footer__row {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem 1.5rem;
  align-items: start;
}

.site-footer__col--left,
.site-footer__col--right {
  text-align: center;
}

.site-footer__col--center {
  text-align: center;
}

.site-footer__col--spacer {
  visibility: hidden;
  pointer-events: none;
}

.site-footer__label {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.site-footer__name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.site-footer__name:hover {
  color: var(--accent);
}

.site-footer__rules-row {
  text-align: center;
  padding: 0.65rem 0 0.85rem;
}

.site-footer__rules {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
}

.site-footer__rules:hover {
  color: var(--accent);
}

.site-footer__accent-bar {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7;
}

@media (max-width: 520px) {
  .site-footer__row {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: center;
  }

  .site-footer__col--left,
  .site-footer__col--center {
    text-align: center;
  }

  .site-footer__col--spacer {
    display: none;
  }
}

/* Confirm dialog */
.confirm-modal {
  width: 100%;
  max-width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.confirm-modal h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.confirm-modal p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.confirm-modal__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Rules modal — KOROL style, compact */
.rules-overlay {
  padding: 0.75rem;
  align-items: flex-end;
}

@media (min-width: 520px) {
  .rules-overlay {
    align-items: center;
  }
}

.rules-modal {
  width: 100%;
  max-width: 520px;
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.rules-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(255, 61, 90, 0.25), var(--bg-elevated));
  border-bottom: 1px solid var(--border);
}

.rules-modal__header h2 {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  color: var(--text);
}

.rules-modal__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.rules-modal__close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.rules-modal__body {
  padding: 0.85rem 1rem 1rem;
  overflow-y: auto;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.rules-modal__body h3 {
  color: var(--accent);
  font-size: 0.82rem;
  margin: 0.85rem 0 0.35rem;
}

.rules-modal__body h3:first-of-type {
  margin-top: 0.5rem;
}

.rules-modal__body p {
  margin: 0.35rem 0;
}

.rules-modal__body ul {
  margin: 0.35rem 0 0.5rem 1rem;
}

.rules-modal__body li {
  margin: 0.2rem 0;
}

.rules-modal__body a {
  color: var(--accent);
}

.rules-updated,
.rules-contact {
  margin-bottom: 0.5rem !important;
  font-size: 0.76rem;
}

/* Admin moderation card */
.admin-item {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 1rem;
  align-items: center;
}

.admin-item__thumb-wrap {
  width: 160px;
}

.admin-item__channel {
  color: var(--text);
  font-weight: 500;
}

.admin-item__submitter {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.admin-item__body {
  min-width: 0;
}

.admin-item__link {
  display: block;
  font-size: 0.8rem;
  color: var(--accent);
  word-break: break-all;
  margin-top: 0.35rem;
}

.admin-item__actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.admin-item__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
}

@media (max-width: 640px) {
  .admin-item {
    grid-template-columns: 1fr;
  }
  .admin-item__thumb {
    width: 100%;
  }
}
