:root {
  --bg: #071620;
  --bg-soft: #0c2332;
  --surface: rgba(10, 30, 43, 0.78);
  --surface-lite: rgba(10, 30, 43, 0.56);
  --stroke: rgba(168, 214, 255, 0.26);
  --text: #eaf8ff;
  --muted: #9fc1d6;
  --accent: #31d5bf;
  --accent-strong: #0fb59f;
  --danger: #ff6a57;
  --shadow: 0 20px 60px rgba(2, 9, 16, 0.5);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: radial-gradient(1200px 600px at 10% 10%, #1d3d50 0%, transparent 60%),
    radial-gradient(900px 500px at 90% 90%, #0f5e58 0%, transparent 55%),
    linear-gradient(140deg, var(--bg) 0%, var(--bg-soft) 100%);
  color: var(--text);
  font-family: "Manrope", sans-serif;
  position: relative;
  padding: 24px;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0;
}

a {
  color: inherit;
}

.aurora {
  pointer-events: none;
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  z-index: -1;
  animation: floatGlow 10s ease-in-out infinite;
}

.aurora-1 {
  top: -160px;
  left: -80px;
  background: #3cead2;
}

.aurora-2 {
  bottom: -180px;
  right: -80px;
  background: #2f7fd7;
  animation-delay: -4s;
}

@keyframes floatGlow {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(24px, -18px, 0);
  }
}

.glass {
  background: var(--surface);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.glass-lite {
  background: var(--surface-lite);
  border: 1px solid rgba(159, 193, 214, 0.22);
  backdrop-filter: blur(12px);
}

.eyebrow {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  height: 42px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

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

.is-hidden {
  display: none !important;
}

.btn-primary {
  color: #03201d;
  background: linear-gradient(120deg, #35efc7, #17c7b4);
}

.btn-ghost {
  color: var(--text);
  border: 1px solid rgba(166, 211, 242, 0.36);
  background: rgba(5, 17, 27, 0.26);
}

.btn-danger {
  color: #ffeceb;
  background: linear-gradient(120deg, #ef6b5d, #e64c44);
}

.btn-block {
  width: 100%;
}

.login-page {
  display: grid;
  place-items: center;
}

.login-wrap {
  width: 100%;
  max-width: 440px;
}

.login-card {
  border-radius: var(--radius-lg);
  padding: 34px;
}

.login-card h1 {
  font-size: clamp(28px, 4vw, 36px);
  margin-bottom: 8px;
}

.subline {
  margin: 0 0 22px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 8px;
}

.login-form span {
  font-size: 13px;
  color: var(--muted);
}

input[type="text"],
input[type="password"] {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(164, 206, 237, 0.28);
  border-radius: 12px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(2, 18, 31, 0.6);
  font: inherit;
}

input:focus {
  outline: 2px solid rgba(49, 213, 191, 0.5);
  outline-offset: 1px;
}

.alert {
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
  background: rgba(239, 107, 93, 0.2);
  border: 1px solid rgba(239, 107, 93, 0.45);
  color: #ffd8d4;
  font-size: 14px;
}

.topbar {
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.topbar h1 {
  font-size: clamp(24px, 3vw, 34px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-install {
  min-width: 140px;
}

.user-chip {
  border-radius: 999px;
  border: 1px solid rgba(164, 206, 237, 0.3);
  padding: 8px 14px;
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
}

.panel {
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 220px;
}

.panel-head {
  margin-bottom: 14px;
}

.panel-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.pwa-note {
  color: #ffd88b !important;
}

.file-input-native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  white-space: nowrap;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
}

.dropzone {
  border: 1px dashed rgba(124, 195, 230, 0.65);
  background: rgba(2, 15, 24, 0.55);
  border-radius: 18px;
  min-height: 190px;
  padding: 24px;
  display: grid;
  gap: 6px;
  place-content: center;
  text-align: center;
  cursor: pointer;
  transition: 0.2s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(11, 36, 52, 0.9);
}

.dropzone-icon {
  font-size: 38px;
  color: #84f2e0;
  line-height: 1;
}

.dropzone strong {
  font-size: 18px;
}

.dropzone small {
  font-size: 13px;
  color: var(--muted);
}

.queue {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.queue-item {
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(164, 206, 237, 0.24);
  background: rgba(5, 23, 35, 0.7);
}

.queue-item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.queue-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #d6efff;
}

.queue-item-status {
  color: var(--muted);
}

.progress {
  width: 100%;
  height: 8px;
  margin-top: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(145, 190, 220, 0.22);
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #2ae9c3, #22c9d4);
  transition: width 0.15s linear;
}

.videos-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.video-card {
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 12px;
}

.video-meta {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 104px;
}

.video-preview {
  border-radius: 12px;
  overflow: hidden;
  background: #020b12;
  aspect-ratio: 16 / 9;
}

.video-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-topline {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 8px;
}

.video-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.video-status[data-status="ready"] {
  color: #042820;
  background: rgba(53, 239, 199, 0.88);
}

.video-status[data-status="processing"] {
  color: #0a2430;
  background: rgba(255, 209, 102, 0.92);
}

.video-status[data-status="failed"] {
  color: #fff0ee;
  background: rgba(230, 76, 68, 0.88);
}

.video-title {
  font-size: 17px;
  line-height: 1.3;
  margin-bottom: 4px;
  word-break: break-word;
}

.video-sub {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  min-height: 32px;
}

.video-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  font-size: 12px;
}

.video-progress-stage {
  color: #d7f0ff;
  font-weight: 700;
}

.video-progress-value {
  color: #ffe7a3;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.video-progress {
  width: 100%;
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(145, 190, 220, 0.18);
}

.video-progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ffd166, #31d5bf);
  transition: width 0.3s ease;
}

.video-links {
  display: block;
}

.link-input {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(164, 206, 237, 0.28);
  background: rgba(3, 15, 26, 0.85);
  color: #d5ecff;
  padding: 0 10px;
  font-size: 12px;
}

.video-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.watch-page {
  display: grid;
  place-items: center;
}

.watch-wrap {
  width: min(1100px, 100%);
}

.watch-card {
  border-radius: var(--radius-lg);
  padding: 22px;
}

.watch-title {
  font-size: clamp(22px, 3vw, 36px);
  margin-bottom: 6px;
  word-break: break-word;
}

.watch-meta {
  margin: 0 0 14px;
  color: var(--muted);
}

.player-shell {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(164, 206, 237, 0.2);
  background: #000;
  aspect-ratio: 16 / 9;
}

.main-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.watch-help {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.watch-progress {
  width: 100%;
  height: 14px;
  margin-top: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(145, 190, 220, 0.18);
}

.watch-progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ffd166, #31d5bf);
  transition: width 0.35s ease;
}

.watch-progress-value {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 1060px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .upload-panel {
    order: 1;
  }

  .videos-panel {
    order: 2;
  }
}

@media (max-width: 760px) {
  body {
    padding: 14px;
  }

  .topbar {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .panel {
    padding: 14px;
  }

  .video-actions {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 24px 18px;
  }
}
