* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #000;
  color: #f5f5f5;
}

.hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 68px;
  padding: 14px 20px;
  border-bottom: 1px solid #1d1d1d;
  background: rgba(0, 0, 0, 0.95);
}

.logo {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
}

.logout-btn {
  position: absolute;
  right: 20px;
  top: 14px;
  width: auto;
  padding: 10px 14px;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.login-wrap,
.upload-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 26px;
}

.login-card,
.upload-card {
  width: min(520px, 100%);
  background: #0d0d0d;
  border: 1px solid #202020;
  border-radius: 14px;
  padding: 20px;
}

.login-title {
  text-align: center;
  margin-top: 0;
}

input,
textarea,
button {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid #303030;
  background: #090909;
  color: #fff;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

button {
  cursor: pointer;
}

.library-section {
  margin-top: 10px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.search-input {
  max-width: 280px;
  margin-top: 0;
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 260px));
  justify-content: center;
  gap: 16px;
  width: 100%;
  margin: 0 auto;
}
.video-card {
  background: #111;
  border: 1px solid #242424;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.video-card:hover {
  transform: translateY(-2px);
  border-color: #3a3a3a;
}

.video-thumb {
  height: 140px;
  background: #1a1a1a;
  display: grid;
  place-items: center;
  font-size: 40px;
  color: #d7d7d7;
  overflow: hidden;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-meta {
  padding: 12px;
}

.video-meta h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.video-meta p {
  margin: 0;
}

.tiny {
  color: #8e8e8e;
  font-size: 12px;
  margin-top: 6px;
}

.muted {
  color: #a9a9a9;
}

.error {
  color: #ff9b9b;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}

.modal-card {
  position: relative;
  z-index: 2;
  width: min(900px, calc(100vw - 24px));
  margin: 40px auto;
  background: #0b0b0b;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  padding: 18px;
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: auto;
  padding: 6px 12px;
  font-size: 24px;
  line-height: 1;
}

#modal-player {
  width: 100%;
  max-height: 65vh;
  background: #000;
  border-radius: 12px;
  margin-top: 12px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.modal-actions button {
  width: auto;
  min-width: 120px;
}
.danger-btn {
  border: 1px solid #7a2f2f;
  background: #180909;
  color: #fff;
}

.danger-btn:hover {
  background: #241010;
}
.progress-wrap {
  margin-top: 14px;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: #1a1a1a;
  border: 1px solid #2c2c2c;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: #f5f5f5;
  transition: width 0.15s ease;
}
.progress-fill.converting {
  width: 100% !important;
  background: linear-gradient(90deg, #666, #fff, #666);
  background-size: 200% 100%;
  animation: convertingStripe 1s linear infinite;
}
.menu-wrap {
  position: absolute;
  right: 20px;
  top: 14px;
}

.menu-btn {
  width: auto;
  padding: 8px 12px;
  font-size: 22px;
  line-height: 1;
  background: #090909;
  border: 1px solid #2f2f2f;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
}

.menu-dropdown {
  position: absolute;
  right: 0;
  top: 46px;
  min-width: 180px;
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 8px;
  z-index: 50;
}

.menu-dropdown button {
  width: 100%;
  text-align: left;
  margin-top: 0;
}
.small-modal {
  max-width: 420px;
}

@keyframes convertingStripe {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}