:root {
  --bg: #0e0e11; --bg-2: #17171c; --bg-3: #1f1f26; --line: #2b2b34;
  --fg: #ecebf0; --muted: #9a98a6; --accent: #a6672c; --accent-2: #e8b93f; --ok: #3ddc97; --warn: #ffb347; --bad: #ff5c5c;
  --radius: 10px; --max: 1240px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--fg); }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6rem; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
p.lead { color: var(--muted); font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(14,14,17,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .inner { max-width: var(--max); margin: 0 auto; padding: .6rem 1rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.25rem; color: #fff; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.search { flex: 1 1 260px; display: flex; max-width: 520px; }
.search input { flex: 1; border-radius: 999px 0 0 999px; border-right: 0; }
.search button { border-radius: 0 999px 999px 0; padding: .45rem .9rem; }
nav.main { display: flex; gap: .3rem; align-items: center; margin-left: auto; flex-wrap: wrap; }
nav.main a, nav.main button.link { color: var(--fg); background: none; border: 0; padding: .4rem .7rem; border-radius: 6px; font: inherit; cursor: pointer; }
nav.main a:hover, nav.main button.link:hover { background: var(--bg-3); text-decoration: none; }
nav.main .badge { background: var(--accent); color: #fff; border-radius: 999px; font-size: .7rem; padding: .05rem .4rem; margin-left: .2rem; }
.subnav { max-width: var(--max); margin: 0 auto; padding: 0 1rem .5rem; display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; }
.subnav a { white-space: nowrap; color: var(--muted); font-size: .85rem; padding: .25rem .7rem; border: 1px solid var(--line); border-radius: 999px; }
.subnav a.active, .subnav a:hover { color: #fff; border-color: var(--accent); text-decoration: none; }

.container { max-width: var(--max); margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.narrow { max-width: 720px; }
.row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.pill { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.pill.ok { color: var(--ok); border-color: var(--ok); } .pill.warn { color: var(--warn); border-color: var(--warn); } .pill.bad { color: var(--bad); border-color: var(--bad); }

/* hero */
.hero { background: linear-gradient(135deg, #241a10, #14141a 60%); border: 1px solid var(--line); border-radius: 16px; padding: 2rem; margin-bottom: 1.5rem; }
.hero h1 { font-size: 2rem; } .hero p { max-width: 620px; }

/* grid + cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.card { display: block; color: var(--fg); background: var(--bg-2); border-radius: var(--radius); overflow: hidden; border: 1px solid transparent; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--line); transform: translateY(-2px); text-decoration: none; }
.thumb { position: relative; aspect-ratio: 16/9; background: #000; overflow: hidden; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb video { position: absolute; inset: 0; opacity: 0; }
.card:hover .thumb video.ready { opacity: 1; }
.thumb .dur { position: absolute; right: .4rem; bottom: .4rem; background: rgba(0,0,0,.75); font-size: .72rem; padding: .05rem .35rem; border-radius: 4px; }
.thumb .placeholder { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; }
.lock-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; background: rgba(10,8,6,.72); backdrop-filter: blur(1px); font-size: 1.5rem; text-align: center; }
.lock-overlay span { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #fff; }
.card-body { padding: .6rem .75rem .75rem; }
.card-title { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { color: var(--muted); font-size: .8rem; margin-top: .25rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.tags { display: flex; gap: .35rem; flex-wrap: wrap; }
.tags a { font-size: .78rem; background: var(--bg-3); color: var(--muted); padding: .1rem .5rem; border-radius: 999px; }
.tags a:hover { color: #fff; text-decoration: none; }
.sortbar { display: flex; gap: .4rem; align-items: center; margin: .5rem 0 1rem; flex-wrap: wrap; }
.sortbar a { color: var(--muted); padding: .3rem .7rem; border-radius: 6px; } .sortbar a.active { background: var(--bg-3); color: #fff; }
.pager { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; }

/* watch page */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; }
@media (max-width: 900px) { .watch { grid-template-columns: 1fr; } }
.player { background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; }
.player video { width: 100%; height: 100%; display: block; }
.video-head { margin: 1rem 0; }
.creator-line { display: flex; align-items: center; gap: .8rem; padding: .8rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; }
.desc { white-space: pre-wrap; margin: 1rem 0; }
.comment { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.comment .who { font-weight: 600; font-size: .9rem; } .comment .when { color: var(--muted); font-size: .8rem; margin-left: .4rem; }
.side .card { margin-bottom: .8rem; display: grid; grid-template-columns: 140px 1fr; }
.side .card .thumb { aspect-ratio: 16/9; }

/* forms */
form.stack { display: flex; flex-direction: column; gap: .9rem; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; color: var(--muted); }
label > span b { color: var(--fg); }
label.check { flex-direction: row; align-items: flex-start; gap: .6rem; color: var(--fg); }
label.check input { margin-top: .25rem; }
input, textarea, select { font: inherit; padding: .55rem .7rem; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); color: var(--fg); width: 100%; }
input[type=checkbox], input[type=radio] { width: 1.1rem; height: 1.1rem; flex: none; accent-color: var(--accent); }
input[type=file] { padding: .4rem; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea { min-height: 100px; resize: vertical; }
button, .btn { font: inherit; font-weight: 600; padding: .55rem 1rem; border-radius: 8px; border: 0; background: var(--accent); color: #fff; cursor: pointer; display: inline-block; }
button:hover, .btn:hover { background: var(--accent-2); text-decoration: none; }
button.ghost, .btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--fg); }
button.ghost:hover, .btn.ghost:hover { background: var(--bg-3); }
button.danger { background: var(--bad); } button.ok { background: #1f9e6a; }
button.sm, .btn.sm { padding: .3rem .7rem; font-size: .85rem; }
.inline { display: inline; }
.error { color: var(--bad); background: rgba(255,92,92,.08); border: 1px solid rgba(255,92,92,.3); padding: .6rem .8rem; border-radius: 8px; }
.notice { background: var(--bg-2); border-left: 3px solid var(--accent); padding: .7rem .9rem; border-radius: 0 8px 8px 0; margin: 1rem 0; }
.notice.warn { border-color: var(--warn); } .notice.ok { border-color: var(--ok); } .notice.bad { border-color: var(--bad); }
.box { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.box h2 { margin-top: 0; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.table-wrap { overflow-x: auto; }
.stat { display: inline-block; background: var(--bg-3); border-radius: 8px; padding: .6rem 1rem; margin: 0 .5rem .5rem 0; }
.stat b { display: block; font-size: 1.4rem; }
.prose { max-width: 760px; } .prose h2 { margin-top: 1.8rem; } .prose li { margin: .3rem 0; }
details summary { cursor: pointer; color: var(--muted); }
.ad-slot { background: var(--bg-2); border: 1px dashed var(--line); border-radius: var(--radius); min-height: 60px; display: grid; place-items: center; color: var(--muted); font-size: .75rem; margin: 1rem 0; }
.ad-slot:empty { display: none; }

/* gate */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: radial-gradient(circle at top, #241a10, var(--bg) 60%); }
.gate .box { max-width: 520px; text-align: center; padding: 2rem; }
.gate .actions { display: flex; gap: 1rem; justify-content: center; margin-top: 1.2rem; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; padding: 1.5rem 1rem 2.5rem; }
.site-footer .inner { max-width: var(--max); margin: 0 auto; display: flex; gap: 1rem 1.5rem; flex-wrap: wrap; justify-content: space-between; }
.site-footer nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
