/* ---- lolzclip: clean dark theme, red accent ---- */
:root {
  --bg:        #0c0c0e;
  --surface:   #151518;
  --surface-2: #1b1b1f;
  --border:    #2a2a30;
  --text:      #f3f3f5;
  --muted:     #9596a0;
  --red:       #ff4d4d;
  --red-dark:  #e23b3b;
  --radius:    14px;
  --maxw:      820px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.3px; margin: 0; }
h2 { font-size: 16px; font-weight: 600; letter-spacing: -.2px; margin: 0; }
.muted { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); text-align: center; padding: 48px 0; }
.error { color: #ff9a9a; background: #2a1416; border: 1px solid #5a2329; padding: 10px 12px; border-radius: 10px; font-size: 14px; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--red); color: #fff; border: 0; border-radius: 10px;
  padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
  line-height: 1; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--red-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.big { width: 100%; padding: 14px; font-size: 15px; }
.btn.danger { background: transparent; border: 1px solid #5a2329; color: #ff8585; }
.btn.danger:hover { background: #2a1416; }

/* ---- top nav ---- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; height: 58px;
  background: rgba(12,12,14,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-left { display: flex; align-items: center; gap: 16px; }
.brand { font-size: 20px; font-weight: 800; letter-spacing: -.5px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand span { color: var(--red); }
.links { display: flex; align-items: center; gap: 20px; }
.links a { color: var(--muted); font-size: 14px; }
.links a:hover { color: var(--text); text-decoration: none; }
.links .me { color: var(--text); font-weight: 600; }
.links .nav-upload, .links .nav-upload:hover { color: #fff; }

/* ---- layout ---- */
main { max-width: var(--maxw); margin: 0 auto; padding: 28px 22px 90px; }
section { margin-bottom: 30px; }

/* ---- upload hero ---- */
.upload-hero {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 22px;
}
.upload-hero > h1 { margin-bottom: 16px; }
.upload-hero.signup { text-align: center; padding: 44px 22px; }
.upload-hero.signup .muted { margin: 8px 0 18px; }

.uploader { display: flex; flex-direction: column; gap: 12px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; cursor: pointer;
  border: 2px dashed var(--border); border-radius: 14px;
  padding: 34px 20px; background: var(--bg);
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--red); background: #141012; }
.dz-icon { font-size: 24px; color: var(--red); line-height: 1; }
.dz-text { font-size: 15px; font-weight: 600; }
.dz-text span { color: var(--red); }
.dz-sub { font-size: 12px; color: var(--muted); }

.uploader-row { display: flex; gap: 10px; }
.uploader-row input { flex: 1; min-width: 0; }
.uploader-row select { flex: 0 0 168px; }

/* ---- form controls ---- */
input, select {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px; padding: 11px 13px;
  font-size: 15px; font-family: inherit;
}
input::placeholder { color: #5f606a; }
input:focus, select:focus { outline: none; border-color: var(--red); }
select {
  cursor: pointer;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239596a0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

/* ---- progress ---- */
.progress { height: 7px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.bar { height: 100%; width: 0; background: var(--red); transition: width .2s ease; }
#status:empty { display: none; }
#status { margin: 2px 0 0; }

/* ---- auth cards ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.narrow { max-width: 380px; margin: 36px auto; }
.card form { display: flex; flex-direction: column; gap: 14px; margin: 18px 0 8px; }
.card label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---- feed ---- */
.feed-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); font-size: 13px; font-weight: 500; background: var(--surface);
}
.chip:hover { color: var(--text); border-color: #44454d; text-decoration: none; }
.chip.on { background: var(--red); border-color: var(--red); color: #fff; }

.clips { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.clip {
  display: flex; gap: 14px; align-items: stretch;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 11px; transition: border-color .15s, background .15s;
}
.clip:hover { border-color: #3a3b43; background: var(--surface-2); }
.clip-thumb {
  position: relative; flex: 0 0 auto; width: 132px; height: 74px;
  border-radius: 8px; overflow: hidden; background: #000; display: block;
}
.clip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.clip-thumb-ph {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: #42434c; font-size: 20px;
}
.clip-dur {
  position: absolute; right: 5px; bottom: 5px; background: rgba(0,0,0,.82);
  color: #fff; font-size: 11px; font-weight: 600; padding: 1px 5px; border-radius: 4px;
}
.clip-body { min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.clip-title {
  font-size: 15px; font-weight: 600; color: var(--text); display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.clip-title:hover { color: var(--red); text-decoration: none; }
.clip-meta { color: var(--muted); font-size: 12.5px; }
.clip-meta .user-link { font-weight: 600; }
.clip-meta .user-link:hover { text-decoration: underline; }
.clip-meta .dot { opacity: .4; margin: 0 5px; }
.clip-meta .game-tag { vertical-align: middle; margin-right: 7px; }

@media (max-width: 480px) {
  .clip-thumb { width: 108px; height: 61px; }
}

.game-tag {
  display: inline-block; background: var(--surface-2); border: 1px solid var(--border);
  color: #c7c8d2; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px;
  letter-spacing: .02em;
}
a.game-tag:hover { border-color: var(--red); color: #fff; text-decoration: none; }

/* ---- watch ---- */
.processing-banner {
  background: #2a230f; border: 1px solid #5a4a1e; color: #ffd98a;
  padding: 10px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 12px;
}
.watch video { width: 100%; max-height: 70vh; border-radius: 14px; background: #000; display: block; }
.watch h1 { margin: 18px 0 8px; }
.watch .clip-meta { font-size: 13px; }
.share { display: flex; gap: 8px; }
.share input { flex: 1; }

.watch-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.watch-actions .share { flex: 1; min-width: 220px; }
.clip-actions { display: flex; gap: 8px; }
.clip-actions form { margin: 0; }
.btn.ghost { background: transparent; background-image: none; border: 1px solid var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.cancel { display: inline-block; margin-top: 4px; text-align: center; }

/* comments */
.comments { margin-top: 28px; border-top: 1px solid var(--border); padding-top: 22px; }
.comments h2 { margin-bottom: 14px; }
.comment-form { display: flex; gap: 8px; margin: 0 0 18px; }
.comment-form input { flex: 1; }
.comment-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.comment { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; }
.comment-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.comment-head .user-link { font-weight: 600; font-size: 13.5px; }
.comment-head .user-link:hover { text-decoration: underline; }
.comment-time { color: var(--muted); font-size: 11.5px; }
.comment-body { font-size: 14px; white-space: pre-wrap; word-break: break-word; }

/* ---- rankings ---- */
.ranks { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ranks th, .ranks td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.ranks tr:last-child td { border-bottom: 0; }
.ranks th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); }
.ranks .rank { color: var(--muted); width: 44px; font-weight: 700; }
.ranks tbody tr:nth-child(1) .rank { color: #ffd166; }
.ranks .points { font-weight: 700; color: var(--red); }
.points-badge { color: var(--muted); font-size: 13px; }

/* ---- small screens ---- */
@media (max-width: 560px) {
  .uploader-row { flex-direction: column; }
  .uploader-row select { flex: 1; }
  .links { gap: 14px; }
}
