:root {
  --bg: #0b0c10;
  --bg-soft: #14161d;
  --card: #171922;
  --line: #262a36;
  --text: #eef0f6;
  --muted: #9aa0b4;
  --accent: #7c5cff;
  --accent2: #22d3ee;
  --danger: #ff5c7a;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(800px 500px at 90% 0%, rgba(34, 211, 238, 0.12), transparent 55%);
  z-index: 0;
}

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

.wrap { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 22px 20px 80px; }

header.top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0 22px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.logo .mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 6px 24px rgba(124, 92, 255, 0.4);
  color: #fff;
}

.logo .mark svg { width: 18px; height: 18px; }

.spacer { flex: 1; }

.stats { color: var(--muted); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; }
.stats b { color: var(--text); }

/* ---------------- uploader ---------------- */

.uploader {
  border: 1.5px dashed var(--line);
  background: linear-gradient(180deg, rgba(23, 25, 34, 0.9), rgba(20, 22, 29, 0.7));
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 30px;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

.uploader.drag { border-color: var(--accent); background: rgba(124, 92, 255, 0.08); }

.uploader h2 { margin: 0 0 4px; font-size: 18px; }
.uploader p.hint { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }

.droprow { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 180px; }
.field label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

input[type="text"], textarea, input[type="file"] {
  background: #0f1117;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 13px;
  font: inherit;
  font-size: 14px;
  outline: none;
  width: 100%;
}
input[type="text"]:focus, textarea:focus { border-color: var(--accent); }

input[type="file"] { padding: 9px; }

.btn {
  border: 0;
  border-radius: 11px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.32);
  transition: transform 0.12s, filter 0.18s;
  align-self: end;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
  color: var(--text);
}

.progressbar {
  margin-top: 16px;
  height: 8px;
  background: #0f1117;
  border: 1px solid var(--line);
  border-radius: 99px;
  overflow: hidden;
  display: none;
}
.progressbar.show { display: block; }
.progressbar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.25s;
}
.progress-note { margin-top: 8px; font-size: 13px; color: var(--muted); display: none; }
.progress-note.show { display: block; }
.progress-note.err { color: var(--danger); }

/* ---------------- gallery ---------------- */

.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 6px 0 16px;
}
.section-title h2 { margin: 0; font-size: 17px; }
.section-title span { color: var(--muted); font-size: 13px; }

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
  position: relative;
}
.card:hover { transform: translateY(-3px); border-color: #3a4055; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); }

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0c0e13 center/cover no-repeat;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(8, 9, 13, 0.28);
  opacity: 0;
  transition: opacity 0.16s;
}
.card:hover .thumb .play { opacity: 1; }
.thumb .play span {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(124, 92, 255, 0.92);
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.thumb .play svg { width: 20px; height: 20px; fill: #fff; margin-left: 3px; }

.badge {
  position: absolute;
  right: 8px; bottom: 8px;
  background: rgba(6, 7, 10, 0.82);
  border-radius: 7px;
  padding: 3px 7px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.badge.tl { top: 8px; bottom: auto; left: 8px; right: auto; background: rgba(124, 92, 255, 0.9); font-weight: 700; text-transform: uppercase; font-size: 10px; }

.card-body { padding: 12px 13px 14px; }
.card-body h3 {
  margin: 0 0 6px;
  font-size: 14.5px;
  line-height: 1.35;
  font-weight: 650;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; align-items: center; }
.card-meta .dot { opacity: 0.5; }

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
}

.processing-card { opacity: 0.85; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.14);
  border-top-color: var(--accent2);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- watch page ---------------- */

.back { color: var(--muted); font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 0 16px; }
.back:hover { color: var(--text); }

.player-shell {
  background: #000;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.player-shell video { width: 100%; display: block; max-height: 72vh; background: #000; }

.watch-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-top: 20px; }
.watch-head h1 { margin: 0 0 8px; font-size: 21px; line-height: 1.3; }
.watch-meta { color: var(--muted); font-size: 13.5px; }

.actions { display: flex; gap: 10px; margin-left: auto; }

.chip {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.chip:hover { border-color: #3a4055; background: #1b1e28; }
.chip.liked { border-color: var(--accent); background: rgba(124, 92, 255, 0.14); color: #cfc4ff; }
.chip svg { width: 16px; height: 16px; }

.panel {
  margin-top: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.panel h2 { margin: 0 0 14px; font-size: 15.5px; }

.comment { display: flex; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.comment:first-of-type { border-top: 0; }
.avatar {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.comment .who { font-size: 13.5px; font-weight: 650; }
.comment .when { color: var(--muted); font-size: 12px; margin-left: 8px; font-weight: 400; }
.comment .text { margin-top: 3px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

.comment-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.comment-form .row { display: flex; gap: 10px; }
.comment-form textarea { resize: vertical; min-height: 78px; }
.comment-form .row input { max-width: 220px; }

.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translate(-50%, 20px);
  background: #1c1f2a;
  border: 1px solid var(--line);
  padding: 11px 18px;
  border-radius: 11px;
  font-size: 13.5px;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

footer.foot { margin-top: 44px; color: var(--muted); font-size: 12.5px; text-align: center; }
footer.foot code { background: #14161d; border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; }

@media (max-width: 640px) {
  .wrap { padding: 16px 14px 60px; }
  .actions { margin-left: 0; width: 100%; }
  .watch-head h1 { font-size: 18px; }
}
