/* FazeVideo — mobile-first, light/dark via prefers-color-scheme. No framework. */
:root {
    --brand: #ff3d2e;
    --brand-ink: #fff;
    --bg: #f6f6f8;
    --surface: #ffffff;
    --surface-2: #eeeef2;
    --text: #16161d;
    --muted: #5d5d6b;
    --border: #e1e1e8;
    --radius: 12px;
    --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 16px rgb(0 0 0 / .06);
    --gutter: 16px;
    --max: 1320px;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f0f14;
        --surface: #181820;
        --surface-2: #23232d;
        --text: #f1f1f5;
        --muted: #a2a2b2;
        --border: #2c2c38;
        --shadow: 0 1px 2px rgb(0 0 0 / .4);
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
h2 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-row { display: flex; align-items: center; gap: 12px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; flex-shrink: 0; }
.logo em { font-style: normal; color: var(--brand); }
.logo.small { font-size: 1.05rem; }
.search { flex: 1; display: flex; max-width: 560px; margin-left: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); padding: 9px 14px; font: inherit; outline: none; }
.search button { border: 0; background: transparent; color: var(--muted); padding: 0 14px; }
.search:focus-within { border-color: var(--brand); }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--muted); flex-shrink: 0; }
.icon-btn:hover { background: var(--surface-2); }
@media (max-width: 560px) {
    .logo span { display: none; }
}

.chips { display: flex; gap: 8px; overflow-x: auto; padding-top: 4px; padding-bottom: 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips a, .chip {
    flex-shrink: 0; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: .9rem; font-weight: 600; white-space: nowrap;
}
.chips a:hover, .chip:hover { background: var(--brand); color: var(--brand-ink); }

/* Sections */
.hero { padding-top: 24px; }
.hero p { color: var(--muted); margin: 0; }
.section { padding-top: 24px; padding-bottom: 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.section-head > a { color: var(--brand); font-weight: 600; font-size: .95rem; white-space: nowrap; }
.intro { color: var(--muted); max-width: 75ch; }
.empty { color: var(--muted); padding: 24px 0; }
.seo-text { padding-top: 32px; padding-bottom: 16px; color: var(--muted); }

/* Grid + cards */
.grid { display: grid; gap: 20px 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.card { min-width: 0; }
.thumb { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); aspect-ratio: 16 / 9; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.card:hover .thumb img { transform: scale(1.04); }
.duration { position: absolute; right: 6px; bottom: 6px; background: rgb(0 0 0 / .8); color: #fff; font-size: .78rem; font-weight: 600; padding: 1px 6px; border-radius: 4px; }
.badge-new { position: absolute; left: 6px; top: 6px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 800; padding: 2px 7px; border-radius: 4px; letter-spacing: .04em; }
.card-body { padding: 8px 2px 0; }
.card-title { font-size: 1rem; font-weight: 650; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card-meta { color: var(--muted); font-size: .85rem; margin: 2px 0 0; }
.card-meta a { text-transform: capitalize; }

/* Ads */
.ad { grid-column: 1 / -1; min-height: 100px; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.ad-below-player { margin: 20px 0; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 9px 16px;
    background: var(--brand); color: var(--brand-ink); font-weight: 650; font-size: .95rem;
}
.btn:hover { filter: brightness(1.08); color: var(--brand-ink); }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.ghost:hover { color: var(--text); filter: brightness(.96); }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn.whatsapp { background: #25d366; color: #fff; }
.btn.facebook { background: #1877f2; color: #fff; }
.btn[aria-pressed="true"] { background: var(--brand); color: #fff; }
.load-more { text-align: center; padding: 20px 0 4px; }

/* Pager */
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 28px 0 8px; }
.pager a, .pager span { min-width: 40px; height: 40px; padding: 0 12px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; }
.pager .current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Video page */
.video-layout { display: grid; gap: 24px; padding-top: 16px; padding-bottom: 16px; }
@media (min-width: 1000px) { .video-layout { grid-template-columns: minmax(0, 1fr) 360px; } }
.video-side h2 { font-size: 1.1rem; }
@media (min-width: 1000px) { .video-side .grid { grid-template-columns: 1fr; } }
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 8px; text-transform: capitalize; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; cursor: pointer; }
.player.player-short { max-width: 420px; aspect-ratio: 9 / 16; margin: 0 auto; }
.player img { width: 100%; height: 100%; object-fit: cover; }
.player iframe, .player-static iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-static { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.play-btn { position: absolute; inset: 0; margin: auto; width: 68px; height: 48px; border: 0; background: transparent; padding: 0; transition: transform .15s; }
.player:hover .play-btn { transform: scale(1.1); }
.next-up { position: absolute; inset: 0; background: rgb(0 0 0 / .85); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px; gap: 4px; }
.next-up[hidden] { display: none; }
.next-up p { margin: 0; color: #ccc; }
.next-up strong { font-size: 1.1rem; max-width: 40ch; }
.next-up div { display: flex; gap: 8px; margin-top: 10px; }
.video-title { margin-top: 14px; font-size: clamp(1.25rem, 2.4vw, 1.7rem); overflow-wrap: anywhere; }
.video-meta { color: var(--muted); font-size: .9rem; margin: 0 0 12px; }
.video-meta a { text-transform: capitalize; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.description { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; }
.description p { margin: 0 0 .7em; }
.description p:last-child { margin: 0; }
.description:empty { display: none; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.tags > span { color: var(--muted); font-size: .9rem; }

/* Shorts feed */
.shorts { height: calc(100dvh - 110px); overflow-y: auto; scroll-snap-type: y mandatory; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0; }
.short { position: relative; flex-shrink: 0; width: min(100%, calc((100dvh - 140px) * 9 / 16)); aspect-ratio: 9 / 16; background: #000; border-radius: var(--radius); overflow: hidden; scroll-snap-align: center; }
.short img { width: 100%; height: 100%; object-fit: cover; }
.short iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.short-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 14px 14px; background: linear-gradient(transparent, rgb(0 0 0 / .8)); color: #fff; pointer-events: none; }
.short-info a { pointer-events: auto; font-weight: 700; display: block; }
.short-info span { font-size: .85rem; opacity: .8; text-transform: capitalize; }
.short.playing .short-info { opacity: 0; transition: opacity .5s 2s; }

/* Collections */
.intro-box { margin-bottom: 20px; }
.ranking { list-style: none; padding: 0; margin: 0; counter-reset: rank; display: grid; gap: 24px; }
.ranking > li { counter-increment: rank; position: relative; display: grid; gap: 8px; }
@media (min-width: 720px) { .ranking > li { grid-template-columns: 360px 1fr; align-items: start; } }
.ranking > li::before { content: counter(rank); position: absolute; left: -6px; top: -10px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; }
.note { margin: 0; color: var(--muted); }
@media (min-width: 720px) { .note { padding-top: 34px; font-size: 1.05rem; color: var(--text); } }
.collection-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.collection-list a { font-weight: 650; }
.collection-list small { color: var(--muted); margin-left: 6px; }

/* Pages */
.page { padding-top: 24px; padding-bottom: 24px; }
.prose { max-width: 78ch; }
.prose p, .prose li { color: var(--text); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.error-page { text-align: center; padding: 48px var(--gutter); }
.error-code { font-size: 4rem; font-weight: 900; color: var(--brand); margin: 0; }

/* Footer */
.site-footer { margin-top: 40px; background: var(--surface); border-top: 1px solid var(--border); padding: 28px 0 12px; font-size: .92rem; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer-grid p { color: var(--muted); margin: 6px 0 0; }
.footer-grid nav { display: flex; flex-direction: column; gap: 6px; }
.copyright { color: var(--muted); font-size: .8rem; margin-top: 20px; }

/* Admin */
.admin-nav { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 16px; font-weight: 600; }
.admin-nav form { margin-left: auto; }
.link { background: none; border: 0; color: var(--brand); padding: 0; }
.narrow { max-width: 420px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; }
.form input:not([type=checkbox]), .form textarea, .form select, .admin-search input {
    font: inherit; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.error { color: var(--brand); }
.notice { background: #1f9d55; color: #fff; padding: 8px 12px; border-radius: 8px; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 24px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat strong { font-size: 1.6rem; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; background: var(--surface); border-radius: var(--radius); padding: 12px; margin-bottom: 24px; }
.bar { flex: 1; height: var(--h); min-height: 2px; background: var(--brand); border-radius: 3px 3px 0 0; position: relative; }
.bar span { display: none; }
.bar:hover span { display: block; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: .75rem; background: var(--text); color: var(--bg); padding: 1px 5px; border-radius: 4px; }
.admin-search { display: flex; gap: 8px; margin-bottom: 12px; }
.admin-search input { flex: 1; }
.admin-table tr.inactive { opacity: .55; }
.admin-table img { border-radius: 6px; }
.edit-layout { display: grid; gap: 24px; }
@media (min-width: 900px) { .edit-layout { grid-template-columns: 1fr 1fr; } }
tr.log td { padding-top: 0; }
pre { white-space: pre-wrap; font-size: .8rem; max-height: 300px; overflow: auto; }

/* Cookie consent (analytics only) */
.consent {
    position: fixed; z-index: 50; left: 12px; right: 12px; bottom: 12px; max-width: 560px; margin: 0 auto;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 16px;
    background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 32px rgb(0 0 0 / .18);
}
.consent[hidden] { display: none; }
.consent p { flex: 1 1 260px; margin: 0; font-size: .92rem; }
.consent-actions { display: flex; gap: 8px; margin-left: auto; }
